This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: resolve TypeScript build errors in search module

Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>

+20 -13
+1 -1
src/modules/search/application/use-cases/SearchLeafletDocsForUrlUseCase.ts
··· 70 70 71 71 return ok({ 72 72 urls, 73 - cursor: null, // Constellation API doesn't seem to use cursors in the example 73 + cursor: undefined, // Constellation API doesn't seem to use cursors in the example 74 74 total: documents.length, 75 75 }); 76 76 } catch (error: any) {
+10 -12
src/modules/search/domain/services/LeafletSearchService.ts
··· 153 153 const documentUrl = `https://${publication.base_path}/${record.rkey}`; 154 154 155 155 // Step 4: Fetch metadata 156 - const metadataResult = await this.metadataService.getUrlMetadata( 157 - documentUrl, 156 + const metadataResult = await this.metadataService.fetchMetadata( 157 + new URL(documentUrl), 158 158 ); 159 159 if (metadataResult.isErr()) { 160 160 // If metadata fetch fails, create basic metadata from document ··· 191 191 rkey: string, 192 192 ): Promise<Result<LeafletDocumentRecord, AppError.UnexpectedError>> { 193 193 try { 194 - const params = new URLSearchParams({ 195 - repo: did, 196 - collection: 'pub.leaflet.document', 197 - rkey: rkey, 198 - }); 194 + const params = new URLSearchParams(); 195 + params.set('repo', did); 196 + params.set('collection', 'pub.leaflet.document'); 197 + params.set('rkey', rkey); 199 198 200 199 const response = await fetch( 201 200 `${this.ATPROTO_XRPC_BASE_URL}/com.atproto.repo.getRecord?${params}`, ··· 230 229 231 230 const [did, collection, rkey] = uriParts; 232 231 233 - const params = new URLSearchParams({ 234 - repo: did, 235 - collection: collection, 236 - rkey: rkey, 237 - }); 232 + const params = new URLSearchParams(); 233 + params.set('repo', did); 234 + params.set('collection', collection); 235 + params.set('rkey', rkey); 238 236 239 237 const response = await fetch( 240 238 `${this.ATPROTO_XRPC_BASE_URL}/com.atproto.repo.getRecord?${params}`,
+1
src/shared/infrastructure/http/app.ts
··· 129 129 controllers.searchBskyPostsForUrlController, 130 130 controllers.semanticSearchUrlsController, 131 131 controllers.searchAtProtoAccountsController, 132 + controllers.searchLeafletDocsForUrlController, 132 133 ); 133 134 134 135 const notificationRouter = createNotificationRoutes(
+8
src/shared/infrastructure/http/factories/ServiceFactory.ts
··· 76 76 configService: EnvironmentConfigService; 77 77 cookieService: CookieService; 78 78 searchService: SearchService; 79 + leafletSearchService: LeafletSearchService; 79 80 cardLibraryService: CardLibraryService; 80 81 cardCollectionService: CardCollectionService; 81 82 eventPublisher: IEventPublisher; ··· 355 356 repositories.cardQueryRepository, 356 357 ); 357 358 359 + // Create LeafletSearchService 360 + const leafletSearchService = new LeafletSearchService( 361 + atProtoAgentService, 362 + metadataService, 363 + ); 364 + 358 365 // Create publishers needed for shared services 359 366 const useFakePublishers = configService.shouldUseFakePublishers(); 360 367 const collections = configService.getAtProtoCollections(); ··· 410 417 configService, 411 418 cookieService, 412 419 searchService, 420 + leafletSearchService, 413 421 cardLibraryService, 414 422 cardCollectionService, 415 423 eventPublisher,