@singi-labs/sifa-sdk 0.12.57 → 0.12.59

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 (31) hide show
  1. package/dist/{index-Cd_heN1n.d.ts → index-B1WYOzm1.d.ts} +3 -2
  2. package/dist/{index-mXTN0GbN.d.cts → index-BcKfdI4X.d.cts} +3 -2
  3. package/dist/{types-Vf-kTiu1.d.cts → index-DMyroYoB.d.cts} +1 -509
  4. package/dist/{types-Vf-kTiu1.d.ts → index-DMyroYoB.d.ts} +1 -509
  5. package/dist/{index-DZGw-VDY.d.cts → index-Dqe0Nlck.d.cts} +4 -3
  6. package/dist/{index-GmKuSxp6.d.ts → index-czrerd84.d.ts} +4 -3
  7. package/dist/index.cjs +142 -117
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +30 -4
  10. package/dist/index.d.ts +30 -4
  11. package/dist/index.js +142 -118
  12. package/dist/index.js.map +1 -1
  13. package/dist/jsonld/index.cjs +891 -0
  14. package/dist/jsonld/index.cjs.map +1 -0
  15. package/dist/jsonld/index.d.cts +494 -0
  16. package/dist/jsonld/index.d.ts +494 -0
  17. package/dist/jsonld/index.js +878 -0
  18. package/dist/jsonld/index.js.map +1 -0
  19. package/dist/{org-fq2Xwg6Q.d.ts → org-66bQLHJd.d.ts} +2 -1
  20. package/dist/{org-CHVTcTcj.d.cts → org-GI1GVjZw.d.cts} +2 -1
  21. package/dist/{profile-summary-CdLI8k7M.d.cts → profile-summary-Bqj3TDVd.d.cts} +1 -1
  22. package/dist/{profile-summary-BS2GPBxw.d.ts → profile-summary-YZXjMymn.d.ts} +1 -1
  23. package/dist/query/fetchers/index.d.cts +5 -4
  24. package/dist/query/fetchers/index.d.ts +5 -4
  25. package/dist/query/hooks/index.d.cts +4 -3
  26. package/dist/query/hooks/index.d.ts +4 -3
  27. package/dist/query/index.d.cts +8 -7
  28. package/dist/query/index.d.ts +8 -7
  29. package/dist/types-BiBx2Utr.d.cts +511 -0
  30. package/dist/types-BkRDvKTp.d.ts +511 -0
  31. package/package.json +11 -1
