@singi-labs/sifa-sdk 0.12.2 → 0.12.4
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.
- package/dist/{adult-content-DDGP8W1e.d.cts → adult-content-n2uy3rT3.d.cts} +31 -1
- package/dist/{adult-content-DDGP8W1e.d.ts → adult-content-n2uy3rT3.d.ts} +31 -1
- package/dist/{index-IMvNS08M.d.ts → index-BLv2bK_K.d.ts} +2 -2
- package/dist/{index-BS7zO7KI.d.cts → index-COjgkXRe.d.cts} +86 -3
- package/dist/{index-CNh-GI9A.d.cts → index-HTTNUcN4.d.cts} +2 -2
- package/dist/{index-iAzeLOcz.d.ts → index-tkWmoZAu.d.ts} +86 -3
- package/dist/index.cjs +73 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +96 -5
- package/dist/index.d.ts +96 -5
- package/dist/index.js +68 -2
- package/dist/index.js.map +1 -1
- package/dist/{keys-5oyp950_.d.ts → org-BZcAnLab.d.ts} +88 -2
- package/dist/{keys-Bn36IA8Q.d.cts → org-lIB6pSYc.d.cts} +88 -2
- package/dist/org-settings-CmaSX5ZI.d.cts +74 -0
- package/dist/org-settings-CmaSX5ZI.d.ts +74 -0
- package/dist/query/fetchers/index.cjs +45 -0
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +4 -3
- package/dist/query/fetchers/index.d.ts +4 -3
- package/dist/query/fetchers/index.js +40 -1
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +118 -0
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +4 -3
- package/dist/query/hooks/index.d.ts +4 -3
- package/dist/query/hooks/index.js +112 -1
- package/dist/query/hooks/index.js.map +1 -1
- package/dist/query/index.cjs +122 -0
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +6 -5
- package/dist/query/index.d.ts +6 -5
- package/dist/query/index.js +110 -1
- package/dist/query/index.js.map +1 -1
- package/dist/schemas/index.cjs +27 -0
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +67 -1
- package/dist/schemas/index.d.ts +67 -1
- package/dist/schemas/index.js +26 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/write/index.cjs +161 -1
- package/dist/schemas/write/index.cjs.map +1 -1
- package/dist/schemas/write/index.d.cts +204 -8
- package/dist/schemas/write/index.d.ts +204 -8
- package/dist/schemas/write/index.js +146 -2
- package/dist/schemas/write/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export { O as OrgClaimRequestInput, a as OrgClaimRequestSchema, b as OrgDomainChallengeRequestInput, c as OrgDomainChallengeRequestSchema, d as OrgDomainVerifyRequestInput, e as OrgDomainVerifyRequestSchema, f as OrgNotificationEmailRequestInput, g as OrgNotificationEmailRequestSchema, h as OrgProfileUpdateRequestInput, i as OrgProfileUpdateRequestSchema } from '../../org-settings-CmaSX5ZI.js';
|
|
2
3
|
|
|
3
4
|
/** Prepend `https://` if no scheme is present. */
|
|
4
5
|
declare function normalizeUrl(val: string): string;
|
|
@@ -47,11 +48,56 @@ declare const skillRefSchema: z.ZodObject<{
|
|
|
47
48
|
*/
|
|
48
49
|
declare const VALID_PLATFORMS: readonly ["rss", "fediverse", "twitter", "instagram", "github", "codeberg", "gitlab", "forgejo", "gitea", "youtube", "linkedin", "substack", "website", "orcid", "keyoxide", "other"];
|
|
49
50
|
type ValidPlatform = (typeof VALID_PLATFORMS)[number];
|
|
51
|
+
/**
|
|
52
|
+
* Returns `input` when it is an http(s) URL string, else `null`. Blocks
|
|
53
|
+
* dangerous schemes (`javascript:`, `data:`, etc.) from being stored and
|
|
54
|
+
* later rendered.
|
|
55
|
+
*/
|
|
56
|
+
declare function httpUrlOrNull(input: unknown): string | null;
|
|
57
|
+
/**
|
|
58
|
+
* Strict calendar-date validator. Returns `true` for `YYYY-MM-DD` strings
|
|
59
|
+
* that name a real day, rejecting impossible values (`2024-02-30`, `2024-13-01`)
|
|
60
|
+
* by requiring the JavaScript `Date` round-trip to preserve the input.
|
|
61
|
+
*/
|
|
62
|
+
declare function isValidDateOnly(input: unknown): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Portable org entity identifier (Wikidata / ROR / LEI / sifa.id URI) chosen
|
|
65
|
+
* from the typeahead. Constrained to http(s) so a script-bearing scheme can't
|
|
66
|
+
* be written to the PDS record. Absent for free-text / unlinked records.
|
|
67
|
+
* Shared by the org-bearing sections (position, education, certification,
|
|
68
|
+
* volunteering, course, honor).
|
|
69
|
+
*/
|
|
70
|
+
declare const entityRefSchema: z.ZodOptional<z.ZodString>;
|
|
71
|
+
/**
|
|
72
|
+
* One proof link on an involvement record (`id.sifa.defs#artifactLink`).
|
|
73
|
+
* Only http(s) URLs are accepted so a dangerous scheme is never written to
|
|
74
|
+
* the PDS.
|
|
75
|
+
*/
|
|
76
|
+
declare const artifactLinkSchema: z.ZodObject<{
|
|
77
|
+
url: z.ZodString;
|
|
78
|
+
kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
/**
|
|
82
|
+
* Reference to a record by at-uri, with an optional CID
|
|
83
|
+
* (`id.sifa.defs#externalRecordRef`).
|
|
84
|
+
*/
|
|
85
|
+
declare const externalRecordRefSchema: z.ZodObject<{
|
|
86
|
+
uri: z.ZodString;
|
|
87
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
/** Link attached to a presentation record. */
|
|
90
|
+
declare const presentationLinkSchema: z.ZodObject<{
|
|
91
|
+
uri: z.ZodString;
|
|
92
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
93
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
94
|
+
}, z.core.$strip>;
|
|
50
95
|
|
|
51
96
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.certification`. */
|
|
52
97
|
declare const CertificationWriteSchema: z.ZodObject<{
|
|
53
98
|
name: z.ZodString;
|
|
54
99
|
authority: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
55
101
|
credentialId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
102
|
credentialUrl: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
57
103
|
issuedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -64,12 +110,16 @@ declare const CourseWriteSchema: z.ZodObject<{
|
|
|
64
110
|
name: z.ZodString;
|
|
65
111
|
number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
112
|
institution: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
113
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
114
|
+
credential: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
116
|
}, z.core.$strip>;
|
|
68
117
|
type CourseWriteInput = z.infer<typeof CourseWriteSchema>;
|
|
69
118
|
|
|
70
119
|
/** Schema enforced by `POST /profile/education` on sifa-api. */
|
|
71
120
|
declare const EducationWriteSchema: z.ZodObject<{
|
|
72
121
|
institution: z.ZodString;
|
|
122
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
73
123
|
degree: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
124
|
fieldOfStudy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
125
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -109,11 +159,51 @@ type ExternalAccountWriteInput = z.infer<typeof ExternalAccountWriteSchema>;
|
|
|
109
159
|
declare const HonorWriteSchema: z.ZodObject<{
|
|
110
160
|
title: z.ZodString;
|
|
111
161
|
issuer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
162
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
112
163
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
113
164
|
awardedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
165
|
}, z.core.$strip>;
|
|
115
166
|
type HonorWriteInput = z.infer<typeof HonorWriteSchema>;
|
|
116
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Schema enforced by the generic-record write endpoint for `id.sifa.profile.involvement`.
|
|
170
|
+
*
|
|
171
|
+
* Represents contribution to an upstream project or community
|
|
172
|
+
* (open-source maintainership, community volunteering, etc.). `upstream` /
|
|
173
|
+
* `upstreamDid` / `upstreamUrl` describe what the user contributed to;
|
|
174
|
+
* `links` collect proof artifacts.
|
|
175
|
+
*/
|
|
176
|
+
declare const InvolvementWriteSchema: z.ZodObject<{
|
|
177
|
+
kind: z.ZodString;
|
|
178
|
+
upstream: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
179
|
+
upstreamDid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
180
|
+
upstreamUrl: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
181
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
182
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
183
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
184
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
185
|
+
links: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
186
|
+
url: z.ZodString;
|
|
187
|
+
kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
188
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
189
|
+
}, z.core.$strip>>>>;
|
|
190
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
191
|
+
location: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
192
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
193
|
+
countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
194
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
195
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
196
|
+
locality: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
197
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
198
|
+
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
199
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
200
|
+
}, z.core.$strip>, z.ZodString]>>>;
|
|
201
|
+
skills: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
202
|
+
uri: z.ZodString;
|
|
203
|
+
}, z.core.$strip>>>>;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
type InvolvementWriteInput = z.infer<typeof InvolvementWriteSchema>;
|
|
206
|
+
|
|
117
207
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.language`. */
|
|
118
208
|
declare const LanguageWriteSchema: z.ZodObject<{
|
|
119
209
|
name: z.ZodString;
|
|
@@ -121,6 +211,52 @@ declare const LanguageWriteSchema: z.ZodObject<{
|
|
|
121
211
|
}, z.core.$strip>;
|
|
122
212
|
type LanguageWriteInput = z.infer<typeof LanguageWriteSchema>;
|
|
123
213
|
|
|
214
|
+
/**
|
|
215
|
+
* Schema enforced by the org-employment-attestation write endpoint on sifa-api.
|
|
216
|
+
*
|
|
217
|
+
* An org attests that a Sifa user (`subject`) held a specific `position` record
|
|
218
|
+
* with `title` between `startedAt` and `endedAt` (inclusive of "current" status).
|
|
219
|
+
* The attestation itself is signed by the org's DID; `entityRef` / `companyDid`
|
|
220
|
+
* optionally cross-link the org identifier(s) used at the time.
|
|
221
|
+
*/
|
|
222
|
+
declare const OrgEmploymentAttestationWriteSchema: z.ZodObject<{
|
|
223
|
+
subject: z.ZodString;
|
|
224
|
+
position: z.ZodObject<{
|
|
225
|
+
uri: z.ZodString;
|
|
226
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
227
|
+
}, z.core.$strip>;
|
|
228
|
+
status: z.ZodEnum<{
|
|
229
|
+
current: "current";
|
|
230
|
+
past: "past";
|
|
231
|
+
}>;
|
|
232
|
+
title: z.ZodString;
|
|
233
|
+
startedAt: z.ZodString;
|
|
234
|
+
entityRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
235
|
+
companyDid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
236
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
237
|
+
comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
238
|
+
createdAt: z.ZodString;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
type OrgEmploymentAttestationWriteInput = z.infer<typeof OrgEmploymentAttestationWriteSchema>;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Schema enforced by the org-profile write endpoint on sifa-api.
|
|
244
|
+
*
|
|
245
|
+
* Sifa-managed org identity: name + description + contact channel plus
|
|
246
|
+
* `entityRefs` linking the org to portable identifiers (Wikidata / ROR /
|
|
247
|
+
* LEI / sifa.id URI, http(s) enforced elsewhere).
|
|
248
|
+
*/
|
|
249
|
+
declare const OrgProfileWriteSchema: z.ZodObject<{
|
|
250
|
+
name: z.ZodString;
|
|
251
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
252
|
+
logo: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
253
|
+
website: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
254
|
+
entityRefs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
255
|
+
contact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
256
|
+
createdAt: z.ZodString;
|
|
257
|
+
}, z.core.$strip>;
|
|
258
|
+
type OrgProfileWriteInput = z.infer<typeof OrgProfileWriteSchema>;
|
|
259
|
+
|
|
124
260
|
/**
|
|
125
261
|
* Schema enforced by `POST /profile/positions` on sifa-api.
|
|
126
262
|
*
|
|
@@ -129,16 +265,14 @@ type LanguageWriteInput = z.infer<typeof LanguageWriteSchema>;
|
|
|
129
265
|
* round-trip. If it passes here, the API will accept the write modulo
|
|
130
266
|
* transport / auth failures.
|
|
131
267
|
*
|
|
132
|
-
* `company` is
|
|
133
|
-
*
|
|
134
|
-
* `
|
|
135
|
-
* sifa-
|
|
136
|
-
* behavior change that unblocks the freelancer flow. The SDK's lexicon
|
|
137
|
-
* schema (`ProfilePositionRecordSchema`) has treated `company` as optional
|
|
138
|
-
* since sifa-sdk #184.
|
|
268
|
+
* `company` is optional to support freelancer / independent employment types
|
|
269
|
+
* where the position has no employer. This matches sifa-api's current
|
|
270
|
+
* behavior in `src/routes/schemas.ts` and the SDK's lexicon schema
|
|
271
|
+
* (`ProfilePositionRecordSchema`) since sifa-sdk #184.
|
|
139
272
|
*/
|
|
140
273
|
declare const PositionWriteSchema: z.ZodObject<{
|
|
141
274
|
company: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
275
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
142
276
|
title: z.ZodString;
|
|
143
277
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
278
|
employmentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -161,6 +295,66 @@ declare const PositionWriteSchema: z.ZodObject<{
|
|
|
161
295
|
}, z.core.$strip>;
|
|
162
296
|
type PositionWriteInput = z.infer<typeof PositionWriteSchema>;
|
|
163
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Schema enforced by the generic-record write endpoint for `id.sifa.profile.presentationDelivery`.
|
|
300
|
+
*
|
|
301
|
+
* Records a specific delivery of a presentation (e.g., at a conference).
|
|
302
|
+
* `presentationRef` optionally points at the parent `id.sifa.profile.presentation`
|
|
303
|
+
* record; `eventRef` optionally links a Sifa event record; `coSpeakers` are
|
|
304
|
+
* DIDs of people who delivered alongside the profile owner.
|
|
305
|
+
*/
|
|
306
|
+
declare const PresentationDeliveryWriteSchema: z.ZodObject<{
|
|
307
|
+
presentationRef: z.ZodOptional<z.ZodObject<{
|
|
308
|
+
uri: z.ZodString;
|
|
309
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
310
|
+
}, z.core.$strip>>;
|
|
311
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
312
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
313
|
+
eventName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
314
|
+
date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
315
|
+
location: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
316
|
+
mode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
317
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
318
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
319
|
+
uri: z.ZodString;
|
|
320
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
321
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
322
|
+
}, z.core.$strip>>>;
|
|
323
|
+
eventRef: z.ZodOptional<z.ZodObject<{
|
|
324
|
+
uri: z.ZodString;
|
|
325
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
326
|
+
}, z.core.$strip>>;
|
|
327
|
+
coSpeakers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
328
|
+
}, z.core.$strip>;
|
|
329
|
+
type PresentationDeliveryWriteInput = z.infer<typeof PresentationDeliveryWriteSchema>;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Schema enforced by the generic-record write endpoint for `id.sifa.profile.presentation`.
|
|
333
|
+
*
|
|
334
|
+
* Describes a talk / presentation the user can give. `duration` bounds the
|
|
335
|
+
* runtime; `intendedAudiences` names who it's aimed at; `writeupRef` is an
|
|
336
|
+
* optional at-uri pointer to a companion writeup record.
|
|
337
|
+
*/
|
|
338
|
+
declare const PresentationWriteSchema: z.ZodObject<{
|
|
339
|
+
title: z.ZodString;
|
|
340
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
341
|
+
duration: z.ZodOptional<z.ZodObject<{
|
|
342
|
+
minMinutes: z.ZodNumber;
|
|
343
|
+
maxMinutes: z.ZodOptional<z.ZodNumber>;
|
|
344
|
+
}, z.core.$strip>>;
|
|
345
|
+
intendedAudiences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
346
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
347
|
+
uri: z.ZodString;
|
|
348
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
349
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
350
|
+
}, z.core.$strip>>>;
|
|
351
|
+
writeupRef: z.ZodOptional<z.ZodObject<{
|
|
352
|
+
uri: z.ZodString;
|
|
353
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
354
|
+
}, z.core.$strip>>;
|
|
355
|
+
}, z.core.$strip>;
|
|
356
|
+
type PresentationWriteInput = z.infer<typeof PresentationWriteSchema>;
|
|
357
|
+
|
|
164
358
|
/**
|
|
165
359
|
* Schema enforced by `POST /profile/locations` on sifa-api.
|
|
166
360
|
*
|
|
@@ -246,6 +440,7 @@ type ProjectWriteInput = z.infer<typeof ProjectWriteSchema>;
|
|
|
246
440
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.publication`. */
|
|
247
441
|
declare const PublicationWriteSchema: z.ZodObject<{
|
|
248
442
|
title: z.ZodString;
|
|
443
|
+
subtitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
249
444
|
publisher: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
250
445
|
url: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
251
446
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -263,6 +458,7 @@ type SkillWriteInput = z.infer<typeof SkillWriteSchema>;
|
|
|
263
458
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.volunteering`. */
|
|
264
459
|
declare const VolunteeringWriteSchema: z.ZodObject<{
|
|
265
460
|
organization: z.ZodString;
|
|
461
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
266
462
|
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
267
463
|
cause: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
268
464
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -271,4 +467,4 @@ declare const VolunteeringWriteSchema: z.ZodObject<{
|
|
|
271
467
|
}, z.core.$strip>;
|
|
272
468
|
type VolunteeringWriteInput = z.infer<typeof VolunteeringWriteSchema>;
|
|
273
469
|
|
|
274
|
-
export { type CertificationWriteInput, CertificationWriteSchema, type CourseWriteInput, CourseWriteSchema, type EducationWriteInput, EducationWriteSchema, type ExternalAccountWriteInput, ExternalAccountWriteSchema, type HonorWriteInput, HonorWriteSchema, type LanguageWriteInput, LanguageWriteSchema, type PositionWriteInput, PositionWriteSchema, type ProfileLocationWriteInput, ProfileLocationWriteSchema, type ProfileSelfWriteInput, ProfileSelfWriteSchema, type ProjectWriteInput, ProjectWriteSchema, type PublicationWriteInput, PublicationWriteSchema, type SkillWriteInput, SkillWriteSchema, VALID_PLATFORMS, type ValidPlatform, type VolunteeringWriteInput, VolunteeringWriteSchema, normalizeUrl, optionalUrl, skillRefSchema, writeLocationSchema };
|
|
470
|
+
export { type CertificationWriteInput, CertificationWriteSchema, type CourseWriteInput, CourseWriteSchema, type EducationWriteInput, EducationWriteSchema, type ExternalAccountWriteInput, ExternalAccountWriteSchema, type HonorWriteInput, HonorWriteSchema, type InvolvementWriteInput, InvolvementWriteSchema, type LanguageWriteInput, LanguageWriteSchema, type OrgEmploymentAttestationWriteInput, OrgEmploymentAttestationWriteSchema, type OrgProfileWriteInput, OrgProfileWriteSchema, type PositionWriteInput, PositionWriteSchema, type PresentationDeliveryWriteInput, PresentationDeliveryWriteSchema, type PresentationWriteInput, PresentationWriteSchema, type ProfileLocationWriteInput, ProfileLocationWriteSchema, type ProfileSelfWriteInput, ProfileSelfWriteSchema, type ProjectWriteInput, ProjectWriteSchema, type PublicationWriteInput, PublicationWriteSchema, type SkillWriteInput, SkillWriteSchema, VALID_PLATFORMS, type ValidPlatform, type VolunteeringWriteInput, VolunteeringWriteSchema, artifactLinkSchema, entityRefSchema, externalRecordRefSchema, httpUrlOrNull, isValidDateOnly, normalizeUrl, optionalUrl, presentationLinkSchema, skillRefSchema, writeLocationSchema };
|
|
@@ -49,9 +49,41 @@ var VALID_PLATFORMS = [
|
|
|
49
49
|
"keyoxide",
|
|
50
50
|
"other"
|
|
51
51
|
];
|
|
52
|
+
function httpUrlOrNull(input) {
|
|
53
|
+
if (typeof input !== "string") return null;
|
|
54
|
+
try {
|
|
55
|
+
const url = new URL(input);
|
|
56
|
+
return url.protocol === "http:" || url.protocol === "https:" ? input : null;
|
|
57
|
+
} catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
var DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
62
|
+
function isValidDateOnly(input) {
|
|
63
|
+
if (typeof input !== "string" || !DATE_ONLY_RE.test(input)) return false;
|
|
64
|
+
const parsed = /* @__PURE__ */ new Date(`${input}T00:00:00Z`);
|
|
65
|
+
return !Number.isNaN(parsed.getTime()) && parsed.toISOString().startsWith(input);
|
|
66
|
+
}
|
|
67
|
+
var entityRefSchema = z.string().url().refine((s) => /^https?:\/\//i.test(s), { message: "entityRef must be an http(s) URL" }).max(2048).optional();
|
|
68
|
+
var artifactLinkSchema = z.object({
|
|
69
|
+
url: z.string().max(2048).refine((v) => httpUrlOrNull(v) !== null, "must be an http(s) URL"),
|
|
70
|
+
kind: z.string().max(64).nullable().optional(),
|
|
71
|
+
label: z.string().max(2e3).nullable().optional()
|
|
72
|
+
});
|
|
73
|
+
var externalRecordRefSchema = z.object({
|
|
74
|
+
uri: z.string().regex(/^at:\/\/[^/\s]+\/[^/\s]+\/[^/\s]+$/, "must be an at-uri"),
|
|
75
|
+
// CIDv0 (`Qm…`) or CIDv1 (base32, `b…`). Loose but rejects arbitrary strings.
|
|
76
|
+
cid: z.string().max(256).regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z2-7]+)$/, "must be a CID").optional()
|
|
77
|
+
});
|
|
78
|
+
var presentationLinkSchema = z.object({
|
|
79
|
+
uri: z.string().max(2048).refine((v) => httpUrlOrNull(v) !== null, "must be an http(s) URL"),
|
|
80
|
+
label: z.string().max(640).nullable().optional(),
|
|
81
|
+
type: z.string().max(256).nullable().optional()
|
|
82
|
+
});
|
|
52
83
|
var CertificationWriteSchema = z.object({
|
|
53
84
|
name: z.string().min(1).max(256),
|
|
54
85
|
authority: z.string().max(256).nullable().optional(),
|
|
86
|
+
entityRef: entityRefSchema,
|
|
55
87
|
credentialId: z.string().max(256).nullable().optional(),
|
|
56
88
|
credentialUrl: optionalUrl(),
|
|
57
89
|
issuedAt: z.string().nullable().optional(),
|
|
@@ -60,10 +92,24 @@ var CertificationWriteSchema = z.object({
|
|
|
60
92
|
var CourseWriteSchema = z.object({
|
|
61
93
|
name: z.string().min(1).max(200),
|
|
62
94
|
number: z.string().max(50).nullable().optional(),
|
|
63
|
-
institution: z.string().max(256).nullable().optional()
|
|
95
|
+
institution: z.string().max(256).nullable().optional(),
|
|
96
|
+
entityRef: entityRefSchema,
|
|
97
|
+
/**
|
|
98
|
+
* at-uri of the linked `id.sifa.profile.certification` record. Structurally
|
|
99
|
+
* validated (`at://authority/collection/rkey`) so a bad value can't be
|
|
100
|
+
* stored and later split into a bogus rkey.
|
|
101
|
+
*/
|
|
102
|
+
credential: z.string().max(512).regex(/^at:\/\/[^/\s]+\/[^/\s]+\/[^/\s]+$/, "must be an at-uri").nullable().optional(),
|
|
103
|
+
/**
|
|
104
|
+
* RFC 3339 datetime the course was completed. The editor collects month
|
|
105
|
+
* granularity (YYYY-MM) and converts to a datetime before the write; stored
|
|
106
|
+
* and passed through as-is, mirroring `certification.issuedAt`.
|
|
107
|
+
*/
|
|
108
|
+
completedAt: z.string().nullable().optional()
|
|
64
109
|
});
|
|
65
110
|
var EducationWriteSchema = z.object({
|
|
66
111
|
institution: z.string().min(1).max(256),
|
|
112
|
+
entityRef: entityRefSchema,
|
|
67
113
|
degree: z.string().max(256).nullable().optional(),
|
|
68
114
|
fieldOfStudy: z.string().max(256).nullable().optional(),
|
|
69
115
|
description: z.string().max(5e4).nullable().optional(),
|
|
@@ -80,15 +126,84 @@ var ExternalAccountWriteSchema = z.object({
|
|
|
80
126
|
var HonorWriteSchema = z.object({
|
|
81
127
|
title: z.string().min(1).max(200),
|
|
82
128
|
issuer: z.string().max(256).nullable().optional(),
|
|
129
|
+
entityRef: entityRefSchema,
|
|
83
130
|
description: z.string().max(5e4).nullable().optional(),
|
|
84
131
|
awardedAt: z.string().nullable().optional()
|
|
85
132
|
});
|
|
133
|
+
var InvolvementWriteSchema = z.object({
|
|
134
|
+
kind: z.string().min(1).max(256),
|
|
135
|
+
upstream: z.string().max(2560).nullable().optional(),
|
|
136
|
+
upstreamDid: z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID").nullable().optional(),
|
|
137
|
+
upstreamUrl: optionalUrl(),
|
|
138
|
+
role: z.string().max(2560).nullable().optional(),
|
|
139
|
+
description: z.string().max(5e4).nullable().optional(),
|
|
140
|
+
// Freeform YYYY / YYYY-MM / YYYY-MM-DD; validated loosely so partial dates pass.
|
|
141
|
+
startedAt: z.string().max(32).nullable().optional(),
|
|
142
|
+
endedAt: z.string().max(32).nullable().optional(),
|
|
143
|
+
links: z.array(artifactLinkSchema).max(50).nullable().optional(),
|
|
144
|
+
entityRef: entityRefSchema,
|
|
145
|
+
location: writeLocationSchema,
|
|
146
|
+
skills: z.array(skillRefSchema).max(50).nullable().optional()
|
|
147
|
+
});
|
|
86
148
|
var LanguageWriteSchema = z.object({
|
|
87
149
|
name: z.string().min(1).max(64),
|
|
88
150
|
proficiency: z.string().max(50).optional()
|
|
89
151
|
});
|
|
152
|
+
var OrgEmploymentAttestationWriteSchema = z.object({
|
|
153
|
+
subject: z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID"),
|
|
154
|
+
position: externalRecordRefSchema,
|
|
155
|
+
status: z.enum(["current", "past"]),
|
|
156
|
+
title: z.string().min(1).max(2560),
|
|
157
|
+
startedAt: z.string().max(32),
|
|
158
|
+
entityRef: z.string().max(2048).nullable().optional(),
|
|
159
|
+
companyDid: z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID").nullable().optional(),
|
|
160
|
+
endedAt: z.string().max(32).nullable().optional(),
|
|
161
|
+
comment: z.string().max(3e3).nullable().optional(),
|
|
162
|
+
createdAt: z.string()
|
|
163
|
+
});
|
|
164
|
+
var OrgProfileWriteSchema = z.object({
|
|
165
|
+
name: z.string().min(1).max(2e3),
|
|
166
|
+
description: z.string().max(5e4).nullable().optional(),
|
|
167
|
+
logo: z.unknown().nullable().optional(),
|
|
168
|
+
website: z.string().max(2048).nullable().optional(),
|
|
169
|
+
entityRefs: z.array(z.string().max(2048)).max(20).nullable().optional(),
|
|
170
|
+
contact: z.string().max(320).nullable().optional(),
|
|
171
|
+
createdAt: z.string()
|
|
172
|
+
});
|
|
173
|
+
var OrgClaimRequestSchema = z.object({
|
|
174
|
+
name: z.string().min(1).max(2e3),
|
|
175
|
+
description: z.string().max(5e4).optional(),
|
|
176
|
+
website: z.string().max(2048).optional(),
|
|
177
|
+
contact: z.string().max(320).optional(),
|
|
178
|
+
entityRefs: z.array(z.string().min(1).max(2048)).min(1).max(20),
|
|
179
|
+
authorityAck: z.literal(true)
|
|
180
|
+
});
|
|
181
|
+
var orgLogoBlobSchema = z.object({
|
|
182
|
+
$type: z.literal("blob"),
|
|
183
|
+
ref: z.object({ $link: z.string().min(1) }),
|
|
184
|
+
mimeType: z.string().min(1).max(255),
|
|
185
|
+
size: z.number().int().nonnegative()
|
|
186
|
+
});
|
|
187
|
+
var OrgProfileUpdateRequestSchema = z.object({
|
|
188
|
+
name: z.string().min(1).max(2e3),
|
|
189
|
+
description: z.string().max(5e4).optional(),
|
|
190
|
+
website: z.string().max(2048).optional(),
|
|
191
|
+
contact: z.string().max(320).optional(),
|
|
192
|
+
entityRefs: z.array(z.string().min(1).max(2048)).min(1).max(20),
|
|
193
|
+
logo: orgLogoBlobSchema.optional()
|
|
194
|
+
});
|
|
195
|
+
var OrgDomainChallengeRequestSchema = z.object({
|
|
196
|
+
domain: z.string().min(1).max(255)
|
|
197
|
+
});
|
|
198
|
+
var OrgDomainVerifyRequestSchema = z.object({
|
|
199
|
+
token: z.string().min(1).max(2048)
|
|
200
|
+
});
|
|
201
|
+
var OrgNotificationEmailRequestSchema = z.object({
|
|
202
|
+
email: z.string().email().max(320)
|
|
203
|
+
});
|
|
90
204
|
var PositionWriteSchema = z.object({
|
|
91
205
|
company: z.string().min(1).max(256).nullable().optional(),
|
|
206
|
+
entityRef: entityRefSchema,
|
|
92
207
|
title: z.string().min(1).max(256),
|
|
93
208
|
description: z.string().max(5e4).nullable().optional(),
|
|
94
209
|
employmentType: z.string().nullable().optional(),
|
|
@@ -98,6 +213,33 @@ var PositionWriteSchema = z.object({
|
|
|
98
213
|
endedAt: z.string().nullable().optional(),
|
|
99
214
|
skills: z.array(skillRefSchema).max(50).nullable().optional()
|
|
100
215
|
});
|
|
216
|
+
var PresentationDeliveryWriteSchema = z.object({
|
|
217
|
+
presentationRef: externalRecordRefSchema.optional(),
|
|
218
|
+
title: z.string().max(3e3).nullable().optional(),
|
|
219
|
+
role: z.string().max(640).nullable().optional(),
|
|
220
|
+
eventName: z.string().max(3e3).nullable().optional(),
|
|
221
|
+
date: z.string().refine(isValidDateOnly, "must be a valid YYYY-MM-DD date").nullable().optional(),
|
|
222
|
+
location: z.string().max(2560).nullable().optional(),
|
|
223
|
+
mode: z.string().max(256).nullable().optional(),
|
|
224
|
+
status: z.string().max(256).nullable().optional(),
|
|
225
|
+
links: z.array(presentationLinkSchema).max(20).optional(),
|
|
226
|
+
eventRef: externalRecordRefSchema.optional(),
|
|
227
|
+
coSpeakers: z.array(z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID")).max(20).optional()
|
|
228
|
+
});
|
|
229
|
+
var PresentationWriteSchema = z.object({
|
|
230
|
+
title: z.string().min(1).max(3e3),
|
|
231
|
+
description: z.string().max(5e4).nullable().optional(),
|
|
232
|
+
duration: z.object({
|
|
233
|
+
minMinutes: z.number().int().min(1),
|
|
234
|
+
maxMinutes: z.number().int().min(1).optional()
|
|
235
|
+
}).refine((d) => d.maxMinutes === void 0 || d.maxMinutes >= d.minMinutes, {
|
|
236
|
+
message: "maxMinutes must be greater than or equal to minMinutes",
|
|
237
|
+
path: ["maxMinutes"]
|
|
238
|
+
}).optional(),
|
|
239
|
+
intendedAudiences: z.array(z.string().max(1e3)).max(20).optional(),
|
|
240
|
+
links: z.array(presentationLinkSchema).max(20).optional(),
|
|
241
|
+
writeupRef: externalRecordRefSchema.optional()
|
|
242
|
+
});
|
|
101
243
|
var ProfileLocationWriteSchema = z.object({
|
|
102
244
|
address: z.object({
|
|
103
245
|
country: z.string().nullish(),
|
|
@@ -141,6 +283,7 @@ var ProjectWriteSchema = z.object({
|
|
|
141
283
|
});
|
|
142
284
|
var PublicationWriteSchema = z.object({
|
|
143
285
|
title: z.string().min(1).max(200),
|
|
286
|
+
subtitle: z.string().max(2e3).nullable().optional(),
|
|
144
287
|
publisher: z.string().max(256).nullable().optional(),
|
|
145
288
|
url: optionalUrl(),
|
|
146
289
|
description: z.string().max(5e4).nullable().optional(),
|
|
@@ -152,6 +295,7 @@ var SkillWriteSchema = z.object({
|
|
|
152
295
|
});
|
|
153
296
|
var VolunteeringWriteSchema = z.object({
|
|
154
297
|
organization: z.string().min(1).max(256),
|
|
298
|
+
entityRef: entityRefSchema,
|
|
155
299
|
role: z.string().max(256).nullable().optional(),
|
|
156
300
|
cause: z.string().max(256).nullable().optional(),
|
|
157
301
|
description: z.string().max(5e4).nullable().optional(),
|
|
@@ -159,6 +303,6 @@ var VolunteeringWriteSchema = z.object({
|
|
|
159
303
|
endedAt: z.string().nullable().optional()
|
|
160
304
|
});
|
|
161
305
|
|
|
162
|
-
export { CertificationWriteSchema, CourseWriteSchema, EducationWriteSchema, ExternalAccountWriteSchema, HonorWriteSchema, LanguageWriteSchema, PositionWriteSchema, ProfileLocationWriteSchema, ProfileSelfWriteSchema, ProjectWriteSchema, PublicationWriteSchema, SkillWriteSchema, VALID_PLATFORMS, VolunteeringWriteSchema, normalizeUrl, optionalUrl, skillRefSchema, writeLocationSchema };
|
|
306
|
+
export { CertificationWriteSchema, CourseWriteSchema, EducationWriteSchema, ExternalAccountWriteSchema, HonorWriteSchema, InvolvementWriteSchema, LanguageWriteSchema, OrgClaimRequestSchema, OrgDomainChallengeRequestSchema, OrgDomainVerifyRequestSchema, OrgEmploymentAttestationWriteSchema, OrgNotificationEmailRequestSchema, OrgProfileUpdateRequestSchema, OrgProfileWriteSchema, PositionWriteSchema, PresentationDeliveryWriteSchema, PresentationWriteSchema, ProfileLocationWriteSchema, ProfileSelfWriteSchema, ProjectWriteSchema, PublicationWriteSchema, SkillWriteSchema, VALID_PLATFORMS, VolunteeringWriteSchema, artifactLinkSchema, entityRefSchema, externalRecordRefSchema, httpUrlOrNull, isValidDateOnly, normalizeUrl, optionalUrl, presentationLinkSchema, skillRefSchema, writeLocationSchema };
|
|
163
307
|
//# sourceMappingURL=index.js.map
|
|
164
308
|
//# sourceMappingURL=index.js.map
|