@singi-labs/sifa-sdk 0.9.19 → 0.9.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/feed-DHTy7fUN.d.cts +254 -0
  2. package/dist/feed-DHTy7fUN.d.ts +254 -0
  3. package/dist/{index-DCpMh2Ny.d.cts → index-DYUYJxOs.d.cts} +1 -1
  4. package/dist/{index-DCpMh2Ny.d.ts → index-DYUYJxOs.d.ts} +1 -1
  5. package/dist/index.cjs +103 -2
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +4 -3
  8. package/dist/index.d.ts +4 -3
  9. package/dist/index.js +92 -3
  10. package/dist/index.js.map +1 -1
  11. package/dist/keys-D-vNPzXx.d.ts +1085 -0
  12. package/dist/keys-DRD79nDE.d.cts +1085 -0
  13. package/dist/query/fetchers/index.cjs +155 -1
  14. package/dist/query/fetchers/index.cjs.map +1 -1
  15. package/dist/query/fetchers/index.d.cts +6 -933
  16. package/dist/query/fetchers/index.d.ts +6 -933
  17. package/dist/query/fetchers/index.js +146 -2
  18. package/dist/query/fetchers/index.js.map +1 -1
  19. package/dist/query/hooks/index.cjs +2268 -0
  20. package/dist/query/hooks/index.cjs.map +1 -0
  21. package/dist/query/hooks/index.d.cts +479 -0
  22. package/dist/query/hooks/index.d.ts +479 -0
  23. package/dist/query/hooks/index.js +2178 -0
  24. package/dist/query/hooks/index.js.map +1 -0
  25. package/dist/query/index.cjs +340 -1
  26. package/dist/query/index.cjs.map +1 -1
  27. package/dist/query/index.d.cts +9 -352
  28. package/dist/query/index.d.ts +9 -352
  29. package/dist/query/index.js +322 -3
  30. package/dist/query/index.js.map +1 -1
  31. package/dist/schemas/index.cjs +102 -1
  32. package/dist/schemas/index.cjs.map +1 -1
  33. package/dist/schemas/index.d.cts +28 -2
  34. package/dist/schemas/index.d.ts +28 -2
  35. package/dist/schemas/index.js +91 -2
  36. package/dist/schemas/index.js.map +1 -1
  37. package/package.json +11 -1