@@ -0,0 +1,511 @@
1
+ import { P as PresentationLinkView, a as PdsProviderInfo } from './index-DMyroYoB.cjs';
2
+
3
+ /**
4
+ * Types for the `id.sifa.getProfileView` XRPC query: the aggregated public
5
+ * professional profile view served by a Sifa AppView. This is a curated public
6
+ * projection, viewer-specific and internal fields are not included and hidden
7
+ * items are omitted. Mirrors the `id.sifa.getProfileView` lexicon in
8
+ * @singi-labs/sifa-lexicons.
9
+ */
10
+
11
+ interface IndustryDomain {
12
+ industry: string;
13
+ domain?: string;
14
+ }
15
+ interface ProfileLocationView {
16
+ rkey: string;
17
+ type?: string;
18
+ label?: string;
19
+ isPrimary?: boolean;
20
+ locationCountry?: string;
21
+ locationRegion?: string;
22
+ locationLocality?: string;
23
+ countryCode?: string;
24
+ location?: string;
25
+ }
26
+ interface PositionView {
27
+ rkey: string;
28
+ title: string;
29
+ company?: string;
30
+ companyDid?: string;
31
+ entityRef?: string;
32
+ entityName?: string;
33
+ description?: string;
34
+ employmentType?: string;
35
+ workplaceType?: string;
36
+ locationCountry?: string;
37
+ locationRegion?: string;
38
+ locationLocality?: string;
39
+ countryCode?: string;
40
+ location?: string;
41
+ startedAt?: string;
42
+ endedAt?: string;
43
+ primary?: boolean;
44
+ skillRkeys?: string[];
45
+ }
46
+ interface EducationView {
47
+ rkey: string;
48
+ institution?: string;
49
+ institutionDid?: string;
50
+ entityRef?: string;
51
+ degree?: string;
52
+ fieldOfStudy?: string;
53
+ activities?: string;
54
+ description?: string;
55
+ startedAt?: string;
56
+ endedAt?: string;
57
+ }
58
+ interface SkillView {
59
+ rkey: string;
60
+ name: string;
61
+ category?: string;
62
+ /** Freeform user-defined grouping label nested under `category` (#305). */
63
+ subCategory?: string;
64
+ positionRkeys?: string[];
65
+ }
66
+ interface CertificationView {
67
+ rkey: string;
68
+ name: string;
69
+ issuingOrg?: string;
70
+ entityRef?: string;
71
+ issueDate?: string;
72
+ expiryDate?: string;
73
+ credentialUrl?: string;
74
+ }
75
+ interface ProjectView {
76
+ rkey: string;
77
+ name: string;
78
+ description?: string;
79
+ url?: string;
80
+ startDate?: string;
81
+ endDate?: string;
82
+ members?: ProjectMemberView[];
83
+ /** AT-URI of the same project as recorded elsewhere, when this entry duplicates another. */
84
+ /** AT-URI of the same record on another person's profile, when they keep one. */
85
+ sameAs?: string;
86
+ }
87
+ /** A person named as a member of a project. Identity fields appear only once confirmed. */
88
+ interface ProjectMemberView {
89
+ did: string;
90
+ handle: string;
91
+ displayName?: string;
92
+ avatar?: string;
93
+ confirmed?: boolean;
94
+ confirmedStale?: boolean;
95
+ role?: string;
96
+ title?: string;
97
+ }
98
+ interface VolunteeringView {
99
+ rkey: string;
100
+ organization: string;
101
+ entityRef?: string;
102
+ role?: string;
103
+ cause?: string;
104
+ description?: string;
105
+ startDate?: string;
106
+ endDate?: string;
107
+ }
108
+ interface InvolvementLinkView {
109
+ url: string;
110
+ kind?: string;
111
+ label?: string;
112
+ verified?: boolean;
113
+ verifiedPlatform?: string;
114
+ }
115
+ interface InvolvementView {
116
+ rkey: string;
117
+ kind?: string;
118
+ upstream?: string;
119
+ upstreamDid?: string;
120
+ upstreamUrl?: string;
121
+ role?: string;
122
+ description?: string;
123
+ startedAt?: string;
124
+ endedAt?: string;
125
+ links: InvolvementLinkView[];
126
+ legacy: boolean;
127
+ /** Other people named on this involvement, hydrated from the stored DIDs. */
128
+ collaborators?: ProjectMemberView[];
129
+ /** AT-URI of the same involvement as recorded on another person's profile. */
130
+ sameAs?: string;
131
+ }
132
+ interface ContributorView {
133
+ name: string;
134
+ orcidId?: string;
135
+ did?: string;
136
+ handle?: string;
137
+ }
138
+ interface PublicationView {
139
+ rkey: string;
140
+ title: string;
141
+ subtitle?: string;
142
+ publisher?: string;
143
+ date?: string;
144
+ url?: string;
145
+ description?: string;
146
+ doi?: string;
147
+ type?: string;
148
+ typeLabel?: string;
149
+ contributors?: ContributorView[];
150
+ verified: boolean;
151
+ verifiedVia?: string;
152
+ orcidCorroborated?: boolean;
153
+ publicationUri?: string;
154
+ publicationUrl?: string;
155
+ publicationName?: string;
156
+ image?: string;
157
+ }
158
+ interface CourseView {
159
+ rkey: string;
160
+ name: string;
161
+ number?: string;
162
+ institution?: string;
163
+ entityRef?: string;
164
+ credentialRkey?: string;
165
+ }
166
+ interface DurationView {
167
+ minMinutes: number;
168
+ maxMinutes?: number;
169
+ }
170
+ /**
171
+ * A co-speaker on a presentation delivery.
172
+ *
173
+ * `displayName` and `avatar` are served only once `confirmed` is true. The
174
+ * lexicon also declares an unlinked free-text `name`, which the AppView has
175
+ * never emitted -- the record field is `format: did`, so there is nothing to
176
+ * emit it from.
177
+ */
178
+ interface CoSpeakerView {
179
+ did?: string;
180
+ handle?: string;
181
+ displayName?: string;
182
+ avatar?: string;
183
+ hasSifaProfile?: boolean;
184
+ confirmed?: boolean;
185
+ confirmedStale?: boolean;
186
+ name?: string;
187
+ }
188
+ interface PresentationDeliveryView {
189
+ rkey: string;
190
+ presentationRkey?: string;
191
+ title?: string;
192
+ role?: string;
193
+ eventName?: string;
194
+ date?: string;
195
+ location?: string;
196
+ locationCountry?: string;
197
+ locationRegion?: string;
198
+ locationLocality?: string;
199
+ countryCode?: string;
200
+ mode?: string;
201
+ status?: string;
202
+ links?: PresentationLinkView[];
203
+ eventUri?: string;
204
+ coSpeakers?: CoSpeakerView[];
205
+ /** AT-URI of the same session as recorded on another person's profile. */
206
+ sameAs?: string;
207
+ }
208
+ interface PresentationView {
209
+ rkey: string;
210
+ title: string;
211
+ description?: string;
212
+ duration?: DurationView;
213
+ intendedAudiences?: string[];
214
+ links?: PresentationLinkView[];
215
+ writeupUri?: string;
216
+ coverImageUrl?: string;
217
+ deliveries: PresentationDeliveryView[];
218
+ }
219
+ interface HonorView {
220
+ rkey: string;
221
+ title: string;
222
+ issuer?: string;
223
+ entityRef?: string;
224
+ description?: string;
225
+ date?: string;
226
+ }
227
+ interface LanguageView {
228
+ rkey: string;
229
+ language: string;
230
+ proficiency?: string;
231
+ }
232
+ interface ExternalAccountView {
233
+ rkey: string;
234
+ platform?: string;
235
+ url: string;
236
+ label?: string;
237
+ feedUrl?: string;
238
+ verifiable?: boolean;
239
+ verified?: boolean;
240
+ verifiedVia?: string;
241
+ primary?: boolean;
242
+ }
243
+ interface ActiveAppView {
244
+ id: string;
245
+ name: string;
246
+ category?: string;
247
+ recentCount?: number;
248
+ latestRecordAt?: string;
249
+ }
250
+ interface AtfundLinkView {
251
+ url: string;
252
+ label?: string;
253
+ }
254
+ /** Aggregated public professional profile view (`id.sifa.getProfileView#profileView`). */
255
+ interface ProfileView {
256
+ did: string;
257
+ handle: string;
258
+ displayName?: string;
259
+ givenName?: string;
260
+ familyName?: string;
261
+ avatar?: string;
262
+ pronouns?: string;
263
+ headline?: string;
264
+ about?: string;
265
+ industries?: IndustryDomain[];
266
+ locationCountry?: string;
267
+ locationRegion?: string;
268
+ locationLocality?: string;
269
+ countryCode?: string;
270
+ location?: string;
271
+ locations?: ProfileLocationView[];
272
+ website?: string;
273
+ openTo?: string[];
274
+ preferredWorkplace?: string[];
275
+ availableFromUtc?: number;
276
+ availableToUtc?: number;
277
+ langs?: string[];
278
+ createdAt?: string;
279
+ positions?: PositionView[];
280
+ education?: EducationView[];
281
+ skills?: SkillView[];
282
+ certifications?: CertificationView[];
283
+ projects?: ProjectView[];
284
+ volunteering?: VolunteeringView[];
285
+ involvement?: InvolvementView[];
286
+ publications?: PublicationView[];
287
+ courses?: CourseView[];
288
+ presentations?: PresentationView[];
289
+ presentationDeliveries?: PresentationDeliveryView[];
290
+ honors?: HonorView[];
291
+ languages?: LanguageView[];
292
+ externalAccounts?: ExternalAccountView[];
293
+ atfundContribute?: AtfundLinkView;
294
+ followersCount?: number;
295
+ followingCount?: number;
296
+ connectionsCount?: number;
297
+ metInPersonCount?: number;
298
+ atprotoFollowersCount?: number;
299
+ blueskyVerified?: boolean;
300
+ blueskyVerifiedAt?: string;
301
+ activeApps?: ActiveAppView[];
302
+ pdsProvider?: PdsProviderInfo;
303
+ claimed?: boolean;
304
+ }
305
+
306
+ /**
307
+ * Adult-content gating for Bluesky activity items.
308
+ *
309
+ * Bluesky's official moderation labeler attaches content labels to
310
+ * `app.bsky.feed.defs#postView.labels`. The four sex-and-violence labels
311
+ * below are the ones we hide by default on Sifa: media is replaced with an
312
+ * `<AdultContentWarning>` placeholder card in sifa-web. Authenticated
313
+ * viewers can reveal per-card; anonymous viewers cannot.
314
+ *
315
+ * The list mirrors Bluesky's own globalLabelStrings; if the official set
316
+ * grows (e.g. a new `extreme-violence` label), update this constant.
317
+ *
318
+ * Why a constant + predicate live in the SDK: the same logic needs to run
319
+ * in sifa-web today and sifa-app tomorrow, and the API only forwards the
320
+ * raw labels — the hide decision is a client concern.
321
+ */
322
+ declare const ADULT_CONTENT_LABELS: readonly ["porn", "sexual", "nudity", "graphic-media"];
323
+ type AdultContentLabel = (typeof ADULT_CONTENT_LABELS)[number];
324
+ /**
325
+ * A single label entry as emitted by `app.bsky.feed.defs#postView.labels`.
326
+ * Matches `com.atproto.label.defs#label` (the on-wire shape after the AppView
327
+ * resolves a `postView`). `neg: true` marks a retraction.
328
+ */
329
+ interface ActivityLabel {
330
+ val: string;
331
+ src: string;
332
+ uri: string;
333
+ cts?: string;
334
+ neg?: boolean;
335
+ }
336
+ /**
337
+ * Return true if the item carries at least one adult-content label that is
338
+ * not negated. Items without a `labels` field (every non-Bluesky source,
339
+ * legacy responses) are treated as safe.
340
+ */
341
+ declare function hasAdultContent(item: {
342
+ labels?: ActivityLabel[];
343
+ }): boolean;
344
+
345
+ /**
346
+ * The buckets a repo data-management UI shows instead of raw collections.
347
+ *
348
+ * "id.sifa.profile.presentationDelivery" means nothing to someone who has never
349
+ * heard of a lexicon. Grouping is the whole difference between a developer tool
350
+ * and something a user can act on, so it lives here rather than in one app: the
351
+ * web settings page and a future native app must agree on what a bucket holds,
352
+ * or the same repo reads differently depending where you look at it.
353
+ *
354
+ * Ids only, no display strings -- copy is translated at the surface.
355
+ */
356
+ type RepoGroupId = 'profile-basics' | 'work-history' | 'education' | 'skills-endorsements' | 'projects' | 'publications-talks' | 'people' | 'meetings' | 'other';
357
+ interface RepoGroupDefinition {
358
+ id: RepoGroupId;
359
+ /** Collections this bucket claims, in the order a UI should list them. */
360
+ collections: readonly string[];
361
+ }
362
+ /**
363
+ * Ordered so the buckets a user recognises come first and the machinery they
364
+ * never think about (consents, access grants) comes last.
365
+ *
366
+ * `other` is deliberately absent: it is not a claim over a fixed set, it is
367
+ * where anything unmapped lands. See {@link repoGroupForCollection}.
368
+ */
369
+ declare const SIFA_REPO_GROUPS: readonly RepoGroupDefinition[];
370
+ /**
371
+ * Which bucket a collection belongs to, or `other` when we have not mapped it.
372
+ *
373
+ * Unmapped falls through to a visible bucket rather than being filtered out. A
374
+ * lexicon we mint later would otherwise be invisible on the one page whose job
375
+ * is to show everything in the repo -- the user would be told their data is
376
+ * accounted for while some of it was silently omitted.
377
+ */
378
+ declare function repoGroupForCollection(collection: string): RepoGroupId;
379
+
380
+ /**
381
+ * One line of text identifying a record to the person who wrote it.
382
+ *
383
+ * Split into parts rather than one joined string: joining needs a connective
384
+ * ("Senior Engineer at Acme") and a connective is copy, which is translated at
385
+ * the surface. Every value here comes straight from the user's own record, so
386
+ * the SDK contributes no language of its own.
387
+ */
388
+ interface RepoRecordLabel {
389
+ /** The record's own identifying text, or the collection leaf when it has none. */
390
+ primary: string;
391
+ /** Employer, institution, event, or publisher, when the record names one. */
392
+ secondary?: string;
393
+ /** The date the record is about, not when it was written. May be partial ("2021-03"). */
394
+ date?: string;
395
+ /**
396
+ * The person a record is about, for records whose meaning is a relationship
397
+ * rather than text: endorsements, follows, confirmations, attestations.
398
+ *
399
+ * Kept out of {@link primary} so a surface can resolve it to a handle and
400
+ * avatar without parsing a DID back out of display text.
401
+ */
402
+ subjectDid?: string;
403
+ /**
404
+ * Handle and display name for {@link subjectDid}, when a surface resolved it.
405
+ *
406
+ * Records whose whole meaning is a relationship -- follows, meetings,
407
+ * endorsements -- carry only a DID. A page listing 33 of them shows 33
408
+ * identical rows and a column of did:plc: strings, which is unusable for
409
+ * deciding which one to remove. Resolution has to be batched by the caller,
410
+ * so the SDK leaves room for the answer rather than fetching it.
411
+ */
412
+ subjectHandle?: string;
413
+ subjectName?: string;
414
+ /**
415
+ * Set when the record carried no readable text and {@link primary} is the
416
+ * collection leaf rather than the user's own data.
417
+ *
418
+ * A surface must substitute its own wording for these -- a row reading
419
+ * "follow" or "location" tells the reader nothing about which record they
420
+ * are about to delete. The flag exists because the leaf is indistinguishable
421
+ * from real content once it is a string: a headline that genuinely says
422
+ * "location" must not be relabelled.
423
+ */
424
+ isFallback?: true;
425
+ }
426
+ /**
427
+ * Describe one record from the user's repo in terms they will recognise.
428
+ *
429
+ * Never throws and never returns an empty primary. This runs over whatever is
430
+ * actually in the repo, including records written by older versions of Sifa and
431
+ * records hand-edited elsewhere. A page that crashes on one malformed record
432
+ * would hide the rest, which is exactly the data the user came to manage.
433
+ */
434
+ declare function describeSifaRecord(collection: string, value: unknown): RepoRecordLabel;
435
+
436
+ /** One record in the user's repo, reduced to what a management UI needs. */
437
+ interface RepoRecordSummary {
438
+ /** Full AT-URI, the stable identity of the record. */
439
+ uri: string;
440
+ /** Record key, the part a delete request names. */
441
+ rkey: string;
442
+ collection: string;
443
+ label: RepoRecordLabel;
444
+ /** When the record was written, from its own `createdAt`. Absent if it has none. */
445
+ createdAt?: string;
446
+ }
447
+ /** One bucket of the inventory. Buckets the user has no records in are omitted. */
448
+ interface RepoCollectionGroup {
449
+ id: RepoGroupId;
450
+ /** Collections in this bucket the user actually has records in. */
451
+ collections: string[];
452
+ recordCount: number;
453
+ records: RepoRecordSummary[];
454
+ }
455
+ /**
456
+ * What is in the user's repo under id.sifa.*, as their PDS reports it.
457
+ *
458
+ * Read from the PDS rather than the AppView. This is the one surface whose
459
+ * entire purpose is to say what the user owns, so an index that has drifted --
460
+ * lagging the firehose, or holding records deleted elsewhere -- would be
461
+ * lying about the thing the page exists to answer.
462
+ */
463
+ interface RepoInventory {
464
+ did: string;
465
+ /** When the PDS was read, so a UI can say how fresh this is. */
466
+ fetchedAt: string;
467
+ groups: RepoCollectionGroup[];
468
+ totalRecords: number;
469
+ /**
470
+ * Collections found in the repo that could not be listed. Their records are
471
+ * missing from `groups`, so a UI must not present the inventory as complete.
472
+ */
473
+ unreadableCollections?: string[];
474
+ }
475
+ /** What happened to one record in a delete request. */
476
+ type RepoDeleteOutcome =
477
+ /** The PDS confirmed the record is gone. */
478
+ 'deleted'
479
+ /** The delete was attempted and the record is still there. */
480
+ | 'remaining'
481
+ /** We could not establish either way. Not the same as `remaining`, and never success. */
482
+ | 'unknown';
483
+ interface RepoDeleteRecordResult {
484
+ rkey: string;
485
+ outcome: RepoDeleteOutcome;
486
+ }
487
+ /**
488
+ * Result of a delete request.
489
+ *
490
+ * Carries no success flag of its own. The transport adds one meaning "the
491
+ * request was accepted", which is not the same question: a request can be
492
+ * accepted and still leave four of five records in place. What actually
493
+ * happened to the data is in `results`, per record, and callers report that.
494
+ */
495
+ interface RepoDeleteResult {
496
+ collection: string;
497
+ results: RepoDeleteRecordResult[];
498
+ /**
499
+ * Set when the current OAuth grant cannot delete this collection, in which
500
+ * case nothing was attempted. `scope` is the value to request.
501
+ *
502
+ * Present instead of a failure so a UI sends the user to consent rather than
503
+ * telling them the delete failed for no stated reason.
504
+ */
505
+ needsScopeUpgrade?: {
506
+ scope: string;
507
+ collections: string[];
508
+ };
509
+ }
510
+
511
+ export { type AdultContentLabel as A, describeSifaRecord as B, type CertificationView as C, type DurationView as D, type EducationView as E, hasAdultContent as F, repoGroupForCollection as G, type HonorView as H, type IndustryDomain as I, type LanguageView as L, type ProfileView as P, type RepoDeleteResult as R, SIFA_REPO_GROUPS as S, type VolunteeringView as V, type ActivityLabel as a, type RepoInventory as b, ADULT_CONTENT_LABELS as c, type ActiveAppView as d, type AtfundLinkView as e, type CoSpeakerView as f, type ContributorView as g, type CourseView as h, type ExternalAccountView as i, type InvolvementLinkView as j, type InvolvementView as k, type PositionView as l, type PresentationDeliveryView as m, type PresentationView as n, type ProfileLocationView as o, type ProjectMemberView as p, type ProjectView as q, type PublicationView as r, type RepoCollectionGroup as s, type RepoDeleteOutcome as t, type RepoDeleteRecordResult as u, type RepoGroupDefinition as v, type RepoGroupId as w, type RepoRecordLabel as x, type RepoRecordSummary as y, type SkillView as z };