@singi-labs/sifa-sdk 0.11.23 → 0.11.24

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 (41) hide show
  1. package/dist/{adult-content-DLMF0jAx.d.cts → adult-content-BaQjQsbN.d.cts} +31 -0
  2. package/dist/{adult-content-DLMF0jAx.d.ts → adult-content-BaQjQsbN.d.ts} +31 -0
  3. package/dist/{feed-DMWCGvKv.d.cts → feed--omSiO_S.d.cts} +74 -1
  4. package/dist/{feed-DMWCGvKv.d.ts → feed--omSiO_S.d.ts} +74 -1
  5. package/dist/index-BV2QGy4u.d.ts +261 -0
  6. package/dist/index-C4UvwkKA.d.cts +261 -0
  7. package/dist/index-CHPSoiWb.d.cts +611 -0
  8. package/dist/index-Cw0Ows0u.d.ts +611 -0
  9. package/dist/index.cjs +56 -1
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +25 -5
  12. package/dist/index.d.ts +25 -5
  13. package/dist/index.js +53 -2
  14. package/dist/index.js.map +1 -1
  15. package/dist/{keys-6Ck_vMeF.d.cts → keys-BdLh1txD.d.cts} +2 -2
  16. package/dist/{keys-OgHsKn9B.d.ts → keys-Czq74eql.d.ts} +2 -2
  17. package/dist/query/fetchers/index.cjs +11 -0
  18. package/dist/query/fetchers/index.cjs.map +1 -1
  19. package/dist/query/fetchers/index.d.cts +4 -247
  20. package/dist/query/fetchers/index.d.ts +4 -247
  21. package/dist/query/fetchers/index.js +11 -0
  22. package/dist/query/fetchers/index.js.map +1 -1
  23. package/dist/query/hooks/index.cjs +11 -0
  24. package/dist/query/hooks/index.cjs.map +1 -1
  25. package/dist/query/hooks/index.d.cts +6 -558
  26. package/dist/query/hooks/index.d.ts +6 -558
  27. package/dist/query/hooks/index.js +11 -0
  28. package/dist/query/hooks/index.js.map +1 -1
  29. package/dist/query/index.cjs +47 -0
  30. package/dist/query/index.cjs.map +1 -1
  31. package/dist/query/index.d.cts +6 -6
  32. package/dist/query/index.d.ts +6 -6
  33. package/dist/query/index.js +44 -1
  34. package/dist/query/index.js.map +1 -1
  35. package/dist/schemas/index.cjs +14 -0
  36. package/dist/schemas/index.cjs.map +1 -1
  37. package/dist/schemas/index.d.cts +1 -1
  38. package/dist/schemas/index.d.ts +1 -1
  39. package/dist/schemas/index.js +12 -1
  40. package/dist/schemas/index.js.map +1 -1
  41. package/package.json +1 -1