@@ -0,0 +1,1085 @@
1
+ import { E as ExternalAccount, S as SkillSuggestion } from './index-DYUYJxOs.js';
2
+ import { F as FollowFeedPage, a as FollowProfileItem, b as FeatureAllowlistEntry, c as FeatureFlag } from './feed-DHTy7fUN.js';
3
+
4
+ /**
5
+ * Foundation HTTP client for talking to the Sifa AppView.
6
+ *
7
+ * Stateless. Consumers supply a {@link SifaApiConfig} per call (the React
8
+ * hooks read it from context; non-React consumers pass it explicitly). No
9
+ * singletons, no module-level state.
10
+ */
11
+ /** Configuration passed to every fetcher. */
12
+ interface SifaApiConfig {
13
+ /** Base URL of the sifa-api AppView, e.g. `https://api.sifa.id`. No trailing slash. */
14
+ baseUrl: string;
15
+ /**
16
+ * Optional fetch implementation. Defaults to {@link globalThis.fetch}.
17
+ * Lets Next.js consumers pass their cache-enhanced fetch; node/Expo
18
+ * consumers can leave this unset.
19
+ */
20
+ fetch?: typeof fetch;
21
+ }
22
+ /** Options accepted by {@link apiFetch}. */
23
+ interface ApiFetchOptions {
24
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
25
+ /** Request body. Serialized to JSON automatically. */
26
+ body?: unknown;
27
+ /** AbortSignal. Defaults to `AbortSignal.timeout(timeoutMs)` if `timeoutMs` is set. */
28
+ signal?: AbortSignal;
29
+ /** Per-call timeout in milliseconds. Default: 10_000. Ignored if `signal` is provided. */
30
+ timeoutMs?: number;
31
+ /** Retry on HTTP 429 up to 3 times with the server's `Retry-After` delay (capped at 3s). */
32
+ retryOn429?: boolean;
33
+ /** Additional headers. `Content-Type: application/json` is set automatically when `body` is present. */
34
+ headers?: Record<string, string>;
35
+ credentials?: RequestCredentials;
36
+ cache?: RequestCache;
37
+ /**
38
+ * Next.js-specific cache hints. Ignored on non-Next runtimes. Passed
39
+ * through transparently as part of {@link RequestInit}.
40
+ */
41
+ next?: {
42
+ revalidate?: number | false;
43
+ tags?: string[];
44
+ };
45
+ }
46
+ /** Error thrown by {@link apiFetch} on non-2xx responses. */
47
+ declare class ApiError extends Error {
48
+ readonly status: number;
49
+ readonly body: unknown;
50
+ constructor(message: string, status: number, body?: unknown);
51
+ }
52
+ /**
53
+ * Generic fetcher used by all SDK query and mutation functions.
54
+ *
55
+ * Returns parsed JSON typed as `T`. Throws {@link ApiError} on non-2xx
56
+ * responses. Use {@link apiFetchOrNull} when 404 should resolve to `null`
57
+ * instead.
58
+ */
59
+ declare function apiFetch<T = unknown>(config: SifaApiConfig, path: string, options?: ApiFetchOptions): Promise<T>;
60
+ /**
61
+ * Variant of {@link apiFetch} that resolves to `null` on HTTP 404 instead
62
+ * of throwing. Useful for "fetch by handle" reads where missing is
63
+ * expected (e.g. unknown profile).
64
+ */
65
+ declare function apiFetchOrNull<T>(config: SifaApiConfig, path: string, options?: ApiFetchOptions): Promise<T | null>;
66
+ /**
67
+ * Result returned by record-write mutations (create / update / delete).
68
+ *
69
+ * Never throws -- writes against the user's PDS can fail in many ways
70
+ * (network, PDS unreachable, rate limit) and the UI needs structured
71
+ * results to render appropriate messages.
72
+ */
73
+ interface WriteResult {
74
+ success: boolean;
75
+ error?: string;
76
+ /**
77
+ * PDS hostname returned by sifa-api when a write failed at the user's
78
+ * Personal Data Server (issue #167). Lets the UI render
79
+ * "Your data server (eurosky.social) isn't responding" instead of a
80
+ * generic "Request failed (500)".
81
+ */
82
+ pdsHost?: string;
83
+ }
84
+ /** Result returned by create mutations. Includes the newly created `rkey`. */
85
+ interface CreateResult extends WriteResult {
86
+ rkey?: string;
87
+ }
88
+ /**
89
+ * Write mutation against the Sifa AppView. Wraps {@link apiFetch} with the
90
+ * never-throws contract used by all sifa-web mutations: returns a
91
+ * structured {@link WriteResult} on both success and failure, and
92
+ * preserves the `pdsHost` field when the AppView reports a PDS-side
93
+ * failure (issue #167).
94
+ *
95
+ * On success: returns `{ success: true, ...payload }` where `payload` is
96
+ * whatever the server returned in JSON (or `{}` for 204).
97
+ *
98
+ * On failure: returns `{ success: false, error, pdsHost? }`. Never throws.
99
+ *
100
+ * Use {@link apiWriteCreate} when you specifically need the `rkey` from a
101
+ * create response folded into the result shape.
102
+ */
103
+ declare function apiWrite<TExtra extends object = Record<never, never>>(config: SifaApiConfig, path: string, method: 'POST' | 'PUT' | 'DELETE' | 'PATCH', options?: Omit<ApiFetchOptions, 'method'>): Promise<WriteResult & TExtra>;
104
+ /**
105
+ * Write mutation that expects the server to return a record key (`rkey`)
106
+ * in its response body. Wraps {@link apiWrite} and folds the `rkey` into
107
+ * the result shape so consumers get `{ success, rkey?, error?, pdsHost? }`.
108
+ *
109
+ * If the server returns additional fields (e.g. `feedUrl` from external
110
+ * account creation), pass them via the `TExtra` generic to keep them
111
+ * typed.
112
+ */
113
+ declare function apiWriteCreate<TExtra extends object = Record<never, never>>(config: SifaApiConfig, path: string, body: unknown, options?: Omit<ApiFetchOptions, 'method' | 'body'>): Promise<CreateResult & TExtra>;
114
+
115
+ /** Industry/domain entry on the profile self record. */
116
+ interface ProfileIndustryInput {
117
+ industry: string;
118
+ domain?: string;
119
+ }
120
+ /**
121
+ * Location payload accepted by `updateProfileSelf`.
122
+ *
123
+ * Accepts both shapes during the community.lexicon.location.address
124
+ * migration. Prefer `locality` (new) over `city` (legacy) when sending.
125
+ * The API's locationSchema is a Zod union that resolves either input.
126
+ */
127
+ interface ProfileSelfLocation {
128
+ country: string;
129
+ countryCode?: string;
130
+ region?: string;
131
+ city?: string;
132
+ locality?: string;
133
+ }
134
+ /** Body accepted by {@link updateProfileSelf}. */
135
+ interface UpdateProfileSelfInput {
136
+ headline?: string;
137
+ about?: string;
138
+ /** Schema.org Person.givenName from id.sifa.profile.self.givenName. */
139
+ givenName?: string;
140
+ /** Schema.org Person.familyName from id.sifa.profile.self.familyName. */
141
+ familyName?: string;
142
+ industries?: ProfileIndustryInput[];
143
+ location?: ProfileSelfLocation;
144
+ website?: string;
145
+ openTo?: string[];
146
+ preferredWorkplace?: string[];
147
+ availableFromUtc?: number;
148
+ availableToUtc?: number;
149
+ }
150
+ /** Update the authenticated user's `id.sifa.profile.self` record. */
151
+ declare function updateProfileSelf(config: SifaApiConfig, data: UpdateProfileSelfInput, options?: ApiFetchOptions): Promise<WriteResult>;
152
+ /** Body accepted by {@link updateProfileOverride}. */
153
+ interface UpdateProfileOverrideInput {
154
+ headline?: string | null;
155
+ about?: string | null;
156
+ displayName?: string | null;
157
+ pronouns?: string | null;
158
+ }
159
+ /**
160
+ * Override aggregated profile fields with sifa-specific values. `null`
161
+ * clears the override and falls back to the upstream PDS value.
162
+ */
163
+ declare function updateProfileOverride(config: SifaApiConfig, data: UpdateProfileOverrideInput, options?: ApiFetchOptions): Promise<WriteResult>;
164
+ /** Extended result for {@link refreshPds}. */
165
+ interface RefreshPdsResult extends WriteResult {
166
+ displayName?: string | null;
167
+ avatar?: string | null;
168
+ }
169
+ /**
170
+ * Re-pull the authenticated user's `app.bsky.actor.profile` from their
171
+ * PDS. Returns the freshly resolved `displayName` and `avatar` on
172
+ * success so the UI can update without a full profile refetch.
173
+ */
174
+ declare function refreshPds(config: SifaApiConfig, options?: ApiFetchOptions): Promise<RefreshPdsResult>;
175
+ /** Extended result for {@link uploadAvatar}. */
176
+ interface UploadAvatarResult extends WriteResult {
177
+ /** Publicly accessible URL of the newly uploaded avatar. */
178
+ url?: string;
179
+ }
180
+ /**
181
+ * Upload a new avatar via `multipart/form-data`. Pass either a `File`
182
+ * (browser) or any `Blob` (Expo, node). The SDK leaves `Content-Type`
183
+ * unset so the runtime can set the multipart boundary automatically.
184
+ *
185
+ * Never throws -- inspect `result.success` and `result.url`.
186
+ */
187
+ declare function uploadAvatar(config: SifaApiConfig, file: Blob, options?: ApiFetchOptions): Promise<UploadAvatarResult>;
188
+ /** Delete the authenticated user's avatar override (revert to PDS avatar). */
189
+ declare function deleteAvatarOverride(config: SifaApiConfig, options?: ApiFetchOptions): Promise<WriteResult>;
190
+
191
+ /**
192
+ * Address payload accepted by `/api/profile/location` endpoints.
193
+ *
194
+ * Accepts both shapes during the community.lexicon.location.address
195
+ * migration. Prefer `country` + `locality` (new) over `countryCode` +
196
+ * `city` (legacy). The API's `locationSchema` is a Zod union that
197
+ * accepts either pair.
198
+ */
199
+ interface ProfileLocationAddress {
200
+ /** Legacy alias for `country` (alpha-2). */
201
+ countryCode?: string;
202
+ /** community.lexicon.location.address field -- prefer over `countryCode`. */
203
+ country?: string;
204
+ region?: string;
205
+ /** Legacy alias for `locality`. */
206
+ city?: string;
207
+ /** community.lexicon.location.address field -- prefer over `city`. */
208
+ locality?: string;
209
+ }
210
+ /** Body accepted by {@link createProfileLocation} / {@link updateProfileLocation}. */
211
+ interface ProfileLocationInput {
212
+ address: ProfileLocationAddress;
213
+ type: string;
214
+ label?: string;
215
+ isPrimary?: boolean;
216
+ }
217
+ /** Create a new profile location entry. */
218
+ declare function createProfileLocation(config: SifaApiConfig, data: ProfileLocationInput, options?: ApiFetchOptions): Promise<CreateResult>;
219
+ /** Update an existing profile location by `rkey`. */
220
+ declare function updateProfileLocation(config: SifaApiConfig, rkey: string, data: ProfileLocationInput, options?: ApiFetchOptions): Promise<WriteResult>;
221
+ /** Delete a profile location by `rkey`. */
222
+ declare function deleteProfileLocation(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
223
+
224
+ /** Body accepted by {@link createExternalAccount} / {@link updateExternalAccount}. */
225
+ interface ExternalAccountInput {
226
+ platform: string;
227
+ url: string;
228
+ label?: string;
229
+ feedUrl?: string;
230
+ }
231
+ /** Extended create result for {@link createExternalAccount}. */
232
+ interface CreateExternalAccountResult extends WriteResult {
233
+ rkey?: string;
234
+ feedUrl?: string | null;
235
+ }
236
+ /** Extended write result for {@link verifyExternalAccount}. */
237
+ interface VerifyExternalAccountResult extends WriteResult {
238
+ verified?: boolean;
239
+ verifiedVia?: string;
240
+ }
241
+ /** List external accounts attached to a profile. Returns `[]` on error. */
242
+ declare function fetchExternalAccounts(config: SifaApiConfig, handleOrDid: string, options?: ApiFetchOptions): Promise<ExternalAccount[]>;
243
+ /**
244
+ * Create a new external account record. Returns the newly-created `rkey`
245
+ * and the server-resolved `feedUrl` (sifa-api inspects the target for
246
+ * RSS feeds on platforms that publish them).
247
+ */
248
+ declare function createExternalAccount(config: SifaApiConfig, data: ExternalAccountInput, options?: ApiFetchOptions): Promise<CreateExternalAccountResult>;
249
+ /** Update an existing external account by `rkey`. */
250
+ declare function updateExternalAccount(config: SifaApiConfig, rkey: string, data: ExternalAccountInput, options?: ApiFetchOptions): Promise<WriteResult>;
251
+ /** Delete an external account by `rkey`. */
252
+ declare function deleteExternalAccount(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
253
+ /** Mark an external account as the user's primary. */
254
+ declare function setExternalAccountPrimary(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
255
+ /** Clear the "primary" flag on an external account. */
256
+ declare function unsetExternalAccountPrimary(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
257
+ /**
258
+ * Run server-side verification on an external account (e.g. inspect
259
+ * the target for a keytrace claim). Returns `{ verified, verifiedVia }`
260
+ * on success.
261
+ */
262
+ declare function verifyExternalAccount(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<VerifyExternalAccountResult>;
263
+
264
+ /** Body accepted by {@link createEndorsement}. */
265
+ interface EndorsementInput {
266
+ skillUri: string;
267
+ comment?: string;
268
+ }
269
+ /**
270
+ * Create an endorsement of another user's skill. The endorsed user
271
+ * must confirm before the endorsement appears on their profile (the
272
+ * endorsement record is on the endorser's PDS; a separate confirmation
273
+ * record on the endorsed user's PDS gates display).
274
+ */
275
+ declare function createEndorsement(config: SifaApiConfig, data: EndorsementInput, options?: ApiFetchOptions): Promise<CreateResult>;
276
+
277
+ /** Extended result for {@link refreshOrcidPublications}. */
278
+ interface RefreshOrcidPublicationsResult extends WriteResult {
279
+ added?: number;
280
+ removed?: number;
281
+ }
282
+ /**
283
+ * Hide an ORCID-imported publication from the user's profile. The
284
+ * `putCode` is the ORCID-side identifier; the underlying record stays
285
+ * in the index, only its display is suppressed.
286
+ */
287
+ declare function hideOrcidPublication(config: SifaApiConfig, putCode: number, options?: ApiFetchOptions): Promise<WriteResult>;
288
+ /** Restore a previously-hidden ORCID publication. */
289
+ declare function unhideOrcidPublication(config: SifaApiConfig, putCode: number, options?: ApiFetchOptions): Promise<WriteResult>;
290
+ /** Hide a standard (auto-imported) publication by its AT URI. */
291
+ declare function hideStandardPublication(config: SifaApiConfig, uri: string, options?: ApiFetchOptions): Promise<WriteResult>;
292
+ /** Restore a previously-hidden standard publication. */
293
+ declare function unhideStandardPublication(config: SifaApiConfig, uri: string, options?: ApiFetchOptions): Promise<WriteResult>;
294
+ /** Bulk-hide standard publications by AT URI list. */
295
+ declare function bulkHideStandardPublications(config: SifaApiConfig, uris: string[], options?: ApiFetchOptions): Promise<WriteResult>;
296
+ /** Bulk-unhide standard publications by AT URI list. */
297
+ declare function bulkUnhideStandardPublications(config: SifaApiConfig, uris: string[], options?: ApiFetchOptions): Promise<WriteResult>;
298
+ /** Hide an `id.sifa.profile.publication` (user-authored publication record). */
299
+ declare function hideSifaPublication(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
300
+ /** Restore a previously-hidden Sifa publication. */
301
+ declare function unhideSifaPublication(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
302
+ /**
303
+ * Re-pull the authenticated user's ORCID publications. Returns counts
304
+ * of added and removed records. The server returns `{ error: '...' }`
305
+ * inline (not via HTTP status) on quota / linkage failures; the SDK
306
+ * folds that into `{ success: false, error }` to keep the contract
307
+ * consistent with other mutations.
308
+ */
309
+ declare function refreshOrcidPublications(config: SifaApiConfig, options?: ApiFetchOptions): Promise<RefreshOrcidPublicationsResult>;
310
+
311
+ /** Item types that can be hidden on the authenticated user's profile. */
312
+ declare const HIDDEN_ITEM_TYPES: readonly ["position", "education", "certification", "project", "volunteering", "publication", "course", "honor", "language", "externalAccount"];
313
+ type HiddenItemType = (typeof HIDDEN_ITEM_TYPES)[number];
314
+ /** Source from which an item originates; disambiguates `item_id`. */
315
+ declare const HIDDEN_ITEM_SOURCES: readonly ["pds", "standard", "orcid"];
316
+ type HiddenItemSource = (typeof HIDDEN_ITEM_SOURCES)[number];
317
+ interface HideProfileItemInput {
318
+ itemType: HiddenItemType;
319
+ source: HiddenItemSource;
320
+ /** rkey for `pds`, AT-URI for `standard`, ORCID putCode as text for `orcid`. */
321
+ itemId: string;
322
+ }
323
+ interface BulkHideProfileItemInput {
324
+ itemType: HiddenItemType;
325
+ source: HiddenItemSource;
326
+ itemIds: string[];
327
+ }
328
+ /**
329
+ * Hide one profile item. The underlying record stays on the user's PDS;
330
+ * only its display on sifa.id is suppressed.
331
+ */
332
+ declare function hideProfileItem(config: SifaApiConfig, input: HideProfileItemInput, options?: ApiFetchOptions): Promise<WriteResult>;
333
+ /** Restore a previously-hidden profile item. */
334
+ declare function unhideProfileItem(config: SifaApiConfig, input: HideProfileItemInput, options?: ApiFetchOptions): Promise<WriteResult>;
335
+ /** Bulk-hide profile items sharing the same `itemType` + `source`. */
336
+ declare function bulkHideProfileItems(config: SifaApiConfig, input: BulkHideProfileItemInput, options?: ApiFetchOptions): Promise<WriteResult>;
337
+ /** Bulk-unhide profile items sharing the same `itemType` + `source`. */
338
+ declare function bulkUnhideProfileItems(config: SifaApiConfig, input: BulkHideProfileItemInput, options?: ApiFetchOptions): Promise<WriteResult>;
339
+
340
+ /** Public, aggregate stats shown on the homepage and similar surfaces. */
341
+ interface StatsResponse {
342
+ profileCount: number;
343
+ avatars: string[];
344
+ atproto: {
345
+ userCount: number;
346
+ growthPerSecond: number;
347
+ timestamp: number;
348
+ } | null;
349
+ }
350
+ /**
351
+ * Homepage stats (profile count, avatar samples, ATproto growth). Public
352
+ * endpoint -- safe to cache. Returns `null` on any error so callers can
353
+ * render a graceful empty state.
354
+ */
355
+ declare function fetchStats(config: SifaApiConfig, options?: ApiFetchOptions): Promise<StatsResponse | null>;
356
+
357
+ /** Catalog entry describing an ATproto app that Sifa surfaces activity for. */
358
+ interface AppRegistryEntry {
359
+ id: string;
360
+ name: string;
361
+ category: string;
362
+ collectionPrefixes: string[];
363
+ scanCollections: string[];
364
+ urlPattern?: string;
365
+ color: string;
366
+ }
367
+ /** Compact app representation returned by the hidden-apps endpoint. */
368
+ interface HiddenApp {
369
+ id: string;
370
+ name: string;
371
+ category: string;
372
+ }
373
+ interface FetchHiddenAppsOptions extends ApiFetchOptions {
374
+ /**
375
+ * Pass the caller's `Cookie` header on Next.js RSC server-side calls.
376
+ * `credentials: 'include'` does NOT propagate browser cookies in RSC,
377
+ * so authenticated server fetches must forward the header explicitly.
378
+ */
379
+ cookieHeader?: string;
380
+ }
381
+ /**
382
+ * Public app registry shown across discovery surfaces. Heavily cached.
383
+ * Returns `[]` on any error.
384
+ */
385
+ declare function fetchAppsRegistry(config: SifaApiConfig, options?: ApiFetchOptions): Promise<AppRegistryEntry[]>;
386
+ /**
387
+ * Apps the authenticated user has chosen to hide from their activity feed.
388
+ * Requires an authenticated session. Returns `[]` on any error (including
389
+ * the unauthenticated case).
390
+ */
391
+ declare function fetchHiddenApps(config: SifaApiConfig, options?: FetchHiddenAppsOptions): Promise<HiddenApp[]>;
392
+
393
+ /** Profile entry returned by the search endpoint. */
394
+ interface ProfileSearchResult {
395
+ did?: string;
396
+ handle: string;
397
+ displayName?: string;
398
+ headline?: string;
399
+ avatar?: string;
400
+ about?: string;
401
+ currentRole?: string;
402
+ currentCompany?: string;
403
+ industry?: string;
404
+ domain?: string;
405
+ countryCode?: string;
406
+ locationCountry?: string;
407
+ preferredWorkplace?: string[];
408
+ claimed?: boolean;
409
+ blueskyVerified?: boolean;
410
+ blueskyVerifiedAt?: string | null;
411
+ }
412
+ interface SearchFilters {
413
+ q?: string;
414
+ skill?: string;
415
+ country?: string;
416
+ industry?: string;
417
+ domain?: string;
418
+ workplace?: string;
419
+ app?: string;
420
+ limit?: number;
421
+ }
422
+ interface SearchResponse {
423
+ profiles: ProfileSearchResult[];
424
+ total: number;
425
+ limit: number;
426
+ offset: number;
427
+ }
428
+ /** Skill typeahead suggestion. */
429
+ interface SkillSearchResult {
430
+ name: string;
431
+ slug: string;
432
+ category: string;
433
+ userCount: number;
434
+ }
435
+ interface FilterOptions {
436
+ countries: {
437
+ countryCode: string;
438
+ country: string;
439
+ count: number;
440
+ }[];
441
+ industries: {
442
+ industry: string;
443
+ count: number;
444
+ }[];
445
+ apps: {
446
+ appId: string;
447
+ count: number;
448
+ }[];
449
+ }
450
+ /**
451
+ * Search profiles by free-text query and optional filters. Returns an
452
+ * empty result set when no filters are provided (matching sifa-web's
453
+ * "no input, no fetch" behavior).
454
+ */
455
+ declare function fetchSearchProfiles(config: SifaApiConfig, filters: SearchFilters, options?: ApiFetchOptions): Promise<SearchResponse>;
456
+ /**
457
+ * Skill typeahead. Returns up to 8 matches for the given prefix. Empty
458
+ * input returns an empty array without hitting the server.
459
+ */
460
+ declare function fetchSkillSuggestions(config: SifaApiConfig, query: string, options?: ApiFetchOptions): Promise<SkillSearchResult[]>;
461
+ /** Available filter facets (countries, industries, apps) for search UI. */
462
+ declare function fetchSearchFilters(config: SifaApiConfig, options?: ApiFetchOptions): Promise<FilterOptions>;
463
+ /**
464
+ * Canonical-skill search backing the position-editor and similar
465
+ * skill-pickers. Hits `/api/skills/search` (the canonical-skills DB
466
+ * lookup) which is distinct from {@link fetchSkillSuggestions}'s
467
+ * `/api/search/skills` (the profile-skill typeahead).
468
+ *
469
+ * Returns `[]` on empty input (no network call) or any error.
470
+ */
471
+ declare function searchSkills(config: SifaApiConfig, query: string, limit?: number, options?: ApiFetchOptions): Promise<SkillSuggestion[]>;
472
+
473
+ /** Lightweight profile representation used by discovery endpoints. */
474
+ interface SimilarProfile {
475
+ did: string;
476
+ handle: string;
477
+ displayName?: string | null;
478
+ avatar?: string | null;
479
+ headline?: string | null;
480
+ currentRole?: string | null;
481
+ currentCompany?: string | null;
482
+ industry?: string | null;
483
+ domain?: string | null;
484
+ }
485
+ interface SuggestionProfile {
486
+ did: string;
487
+ handle: string;
488
+ displayName?: string;
489
+ headline?: string;
490
+ avatarUrl?: string;
491
+ source: string;
492
+ dismissed: boolean;
493
+ blueskyVerified?: boolean;
494
+ }
495
+ interface SuggestionsResponse {
496
+ onSifa: SuggestionProfile[];
497
+ notOnSifa: SuggestionProfile[];
498
+ cursor?: string;
499
+ }
500
+ interface FeaturedProfile {
501
+ did: string;
502
+ handle: string;
503
+ displayName?: string;
504
+ avatar?: string;
505
+ pronouns?: string;
506
+ headline?: string;
507
+ about?: string;
508
+ currentRole?: string;
509
+ currentCompany?: string;
510
+ locationCountry?: string;
511
+ locationRegion?: string;
512
+ /** Legacy alias for `locationLocality`; emitted by sifa-api during the additive response window. */
513
+ locationCity?: string;
514
+ /** community.lexicon.location.address field name -- prefer over `locationCity`. */
515
+ locationLocality?: string;
516
+ countryCode?: string;
517
+ location?: string;
518
+ website?: string;
519
+ openTo?: string[];
520
+ preferredWorkplace?: string[];
521
+ availableFromUtc?: number;
522
+ availableToUtc?: number;
523
+ followersCount?: number;
524
+ atprotoFollowersCount?: number;
525
+ pdsProvider?: {
526
+ name: string;
527
+ host: string;
528
+ } | null;
529
+ claimed: boolean;
530
+ featuredDate: string;
531
+ }
532
+ /** Profiles similar to the given DID (matchmaking). Returns `[]` on error. */
533
+ declare function fetchSimilarProfiles(config: SifaApiConfig, did: string, opts?: {
534
+ limit?: number;
535
+ } & ApiFetchOptions): Promise<SimilarProfile[]>;
536
+ interface FetchSuggestionsOptions extends ApiFetchOptions {
537
+ source?: string;
538
+ includeDismissed?: boolean;
539
+ cursor?: string;
540
+ limit?: number;
541
+ /**
542
+ * Pass the caller's `Cookie` header on Next.js RSC server-side calls.
543
+ * `credentials: 'include'` does NOT propagate browser cookies in RSC,
544
+ * so authenticated server fetches must forward the header explicitly.
545
+ */
546
+ cookieHeader?: string;
547
+ }
548
+ /** Discovery suggestions feed. Resolves to empty arrays on error. */
549
+ declare function fetchSuggestions(config: SifaApiConfig, opts?: FetchSuggestionsOptions): Promise<SuggestionsResponse>;
550
+ /** Count of pending suggestions since an optional timestamp. */
551
+ declare function fetchSuggestionCount(config: SifaApiConfig, since?: string, options?: ApiFetchOptions): Promise<number>;
552
+ /** Featured profile (rotated by sifa-api). Returns `null` when none. */
553
+ declare function fetchFeaturedProfile(config: SifaApiConfig, options?: ApiFetchOptions): Promise<FeaturedProfile | null>;
554
+
555
+ interface FollowProfile {
556
+ did: string;
557
+ handle: string;
558
+ displayName?: string;
559
+ headline?: string;
560
+ avatarUrl?: string;
561
+ source: string;
562
+ claimed: boolean;
563
+ followedAt: string;
564
+ blueskyVerified?: boolean;
565
+ blueskyVerifiedAt?: string | null;
566
+ }
567
+ interface FollowingResponse {
568
+ follows: FollowProfile[];
569
+ cursor?: string;
570
+ }
571
+ /** People the authenticated user follows. Empty on error. */
572
+ declare function fetchFollowing(config: SifaApiConfig, opts?: {
573
+ source?: string;
574
+ cursor?: string;
575
+ limit?: number;
576
+ } & ApiFetchOptions): Promise<FollowingResponse>;
577
+ /**
578
+ * Result of {@link followUser}. Extends {@link WriteResult} with the
579
+ * follow `rkey` returned by sifa-api on success. Self-follow + invalid
580
+ * handle surface as `success: false` with the server-provided message;
581
+ * dup-follow is idempotent (sifa-api E7) and resolves as `success: true`.
582
+ */
583
+ interface FollowUserResult extends WriteResult {
584
+ rkey?: string;
585
+ /** DID of the followed subject (server-resolved from the handle). */
586
+ subjectDid?: string;
587
+ }
588
+ /**
589
+ * Create an `id.sifa.graph.follow` record on the caller's PDS via the
590
+ * AppView. Idempotent on duplicate (server catches the unique-violation
591
+ * and returns 200, per sifa-api#673 E7).
592
+ */
593
+ declare function followUser(config: SifaApiConfig, handle: string, opts?: {
594
+ note?: string;
595
+ } & Omit<ApiFetchOptions, 'method' | 'body'>): Promise<FollowUserResult>;
596
+ /** Delete the authenticated viewer's `id.sifa.graph.follow` for `handle`. */
597
+ declare function unfollowUser(config: SifaApiConfig, handle: string, opts?: Omit<ApiFetchOptions, 'method' | 'body'>): Promise<WriteResult>;
598
+ interface FollowListPage {
599
+ follows: FollowProfile[];
600
+ cursor: string | null;
601
+ }
602
+ interface FetchFollowListOptions extends ApiFetchOptions {
603
+ cursor?: string;
604
+ limit?: number;
605
+ /**
606
+ * Pass the caller's `Cookie` header on Next.js RSC server-side calls
607
+ * (mirrors {@link FetchActivityFeedOptions}; required for authenticated
608
+ * server fetches because `credentials: 'include'` does not propagate
609
+ * cookies from RSC).
610
+ */
611
+ cookieHeader?: string;
612
+ }
613
+ /**
614
+ * Paginated list of `handle`'s followers. Returns an empty page on error
615
+ * so the UI can render a graceful "no followers yet" state.
616
+ */
617
+ declare function getFollowers(config: SifaApiConfig, handle: string, opts?: FetchFollowListOptions): Promise<FollowListPage>;
618
+ /** Paginated list of who `handle` follows. */
619
+ declare function getFollowing(config: SifaApiConfig, handle: string, opts?: FetchFollowListOptions): Promise<FollowListPage>;
620
+ /**
621
+ * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
622
+ * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
623
+ * Stream are two distinct surfaces with different data paths (Barazo API
624
+ * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
625
+ * types are no longer consumed. Scheduled for removal in next major bump.
626
+ */
627
+ interface FetchFollowingFeedOptions extends ApiFetchOptions {
628
+ cursor?: string;
629
+ limit?: number;
630
+ /**
631
+ * Comma-separated category filter (per sifa-api#673 TR10). Forwarded
632
+ * as-is; the server validates allowed values.
633
+ */
634
+ categories?: string[];
635
+ cookieHeader?: string;
636
+ }
637
+ /**
638
+ * V5 home feed: Sifa events + curated ATmosphere creation events filtered
639
+ * by the authenticated viewer's followees. Composite cursor (per E5/TR4).
640
+ * Returns an empty page on error.
641
+ *
642
+ * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
643
+ * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
644
+ * Stream are two distinct surfaces with different data paths (Barazo API
645
+ * for Timeline, live PDS reads + Valkey for Stream). This fetcher is no
646
+ * longer consumed. Scheduled for removal in next major bump.
647
+ */
648
+ declare function getFollowingFeed(config: SifaApiConfig, opts?: FetchFollowingFeedOptions): Promise<FollowFeedPage>;
649
+
650
+ /**
651
+ * Options shared by the cursor-paginated follow-graph endpoints introduced in
652
+ * `sifa-api#674` (mutuals + bluesky-suggestions). Mirrors
653
+ * `FetchFollowListOptions` in `./follow.ts` but the response wrapper here uses
654
+ * the `{ items, cursor }` shape (not `{ follows, cursor }`).
655
+ */
656
+ interface FetchFollowProfilePageOptions extends ApiFetchOptions {
657
+ cursor?: string;
658
+ limit?: number;
659
+ /**
660
+ * Pass the caller's `Cookie` header on Next.js RSC server-side calls
661
+ * (mirrors `FetchFollowListOptions`; required for authenticated server
662
+ * fetches because `credentials: 'include'` does not propagate cookies from
663
+ * RSC).
664
+ */
665
+ cookieHeader?: string;
666
+ }
667
+ /** Page of {@link FollowProfileItem} rows with an opaque next-page cursor. */
668
+ interface FollowProfilePageResponse {
669
+ items: FollowProfileItem[];
670
+ cursor: string | null;
671
+ }
672
+ /**
673
+ * Cursor-paginated list of mutual sifa-source follows for `handleOrDid`
674
+ * (X↔Y both follow each other on Sifa). Backed by
675
+ * `GET /api/profile/{handleOrDid}/mutuals` from `sifa-api#674`. Public —
676
+ * does not require auth. Returns an empty page on error.
677
+ */
678
+ declare function getMutuals(config: SifaApiConfig, handleOrDid: string, opts?: FetchFollowProfilePageOptions): Promise<FollowProfilePageResponse>;
679
+ /**
680
+ * Cursor-paginated list of Sifa users the viewer follows on Bluesky but NOT
681
+ * on Sifa, filtered to people active on Sifa. Backed by
682
+ * `GET /api/me/bluesky-suggestions` from `sifa-api#674`. Auth-required.
683
+ * Returns an empty page on error.
684
+ */
685
+ declare function getBlueskySuggestions(config: SifaApiConfig, opts?: FetchFollowProfilePageOptions): Promise<FollowProfilePageResponse>;
686
+
687
+ /**
688
+ * Options for {@link listFeatureAllowlist}. Supports the same `cookieHeader`
689
+ * passthrough as the other admin reads for RSC contexts.
690
+ */
691
+ interface ListFeatureAllowlistOptions extends ApiFetchOptions {
692
+ cookieHeader?: string;
693
+ }
694
+ /** Response shape of `GET /api/admin/feature-allowlists/:flag`. */
695
+ interface FeatureAllowlistResponse {
696
+ items: FeatureAllowlistEntry[];
697
+ }
698
+ /**
699
+ * List all DIDs on the given feature flag's allowlist. Admin-gated server-
700
+ * side (caller must be an admin). Returns an empty list on error so the UI
701
+ * can render a graceful empty state.
702
+ */
703
+ declare function listFeatureAllowlist(config: SifaApiConfig, flag: FeatureFlag, opts?: ListFeatureAllowlistOptions): Promise<FeatureAllowlistResponse>;
704
+ /**
705
+ * Add (or upsert the note for) a DID on the given flag's allowlist. Maps to
706
+ * `POST /api/admin/feature-allowlists/{flag}`. Returns a {@link WriteResult};
707
+ * never throws.
708
+ */
709
+ declare function addFeatureAllowlist(config: SifaApiConfig, flag: FeatureFlag, did: string, opts?: {
710
+ note?: string;
711
+ } & Omit<ApiFetchOptions, 'method' | 'body'>): Promise<WriteResult>;
712
+ /**
713
+ * Remove a DID from the given flag's allowlist. Maps to
714
+ * `DELETE /api/admin/feature-allowlists/{flag}/{did}`. Returns a
715
+ * {@link WriteResult}; never throws.
716
+ */
717
+ declare function removeFeatureAllowlist(config: SifaApiConfig, flag: FeatureFlag, did: string, opts?: Omit<ApiFetchOptions, 'method' | 'body'>): Promise<WriteResult>;
718
+
719
+ interface QuotedPostAuthor {
720
+ did: string;
721
+ handle: string;
722
+ displayName?: string;
723
+ avatar?: string;
724
+ }
725
+ interface QuotedPostImage {
726
+ thumb: string;
727
+ fullsize: string;
728
+ alt?: string;
729
+ }
730
+ interface QuotedPostView {
731
+ uri: string;
732
+ cid: string;
733
+ author: QuotedPostAuthor;
734
+ text: string;
735
+ createdAt: string;
736
+ images?: QuotedPostImage[];
737
+ }
738
+ type QuotedPostResult = {
739
+ status: 'ok';
740
+ record: QuotedPostView;
741
+ } | {
742
+ status: 'deleted';
743
+ uri: string;
744
+ } | {
745
+ status: 'unavailable';
746
+ uri: string;
747
+ };
748
+ /** Max URIs per request to `POST /api/quoted-posts/resolve` (mirrors server cap). */
749
+ declare const QUOTED_POSTS_BATCH_MAX = 20;
750
+ interface ResolveQuotedPostsOptions extends ApiFetchOptions {
751
+ /** Cookie header for Next.js RSC server-side calls; ignored in browsers. */
752
+ cookieHeader?: string;
753
+ }
754
+ /**
755
+ * Resolve a batch of AT-URIs to their quoted-post snapshots via the Sifa AppView.
756
+ *
757
+ * Auto-deduplicates input URIs and splits requests into chunks of
758
+ * {@link QUOTED_POSTS_BATCH_MAX} so callers can pass an arbitrary-length array.
759
+ * Each chunk is fired in parallel. The server caches results in Valkey, so
760
+ * repeated calls for the same URI are cheap.
761
+ *
762
+ * Returns a map of `uri -> QuotedPostResult`. URIs that fail (network error,
763
+ * non-2xx, or the server omitting them) are absent from the map; the caller
764
+ * should render a skeleton or tombstone for those.
765
+ */
766
+ declare function resolveQuotedPosts(config: SifaApiConfig, uris: string[], options?: ResolveQuotedPostsOptions): Promise<Record<string, QuotedPostResult>>;
767
+
768
+ /**
769
+ * Reachability of an activity card's external destination, as reported by
770
+ * sifa-api's `/api/activity` enrichment (see sifa-api `url-health-checker`).
771
+ *
772
+ * ok -- last HEAD returned 2xx/3xx
773
+ * broken -- confirmed dead (>=2 consecutive 4xx, or >=5 consecutive 5xx)
774
+ * unverifiable -- 403/429/network error; anti-bot or rate-limited, NOT dead
775
+ * unknown -- newly seen, not yet checked
776
+ *
777
+ * Consumers should only suppress UI on `'broken'`. All other values
778
+ * (including missing) mean "render normally".
779
+ */
780
+ type ActivityItemLinkHealth = 'ok' | 'broken' | 'unverifiable' | 'unknown';
781
+ interface HeatmapDay {
782
+ date: string;
783
+ total: number;
784
+ apps: {
785
+ appId: string;
786
+ count: number;
787
+ }[];
788
+ }
789
+ interface HeatmapResponse {
790
+ days: HeatmapDay[];
791
+ appTotals: {
792
+ appId: string;
793
+ appName: string;
794
+ total: number;
795
+ }[];
796
+ thresholds: [number, number, number, number];
797
+ }
798
+ interface ActivityItem {
799
+ uri: string;
800
+ cid: string;
801
+ collection: string;
802
+ rkey: string;
803
+ record: Record<string, unknown>;
804
+ appId: string;
805
+ appName: string;
806
+ category: string;
807
+ indexedAt: string;
808
+ /**
809
+ * Set by the server when an `app.bsky.embed.record` quote was already
810
+ * resolved upstream (AppView path). Mutually exclusive with `quotedPostUri`.
811
+ */
812
+ quotedPost?: QuotedPostResult;
813
+ /**
814
+ * Set by the server when an `app.bsky.embed.record` quote needs client-side
815
+ * resolution (PDS path). Pass batches to {@link resolveQuotedPosts}.
816
+ * Mutually exclusive with `quotedPost`.
817
+ */
818
+ quotedPostUri?: string;
819
+ /**
820
+ * Reachability of the card's external destination as last checked by
821
+ * sifa-api. Undefined for legacy responses; treat as 'unknown'.
822
+ * See {@link ActivityItemLinkHealth}.
823
+ */
824
+ linkHealth?: ActivityItemLinkHealth;
825
+ }
826
+ interface ActivityTeaserResponse {
827
+ items: ActivityItem[];
828
+ blueskyGated?: boolean;
829
+ backfillPending?: boolean;
830
+ failedApps?: string[];
831
+ }
832
+ interface ActivityFeedResponse {
833
+ items: ActivityItem[];
834
+ cursor: string | null;
835
+ hasMore: boolean;
836
+ availableCategories?: string[];
837
+ blueskyGated?: boolean;
838
+ failedApps?: string[];
839
+ }
840
+ /**
841
+ * Per-day activity counts for a profile across all ATproto apps. Returns
842
+ * `null` on any error so callers can render a graceful empty state.
843
+ */
844
+ declare function fetchHeatmapData(config: SifaApiConfig, handleOrDid: string, days: number, options?: ApiFetchOptions): Promise<HeatmapResponse | null>;
845
+ interface FetchActivityTeaserOptions extends ApiFetchOptions {
846
+ /**
847
+ * Pass the caller's `Cookie` header on Next.js RSC server-side calls.
848
+ * Required for authenticated server fetches because `credentials: 'include'`
849
+ * does not propagate browser cookies in RSC.
850
+ */
851
+ cookieHeader?: string;
852
+ }
853
+ /**
854
+ * Recent activity teaser for a profile (homepage-sized slice). Caps the
855
+ * upstream wait so the SSR path cannot hang. Returns `null` on any error.
856
+ */
857
+ declare function fetchActivityTeaser(config: SifaApiConfig, handleOrDid: string, options?: FetchActivityTeaserOptions): Promise<ActivityTeaserResponse | null>;
858
+ interface FetchActivityFeedOptions extends ApiFetchOptions {
859
+ category?: string;
860
+ limit?: number;
861
+ cursor?: string;
862
+ cookieHeader?: string;
863
+ }
864
+ /**
865
+ * Paginated activity feed for a profile. Always fresh (`cache: 'no-store'`).
866
+ * Returns `null` on any error.
867
+ */
868
+ declare function fetchActivityFeed(config: SifaApiConfig, handleOrDid: string, options?: FetchActivityFeedOptions): Promise<ActivityFeedResponse | null>;
869
+
870
+ /** Per-URI reaction state for the authenticated viewer. */
871
+ interface ReactionStatus {
872
+ reacted: boolean;
873
+ rkey?: string;
874
+ collection?: string;
875
+ }
876
+ /** Result of checking whether the authenticated viewer has an account on a given app. */
877
+ interface AccountCheckResult {
878
+ hasAccount: boolean;
879
+ appName: string;
880
+ appUrl: string;
881
+ }
882
+ interface FetchReactionStatusOptions extends ApiFetchOptions {
883
+ /**
884
+ * Pass the caller's `Cookie` header on Next.js RSC server-side calls.
885
+ * Required for authenticated server fetches because `credentials: 'include'`
886
+ * does not propagate browser cookies in RSC.
887
+ */
888
+ cookieHeader?: string;
889
+ }
890
+ /**
891
+ * Batch-look up reaction status for multiple URIs. Returns `{}` for an
892
+ * empty input list (no network call) and `null` on any error.
893
+ */
894
+ declare function fetchReactionStatus(config: SifaApiConfig, uris: string[], options?: FetchReactionStatusOptions): Promise<Record<string, ReactionStatus> | null>;
895
+ interface CheckAppAccountOptions extends ApiFetchOptions {
896
+ cookieHeader?: string;
897
+ }
898
+ /**
899
+ * Check whether the authenticated viewer has an account on a given app.
900
+ * Returns `null` on any error.
901
+ */
902
+ declare function checkAppAccount(config: SifaApiConfig, appId: string, options?: CheckAppAccountOptions): Promise<AccountCheckResult | null>;
903
+ /** Result of a successful {@link createReaction}. */
904
+ interface ReactionResult {
905
+ uri: string;
906
+ rkey: string;
907
+ }
908
+ /** Structured error returned by {@link createReaction} on failure. */
909
+ interface ReactionError {
910
+ type: 'scope_insufficient' | 'error';
911
+ /** When `type === 'scope_insufficient'`, the lexicon scope the user must re-authorize for. */
912
+ requiredScope?: string;
913
+ }
914
+ /**
915
+ * Create a reaction (like / star) on a target ATproto record.
916
+ *
917
+ * Returns a discriminated-union result instead of the generic
918
+ * {@link WriteResult} shape because reactions have a distinct
919
+ * "scope insufficient" failure that callers handle differently from
920
+ * other errors (it triggers an OAuth scope-upgrade flow rather than
921
+ * an error toast).
922
+ *
923
+ * Never throws.
924
+ */
925
+ declare function createReaction(config: SifaApiConfig, targetUri: string, appId: string, targetCid?: string, options?: ApiFetchOptions): Promise<{
926
+ ok: true;
927
+ data: ReactionResult;
928
+ } | {
929
+ ok: false;
930
+ error: ReactionError;
931
+ }>;
932
+ /**
933
+ * Delete a reaction (like / star) on a target ATproto record. Returns
934
+ * `{ success: true }` on 2xx, `{ success: false, error }` on failure.
935
+ */
936
+ declare function deleteReaction(config: SifaApiConfig, targetUri: string, appId: string, options?: ApiFetchOptions): Promise<WriteResult>;
937
+
938
+ /** Voter on a roadmap item. */
939
+ interface RoadmapVoter {
940
+ did: string;
941
+ avatarUrl?: string;
942
+ }
943
+ /** Map of item key -> vote tally and voter list. */
944
+ type RoadmapVotesResponse = Record<string, {
945
+ count: number;
946
+ voters: RoadmapVoter[];
947
+ }>;
948
+ /**
949
+ * Public roadmap vote tallies, keyed by item. Returns `{}` on any error.
950
+ */
951
+ declare function fetchRoadmapVotes(config: SifaApiConfig, options?: ApiFetchOptions): Promise<RoadmapVotesResponse>;
952
+ interface FetchMyRoadmapVotesOptions extends ApiFetchOptions {
953
+ /**
954
+ * Pass the caller's `Cookie` header on Next.js RSC server-side calls.
955
+ * Required for authenticated server fetches because `credentials: 'include'`
956
+ * does not propagate browser cookies in RSC.
957
+ */
958
+ cookieHeader?: string;
959
+ }
960
+ /**
961
+ * Roadmap items the authenticated user has voted on. Returns `[]` on any
962
+ * error or when the response payload is shaped unexpectedly.
963
+ */
964
+ declare function fetchMyRoadmapVotes(config: SifaApiConfig, options?: FetchMyRoadmapVotesOptions): Promise<string[]>;
965
+ /** Cast a vote on a roadmap item by its key. */
966
+ declare function castRoadmapVote(config: SifaApiConfig, key: string, options?: ApiFetchOptions): Promise<WriteResult>;
967
+ /** Retract a previously-cast roadmap vote. */
968
+ declare function retractRoadmapVote(config: SifaApiConfig, key: string, options?: ApiFetchOptions): Promise<WriteResult>;
969
+
970
+ /** Extended write result for {@link deleteAccount}. */
971
+ interface DeleteAccountResult extends WriteResult {
972
+ /** The deleted handle, returned by the server for confirmation UIs. */
973
+ handle?: string;
974
+ }
975
+ /**
976
+ * Reset the authenticated user's Sifa profile.
977
+ *
978
+ * `deletePdsData: true` also deletes the corresponding records on the
979
+ * user's PDS. `deletePdsData: false` only removes the AppView's
980
+ * indexed state -- the records on the PDS are left intact and could be
981
+ * re-indexed later.
982
+ *
983
+ * Destructive. Server enforces session check + attestation; the SDK
984
+ * does not gate on additional confirmation. Wrap call sites in your
985
+ * own modal if you want a UX confirmation step.
986
+ */
987
+ declare function resetProfile(config: SifaApiConfig, deletePdsData: boolean, options?: ApiFetchOptions): Promise<WriteResult>;
988
+ /**
989
+ * Delete the authenticated user's account. Returns the deleted handle
990
+ * on success (used by the post-delete confirmation screen).
991
+ *
992
+ * `deletePdsData: true` also deletes the corresponding records on the
993
+ * user's PDS; `false` leaves the PDS records intact.
994
+ *
995
+ * Destructive. Same caveat as {@link resetProfile}.
996
+ */
997
+ declare function deleteAccount(config: SifaApiConfig, deletePdsData: boolean, options?: ApiFetchOptions): Promise<DeleteAccountResult>;
998
+
999
+ /**
1000
+ * Query key factory for TanStack Query.
1001
+ *
1002
+ * Keys are read-only tuples; the hierarchy matches the SDK's fetcher
1003
+ * grouping. Use these instead of inline arrays so consumers can target
1004
+ * `queryClient.invalidateQueries({ queryKey: keys.profile.all() })` and
1005
+ * similar patterns without typos.
1006
+ *
1007
+ * Convention: every leaf key starts with the namespace ('sifa') so
1008
+ * consumers can invalidate everything Sifa-related in one call.
1009
+ */
1010
+ declare const sifaQueryKeys: {
1011
+ readonly all: () => readonly ["sifa"];
1012
+ readonly profile: {
1013
+ readonly all: () => readonly ["sifa", "profile"];
1014
+ readonly byHandle: (handleOrDid: string) => readonly ["sifa", "profile", string];
1015
+ readonly atFundLink: (did: string) => readonly ["sifa", "profile", "at-fund-link", string];
1016
+ readonly externalAccounts: (handleOrDid: string) => readonly ["sifa", "profile", "external-accounts", string];
1017
+ };
1018
+ readonly position: {
1019
+ readonly all: () => readonly ["sifa", "position"];
1020
+ readonly byOwner: (did: string) => readonly ["sifa", "position", "by-owner", string];
1021
+ };
1022
+ readonly search: {
1023
+ readonly all: () => readonly ["sifa", "search"];
1024
+ readonly profiles: (filters: Record<string, unknown>) => readonly ["sifa", "search", "profiles", Record<string, unknown>];
1025
+ readonly skills: (query: string) => readonly ["sifa", "search", "skills", string];
1026
+ readonly canonicalSkills: (query: string, limit: number) => readonly ["sifa", "search", "canonical-skills", string, number];
1027
+ readonly filters: () => readonly ["sifa", "search", "filters"];
1028
+ };
1029
+ readonly discovery: {
1030
+ readonly all: () => readonly ["sifa", "discovery"];
1031
+ readonly similar: (did: string, limit: number) => readonly ["sifa", "discovery", "similar", string, number];
1032
+ readonly suggestions: (opts: Record<string, unknown>) => readonly ["sifa", "discovery", "suggestions", Record<string, unknown>];
1033
+ readonly suggestionCount: (since: string | undefined) => readonly ["sifa", "discovery", "suggestion-count", string | null];
1034
+ readonly featured: () => readonly ["sifa", "discovery", "featured"];
1035
+ };
1036
+ readonly follow: {
1037
+ readonly all: () => readonly ["sifa", "follow"];
1038
+ readonly following: (opts: Record<string, unknown>) => readonly ["sifa", "follow", "following", Record<string, unknown>];
1039
+ readonly followers: (handle: string) => readonly ["sifa", "follow", "followers", string];
1040
+ readonly followingOf: (handle: string) => readonly ["sifa", "follow", "following-of", string];
1041
+ readonly feed: (opts: Record<string, unknown>) => readonly ["sifa", "follow", "feed", Record<string, unknown>];
1042
+ readonly mutuals: (handle: string) => readonly ["sifa", "follow", "mutuals", string];
1043
+ readonly blueskySuggestions: () => readonly ["sifa", "follow", "bluesky-suggestions"];
1044
+ };
1045
+ readonly admin: {
1046
+ readonly all: () => readonly ["sifa", "admin"];
1047
+ readonly featureAllowlist: (flag: string) => readonly ["sifa", "admin", "feature-allowlist", string];
1048
+ };
1049
+ readonly stats: {
1050
+ readonly all: () => readonly ["sifa", "stats"];
1051
+ readonly homepage: () => readonly ["sifa", "stats", "homepage"];
1052
+ };
1053
+ readonly apps: {
1054
+ readonly all: () => readonly ["sifa", "apps"];
1055
+ readonly registry: () => readonly ["sifa", "apps", "registry"];
1056
+ readonly hidden: () => readonly ["sifa", "apps", "hidden"];
1057
+ };
1058
+ readonly activity: {
1059
+ readonly all: () => readonly ["sifa", "activity"];
1060
+ readonly heatmap: (handleOrDid: string, days: number) => readonly ["sifa", "activity", "heatmap", string, number];
1061
+ readonly teaser: (handleOrDid: string) => readonly ["sifa", "activity", "teaser", string];
1062
+ readonly feed: (handleOrDid: string, opts: Record<string, unknown>) => readonly ["sifa", "activity", "feed", string, Record<string, unknown>];
1063
+ };
1064
+ readonly endorsement: {
1065
+ readonly all: () => readonly ["sifa", "endorsement"];
1066
+ readonly count: (did: string) => readonly ["sifa", "endorsement", "count", string];
1067
+ };
1068
+ readonly stream: {
1069
+ readonly all: () => readonly ["sifa", "stream"];
1070
+ readonly networkCount: (did: string) => readonly ["sifa", "stream", "network-count", string];
1071
+ };
1072
+ readonly reactions: {
1073
+ readonly all: () => readonly ["sifa", "reactions"];
1074
+ readonly status: (uris: string[]) => readonly ["sifa", "reactions", "status", string[]];
1075
+ readonly accountCheck: (appId: string) => readonly ["sifa", "reactions", "account-check", string];
1076
+ };
1077
+ readonly roadmap: {
1078
+ readonly all: () => readonly ["sifa", "roadmap"];
1079
+ readonly votes: () => readonly ["sifa", "roadmap", "votes"];
1080
+ readonly myVotes: () => readonly ["sifa", "roadmap", "my-votes"];
1081
+ };
1082
+ };
1083
+ type SifaQueryKey = ReturnType<typeof sifaQueryKeys.all> | ReturnType<typeof sifaQueryKeys.profile.all> | ReturnType<typeof sifaQueryKeys.profile.byHandle> | ReturnType<typeof sifaQueryKeys.profile.atFundLink> | ReturnType<typeof sifaQueryKeys.profile.externalAccounts> | ReturnType<typeof sifaQueryKeys.position.all> | ReturnType<typeof sifaQueryKeys.position.byOwner> | ReturnType<typeof sifaQueryKeys.search.all> | ReturnType<typeof sifaQueryKeys.search.profiles> | ReturnType<typeof sifaQueryKeys.search.canonicalSkills> | ReturnType<typeof sifaQueryKeys.search.skills> | ReturnType<typeof sifaQueryKeys.search.filters> | ReturnType<typeof sifaQueryKeys.discovery.all> | ReturnType<typeof sifaQueryKeys.discovery.similar> | ReturnType<typeof sifaQueryKeys.discovery.suggestions> | ReturnType<typeof sifaQueryKeys.discovery.suggestionCount> | ReturnType<typeof sifaQueryKeys.discovery.featured> | ReturnType<typeof sifaQueryKeys.follow.all> | ReturnType<typeof sifaQueryKeys.follow.following> | ReturnType<typeof sifaQueryKeys.follow.followers> | ReturnType<typeof sifaQueryKeys.follow.followingOf> | ReturnType<typeof sifaQueryKeys.follow.feed> | ReturnType<typeof sifaQueryKeys.follow.mutuals> | ReturnType<typeof sifaQueryKeys.follow.blueskySuggestions> | ReturnType<typeof sifaQueryKeys.admin.all> | ReturnType<typeof sifaQueryKeys.admin.featureAllowlist> | ReturnType<typeof sifaQueryKeys.stats.all> | ReturnType<typeof sifaQueryKeys.stats.homepage> | ReturnType<typeof sifaQueryKeys.apps.all> | ReturnType<typeof sifaQueryKeys.apps.registry> | ReturnType<typeof sifaQueryKeys.apps.hidden> | ReturnType<typeof sifaQueryKeys.activity.all> | ReturnType<typeof sifaQueryKeys.activity.heatmap> | ReturnType<typeof sifaQueryKeys.activity.teaser> | ReturnType<typeof sifaQueryKeys.activity.feed> | ReturnType<typeof sifaQueryKeys.endorsement.all> | ReturnType<typeof sifaQueryKeys.endorsement.count> | ReturnType<typeof sifaQueryKeys.stream.all> | ReturnType<typeof sifaQueryKeys.stream.networkCount> | ReturnType<typeof sifaQueryKeys.reactions.all> | ReturnType<typeof sifaQueryKeys.reactions.status> | ReturnType<typeof sifaQueryKeys.reactions.accountCheck> | ReturnType<typeof sifaQueryKeys.roadmap.all> | ReturnType<typeof sifaQueryKeys.roadmap.votes> | ReturnType<typeof sifaQueryKeys.roadmap.myVotes>;
1084
+
1085
+ export { type ReactionStatus as $, type AccountCheckResult as A, type BulkHideProfileItemInput as B, type CheckAppAccountOptions as C, type DeleteAccountResult as D, type EndorsementInput as E, type FeatureAllowlistResponse as F, HIDDEN_ITEM_TYPES as G, HIDDEN_ITEM_SOURCES as H, type HeatmapDay as I, type HeatmapResponse as J, type HiddenApp as K, type HiddenItemSource as L, type HiddenItemType as M, type HideProfileItemInput as N, type ListFeatureAllowlistOptions as O, type ProfileIndustryInput as P, type ProfileLocationAddress as Q, type ProfileLocationInput as R, type ProfileSearchResult as S, type ProfileSelfLocation as T, QUOTED_POSTS_BATCH_MAX as U, type QuotedPostAuthor as V, type QuotedPostImage as W, type QuotedPostResult as X, type QuotedPostView as Y, type ReactionError as Z, type ReactionResult as _, type ActivityFeedResponse as a, hideOrcidPublication as a$, type RefreshOrcidPublicationsResult as a0, type RefreshPdsResult as a1, type ResolveQuotedPostsOptions as a2, type RoadmapVoter as a3, type RoadmapVotesResponse as a4, type SearchFilters as a5, type SearchResponse as a6, type SifaApiConfig as a7, type SifaQueryKey as a8, type SimilarProfile as a9, deleteExternalAccount as aA, deleteProfileLocation as aB, deleteReaction as aC, fetchActivityFeed as aD, fetchActivityTeaser as aE, fetchAppsRegistry as aF, fetchExternalAccounts as aG, fetchFeaturedProfile as aH, fetchFollowing as aI, fetchHeatmapData as aJ, fetchHiddenApps as aK, fetchMyRoadmapVotes as aL, fetchReactionStatus as aM, fetchRoadmapVotes as aN, fetchSearchFilters as aO, fetchSearchProfiles as aP, fetchSimilarProfiles as aQ, fetchSkillSuggestions as aR, fetchStats as aS, fetchSuggestionCount as aT, fetchSuggestions as aU, followUser as aV, getBlueskySuggestions as aW, getFollowers as aX, getFollowing as aY, getFollowingFeed as aZ, getMutuals as a_, type SkillSearchResult as aa, type StatsResponse as ab, type SuggestionProfile as ac, type SuggestionsResponse as ad, type UpdateProfileOverrideInput as ae, type UpdateProfileSelfInput as af, type UploadAvatarResult as ag, type VerifyExternalAccountResult as ah, type WriteResult as ai, addFeatureAllowlist as aj, apiFetch as ak, apiFetchOrNull as al, apiWrite as am, apiWriteCreate as an, bulkHideProfileItems as ao, bulkHideStandardPublications as ap, bulkUnhideProfileItems as aq, bulkUnhideStandardPublications as ar, castRoadmapVote as as, checkAppAccount as at, createEndorsement as au, createExternalAccount as av, createProfileLocation as aw, createReaction as ax, deleteAccount as ay, deleteAvatarOverride as az, type ActivityItem as b, hideProfileItem as b0, hideSifaPublication as b1, hideStandardPublication as b2, listFeatureAllowlist as b3, refreshOrcidPublications as b4, refreshPds as b5, removeFeatureAllowlist as b6, resetProfile as b7, resolveQuotedPosts as b8, retractRoadmapVote as b9, searchSkills as ba, setExternalAccountPrimary as bb, sifaQueryKeys as bc, unfollowUser as bd, unhideOrcidPublication as be, unhideProfileItem as bf, unhideSifaPublication as bg, unhideStandardPublication as bh, unsetExternalAccountPrimary as bi, updateExternalAccount as bj, updateProfileLocation as bk, updateProfileOverride as bl, updateProfileSelf as bm, uploadAvatar as bn, verifyExternalAccount as bo, type ActivityItemLinkHealth as c, type ActivityTeaserResponse as d, ApiError as e, type ApiFetchOptions as f, type AppRegistryEntry as g, type CreateExternalAccountResult as h, type CreateResult as i, type ExternalAccountInput as j, type FeaturedProfile as k, type FetchActivityFeedOptions as l, type FetchActivityTeaserOptions as m, type FetchFollowListOptions as n, type FetchFollowProfilePageOptions as o, type FetchFollowingFeedOptions as p, type FetchHiddenAppsOptions as q, type FetchMyRoadmapVotesOptions as r, type FetchReactionStatusOptions as s, type FetchSuggestionsOptions as t, type FilterOptions as u, type FollowListPage as v, type FollowProfile as w, type FollowProfilePageResponse as x, type FollowUserResult as y, type FollowingResponse as z };