@singi-labs/sifa-sdk 0.12.1 → 0.12.3
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/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas/write/index.cjs +307 -0
- package/dist/schemas/write/index.cjs.map +1 -0
- package/dist/schemas/write/index.d.cts +469 -0
- package/dist/schemas/write/index.d.ts +469 -0
- package/dist/schemas/write/index.js +277 -0
- package/dist/schemas/write/index.js.map +1 -0
- package/package.json +11 -1
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** Prepend `https://` if no scheme is present. */
|
|
4
|
+
declare function normalizeUrl(val: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Accept a URL string or silently drop it if invalid (returns `undefined`).
|
|
7
|
+
* Preserves the write-time policy: bad URLs from imports are dropped, not rejected.
|
|
8
|
+
*/
|
|
9
|
+
declare const optionalUrl: () => z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
10
|
+
/**
|
|
11
|
+
* Location shape accepted by the sifa-api write endpoints.
|
|
12
|
+
*
|
|
13
|
+
* Accepts BOTH the legacy shape (`id.sifa.defs#locationAddress`: `countryCode`,
|
|
14
|
+
* `region`, `city`) AND the new community shape
|
|
15
|
+
* (`community.lexicon.location.address`: `country`, `region`, `locality`,
|
|
16
|
+
* `street?`, `postalCode?`, `name?`). The frontend reads location records from
|
|
17
|
+
* the API and echoes them back on save. The API serializer emits explicit `null`
|
|
18
|
+
* for absent fields (not `undefined`), so every field uses `.nullish()`
|
|
19
|
+
* (`string | null | undefined`) instead of `.optional()` (`string | undefined`).
|
|
20
|
+
*
|
|
21
|
+
* `buildPdsLocation` on the server handles conversion to the PDS shape (always
|
|
22
|
+
* emitting the new community shape) and returns `undefined` when neither
|
|
23
|
+
* `country` nor `countryCode` is usable.
|
|
24
|
+
*/
|
|
25
|
+
declare const writeLocationSchema: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
26
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
locality: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
}, z.core.$strip>, z.ZodString]>>>;
|
|
35
|
+
/** Skill reference: a strong ref to a canonical skill record. */
|
|
36
|
+
declare const skillRefSchema: z.ZodObject<{
|
|
37
|
+
uri: z.ZodString;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
/**
|
|
40
|
+
* Platforms accepted by the external-account write endpoint.
|
|
41
|
+
*
|
|
42
|
+
* NOTE: this list intentionally differs from `PLATFORM_LABELS` in the SDK's
|
|
43
|
+
* `/taxonomy` subpath. `VALID_PLATFORMS` is what sifa-api's `POST /external-accounts`
|
|
44
|
+
* endpoint enforces; `PLATFORM_LABELS` is the display taxonomy used by the profile
|
|
45
|
+
* UI. Reconciling them is a separate follow-up (see #TBD). For now the two are
|
|
46
|
+
* mirrored verbatim from their prior definitions to preserve behavior.
|
|
47
|
+
*/
|
|
48
|
+
declare const VALID_PLATFORMS: readonly ["rss", "fediverse", "twitter", "instagram", "github", "codeberg", "gitlab", "forgejo", "gitea", "youtube", "linkedin", "substack", "website", "orcid", "keyoxide", "other"];
|
|
49
|
+
type ValidPlatform = (typeof VALID_PLATFORMS)[number];
|
|
50
|
+
/**
|
|
51
|
+
* Returns `input` when it is an http(s) URL string, else `null`. Blocks
|
|
52
|
+
* dangerous schemes (`javascript:`, `data:`, etc.) from being stored and
|
|
53
|
+
* later rendered.
|
|
54
|
+
*/
|
|
55
|
+
declare function httpUrlOrNull(input: unknown): string | null;
|
|
56
|
+
/**
|
|
57
|
+
* Strict calendar-date validator. Returns `true` for `YYYY-MM-DD` strings
|
|
58
|
+
* that name a real day, rejecting impossible values (`2024-02-30`, `2024-13-01`)
|
|
59
|
+
* by requiring the JavaScript `Date` round-trip to preserve the input.
|
|
60
|
+
*/
|
|
61
|
+
declare function isValidDateOnly(input: unknown): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Portable org entity identifier (Wikidata / ROR / LEI / sifa.id URI) chosen
|
|
64
|
+
* from the typeahead. Constrained to http(s) so a script-bearing scheme can't
|
|
65
|
+
* be written to the PDS record. Absent for free-text / unlinked records.
|
|
66
|
+
* Shared by the org-bearing sections (position, education, certification,
|
|
67
|
+
* volunteering, course, honor).
|
|
68
|
+
*/
|
|
69
|
+
declare const entityRefSchema: z.ZodOptional<z.ZodString>;
|
|
70
|
+
/**
|
|
71
|
+
* One proof link on an involvement record (`id.sifa.defs#artifactLink`).
|
|
72
|
+
* Only http(s) URLs are accepted so a dangerous scheme is never written to
|
|
73
|
+
* the PDS.
|
|
74
|
+
*/
|
|
75
|
+
declare const artifactLinkSchema: z.ZodObject<{
|
|
76
|
+
url: z.ZodString;
|
|
77
|
+
kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
/**
|
|
81
|
+
* Reference to a record by at-uri, with an optional CID
|
|
82
|
+
* (`id.sifa.defs#externalRecordRef`).
|
|
83
|
+
*/
|
|
84
|
+
declare const externalRecordRefSchema: z.ZodObject<{
|
|
85
|
+
uri: z.ZodString;
|
|
86
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
/** Link attached to a presentation record. */
|
|
89
|
+
declare const presentationLinkSchema: z.ZodObject<{
|
|
90
|
+
uri: z.ZodString;
|
|
91
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
|
|
95
|
+
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.certification`. */
|
|
96
|
+
declare const CertificationWriteSchema: z.ZodObject<{
|
|
97
|
+
name: z.ZodString;
|
|
98
|
+
authority: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
100
|
+
credentialId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
|
+
credentialUrl: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
102
|
+
issuedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
type CertificationWriteInput = z.infer<typeof CertificationWriteSchema>;
|
|
106
|
+
|
|
107
|
+
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.course`. */
|
|
108
|
+
declare const CourseWriteSchema: z.ZodObject<{
|
|
109
|
+
name: z.ZodString;
|
|
110
|
+
number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
111
|
+
institution: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
112
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
113
|
+
credential: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
type CourseWriteInput = z.infer<typeof CourseWriteSchema>;
|
|
117
|
+
|
|
118
|
+
/** Schema enforced by `POST /profile/education` on sifa-api. */
|
|
119
|
+
declare const EducationWriteSchema: z.ZodObject<{
|
|
120
|
+
institution: z.ZodString;
|
|
121
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
122
|
+
degree: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
123
|
+
fieldOfStudy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
124
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
|
+
activities: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
126
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
127
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
type EducationWriteInput = z.infer<typeof EducationWriteSchema>;
|
|
130
|
+
|
|
131
|
+
/** Schema enforced by `POST /external-accounts` on sifa-api. */
|
|
132
|
+
declare const ExternalAccountWriteSchema: z.ZodObject<{
|
|
133
|
+
platform: z.ZodEnum<{
|
|
134
|
+
rss: "rss";
|
|
135
|
+
fediverse: "fediverse";
|
|
136
|
+
twitter: "twitter";
|
|
137
|
+
instagram: "instagram";
|
|
138
|
+
github: "github";
|
|
139
|
+
codeberg: "codeberg";
|
|
140
|
+
gitlab: "gitlab";
|
|
141
|
+
forgejo: "forgejo";
|
|
142
|
+
gitea: "gitea";
|
|
143
|
+
youtube: "youtube";
|
|
144
|
+
linkedin: "linkedin";
|
|
145
|
+
substack: "substack";
|
|
146
|
+
website: "website";
|
|
147
|
+
orcid: "orcid";
|
|
148
|
+
keyoxide: "keyoxide";
|
|
149
|
+
other: "other";
|
|
150
|
+
}>;
|
|
151
|
+
url: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
152
|
+
label: z.ZodOptional<z.ZodString>;
|
|
153
|
+
feedUrl: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
type ExternalAccountWriteInput = z.infer<typeof ExternalAccountWriteSchema>;
|
|
156
|
+
|
|
157
|
+
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.honor`. */
|
|
158
|
+
declare const HonorWriteSchema: z.ZodObject<{
|
|
159
|
+
title: z.ZodString;
|
|
160
|
+
issuer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
161
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
162
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
163
|
+
awardedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
type HonorWriteInput = z.infer<typeof HonorWriteSchema>;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Schema enforced by the generic-record write endpoint for `id.sifa.profile.involvement`.
|
|
169
|
+
*
|
|
170
|
+
* Represents contribution to an upstream project or community
|
|
171
|
+
* (open-source maintainership, community volunteering, etc.). `upstream` /
|
|
172
|
+
* `upstreamDid` / `upstreamUrl` describe what the user contributed to;
|
|
173
|
+
* `links` collect proof artifacts.
|
|
174
|
+
*/
|
|
175
|
+
declare const InvolvementWriteSchema: z.ZodObject<{
|
|
176
|
+
kind: z.ZodString;
|
|
177
|
+
upstream: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
178
|
+
upstreamDid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
179
|
+
upstreamUrl: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
180
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
181
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
182
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
183
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
184
|
+
links: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
185
|
+
url: z.ZodString;
|
|
186
|
+
kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
187
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
188
|
+
}, z.core.$strip>>>>;
|
|
189
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
190
|
+
location: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
191
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
192
|
+
countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
193
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
194
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
195
|
+
locality: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
196
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
197
|
+
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
198
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
199
|
+
}, z.core.$strip>, z.ZodString]>>>;
|
|
200
|
+
skills: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
201
|
+
uri: z.ZodString;
|
|
202
|
+
}, z.core.$strip>>>>;
|
|
203
|
+
}, z.core.$strip>;
|
|
204
|
+
type InvolvementWriteInput = z.infer<typeof InvolvementWriteSchema>;
|
|
205
|
+
|
|
206
|
+
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.language`. */
|
|
207
|
+
declare const LanguageWriteSchema: z.ZodObject<{
|
|
208
|
+
name: z.ZodString;
|
|
209
|
+
proficiency: z.ZodOptional<z.ZodString>;
|
|
210
|
+
}, z.core.$strip>;
|
|
211
|
+
type LanguageWriteInput = z.infer<typeof LanguageWriteSchema>;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Schema enforced by the org-employment-attestation write endpoint on sifa-api.
|
|
215
|
+
*
|
|
216
|
+
* An org attests that a Sifa user (`subject`) held a specific `position` record
|
|
217
|
+
* with `title` between `startedAt` and `endedAt` (inclusive of "current" status).
|
|
218
|
+
* The attestation itself is signed by the org's DID; `entityRef` / `companyDid`
|
|
219
|
+
* optionally cross-link the org identifier(s) used at the time.
|
|
220
|
+
*/
|
|
221
|
+
declare const OrgEmploymentAttestationWriteSchema: z.ZodObject<{
|
|
222
|
+
subject: z.ZodString;
|
|
223
|
+
position: z.ZodObject<{
|
|
224
|
+
uri: z.ZodString;
|
|
225
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
status: z.ZodEnum<{
|
|
228
|
+
current: "current";
|
|
229
|
+
past: "past";
|
|
230
|
+
}>;
|
|
231
|
+
title: z.ZodString;
|
|
232
|
+
startedAt: z.ZodString;
|
|
233
|
+
entityRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
234
|
+
companyDid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
235
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
236
|
+
comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
237
|
+
createdAt: z.ZodString;
|
|
238
|
+
}, z.core.$strip>;
|
|
239
|
+
type OrgEmploymentAttestationWriteInput = z.infer<typeof OrgEmploymentAttestationWriteSchema>;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Schema enforced by the org-profile write endpoint on sifa-api.
|
|
243
|
+
*
|
|
244
|
+
* Sifa-managed org identity: name + description + contact channel plus
|
|
245
|
+
* `entityRefs` linking the org to portable identifiers (Wikidata / ROR /
|
|
246
|
+
* LEI / sifa.id URI, http(s) enforced elsewhere).
|
|
247
|
+
*/
|
|
248
|
+
declare const OrgProfileWriteSchema: z.ZodObject<{
|
|
249
|
+
name: z.ZodString;
|
|
250
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
251
|
+
logo: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
252
|
+
website: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
253
|
+
entityRefs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
254
|
+
contact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
255
|
+
createdAt: z.ZodString;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
type OrgProfileWriteInput = z.infer<typeof OrgProfileWriteSchema>;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Schema enforced by `POST /profile/positions` on sifa-api.
|
|
261
|
+
*
|
|
262
|
+
* Client-side callers can `.safeParse(...)` this before submitting to catch
|
|
263
|
+
* obvious problems (empty `title`, over-length text) before the network
|
|
264
|
+
* round-trip. If it passes here, the API will accept the write modulo
|
|
265
|
+
* transport / auth failures.
|
|
266
|
+
*
|
|
267
|
+
* `company` is optional to support freelancer / independent employment types
|
|
268
|
+
* where the position has no employer. This matches sifa-api's current
|
|
269
|
+
* behavior in `src/routes/schemas.ts` and the SDK's lexicon schema
|
|
270
|
+
* (`ProfilePositionRecordSchema`) since sifa-sdk #184.
|
|
271
|
+
*/
|
|
272
|
+
declare const PositionWriteSchema: z.ZodObject<{
|
|
273
|
+
company: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
274
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
275
|
+
title: z.ZodString;
|
|
276
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
277
|
+
employmentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
278
|
+
workplaceType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
279
|
+
location: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
280
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
281
|
+
countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
282
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
283
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
284
|
+
locality: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
285
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
286
|
+
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
287
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
288
|
+
}, z.core.$strip>, z.ZodString]>>>;
|
|
289
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
290
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
291
|
+
skills: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
292
|
+
uri: z.ZodString;
|
|
293
|
+
}, z.core.$strip>>>>;
|
|
294
|
+
}, z.core.$strip>;
|
|
295
|
+
type PositionWriteInput = z.infer<typeof PositionWriteSchema>;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Schema enforced by the generic-record write endpoint for `id.sifa.profile.presentationDelivery`.
|
|
299
|
+
*
|
|
300
|
+
* Records a specific delivery of a presentation (e.g., at a conference).
|
|
301
|
+
* `presentationRef` optionally points at the parent `id.sifa.profile.presentation`
|
|
302
|
+
* record; `eventRef` optionally links a Sifa event record; `coSpeakers` are
|
|
303
|
+
* DIDs of people who delivered alongside the profile owner.
|
|
304
|
+
*/
|
|
305
|
+
declare const PresentationDeliveryWriteSchema: z.ZodObject<{
|
|
306
|
+
presentationRef: z.ZodOptional<z.ZodObject<{
|
|
307
|
+
uri: z.ZodString;
|
|
308
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
309
|
+
}, z.core.$strip>>;
|
|
310
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
311
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
312
|
+
eventName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
313
|
+
date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
314
|
+
location: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
315
|
+
mode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
316
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
317
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
318
|
+
uri: z.ZodString;
|
|
319
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
320
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
321
|
+
}, z.core.$strip>>>;
|
|
322
|
+
eventRef: z.ZodOptional<z.ZodObject<{
|
|
323
|
+
uri: z.ZodString;
|
|
324
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
325
|
+
}, z.core.$strip>>;
|
|
326
|
+
coSpeakers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
327
|
+
}, z.core.$strip>;
|
|
328
|
+
type PresentationDeliveryWriteInput = z.infer<typeof PresentationDeliveryWriteSchema>;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Schema enforced by the generic-record write endpoint for `id.sifa.profile.presentation`.
|
|
332
|
+
*
|
|
333
|
+
* Describes a talk / presentation the user can give. `duration` bounds the
|
|
334
|
+
* runtime; `intendedAudiences` names who it's aimed at; `writeupRef` is an
|
|
335
|
+
* optional at-uri pointer to a companion writeup record.
|
|
336
|
+
*/
|
|
337
|
+
declare const PresentationWriteSchema: z.ZodObject<{
|
|
338
|
+
title: z.ZodString;
|
|
339
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
340
|
+
duration: z.ZodOptional<z.ZodObject<{
|
|
341
|
+
minMinutes: z.ZodNumber;
|
|
342
|
+
maxMinutes: z.ZodOptional<z.ZodNumber>;
|
|
343
|
+
}, z.core.$strip>>;
|
|
344
|
+
intendedAudiences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
345
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
346
|
+
uri: z.ZodString;
|
|
347
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
348
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
349
|
+
}, z.core.$strip>>>;
|
|
350
|
+
writeupRef: z.ZodOptional<z.ZodObject<{
|
|
351
|
+
uri: z.ZodString;
|
|
352
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
353
|
+
}, z.core.$strip>>;
|
|
354
|
+
}, z.core.$strip>;
|
|
355
|
+
type PresentationWriteInput = z.infer<typeof PresentationWriteSchema>;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Schema enforced by `POST /profile/locations` on sifa-api.
|
|
359
|
+
*
|
|
360
|
+
* Mirrors the inner object of `writeLocationSchema`: accepts both the community
|
|
361
|
+
* shape (`country`, `locality`) and the legacy shape (`countryCode`, `city`)
|
|
362
|
+
* during the dual-read window. sifa-web #840 switched outbound writes to the
|
|
363
|
+
* community shape; older clients may still send the legacy shape. All address
|
|
364
|
+
* fields are `.nullish()` so explicit `null` from API echoes is accepted
|
|
365
|
+
* (see sifa-api #426).
|
|
366
|
+
*
|
|
367
|
+
* The route handler hands `address` to `buildPdsLocation`, which normalizes
|
|
368
|
+
* either input and enforces alpha-2 on the wire to PDS — returning a 400 with
|
|
369
|
+
* `message: "address.country (alpha-2) is required"` when no usable code is
|
|
370
|
+
* present. The schema stays permissive on country length here and lets
|
|
371
|
+
* `buildPdsLocation` be the single enforcement point.
|
|
372
|
+
*/
|
|
373
|
+
declare const ProfileLocationWriteSchema: z.ZodObject<{
|
|
374
|
+
address: z.ZodObject<{
|
|
375
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
376
|
+
countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
377
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
378
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
379
|
+
locality: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
380
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
381
|
+
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
382
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
383
|
+
}, z.core.$strip>;
|
|
384
|
+
type: z.ZodString;
|
|
385
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
386
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
387
|
+
}, z.core.$strip>;
|
|
388
|
+
type ProfileLocationWriteInput = z.infer<typeof ProfileLocationWriteSchema>;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Schema enforced by `POST /profile/self` on sifa-api.
|
|
392
|
+
*
|
|
393
|
+
* `.passthrough()` so the API accepts fields not yet enumerated here (used for
|
|
394
|
+
* gradual rollout of new profile-self keys without requiring lockstep bumps
|
|
395
|
+
* between web/api). Note this means client validation on this schema will
|
|
396
|
+
* NEVER reject "unknown" fields — the divergence is intentional.
|
|
397
|
+
*
|
|
398
|
+
* Grapheme caps (e.g. 64 on given/familyName) are enforced client-side by the
|
|
399
|
+
* SDK's lexicon schema; the write schema only guards the byte-length ceiling.
|
|
400
|
+
*/
|
|
401
|
+
declare const ProfileSelfWriteSchema: z.ZodObject<{
|
|
402
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
403
|
+
about: z.ZodOptional<z.ZodString>;
|
|
404
|
+
givenName: z.ZodOptional<z.ZodString>;
|
|
405
|
+
familyName: z.ZodOptional<z.ZodString>;
|
|
406
|
+
industries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
407
|
+
industry: z.ZodString;
|
|
408
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
409
|
+
}, z.core.$strip>>>;
|
|
410
|
+
location: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
411
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
412
|
+
countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
413
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
414
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
415
|
+
locality: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
416
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
417
|
+
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
418
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
419
|
+
}, z.core.$strip>, z.ZodString]>>>;
|
|
420
|
+
openTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
421
|
+
preferredWorkplace: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
422
|
+
availableFromUtc: z.ZodOptional<z.ZodNumber>;
|
|
423
|
+
availableToUtc: z.ZodOptional<z.ZodNumber>;
|
|
424
|
+
langs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
425
|
+
discoverable: z.ZodOptional<z.ZodBoolean>;
|
|
426
|
+
}, z.core.$loose>;
|
|
427
|
+
type ProfileSelfWriteInput = z.infer<typeof ProfileSelfWriteSchema>;
|
|
428
|
+
|
|
429
|
+
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.project`. */
|
|
430
|
+
declare const ProjectWriteSchema: z.ZodObject<{
|
|
431
|
+
name: z.ZodString;
|
|
432
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
433
|
+
url: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
434
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
435
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
436
|
+
}, z.core.$strip>;
|
|
437
|
+
type ProjectWriteInput = z.infer<typeof ProjectWriteSchema>;
|
|
438
|
+
|
|
439
|
+
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.publication`. */
|
|
440
|
+
declare const PublicationWriteSchema: z.ZodObject<{
|
|
441
|
+
title: z.ZodString;
|
|
442
|
+
subtitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
443
|
+
publisher: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
444
|
+
url: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
445
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
446
|
+
publishedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
447
|
+
}, z.core.$strip>;
|
|
448
|
+
type PublicationWriteInput = z.infer<typeof PublicationWriteSchema>;
|
|
449
|
+
|
|
450
|
+
/** Schema enforced by `POST /profile/skills` on sifa-api. */
|
|
451
|
+
declare const SkillWriteSchema: z.ZodObject<{
|
|
452
|
+
name: z.ZodString;
|
|
453
|
+
category: z.ZodOptional<z.ZodString>;
|
|
454
|
+
}, z.core.$strip>;
|
|
455
|
+
type SkillWriteInput = z.infer<typeof SkillWriteSchema>;
|
|
456
|
+
|
|
457
|
+
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.volunteering`. */
|
|
458
|
+
declare const VolunteeringWriteSchema: z.ZodObject<{
|
|
459
|
+
organization: z.ZodString;
|
|
460
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
461
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
462
|
+
cause: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
463
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
464
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
465
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
466
|
+
}, z.core.$strip>;
|
|
467
|
+
type VolunteeringWriteInput = z.infer<typeof VolunteeringWriteSchema>;
|
|
468
|
+
|
|
469
|
+
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 };
|