A social knowledge tool for researchers built on ATProto
45
fork

Configure Feed

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

feat: add `getUrlStatusForMyLibrary` method to ApiClient

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

+35
+9
src/webapp/api-client/ApiClient.ts
··· 57 57 GetUrlCardsResponse, 58 58 GetProfileResponse, 59 59 GetProfileParams, 60 + GetUrlStatusForMyLibraryParams, 61 + GetUrlStatusForMyLibraryResponse, 60 62 } from './types'; 61 63 62 64 // Main API Client class using composition ··· 150 152 params: GetCollectionsParams, 151 153 ): Promise<GetCollectionsResponse> { 152 154 return this.queryClient.getUserCollections(params); 155 + } 156 + 157 + async getUrlStatusForMyLibrary( 158 + params: GetUrlStatusForMyLibraryParams, 159 + ): Promise<GetUrlStatusForMyLibraryResponse> { 160 + this.requireAuthentication('getUrlStatusForMyLibrary'); 161 + return this.queryClient.getUrlStatusForMyLibrary(params); 153 162 } 154 163 155 164 // Card operations - delegate to CardClient (all require authentication)
+12
src/webapp/api-client/clients/QueryClient.ts
··· 7 7 GetProfileResponse, 8 8 GetCollectionPageResponse, 9 9 GetCollectionsResponse, 10 + GetUrlStatusForMyLibraryResponse, 10 11 GetMyUrlCardsParams, 11 12 GetUrlCardsParams, 12 13 GetCollectionPageParams, ··· 14 15 GetCollectionsParams, 15 16 GetCollectionPageByAtUriParams, 16 17 GetProfileParams, 18 + GetUrlStatusForMyLibraryParams, 17 19 } from '../types'; 18 20 19 21 export class QueryClient extends BaseClient { ··· 156 158 : `/api/collections/user/${params.identifier}`; 157 159 158 160 return this.request<GetCollectionsResponse>('GET', endpoint); 161 + } 162 + 163 + async getUrlStatusForMyLibrary( 164 + params: GetUrlStatusForMyLibraryParams, 165 + ): Promise<GetUrlStatusForMyLibraryResponse> { 166 + const searchParams = new URLSearchParams({ url: params.url }); 167 + return this.request<GetUrlStatusForMyLibraryResponse>( 168 + 'GET', 169 + `/api/cards/library/status?${searchParams}`, 170 + ); 159 171 } 160 172 }
+4
src/webapp/api-client/types/requests.ts
··· 127 127 export interface GetProfileParams { 128 128 identifier: string; // Can be DID or handle 129 129 } 130 + 131 + export interface GetUrlStatusForMyLibraryParams { 132 + url: string; 133 + }
+10
src/webapp/api-client/types/responses.ts
··· 297 297 nextCursor?: string; 298 298 }; 299 299 } 300 + 301 + export interface GetUrlStatusForMyLibraryResponse { 302 + cardId?: string; 303 + collections?: { 304 + id: string; 305 + uri?: string; 306 + name: string; 307 + description?: string; 308 + }[]; 309 + }