@@ -47,6 +47,13 @@ interface ProfilePosition {
47
47
  interface ProfileEducation {
48
48
  rkey: string;
49
49
  institution: string;
50
+ /**
51
+ * Portable org entity identifier (Wikidata/ROR/LEI URI) written when the user
52
+ * links the institution to a resolved organization (#159/#241). Absent for
53
+ * free-text entries. Mirrors `ProfilePosition.entityRef`; the AppView sends it
54
+ * for display (the "Linked" badge).
55
+ */
56
+ entityRef?: string;
50
57
  degree?: string;
51
58
  fieldOfStudy?: string;
52
59
  description?: string;
@@ -100,6 +107,12 @@ interface ProfileCertification {
100
107
  rkey: string;
101
108
  name: string;
102
109
  issuingOrg: string;
110
+ /**
111
+ * Portable org entity identifier (Wikidata/ROR/LEI URI) linking the issuing
112
+ * organization to a resolved entity (#159/#241). Absent for free-text entries.
113
+ * Mirrors `ProfilePosition.entityRef`; the AppView sends it for display.
114
+ */
115
+ entityRef?: string;
103
116
  issueDate?: string;
104
117
  expiryDate?: string;
105
118
  credentialUrl?: string;
@@ -160,6 +173,12 @@ interface ProfilePublication {
160
173
  interface ProfileVolunteering {
161
174
  rkey: string;
162
175
  organization: string;
176
+ /**
177
+ * Portable org entity identifier (Wikidata/ROR/LEI URI) linking the
178
+ * organization to a resolved entity (#159/#241). Absent for free-text entries.
179
+ * Mirrors `ProfilePosition.entityRef`; the AppView sends it for display.
180
+ */
181
+ entityRef?: string;
163
182
  role?: string;
164
183
  cause?: string;
165
184
  startDate?: string;
@@ -171,6 +190,12 @@ interface ProfileHonor {
171
190
  rkey: string;
172
191
  title: string;
173
192
  issuer?: string;
193
+ /**
194
+ * Portable org entity identifier (Wikidata/ROR/LEI URI) linking the issuer to a
195
+ * resolved entity (#159/#241). Absent for free-text entries. Mirrors
196
+ * `ProfilePosition.entityRef`; the AppView sends it for display.
197
+ */
198
+ entityRef?: string;
174
199
  date?: string;
175
200
  description?: string;
176
201
  hidden?: boolean;
@@ -232,6 +257,12 @@ interface ProfileCourse {
232
257
  rkey: string;
233
258
  name: string;
234
259
  institution?: string;
260
+ /**
261
+ * Portable org entity identifier (Wikidata/ROR/LEI URI) linking the institution
262
+ * to a resolved entity (#159/#241). Absent for free-text entries. Mirrors
263
+ * `ProfilePosition.entityRef`; the AppView sends it for display.
264
+ */
265
+ entityRef?: string;
235
266
  number?: string;
236
267
  /** rkey of the associated certification, resolved from the course's
237
268
  * `credential` at-uri. Used to join the course to a certification in the
@@ -47,6 +47,13 @@ interface ProfilePosition {
47
47
  interface ProfileEducation {
48
48
  rkey: string;
49
49
  institution: string;
50
+ /**
51
+ * Portable org entity identifier (Wikidata/ROR/LEI URI) written when the user
52
+ * links the institution to a resolved organization (#159/#241). Absent for
53
+ * free-text entries. Mirrors `ProfilePosition.entityRef`; the AppView sends it
54
+ * for display (the "Linked" badge).
55
+ */
56
+ entityRef?: string;
50
57
  degree?: string;
51
58
  fieldOfStudy?: string;
52
59
  description?: string;
@@ -100,6 +107,12 @@ interface ProfileCertification {
100
107
  rkey: string;
101
108
  name: string;
102
109
  issuingOrg: string;
110
+ /**
111
+ * Portable org entity identifier (Wikidata/ROR/LEI URI) linking the issuing
112
+ * organization to a resolved entity (#159/#241). Absent for free-text entries.
113
+ * Mirrors `ProfilePosition.entityRef`; the AppView sends it for display.
114
+ */
115
+ entityRef?: string;
103
116
  issueDate?: string;
104
117
  expiryDate?: string;
105
118
  credentialUrl?: string;
@@ -160,6 +173,12 @@ interface ProfilePublication {
160
173
  interface ProfileVolunteering {
161
174
  rkey: string;
162
175
  organization: string;
176
+ /**
177
+ * Portable org entity identifier (Wikidata/ROR/LEI URI) linking the
178
+ * organization to a resolved entity (#159/#241). Absent for free-text entries.
179
+ * Mirrors `ProfilePosition.entityRef`; the AppView sends it for display.
180
+ */
181
+ entityRef?: string;
163
182
  role?: string;
164
183
  cause?: string;
165
184
  startDate?: string;
@@ -171,6 +190,12 @@ interface ProfileHonor {
171
190
  rkey: string;
172
191
  title: string;
173
192
  issuer?: string;
193
+ /**
194
+ * Portable org entity identifier (Wikidata/ROR/LEI URI) linking the issuer to a
195
+ * resolved entity (#159/#241). Absent for free-text entries. Mirrors
196
+ * `ProfilePosition.entityRef`; the AppView sends it for display.
197
+ */
198
+ entityRef?: string;
174
199
  date?: string;
175
200
  description?: string;
176
201
  hidden?: boolean;
@@ -232,6 +257,12 @@ interface ProfileCourse {
232
257
  rkey: string;
233
258
  name: string;
234
259
  institution?: string;
260
+ /**
261
+ * Portable org entity identifier (Wikidata/ROR/LEI URI) linking the institution
262
+ * to a resolved entity (#159/#241). Absent for free-text entries. Mirrors
263
+ * `ProfilePosition.entityRef`; the AppView sends it for display.
264
+ */
265
+ entityRef?: string;
235
266
  number?: string;
236
267
  /** rkey of the associated certification, resolved from the course's
237
268
  * `credential` at-uri. Used to join the course to a certification in the
@@ -96,6 +96,79 @@ declare const EntityImportSearchResponseSchema: z.ZodObject<{
96
96
  }, z.core.$strip>], "source">>;
97
97
  }, z.core.$strip>;
98
98
  type EntityImportSearchResponse = z.infer<typeof EntityImportSearchResponseSchema>;
99
+ /**
100
+ * Body of the domain grow-on-demand endpoints (`POST /api/entities/resolve-domain`
101
+ * and `POST /api/entities/mint-domain`). The server re-validates the value as a
102
+ * registrable domain; 253 is the max DNS name length.
103
+ */
104
+ declare const EntityResolveDomainRequestSchema: z.ZodObject<{
105
+ domain: z.ZodString;
106
+ }, z.core.$strip>;
107
+ type EntityResolveDomainRequest = z.infer<typeof EntityResolveDomainRequestSchema>;
108
+ /**
109
+ * Response of `POST /api/entities/resolve-domain` (grow-on-demand Branch 1). Any
110
+ * notable companies whose official website is the domain, imported from Wikidata.
111
+ * `canMint` is true when nothing notable matched AND the domain is eligible for
112
+ * the user-initiated mint-from-domain path -- it drives the "Add <domain>"
113
+ * affordance.
114
+ */
115
+ declare const EntityResolveDomainResponseSchema: z.ZodObject<{
116
+ results: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
117
+ kind: z.ZodString;
118
+ name: z.ZodString;
119
+ domain: z.ZodNullable<z.ZodString>;
120
+ country: z.ZodNullable<z.ZodString>;
121
+ logoUrl: z.ZodNullable<z.ZodString>;
122
+ parentName: z.ZodNullable<z.ZodString>;
123
+ source: z.ZodLiteral<"entity">;
124
+ entityId: z.ZodNumber;
125
+ }, z.core.$strip>, z.ZodObject<{
126
+ kind: z.ZodString;
127
+ name: z.ZodString;
128
+ domain: z.ZodNullable<z.ZodString>;
129
+ country: z.ZodNullable<z.ZodString>;
130
+ logoUrl: z.ZodNullable<z.ZodString>;
131
+ parentName: z.ZodNullable<z.ZodString>;
132
+ source: z.ZodLiteral<"pdl">;
133
+ pdlId: z.ZodString;
134
+ }, z.core.$strip>], "source">>;
135
+ canMint: z.ZodBoolean;
136
+ }, z.core.$strip>;
137
+ type EntityResolveDomainResponse = z.infer<typeof EntityResolveDomainResponseSchema>;
138
+ /**
139
+ * Response of `POST /api/entities/mint-domain` (grow-on-demand Branch 2). The
140
+ * linkable entity minted from (or already resolved for) the domain. A non-2xx
141
+ * status (e.g. the domain is not mintable, a confusable look-alike, or the site
142
+ * yielded nothing usable) surfaces as a thrown error, not a null result.
143
+ *
144
+ * `pending` is true when the entity is a fresh hidden-pending mint: the
145
+ * requesting user's own link resolves to it immediately, but it stays out of
146
+ * other users' typeahead + aggregation until an admin approves it. Clients should
147
+ * reflect this ("added -- pending review") rather than "added & live".
148
+ */
149
+ declare const EntityMintDomainResponseSchema: z.ZodObject<{
150
+ result: z.ZodDiscriminatedUnion<[z.ZodObject<{
151
+ kind: z.ZodString;
152
+ name: z.ZodString;
153
+ domain: z.ZodNullable<z.ZodString>;
154
+ country: z.ZodNullable<z.ZodString>;
155
+ logoUrl: z.ZodNullable<z.ZodString>;
156
+ parentName: z.ZodNullable<z.ZodString>;
157
+ source: z.ZodLiteral<"entity">;
158
+ entityId: z.ZodNumber;
159
+ }, z.core.$strip>, z.ZodObject<{
160
+ kind: z.ZodString;
161
+ name: z.ZodString;
162
+ domain: z.ZodNullable<z.ZodString>;
163
+ country: z.ZodNullable<z.ZodString>;
164
+ logoUrl: z.ZodNullable<z.ZodString>;
165
+ parentName: z.ZodNullable<z.ZodString>;
166
+ source: z.ZodLiteral<"pdl">;
167
+ pdlId: z.ZodString;
168
+ }, z.core.$strip>], "source">;
169
+ pending: z.ZodBoolean;
170
+ }, z.core.$strip>;
171
+ type EntityMintDomainResponse = z.infer<typeof EntityMintDomainResponseSchema>;
99
172
 
100
173
  /**
101
174
  * Profile row shared across `/api/following`, `/api/profile/:handleOrDid/mutuals`,
@@ -348,4 +421,4 @@ interface FeedCursor {
348
421
  declare function encodeFeedCursor(cursor: FeedCursor): string;
349
422
  declare function decodeFeedCursor(encoded: string): FeedCursor;
350
423
 
351
- export { type AtmosphereFeedItem as A, encodeFeedCursor as B, type EntityImportSearchResponse as E, FEATURE_FLAGS as F, type SifaFeedItem as S, AtmosphereFeedItemSchema as a, EntityImportSearchResponseSchema as b, type EntitySearchResponse as c, EntitySearchResponseSchema as d, type EntitySearchResult as e, EntitySearchResultSchema as f, type EntitySelectRequest as g, EntitySelectRequestSchema as h, type EntitySelectResponse as i, EntitySelectResponseSchema as j, type FeatureAllowlistEntry as k, FeatureAllowlistEntrySchema as l, type FeatureFlag as m, type FeedActor as n, FeedActorSchema as o, type FeedCursor as p, type FollowFeedItem as q, FollowFeedItemSchema as r, type FollowFeedPage as s, FollowFeedPageSchema as t, type FollowProfileItem as u, type FollowProfilePage as v, FollowProfilePageSchema as w, FollowProfileSchema as x, SifaFeedItemSchema as y, decodeFeedCursor as z };
424
+ export { type AtmosphereFeedItem as A, type FollowProfileItem as B, type FollowProfilePage as C, FollowProfilePageSchema as D, type EntityImportSearchResponse as E, FEATURE_FLAGS as F, FollowProfileSchema as G, SifaFeedItemSchema as H, decodeFeedCursor as I, encodeFeedCursor as J, type SifaFeedItem as S, AtmosphereFeedItemSchema as a, EntityImportSearchResponseSchema as b, type EntityMintDomainResponse as c, EntityMintDomainResponseSchema as d, type EntityResolveDomainRequest as e, EntityResolveDomainRequestSchema as f, type EntityResolveDomainResponse as g, EntityResolveDomainResponseSchema as h, type EntitySearchResponse as i, EntitySearchResponseSchema as j, type EntitySearchResult as k, EntitySearchResultSchema as l, type EntitySelectRequest as m, EntitySelectRequestSchema as n, type EntitySelectResponse as o, EntitySelectResponseSchema as p, type FeatureAllowlistEntry as q, FeatureAllowlistEntrySchema as r, type FeatureFlag as s, type FeedActor as t, FeedActorSchema as u, type FeedCursor as v, type FollowFeedItem as w, FollowFeedItemSchema as x, type FollowFeedPage as y, FollowFeedPageSchema as z };
@@ -96,6 +96,79 @@ declare const EntityImportSearchResponseSchema: z.ZodObject<{
96
96
  }, z.core.$strip>], "source">>;
97
97
  }, z.core.$strip>;
98
98
  type EntityImportSearchResponse = z.infer<typeof EntityImportSearchResponseSchema>;
99
+ /**
100
+ * Body of the domain grow-on-demand endpoints (`POST /api/entities/resolve-domain`
101
+ * and `POST /api/entities/mint-domain`). The server re-validates the value as a
102
+ * registrable domain; 253 is the max DNS name length.
103
+ */
104
+ declare const EntityResolveDomainRequestSchema: z.ZodObject<{
105
+ domain: z.ZodString;
106
+ }, z.core.$strip>;
107
+ type EntityResolveDomainRequest = z.infer<typeof EntityResolveDomainRequestSchema>;
108
+ /**
109
+ * Response of `POST /api/entities/resolve-domain` (grow-on-demand Branch 1). Any
110
+ * notable companies whose official website is the domain, imported from Wikidata.
111
+ * `canMint` is true when nothing notable matched AND the domain is eligible for
112
+ * the user-initiated mint-from-domain path -- it drives the "Add <domain>"
113
+ * affordance.
114
+ */
115
+ declare const EntityResolveDomainResponseSchema: z.ZodObject<{
116
+ results: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
117
+ kind: z.ZodString;
118
+ name: z.ZodString;
119
+ domain: z.ZodNullable<z.ZodString>;
120
+ country: z.ZodNullable<z.ZodString>;
121
+ logoUrl: z.ZodNullable<z.ZodString>;
122
+ parentName: z.ZodNullable<z.ZodString>;
123
+ source: z.ZodLiteral<"entity">;
124
+ entityId: z.ZodNumber;
125
+ }, z.core.$strip>, z.ZodObject<{
126
+ kind: z.ZodString;
127
+ name: z.ZodString;
128
+ domain: z.ZodNullable<z.ZodString>;
129
+ country: z.ZodNullable<z.ZodString>;
130
+ logoUrl: z.ZodNullable<z.ZodString>;
131
+ parentName: z.ZodNullable<z.ZodString>;
132
+ source: z.ZodLiteral<"pdl">;
133
+ pdlId: z.ZodString;
134
+ }, z.core.$strip>], "source">>;
135
+ canMint: z.ZodBoolean;
136
+ }, z.core.$strip>;
137
+ type EntityResolveDomainResponse = z.infer<typeof EntityResolveDomainResponseSchema>;
138
+ /**
139
+ * Response of `POST /api/entities/mint-domain` (grow-on-demand Branch 2). The
140
+ * linkable entity minted from (or already resolved for) the domain. A non-2xx
141
+ * status (e.g. the domain is not mintable, a confusable look-alike, or the site
142
+ * yielded nothing usable) surfaces as a thrown error, not a null result.
143
+ *
144
+ * `pending` is true when the entity is a fresh hidden-pending mint: the
145
+ * requesting user's own link resolves to it immediately, but it stays out of
146
+ * other users' typeahead + aggregation until an admin approves it. Clients should
147
+ * reflect this ("added -- pending review") rather than "added & live".
148
+ */
149
+ declare const EntityMintDomainResponseSchema: z.ZodObject<{
150
+ result: z.ZodDiscriminatedUnion<[z.ZodObject<{
151
+ kind: z.ZodString;
152
+ name: z.ZodString;
153
+ domain: z.ZodNullable<z.ZodString>;
154
+ country: z.ZodNullable<z.ZodString>;
155
+ logoUrl: z.ZodNullable<z.ZodString>;
156
+ parentName: z.ZodNullable<z.ZodString>;
157
+ source: z.ZodLiteral<"entity">;
158
+ entityId: z.ZodNumber;
159
+ }, z.core.$strip>, z.ZodObject<{
160
+ kind: z.ZodString;
161
+ name: z.ZodString;
162
+ domain: z.ZodNullable<z.ZodString>;
163
+ country: z.ZodNullable<z.ZodString>;
164
+ logoUrl: z.ZodNullable<z.ZodString>;
165
+ parentName: z.ZodNullable<z.ZodString>;
166
+ source: z.ZodLiteral<"pdl">;
167
+ pdlId: z.ZodString;
168
+ }, z.core.$strip>], "source">;
169
+ pending: z.ZodBoolean;
170
+ }, z.core.$strip>;
171
+ type EntityMintDomainResponse = z.infer<typeof EntityMintDomainResponseSchema>;
99
172
 
100
173
  /**
101
174
  * Profile row shared across `/api/following`, `/api/profile/:handleOrDid/mutuals`,
@@ -348,4 +421,4 @@ interface FeedCursor {
348
421
  declare function encodeFeedCursor(cursor: FeedCursor): string;
349
422
  declare function decodeFeedCursor(encoded: string): FeedCursor;
350
423
 
351
- export { type AtmosphereFeedItem as A, encodeFeedCursor as B, type EntityImportSearchResponse as E, FEATURE_FLAGS as F, type SifaFeedItem as S, AtmosphereFeedItemSchema as a, EntityImportSearchResponseSchema as b, type EntitySearchResponse as c, EntitySearchResponseSchema as d, type EntitySearchResult as e, EntitySearchResultSchema as f, type EntitySelectRequest as g, EntitySelectRequestSchema as h, type EntitySelectResponse as i, EntitySelectResponseSchema as j, type FeatureAllowlistEntry as k, FeatureAllowlistEntrySchema as l, type FeatureFlag as m, type FeedActor as n, FeedActorSchema as o, type FeedCursor as p, type FollowFeedItem as q, FollowFeedItemSchema as r, type FollowFeedPage as s, FollowFeedPageSchema as t, type FollowProfileItem as u, type FollowProfilePage as v, FollowProfilePageSchema as w, FollowProfileSchema as x, SifaFeedItemSchema as y, decodeFeedCursor as z };
424
+ export { type AtmosphereFeedItem as A, type FollowProfileItem as B, type FollowProfilePage as C, FollowProfilePageSchema as D, type EntityImportSearchResponse as E, FEATURE_FLAGS as F, FollowProfileSchema as G, SifaFeedItemSchema as H, decodeFeedCursor as I, encodeFeedCursor as J, type SifaFeedItem as S, AtmosphereFeedItemSchema as a, EntityImportSearchResponseSchema as b, type EntityMintDomainResponse as c, EntityMintDomainResponseSchema as d, type EntityResolveDomainRequest as e, EntityResolveDomainRequestSchema as f, type EntityResolveDomainResponse as g, EntityResolveDomainResponseSchema as h, type EntitySearchResponse as i, EntitySearchResponseSchema as j, type EntitySearchResult as k, EntitySearchResultSchema as l, type EntitySelectRequest as m, EntitySelectRequestSchema as n, type EntitySelectResponse as o, EntitySelectResponseSchema as p, type FeatureAllowlistEntry as q, FeatureAllowlistEntrySchema as r, type FeatureFlag as s, type FeedActor as t, FeedActorSchema as u, type FeedCursor as v, type FollowFeedItem as w, FollowFeedItemSchema as x, type FollowFeedPage as y, FollowFeedPageSchema as z };
@@ -0,0 +1,261 @@
1
+ import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from './keys-Czq74eql.js';
2
+ import { d as Profile, t as ProfilePosition, z as SkillRef } from './adult-content-BaQjQsbN.js';
3
+ import { i as EntitySearchResponse, k as EntitySearchResult, c as EntityMintDomainResponse, g as EntityResolveDomainResponse, m as EntitySelectRequest, o as EntitySelectResponse } from './feed--omSiO_S.js';
4
+
5
+ /**
6
+ * Read the aggregated profile for a handle or DID.
7
+ *
8
+ * Returns `null` when the AppView has no profile for the given identifier
9
+ * (HTTP 404). Throws {@link ApiError} on other non-2xx responses.
10
+ *
11
+ * Server-callable (Next.js RSC) and client-callable (Expo, browser).
12
+ */
13
+ declare function fetchProfile(config: SifaApiConfig, handleOrDid: string, options?: ApiFetchOptions): Promise<Profile | null>;
14
+ /**
15
+ * Public AT Fund link for a profile, if one is configured. Returns `null`
16
+ * on any error or when the response payload's `url` field is missing or
17
+ * non-string.
18
+ */
19
+ declare function fetchAtFundLink(config: SifaApiConfig, did: string, options?: ApiFetchOptions): Promise<string | null>;
20
+
21
+ /**
22
+ * Create a new `id.sifa.profile.position` record on the authenticated
23
+ * user's PDS. The AppView signs and writes via the user's OAuth session.
24
+ *
25
+ * `data` should be a lexicon-shaped position record (without `createdAt`
26
+ * or `rkey`; the AppView fills both). Validate with
27
+ * `ProfilePositionRecordSchema.omit({ createdAt: true })` before calling
28
+ * if you want client-side guarantees.
29
+ *
30
+ * Never throws -- inspect `result.success` and use `result.error` /
31
+ * `result.pdsHost` for UI messaging.
32
+ */
33
+ declare function createPosition(config: SifaApiConfig, data: Record<string, unknown>, options?: ApiFetchOptions): Promise<CreateResult>;
34
+ /** Update an existing position by `rkey`. */
35
+ declare function updatePosition(config: SifaApiConfig, rkey: string, data: Record<string, unknown>, options?: ApiFetchOptions): Promise<WriteResult>;
36
+ /** Delete a position by `rkey`. */
37
+ declare function deletePosition(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
38
+ /** Mark a position as the user's primary (current) role. */
39
+ declare function setPositionPrimary(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
40
+ /** Clear the "primary" flag on a position. */
41
+ declare function unsetPositionPrimary(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
42
+ /**
43
+ * Add a skill link to a position. Idempotent: if the skill is already
44
+ * linked, resolves to `{ success: true }` without a network call.
45
+ *
46
+ * Implementation note: the AppView only exposes whole-record PUTs, so
47
+ * this helper rebuilds the position body with the new skills list.
48
+ */
49
+ declare function linkSkillToPosition(config: SifaApiConfig, position: ProfilePosition, skillRef: SkillRef, options?: ApiFetchOptions): Promise<WriteResult>;
50
+ /** Remove a skill link from a position. */
51
+ declare function unlinkSkillFromPosition(config: SifaApiConfig, position: ProfilePosition, skillRef: SkillRef, options?: ApiFetchOptions): Promise<WriteResult>;
52
+
53
+ /**
54
+ * Create a new `id.sifa.profile.education` record on the authenticated
55
+ * user's PDS.
56
+ */
57
+ declare function createEducation(config: SifaApiConfig, data: Record<string, unknown>, options?: ApiFetchOptions): Promise<CreateResult>;
58
+ /** Update an existing education record by `rkey`. */
59
+ declare function updateEducation(config: SifaApiConfig, rkey: string, data: Record<string, unknown>, options?: ApiFetchOptions): Promise<WriteResult>;
60
+ /** Delete an education record by `rkey`. */
61
+ declare function deleteEducation(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
62
+
63
+ /**
64
+ * Create a new `id.sifa.profile.skill` record on the authenticated
65
+ * user's PDS.
66
+ */
67
+ declare function createSkill(config: SifaApiConfig, data: Record<string, unknown>, options?: ApiFetchOptions): Promise<CreateResult>;
68
+ /** Update an existing skill record by `rkey`. */
69
+ declare function updateSkill(config: SifaApiConfig, rkey: string, data: Record<string, unknown>, options?: ApiFetchOptions): Promise<WriteResult>;
70
+ /** Delete a skill record by `rkey`. */
71
+ declare function deleteSkill(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
72
+
73
+ /**
74
+ * Generic record-create escape hatch. Most callers should prefer the
75
+ * dedicated section helpers (`createPosition`, `createEducation`, etc.)
76
+ * which take typed payloads and ship matching hooks. Use this when the
77
+ * lexicon doesn't yet have a dedicated endpoint (certifications,
78
+ * projects, publications, volunteering, honors, languages, courses).
79
+ *
80
+ * `collection` is a `id.sifa.profile.*` collection NSID. Routes to
81
+ * `POST /api/profile/records/<collection>`.
82
+ */
83
+ declare function createRecord(config: SifaApiConfig, collection: string, data: Record<string, unknown>, options?: ApiFetchOptions): Promise<CreateResult>;
84
+ /** Generic record-update escape hatch. See {@link createRecord}. */
85
+ declare function updateRecord(config: SifaApiConfig, collection: string, rkey: string, data: Record<string, unknown>, options?: ApiFetchOptions): Promise<WriteResult>;
86
+ /** Generic record-delete escape hatch. See {@link createRecord}. */
87
+ declare function deleteRecord(config: SifaApiConfig, collection: string, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
88
+
89
+ /**
90
+ * Hide a keytrace claim (verified-account claim discovered on the
91
+ * user's external accounts) from the user's profile. The claim itself
92
+ * stays in the index; only its display is suppressed.
93
+ */
94
+ declare function hideKeytraceClaim(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
95
+ /** Restore a previously-hidden keytrace claim. */
96
+ declare function unhideKeytraceClaim(config: SifaApiConfig, rkey: string, options?: ApiFetchOptions): Promise<WriteResult>;
97
+
98
+ /**
99
+ * Make a Marque-registered domain public in the owner's Links section. Marque
100
+ * domains are owner-only by default; this reveals one. `domain` is the
101
+ * at.marque.domain rkey (the domain name itself).
102
+ */
103
+ declare function revealMarqueDomain(config: SifaApiConfig, domain: string, options?: ApiFetchOptions): Promise<WriteResult>;
104
+ /** Make a previously-revealed Marque domain owner-only again. */
105
+ declare function unrevealMarqueDomain(config: SifaApiConfig, domain: string, options?: ApiFetchOptions): Promise<WriteResult>;
106
+
107
+ /**
108
+ * Organization typeahead. Returns curated entities first, then the PDL crawl,
109
+ * deduped by domain. Empty input returns an empty result without a network call.
110
+ */
111
+ declare function fetchEntitySearch(config: SifaApiConfig, query: string, limit?: number, options?: ApiFetchOptions): Promise<EntitySearchResponse>;
112
+ /**
113
+ * Record a selection: promote a PDL row into a canonical entity (dedupe by
114
+ * domain) or bump an existing entity's usage counter. Returns the entity plus
115
+ * its portable `entityRef` (null for PDL-only entities). Requires a session.
116
+ */
117
+ declare function selectEntity(config: SifaApiConfig, body: EntitySelectRequest, options?: ApiFetchOptions): Promise<EntitySelectResponse>;
118
+ /**
119
+ * Grow-on-demand: when the local typeahead misses, resolve the query live via
120
+ * Wikidata, import the org-class matches, and return them. Requires a session.
121
+ * Empty input returns an empty array without a network call.
122
+ */
123
+ declare function importSearchEntities(config: SifaApiConfig, query: string, options?: ApiFetchOptions): Promise<EntitySearchResult[]>;
124
+ /**
125
+ * Grow-on-demand by domain, Branch 1: when a domain-shaped typeahead query
126
+ * misses locally, resolve any notable company whose official website is that
127
+ * domain (Wikidata reverse P856), importing the matches. Read-only w.r.t.
128
+ * minting. `canMint` tells the caller whether to offer the user-initiated
129
+ * "Add <domain>" affordance. Requires a session.
130
+ */
131
+ declare function resolveEntityDomain(config: SifaApiConfig, domain: string, options?: ApiFetchOptions): Promise<EntityResolveDomainResponse>;
132
+ /**
133
+ * Grow-on-demand by domain, Branch 2 (user-initiated): mint a crawled-tier
134
+ * entity from the domain's own homepage (or resolve it to a notable company if
135
+ * one exists). Throws on a non-2xx response (domain not mintable, or the site
136
+ * yielded nothing usable). Requires a session.
137
+ */
138
+ declare function mintEntityDomain(config: SifaApiConfig, domain: string, options?: ApiFetchOptions): Promise<EntityMintDomainResponse>;
139
+
140
+ /**
141
+ * Counts confirmed endorsements received by a DID. The backend's
142
+ * `GET /api/endorsement/:did` already returns only confirmed endorsements
143
+ * (via inner join with `endorsementConfirmations`), so this helper just
144
+ * returns the array length. Failures return 0 so callers can route safely.
145
+ *
146
+ * Public endpoint -- no credentials needed.
147
+ */
148
+ declare function fetchEndorsementCount(config: SifaApiConfig, did: string, options?: ApiFetchOptions): Promise<number>;
149
+
150
+ interface FetchNetworkStreamCountOptions extends ApiFetchOptions {
151
+ /**
152
+ * Pass the caller's `Cookie` header on Next.js RSC server-side calls.
153
+ * Required for authenticated server fetches because `credentials: 'include'`
154
+ * does not propagate browser cookies in RSC.
155
+ *
156
+ * When omitted, the request falls back to `credentials: 'include'` so
157
+ * client-side calls work without extra plumbing.
158
+ */
159
+ cookieHeader?: string;
160
+ }
161
+ /**
162
+ * Counts items in the authenticated user's network stream digest. The
163
+ * underlying `GET /api/stream/network` endpoint may 404 while the feature
164
+ * is in development; in that case (and on any other error) this returns
165
+ * 0 so callers can route safely to a fallback experience.
166
+ */
167
+ declare function fetchNetworkStreamCount(config: SifaApiConfig, did: string, options?: FetchNetworkStreamCountOptions): Promise<number>;
168
+
169
+ /** A node in the personal network graph. */
170
+ interface NetworkMapNode {
171
+ did: string;
172
+ handle: string;
173
+ displayName: string;
174
+ avatar: string | null;
175
+ /** Number of edges this node participates in within the rendered graph. */
176
+ degree: number;
177
+ /** Phase 2: community detection cluster id. */
178
+ cluster?: number;
179
+ /** Phase 2: pre-computed layout coordinates. */
180
+ x?: number;
181
+ y?: number;
182
+ }
183
+ /** A directed edge in the personal network graph. */
184
+ interface NetworkMapEdge {
185
+ source: string;
186
+ target: string;
187
+ mutual: boolean;
188
+ /** Networks this edge was observed in, e.g. `['sifa', 'bluesky']`. */
189
+ sources: string[];
190
+ }
191
+ /** The graph payload itself, decoupled from response metadata. */
192
+ interface NetworkMapGraphData {
193
+ nodes: NetworkMapNode[];
194
+ edges: NetworkMapEdge[];
195
+ /** Phase 2: cluster metadata for legend rendering. */
196
+ clusters?: Array<{
197
+ id: number;
198
+ label: string;
199
+ color: string;
200
+ }>;
201
+ }
202
+ /** Cached graph response. */
203
+ interface NetworkMapResponse {
204
+ generatedAt: string;
205
+ expiresAt: string;
206
+ graph: NetworkMapGraphData;
207
+ stats: {
208
+ totalNodes: number;
209
+ totalEdges: number;
210
+ mutualCount: number;
211
+ sources: Record<string, number>;
212
+ };
213
+ }
214
+ /** Async job tracking generation progress. */
215
+ interface NetworkMapGenerationJob {
216
+ jobId: string;
217
+ did: string;
218
+ status: 'pending' | 'complete' | 'failed';
219
+ /** 0..100 */
220
+ progress: number;
221
+ createdAt: string;
222
+ completedAt?: string;
223
+ error?: string;
224
+ /**
225
+ * Queue position when the job is still pending and not yet picked up
226
+ * by the worker. 0 = next to run. Absent for in-flight or terminal
227
+ * jobs (and for any backend that doesn't yet report position).
228
+ */
229
+ position?: number;
230
+ /**
231
+ * Estimated remaining seconds, derived server-side from the median
232
+ * historical duration for the user's follow-count bucket multiplied
233
+ * by `position + 1`. Absent when no historical data exists yet.
234
+ */
235
+ etaSeconds?: number;
236
+ }
237
+ /** Returned by `initiateNetworkMapGeneration` when a new job was started or one was already running. */
238
+ interface NetworkMapPendingJob {
239
+ jobId: string;
240
+ status: 'pending' | 'cached';
241
+ }
242
+ /** Discriminate the union returned by `initiateNetworkMapGeneration`. */
243
+ declare function isNetworkMapResponse(value: NetworkMapPendingJob | NetworkMapResponse): value is NetworkMapResponse;
244
+ /**
245
+ * Kick off a personal network-map computation. The backend returns the
246
+ * cached map immediately when fresh, otherwise it returns a job id that
247
+ * the caller polls via `checkNetworkMapJobStatus`.
248
+ */
249
+ declare function initiateNetworkMapGeneration(config: SifaApiConfig, options?: ApiFetchOptions): Promise<NetworkMapPendingJob | NetworkMapResponse>;
250
+ /**
251
+ * Poll the status of an in-flight generation job. Throws on 404 (unknown
252
+ * or expired job) — callers may want to treat that as terminal failure.
253
+ */
254
+ declare function checkNetworkMapJobStatus(config: SifaApiConfig, jobId: string, options?: ApiFetchOptions): Promise<NetworkMapGenerationJob>;
255
+ /**
256
+ * Fetch the most recent cached network map for the authenticated user.
257
+ * Returns `null` when no map has ever been generated (404).
258
+ */
259
+ declare function fetchNetworkMap(config: SifaApiConfig, options?: ApiFetchOptions): Promise<NetworkMapResponse | null>;
260
+
261
+ export { resolveEntityDomain as A, revealMarqueDomain as B, selectEntity as C, setPositionPrimary as D, unhideKeytraceClaim as E, type FetchNetworkStreamCountOptions as F, unlinkSkillFromPosition as G, unrevealMarqueDomain as H, unsetPositionPrimary as I, updateEducation as J, updatePosition as K, updateRecord as L, updateSkill as M, type NetworkMapEdge as N, type NetworkMapGenerationJob as a, type NetworkMapGraphData as b, type NetworkMapNode as c, type NetworkMapPendingJob as d, type NetworkMapResponse as e, checkNetworkMapJobStatus as f, createEducation as g, createPosition as h, createRecord as i, createSkill as j, deleteEducation as k, deletePosition as l, deleteRecord as m, deleteSkill as n, fetchAtFundLink as o, fetchEndorsementCount as p, fetchEntitySearch as q, fetchNetworkMap as r, fetchNetworkStreamCount as s, fetchProfile as t, hideKeytraceClaim as u, importSearchEntities as v, initiateNetworkMapGeneration as w, isNetworkMapResponse as x, linkSkillToPosition as y, mintEntityDomain as z };