Something went wrong. Try again.
Explore blocks, labels, lists, and posts on Bluesky. skytrace.aly.town
typescript react bluesky atproto
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172import type { ActorIdentity } from '../types'import { SERVICE_URLS } from '../config/serviceUrls'
type LabelRequestOptions = { service?: string uriPatterns: readonly string[] sources?: readonly string[] cursor?: string limit?: number}
export function labelRequestIdentity({ service, uriPatterns, sources, cursor, limit }: LabelRequestOptions) { return [ service ?? SERVICE_URLS.labelRelay, [...new Set(uriPatterns)].sort(), [...new Set(sources ?? [])].sort(), cursor ?? null, limit ?? 50, ] as const}
export const queryKeys = { actorSuggestions: (query: string) => ['actorSuggestions', query] as const, accountDetails: (did: string) => ['accountDetails', did] as const, identity: (identifier: string) => ['identity', identifier] as const, profileView: (identifier: string) => ['actorProfileView', identifier] as const, record: (uri: string) => ['record', uri] as const, listSummary: (uri: string | undefined) => ['listSummary', uri] as const, repositoryRecords: ({ identity, collection, cursor, limit, }: { identity: ActorIdentity collection: string cursor?: string limit: number }) => ['repositoryRecords', identity.pds, identity.did, collection, cursor ?? null, limit] as const, blockedCount: (identity?: ActorIdentity) => ['blockedCount', identity?.pds ?? null, identity?.did ?? null] as const, blockedByCount: (did?: string) => ['blockedByCount', did ?? null] as const, listBlockCount: (uri?: string) => ['listBlockCount', uri ?? null] as const, profileVisibility: (identifier: string, targetDid: string | undefined, hiddenDids: readonly string[]) => ['profileVisibility', identifier, targetDid ?? null, hiddenDids] as const, backlinks: ({ subject, source, cursor, limit, did, }: { subject: string source: string cursor?: string limit?: number did?: string }) => ['backlinks', subject, source, cursor ?? null, limit ?? null, did ?? null] as const, labelerEndpoint: (did: string) => ['labelerEndpoint', did] as const, labelDefinitions: (did: string) => ['labelDefinitions', did] as const, labels: (options: LabelRequestOptions) => ['labelRecords', ...labelRequestIdentity(options)] as const, profileTab: (did: string, tab: string) => ['profileTab', did, tab] as const, labeledPosts: (did: string) => ['labeledPosts', did] as const, feed: (did: string) => ['feed', did] as const, listMembers: (uri: string) => ['listMembers', uri] as const, listMember: (listUri: string, membershipUri: string) => ['listMember', listUri, membershipUri] as const, listedOnMembership: (membershipUri: string, subjectDid: string, minimumBlocking?: number) => ['listedOnMembership', membershipUri, subjectDid, minimumBlocking ?? null] as const, blockedByRecord: (uri: string | undefined, subjectDid: string) => ['blockedByRecord', uri ?? null, subjectDid] as const, feedPost: (uri: string) => ['feedPost', uri] as const,} as const