(domain: string)
| 1019 | } |
| 1020 | |
| 1021 | private async crawlSingleDomainForCatalog(domain: string): Promise<void> { |
| 1022 | const validation = await this.adAgentsManager.validateDomain(domain); |
| 1023 | if (!validation.valid || !validation.raw_data?.authorized_agents) return; |
| 1024 | |
| 1025 | await this.cacheAdagentsManifest(domain, validation.raw_data as AdagentsManifest); |
| 1026 | |
| 1027 | for (const authorizedAgent of validation.raw_data.authorized_agents) { |
| 1028 | if (!authorizedAgent.url) continue; |
| 1029 | |
| 1030 | await this.federatedIndex.recordAgentFromAdagentsJson( |
| 1031 | authorizedAgent.url, |
| 1032 | domain, |
| 1033 | authorizedAgent.authorized_for, |
| 1034 | authorizedAgent.property_ids |
| 1035 | ); |
| 1036 | |
| 1037 | await this.recordPropertiesForAgent( |
| 1038 | validation.raw_data.properties || [], |
| 1039 | domain, |
| 1040 | authorizedAgent.url, |
| 1041 | authorizedAgent.authorized_for, |
| 1042 | authorizedAgent.property_ids |
| 1043 | ); |
| 1044 | } |
| 1045 | |
| 1046 | if (this.eventsDb) { |
| 1047 | await this.eventsDb.writeEvent({ |
| 1048 | event_type: 'publisher.adagents_discovered', |
| 1049 | entity_type: 'publisher', |
| 1050 | entity_id: domain, |
| 1051 | payload: { |
| 1052 | publisher_domain: domain, |
| 1053 | agent_count: validation.raw_data.authorized_agents.length, |
| 1054 | property_count: validation.raw_data.properties?.length ?? 0, |
| 1055 | source: 'catalog_crawl', |
| 1056 | }, |
| 1057 | actor: 'pipeline:catalog_crawl', |
| 1058 | }); |
| 1059 | } |
| 1060 | } |
| 1061 | |
| 1062 | private async processWithConcurrency<T, R>( |
| 1063 | items: T[], |
no test coverage detected