@singi-labs/sifa-sdk 0.21.0 → 0.23.0
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/{follow-profile-CgLLLQtJ.d.cts → follow-profile-BG_6eZwW.d.cts} +1 -1
- package/dist/{follow-profile-CVcA2w1v.d.ts → follow-profile-DGZzB5iM.d.ts} +1 -1
- package/dist/{index-BQAKeEoj.d.cts → index-BKvI1Bvg.d.cts} +1 -1
- package/dist/{index-DDh2RLvx.d.ts → index-BR8LDBo1.d.ts} +1 -1
- package/dist/index.cjs +35 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/jsonld/index.d.cts +2 -2
- package/dist/jsonld/index.d.ts +2 -2
- package/dist/{network-map-2OKh3wSB.d.ts → network-map-CMyjk6jc.d.ts} +4 -4
- package/dist/{network-map-DJonNOl0.d.cts → network-map-CqLYThmY.d.cts} +4 -4
- package/dist/{org-settings-BShvhyFp.d.ts → org-settings-BliQdqbB.d.cts} +57 -1
- package/dist/{profile-investment-QSwX2GL5.d.cts → profile-investment-BmuXFlZw.d.cts} +2 -0
- package/dist/{profile-investment-QSwX2GL5.d.ts → profile-investment-BmuXFlZw.d.ts} +2 -0
- package/dist/{org-settings-C73Sin5E.d.cts → profile-self-D59D_rhI.d.ts} +57 -1
- package/dist/{profile-summary-BCOKt3qS.d.cts → profile-summary-CoTNGDpt.d.cts} +1 -1
- package/dist/{profile-summary-DF8-evvA.d.ts → profile-summary-Sv6rqQbx.d.ts} +1 -1
- package/dist/publishing/index.cjs +21 -1
- package/dist/publishing/index.cjs.map +1 -1
- package/dist/query/fetchers/index.cjs +21 -1
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +9 -9
- package/dist/query/fetchers/index.d.ts +9 -9
- package/dist/query/fetchers/profile-mutations.js.map +1 -1
- package/dist/query/hooks/index.cjs +21 -1
- package/dist/query/hooks/index.cjs.map +1 -1
- package/dist/query/hooks/index.d.cts +7 -7
- package/dist/query/hooks/index.d.ts +7 -7
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +12 -12
- package/dist/query/index.d.ts +12 -12
- package/dist/resume/index.d.cts +2 -2
- package/dist/resume/index.d.ts +2 -2
- package/dist/schemas/index.cjs +29 -6
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +3 -3
- package/dist/schemas/index.d.ts +3 -3
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/profile-self.js +18 -6
- package/dist/schemas/profile-self.js.map +1 -1
- package/dist/schemas/shared.js +28 -1
- package/dist/schemas/shared.js.map +1 -1
- package/dist/schemas/write/certification.js +3 -3
- package/dist/schemas/write/certification.js.map +1 -1
- package/dist/schemas/write/course.js +5 -10
- package/dist/schemas/write/course.js.map +1 -1
- package/dist/schemas/write/education.js +3 -3
- package/dist/schemas/write/education.js.map +1 -1
- package/dist/schemas/write/honor.js +2 -2
- package/dist/schemas/write/honor.js.map +1 -1
- package/dist/schemas/write/index.cjs +58 -32
- package/dist/schemas/write/index.cjs.map +1 -1
- package/dist/schemas/write/index.d.cts +21 -64
- package/dist/schemas/write/index.d.ts +21 -64
- package/dist/schemas/write/index.js +5 -1
- package/dist/schemas/write/index.js.map +1 -1
- package/dist/schemas/write/investment.js +3 -3
- package/dist/schemas/write/investment.js.map +1 -1
- package/dist/schemas/write/involvement.js +3 -3
- package/dist/schemas/write/involvement.js.map +1 -1
- package/dist/schemas/write/position.js +8 -3
- package/dist/schemas/write/position.js.map +1 -1
- package/dist/schemas/write/profile-self.js +19 -5
- package/dist/schemas/write/profile-self.js.map +1 -1
- package/dist/schemas/write/project.js +3 -3
- package/dist/schemas/write/project.js.map +1 -1
- package/dist/schemas/write/publication.js +2 -2
- package/dist/schemas/write/publication.js.map +1 -1
- package/dist/schemas/write/shared.js +6 -0
- package/dist/schemas/write/shared.js.map +1 -1
- package/dist/schemas/write/volunteering.js +3 -3
- package/dist/schemas/write/volunteering.js.map +1 -1
- package/dist/testing/index.d.cts +2 -2
- package/dist/testing/index.d.ts +2 -2
- package/dist/{types-JydVIhN5.d.cts → types-BC4A9-W9.d.cts} +2 -2
- package/dist/{types-CkomzDlY.d.ts → types-CcVRIHcX.d.ts} +2 -2
- package/dist/{use-user-settings-DQ6Dyby7.d.ts → use-user-settings-CI9eZQpp.d.ts} +11 -6
- package/dist/{use-user-settings-Bn6g8bgr.d.cts → use-user-settings-CfQKSBAC.d.cts} +11 -6
- package/dist/{user-settings-BdNrDa9O.d.ts → user-settings-BVFxLAOa.d.cts} +6 -11
- package/dist/{user-settings-C8JUD4DM.d.cts → user-settings-C65eFsPR.d.ts} +6 -11
- package/dist/{verification-providers-DeyGqaoC.d.cts → verification-providers-DQLIOSCK.d.cts} +7 -1
- package/dist/{verification-providers-DeyGqaoC.d.ts → verification-providers-DQLIOSCK.d.ts} +7 -1
- package/package.json +1 -1
|
@@ -1,5 +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 '../../
|
|
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, P as ProfileOverrideWriteInput, j as ProfileOverrideWriteSchema, k as ProfileSelfWriteInput, l as ProfileSelfWriteSchema } from '../../profile-self-D59D_rhI.js';
|
|
3
3
|
|
|
4
4
|
/** Prepend `https://` if no scheme is present. */
|
|
5
5
|
declare function normalizeUrl(val: string): string;
|
|
@@ -111,8 +111,8 @@ declare const CertificationWriteSchema: z.ZodObject<{
|
|
|
111
111
|
entityRef: z.ZodOptional<z.ZodString>;
|
|
112
112
|
credentialId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
113
113
|
credentialUrl: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
114
|
-
issuedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
115
|
-
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
114
|
+
issuedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
115
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
116
116
|
}, z.core.$strip>;
|
|
117
117
|
type CertificationWriteInput = z.infer<typeof CertificationWriteSchema>;
|
|
118
118
|
|
|
@@ -123,10 +123,10 @@ declare const CourseWriteSchema: z.ZodObject<{
|
|
|
123
123
|
institution: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
124
124
|
entityRef: z.ZodOptional<z.ZodString>;
|
|
125
125
|
credential: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
126
|
-
completedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
126
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
127
127
|
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
-
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
129
|
-
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
128
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
129
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
130
130
|
position: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
131
131
|
education: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
132
|
}, z.core.$strip>;
|
|
@@ -141,8 +141,8 @@ declare const EducationWriteSchema: z.ZodObject<{
|
|
|
141
141
|
eqfLevel: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
142
142
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
143
143
|
activities: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
|
-
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
145
|
-
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
144
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
145
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
146
146
|
}, z.core.$strip>;
|
|
147
147
|
type EducationWriteInput = z.infer<typeof EducationWriteSchema>;
|
|
148
148
|
|
|
@@ -178,7 +178,7 @@ declare const HonorWriteSchema: z.ZodObject<{
|
|
|
178
178
|
issuer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
179
179
|
entityRef: z.ZodOptional<z.ZodString>;
|
|
180
180
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
181
|
-
awardedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
181
|
+
awardedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
182
182
|
}, z.core.$strip>;
|
|
183
183
|
type HonorWriteInput = z.infer<typeof HonorWriteSchema>;
|
|
184
184
|
|
|
@@ -197,8 +197,8 @@ declare const InvolvementWriteSchema: z.ZodObject<{
|
|
|
197
197
|
upstreamUrl: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
198
198
|
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
199
199
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
200
|
-
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
201
|
-
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
200
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
201
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
202
202
|
links: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
203
203
|
url: z.ZodString;
|
|
204
204
|
kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -254,8 +254,8 @@ declare const InvestmentWriteSchema: z.ZodObject<{
|
|
|
254
254
|
value: z.ZodNumber;
|
|
255
255
|
currency: z.ZodString;
|
|
256
256
|
}, z.core.$strip>>>;
|
|
257
|
-
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
258
|
-
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
257
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
258
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
259
259
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
260
260
|
links: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
261
261
|
url: z.ZodString;
|
|
@@ -371,8 +371,8 @@ declare const PositionWriteSchema: z.ZodObject<{
|
|
|
371
371
|
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
372
372
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
373
373
|
}, z.core.$strip>, z.ZodString]>>>;
|
|
374
|
-
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
375
|
-
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
374
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
375
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
376
376
|
skills: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
377
377
|
uri: z.ZodString;
|
|
378
378
|
}, z.core.$strip>>>>;
|
|
@@ -494,49 +494,6 @@ declare const ProfileLocationWriteSchema: z.ZodObject<{
|
|
|
494
494
|
}, z.core.$strip>;
|
|
495
495
|
type ProfileLocationWriteInput = z.infer<typeof ProfileLocationWriteSchema>;
|
|
496
496
|
|
|
497
|
-
/**
|
|
498
|
-
* Schema enforced by `POST /profile/self` on sifa-api.
|
|
499
|
-
*
|
|
500
|
-
* `.passthrough()` so the API accepts fields not yet enumerated here (used for
|
|
501
|
-
* gradual rollout of new profile-self keys without requiring lockstep bumps
|
|
502
|
-
* between web/api). Note this means client validation on this schema will
|
|
503
|
-
* NEVER reject "unknown" fields — the divergence is intentional.
|
|
504
|
-
*
|
|
505
|
-
* Grapheme caps (e.g. 64 on given/familyName) are enforced client-side by the
|
|
506
|
-
* SDK's lexicon schema; the write schema only guards the byte-length ceiling.
|
|
507
|
-
*/
|
|
508
|
-
declare const ProfileSelfWriteSchema: z.ZodObject<{
|
|
509
|
-
headline: z.ZodOptional<z.ZodString>;
|
|
510
|
-
about: z.ZodOptional<z.ZodString>;
|
|
511
|
-
givenName: z.ZodOptional<z.ZodString>;
|
|
512
|
-
familyName: z.ZodOptional<z.ZodString>;
|
|
513
|
-
namePronunciation: z.ZodOptional<z.ZodString>;
|
|
514
|
-
industries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
515
|
-
industry: z.ZodString;
|
|
516
|
-
domain: z.ZodOptional<z.ZodString>;
|
|
517
|
-
}, z.core.$strip>>>;
|
|
518
|
-
location: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
519
|
-
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
520
|
-
countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
521
|
-
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
522
|
-
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
523
|
-
locality: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
524
|
-
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
525
|
-
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
526
|
-
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
527
|
-
}, z.core.$strip>, z.ZodString]>>>;
|
|
528
|
-
openTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
529
|
-
preferredWorkplace: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
530
|
-
availableFromUtc: z.ZodOptional<z.ZodNumber>;
|
|
531
|
-
availableToUtc: z.ZodOptional<z.ZodNumber>;
|
|
532
|
-
langs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
533
|
-
discoverable: z.ZodOptional<z.ZodBoolean>;
|
|
534
|
-
avatarSource: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
535
|
-
"actor.rpg.sprite": "actor.rpg.sprite";
|
|
536
|
-
}>>>;
|
|
537
|
-
}, z.core.$loose>;
|
|
538
|
-
type ProfileSelfWriteInput = z.infer<typeof ProfileSelfWriteSchema>;
|
|
539
|
-
|
|
540
497
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.project`. */
|
|
541
498
|
declare const ProjectWriteSchema: z.ZodObject<{
|
|
542
499
|
name: z.ZodString;
|
|
@@ -563,8 +520,8 @@ declare const ProjectWriteSchema: z.ZodObject<{
|
|
|
563
520
|
}, z.core.$strip>;
|
|
564
521
|
role: z.ZodOptional<z.ZodString>;
|
|
565
522
|
}, z.core.$strip>>>;
|
|
566
|
-
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
567
|
-
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
523
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
524
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
568
525
|
}, z.core.$strip>;
|
|
569
526
|
type ProjectWriteInput = z.infer<typeof ProjectWriteSchema>;
|
|
570
527
|
|
|
@@ -612,7 +569,7 @@ declare const PublicationWriteSchema: z.ZodObject<{
|
|
|
612
569
|
publisher: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
613
570
|
url: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
614
571
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
615
|
-
publishedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
572
|
+
publishedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
616
573
|
authors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
617
574
|
name: z.ZodString;
|
|
618
575
|
did: z.ZodOptional<z.ZodString>;
|
|
@@ -654,9 +611,9 @@ declare const VolunteeringWriteSchema: z.ZodObject<{
|
|
|
654
611
|
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
655
612
|
cause: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
656
613
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
657
|
-
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
658
|
-
endedAt: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
614
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
615
|
+
endedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
659
616
|
}, z.core.$strip>;
|
|
660
617
|
type VolunteeringWriteInput = z.infer<typeof VolunteeringWriteSchema>;
|
|
661
618
|
|
|
662
|
-
export { type CertificationWriteInput, CertificationWriteSchema, type CourseWriteInput, CourseWriteSchema, type EducationWriteInput, EducationWriteSchema, type ExternalAccountWriteInput, ExternalAccountWriteSchema, type HonorWriteInput, HonorWriteSchema, type InvestmentWriteInput, InvestmentWriteSchema, 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
|
|
619
|
+
export { type CertificationWriteInput, CertificationWriteSchema, type CourseWriteInput, CourseWriteSchema, type EducationWriteInput, EducationWriteSchema, type ExternalAccountWriteInput, ExternalAccountWriteSchema, type HonorWriteInput, HonorWriteSchema, type InvestmentWriteInput, InvestmentWriteSchema, 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 ProjectWriteInput, ProjectWriteSchema, type PublicationWriteInput, PublicationWriteSchema, type SkillWriteInput, SkillWriteSchema, VALID_PLATFORMS, type ValidPlatform, type VolunteeringWriteInput, VolunteeringWriteSchema, artifactLinkSchema, entityRefSchema, externalRecordRefSchema, httpUrlOrNull, isValidDateOnly, isValidPartialDate, normalizeUrl, optionalUrl, orgFoundedSchema, presentationLinkSchema, publicationAuthorWriteSchema, relatedIdentifierWriteSchema, skillRefSchema, writeLocationSchema };
|
|
@@ -41,7 +41,10 @@ import {
|
|
|
41
41
|
} from "./presentation-delivery.js";
|
|
42
42
|
import { PresentationWriteSchema } from "./presentation.js";
|
|
43
43
|
import { ProfileLocationWriteSchema } from "./profile-location.js";
|
|
44
|
-
import {
|
|
44
|
+
import {
|
|
45
|
+
ProfileOverrideWriteSchema,
|
|
46
|
+
ProfileSelfWriteSchema
|
|
47
|
+
} from "./profile-self.js";
|
|
45
48
|
import { ProjectWriteSchema } from "./project.js";
|
|
46
49
|
import {
|
|
47
50
|
PublicationWriteSchema,
|
|
@@ -70,6 +73,7 @@ export {
|
|
|
70
73
|
PresentationDeliveryWriteSchema,
|
|
71
74
|
PresentationWriteSchema,
|
|
72
75
|
ProfileLocationWriteSchema,
|
|
76
|
+
ProfileOverrideWriteSchema,
|
|
73
77
|
ProfileSelfWriteSchema,
|
|
74
78
|
ProjectWriteSchema,
|
|
75
79
|
PublicationWriteSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/write/index.ts"],"sourcesContent":["/**\n * `@singi-labs/sifa-sdk/schemas/write` — Zod schemas that mirror the input\n * contracts of the sifa-api write endpoints. Client-side callers use these\n * to `.safeParse(...)` inputs before submitting.\n *\n * These are DELIBERATELY separate from the lexicon record schemas in\n * `@singi-labs/sifa-sdk/schemas`:\n * - Lexicon schemas describe the PDS record shape (wire format).\n * - Write schemas describe what sifa-api's HTTP endpoints accept (write policy).\n *\n * The two overlap heavily but diverge in ways that matter for UX (e.g., write\n * schemas allow explicit `null` for optional fields to round-trip API echoes;\n * lexicon schemas use `.optional()` because PDS records never carry `null`).\n * Client-side form validation should use THESE schemas so \"passes locally\"\n * matches \"server accepts\". Wire-shape assertions should use the lexicon\n * schemas.\n *\n * Source of truth: `sifa-api/src/routes/schemas.ts`. Any change to server-side\n * write policy must land here first, then be adopted in sifa-api.\n */\n\nexport {\n artifactLinkSchema,\n entityRefSchema,\n externalRecordRefSchema,\n httpUrlOrNull,\n isValidDateOnly,\n isValidPartialDate,\n normalizeUrl,\n optionalUrl,\n presentationLinkSchema,\n skillRefSchema,\n VALID_PLATFORMS,\n writeLocationSchema,\n type ValidPlatform,\n} from './shared.js';\n\nexport { CertificationWriteSchema, type CertificationWriteInput } from './certification.js';\nexport { CourseWriteSchema, type CourseWriteInput } from './course.js';\nexport { EducationWriteSchema, type EducationWriteInput } from './education.js';\nexport { ExternalAccountWriteSchema, type ExternalAccountWriteInput } from './external-account.js';\nexport { HonorWriteSchema, type HonorWriteInput } from './honor.js';\nexport { InvolvementWriteSchema, type InvolvementWriteInput } from './involvement.js';\nexport { InvestmentWriteSchema, type InvestmentWriteInput } from './investment.js';\nexport { LanguageWriteSchema, type LanguageWriteInput } from './language.js';\nexport {\n OrgEmploymentAttestationWriteSchema,\n type OrgEmploymentAttestationWriteInput,\n} from './org-employment-attestation.js';\nexport {\n OrgProfileWriteSchema,\n orgFoundedSchema,\n type OrgProfileWriteInput,\n} from './org-profile.js';\nexport { OrgClaimRequestSchema, type OrgClaimRequestInput } from './org-claim.js';\nexport {\n OrgProfileUpdateRequestSchema,\n type OrgProfileUpdateRequestInput,\n OrgDomainChallengeRequestSchema,\n type OrgDomainChallengeRequestInput,\n OrgDomainVerifyRequestSchema,\n type OrgDomainVerifyRequestInput,\n OrgNotificationEmailRequestSchema,\n type OrgNotificationEmailRequestInput,\n} from './org-settings.js';\nexport { PositionWriteSchema, type PositionWriteInput } from './position.js';\nexport {\n PresentationDeliveryWriteSchema,\n type PresentationDeliveryWriteInput,\n} from './presentation-delivery.js';\nexport { PresentationWriteSchema, type PresentationWriteInput } from './presentation.js';\nexport { ProfileLocationWriteSchema, type ProfileLocationWriteInput } from './profile-location.js';\nexport {
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/write/index.ts"],"sourcesContent":["/**\n * `@singi-labs/sifa-sdk/schemas/write` — Zod schemas that mirror the input\n * contracts of the sifa-api write endpoints. Client-side callers use these\n * to `.safeParse(...)` inputs before submitting.\n *\n * These are DELIBERATELY separate from the lexicon record schemas in\n * `@singi-labs/sifa-sdk/schemas`:\n * - Lexicon schemas describe the PDS record shape (wire format).\n * - Write schemas describe what sifa-api's HTTP endpoints accept (write policy).\n *\n * The two overlap heavily but diverge in ways that matter for UX (e.g., write\n * schemas allow explicit `null` for optional fields to round-trip API echoes;\n * lexicon schemas use `.optional()` because PDS records never carry `null`).\n * Client-side form validation should use THESE schemas so \"passes locally\"\n * matches \"server accepts\". Wire-shape assertions should use the lexicon\n * schemas.\n *\n * Source of truth: `sifa-api/src/routes/schemas.ts`. Any change to server-side\n * write policy must land here first, then be adopted in sifa-api.\n */\n\nexport {\n artifactLinkSchema,\n entityRefSchema,\n externalRecordRefSchema,\n httpUrlOrNull,\n isValidDateOnly,\n isValidPartialDate,\n normalizeUrl,\n optionalUrl,\n presentationLinkSchema,\n skillRefSchema,\n VALID_PLATFORMS,\n writeLocationSchema,\n type ValidPlatform,\n} from './shared.js';\n\nexport { CertificationWriteSchema, type CertificationWriteInput } from './certification.js';\nexport { CourseWriteSchema, type CourseWriteInput } from './course.js';\nexport { EducationWriteSchema, type EducationWriteInput } from './education.js';\nexport { ExternalAccountWriteSchema, type ExternalAccountWriteInput } from './external-account.js';\nexport { HonorWriteSchema, type HonorWriteInput } from './honor.js';\nexport { InvolvementWriteSchema, type InvolvementWriteInput } from './involvement.js';\nexport { InvestmentWriteSchema, type InvestmentWriteInput } from './investment.js';\nexport { LanguageWriteSchema, type LanguageWriteInput } from './language.js';\nexport {\n OrgEmploymentAttestationWriteSchema,\n type OrgEmploymentAttestationWriteInput,\n} from './org-employment-attestation.js';\nexport {\n OrgProfileWriteSchema,\n orgFoundedSchema,\n type OrgProfileWriteInput,\n} from './org-profile.js';\nexport { OrgClaimRequestSchema, type OrgClaimRequestInput } from './org-claim.js';\nexport {\n OrgProfileUpdateRequestSchema,\n type OrgProfileUpdateRequestInput,\n OrgDomainChallengeRequestSchema,\n type OrgDomainChallengeRequestInput,\n OrgDomainVerifyRequestSchema,\n type OrgDomainVerifyRequestInput,\n OrgNotificationEmailRequestSchema,\n type OrgNotificationEmailRequestInput,\n} from './org-settings.js';\nexport { PositionWriteSchema, type PositionWriteInput } from './position.js';\nexport {\n PresentationDeliveryWriteSchema,\n type PresentationDeliveryWriteInput,\n} from './presentation-delivery.js';\nexport { PresentationWriteSchema, type PresentationWriteInput } from './presentation.js';\nexport { ProfileLocationWriteSchema, type ProfileLocationWriteInput } from './profile-location.js';\nexport {\n ProfileOverrideWriteSchema,\n ProfileSelfWriteSchema,\n type ProfileOverrideWriteInput,\n type ProfileSelfWriteInput,\n} from './profile-self.js';\nexport { ProjectWriteSchema, type ProjectWriteInput } from './project.js';\nexport {\n PublicationWriteSchema,\n relatedIdentifierWriteSchema,\n publicationAuthorWriteSchema,\n type PublicationWriteInput,\n} from './publication.js';\nexport { SkillWriteSchema, type SkillWriteInput } from './skill.js';\nexport { VolunteeringWriteSchema, type VolunteeringWriteInput } from './volunteering.js';\n"],"mappings":";AAqBA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP,SAAS,gCAA8D;AACvE,SAAS,yBAAgD;AACzD,SAAS,4BAAsD;AAC/D,SAAS,kCAAkE;AAC3E,SAAS,wBAA8C;AACvD,SAAS,8BAA0D;AACnE,SAAS,6BAAwD;AACjE,SAAS,2BAAoD;AAC7D;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,6BAAwD;AACjE;AAAA,EACE;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,OAEK;AACP,SAAS,2BAAoD;AAC7D;AAAA,EACE;AAAA,OAEK;AACP,SAAS,+BAA4D;AACrE,SAAS,kCAAkE;AAC3E;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,0BAAkD;AAC3D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,wBAA8C;AACvD,SAAS,+BAA4D;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/schemas/write/investment.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { artifactLinkSchema, entityRefSchema } from "./shared.js";
|
|
3
|
+
import { artifactLinkSchema, entityRefSchema, partialDateFieldSchema } from "./shared.js";
|
|
4
4
|
var InvestmentWriteSchema = z.object({
|
|
5
5
|
/** For a limited-partner entry this names the fund, not a portfolio company. */
|
|
6
6
|
company: z.string().min(1).max(256),
|
|
@@ -21,8 +21,8 @@ var InvestmentWriteSchema = z.object({
|
|
|
21
21
|
value: z.number().int().min(0),
|
|
22
22
|
currency: z.string().length(3)
|
|
23
23
|
}).nullable().optional(),
|
|
24
|
-
startedAt:
|
|
25
|
-
endedAt:
|
|
24
|
+
startedAt: partialDateFieldSchema,
|
|
25
|
+
endedAt: partialDateFieldSchema,
|
|
26
26
|
description: z.string().max(5e4).nullable().optional(),
|
|
27
27
|
links: z.array(artifactLinkSchema).max(50).nullable().optional()
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/write/investment.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { artifactLinkSchema, entityRefSchema } from './shared.js';\n\n/**\n * Schema enforced by `POST /profile/investment` on sifa-api.\n *\n * An investment is capital the person put in. Roles with duties -- board seats,\n * advisory work -- are positions and use `PositionWriteSchema` instead.\n *\n * Every optional field is nullable so a client can clear it. Omitting a field on\n * update leaves the stored value in place, which would let a corrected status or a\n * withdrawn amount silently persist.\n */\nexport const InvestmentWriteSchema = z.object({\n /** For a limited-partner entry this names the fund, not a portfolio company. */\n company: z.string().min(1).max(256),\n companyDid: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema.nullable(),\n role: z.string().max(256).nullable().optional(),\n stage: z.string().max(256).nullable().optional(),\n status: z.string().max(256).nullable().optional(),\n via: z.string().max(256).nullable().optional(),\n viaDid: z.string().max(256).nullable().optional(),\n viaEntityRef: entityRefSchema.nullable(),\n /**\n * Optional and empty by default -- cheque size is a personal financial disclosure.\n * Structured rather than free text: an unparseable money string cannot be repaired\n * once people have written them.\n */\n amount: z\n .object({\n value: z.number().int().min(0),\n currency: z.string().length(3),\n })\n .nullable()\n .optional(),\n startedAt:
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/write/investment.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { artifactLinkSchema, entityRefSchema, partialDateFieldSchema } from './shared.js';\n\n/**\n * Schema enforced by `POST /profile/investment` on sifa-api.\n *\n * An investment is capital the person put in. Roles with duties -- board seats,\n * advisory work -- are positions and use `PositionWriteSchema` instead.\n *\n * Every optional field is nullable so a client can clear it. Omitting a field on\n * update leaves the stored value in place, which would let a corrected status or a\n * withdrawn amount silently persist.\n */\nexport const InvestmentWriteSchema = z.object({\n /** For a limited-partner entry this names the fund, not a portfolio company. */\n company: z.string().min(1).max(256),\n companyDid: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema.nullable(),\n role: z.string().max(256).nullable().optional(),\n stage: z.string().max(256).nullable().optional(),\n status: z.string().max(256).nullable().optional(),\n via: z.string().max(256).nullable().optional(),\n viaDid: z.string().max(256).nullable().optional(),\n viaEntityRef: entityRefSchema.nullable(),\n /**\n * Optional and empty by default -- cheque size is a personal financial disclosure.\n * Structured rather than free text: an unparseable money string cannot be repaired\n * once people have written them.\n */\n amount: z\n .object({\n value: z.number().int().min(0),\n currency: z.string().length(3),\n })\n .nullable()\n .optional(),\n startedAt: partialDateFieldSchema,\n endedAt: partialDateFieldSchema,\n description: z.string().max(50000).nullable().optional(),\n links: z.array(artifactLinkSchema).max(50).nullable().optional(),\n});\n\nexport type InvestmentWriteInput = z.infer<typeof InvestmentWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,oBAAoB,iBAAiB,8BAA8B;AAYrE,IAAM,wBAAwB,EAAE,OAAO;AAAA;AAAA,EAE5C,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAClC,YAAY,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACpD,WAAW,gBAAgB,SAAS;AAAA,EACpC,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAC9C,OAAO,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAC/C,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAChD,KAAK,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAC7C,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAChD,cAAc,gBAAgB,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvC,QAAQ,EACL,OAAO;AAAA,IACN,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC;AAAA,IAC7B,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC;AAAA,EAC/B,CAAC,EACA,SAAS,EACT,SAAS;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,aAAa,EAAE,OAAO,EAAE,IAAI,GAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,OAAO,EAAE,MAAM,kBAAkB,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS;AACjE,CAAC;","names":[]}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
entityRefSchema,
|
|
7
7
|
externalRecordRefSchema,
|
|
8
8
|
optionalUrl,
|
|
9
|
+
partialDateFieldSchema,
|
|
9
10
|
skillRefSchema,
|
|
10
11
|
writeLocationSchema
|
|
11
12
|
} from "./shared.js";
|
|
@@ -16,9 +17,8 @@ var InvolvementWriteSchema = z.object({
|
|
|
16
17
|
upstreamUrl: optionalUrl(),
|
|
17
18
|
role: z.string().max(2560).nullable().optional(),
|
|
18
19
|
description: z.string().max(5e4).nullable().optional(),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
endedAt: z.string().max(32).nullable().optional(),
|
|
20
|
+
startedAt: partialDateFieldSchema,
|
|
21
|
+
endedAt: partialDateFieldSchema,
|
|
22
22
|
links: z.array(artifactLinkSchema).max(50).nullable().optional(),
|
|
23
23
|
/** Other people who worked on this alongside you. Same shape as project members. */
|
|
24
24
|
collaborators: z.array(projectMemberWriteSchema).max(50).optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/write/involvement.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { projectMemberWriteSchema } from './project.js';\n\nimport {\n artifactLinkSchema,\n entityRefSchema,\n externalRecordRefSchema,\n optionalUrl,\n skillRefSchema,\n writeLocationSchema,\n} from './shared.js';\n\n/**\n * Schema enforced by the generic-record write endpoint for `id.sifa.profile.involvement`.\n *\n * Represents contribution to an upstream project or community\n * (open-source maintainership, community volunteering, etc.). `upstream` /\n * `upstreamDid` / `upstreamUrl` describe what the user contributed to;\n * `links` collect proof artifacts.\n */\nexport const InvolvementWriteSchema = z.object({\n kind: z.string().min(1).max(256),\n upstream: z.string().max(2560).nullable().optional(),\n upstreamDid: z\n .string()\n .regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID')\n .nullable()\n .optional(),\n upstreamUrl: optionalUrl(),\n role: z.string().max(2560).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/write/involvement.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { projectMemberWriteSchema } from './project.js';\n\nimport {\n artifactLinkSchema,\n entityRefSchema,\n externalRecordRefSchema,\n optionalUrl,\n partialDateFieldSchema,\n skillRefSchema,\n writeLocationSchema,\n} from './shared.js';\n\n/**\n * Schema enforced by the generic-record write endpoint for `id.sifa.profile.involvement`.\n *\n * Represents contribution to an upstream project or community\n * (open-source maintainership, community volunteering, etc.). `upstream` /\n * `upstreamDid` / `upstreamUrl` describe what the user contributed to;\n * `links` collect proof artifacts.\n */\nexport const InvolvementWriteSchema = z.object({\n kind: z.string().min(1).max(256),\n upstream: z.string().max(2560).nullable().optional(),\n upstreamDid: z\n .string()\n .regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID')\n .nullable()\n .optional(),\n upstreamUrl: optionalUrl(),\n role: z.string().max(2560).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n startedAt: partialDateFieldSchema,\n endedAt: partialDateFieldSchema,\n links: z.array(artifactLinkSchema).max(50).nullable().optional(),\n /** Other people who worked on this alongside you. Same shape as project members. */\n collaborators: z.array(projectMemberWriteSchema).max(50).optional(),\n /** The same involvement as recorded on another person's profile. */\n sameAs: externalRecordRefSchema.optional(),\n entityRef: entityRefSchema,\n location: writeLocationSchema,\n skills: z.array(skillRefSchema).max(50).nullable().optional(),\n});\n\nexport type InvolvementWriteInput = z.infer<typeof InvolvementWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,gCAAgC;AAEzC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUA,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/B,UAAU,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,SAAS,EAAE,SAAS;AAAA,EACnD,aAAa,EACV,OAAO,EACP,MAAM,uBAAuB,eAAe,EAC5C,SAAS,EACT,SAAS;AAAA,EACZ,aAAa,YAAY;AAAA,EACzB,MAAM,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,SAAS,EAAE,SAAS;AAAA,EAC/C,aAAa,EAAE,OAAO,EAAE,IAAI,GAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO,EAAE,MAAM,kBAAkB,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS;AAAA;AAAA,EAE/D,eAAe,EAAE,MAAM,wBAAwB,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA;AAAA,EAElE,QAAQ,wBAAwB,SAAS;AAAA,EACzC,WAAW;AAAA,EACX,UAAU;AAAA,EACV,QAAQ,EAAE,MAAM,cAAc,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS;AAC9D,CAAC;","names":[]}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
// src/schemas/write/position.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
entityRefSchema,
|
|
5
|
+
partialDateFieldSchema,
|
|
6
|
+
skillRefSchema,
|
|
7
|
+
writeLocationSchema
|
|
8
|
+
} from "./shared.js";
|
|
4
9
|
var PositionWriteSchema = z.object({
|
|
5
10
|
company: z.string().min(1).max(256).nullable().optional(),
|
|
6
11
|
entityRef: entityRefSchema,
|
|
@@ -14,8 +19,8 @@ var PositionWriteSchema = z.object({
|
|
|
14
19
|
onBehalfOfEntityRef: entityRefSchema.nullable(),
|
|
15
20
|
workplaceType: z.string().nullable().optional(),
|
|
16
21
|
location: writeLocationSchema,
|
|
17
|
-
startedAt:
|
|
18
|
-
endedAt:
|
|
22
|
+
startedAt: partialDateFieldSchema,
|
|
23
|
+
endedAt: partialDateFieldSchema,
|
|
19
24
|
skills: z.array(skillRefSchema).max(50).nullable().optional()
|
|
20
25
|
});
|
|
21
26
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/write/position.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/write/position.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport {\n entityRefSchema,\n partialDateFieldSchema,\n skillRefSchema,\n writeLocationSchema,\n} from './shared.js';\n\n/**\n * Schema enforced by `POST /profile/positions` on sifa-api.\n *\n * Client-side callers can `.safeParse(...)` this before submitting to catch\n * obvious problems (empty `title`, over-length text) before the network\n * round-trip. If it passes here, the API will accept the write modulo\n * transport / auth failures.\n *\n * `company` is optional to support freelancer / independent employment types\n * where the position has no employer. This matches sifa-api's current\n * behavior in `src/routes/schemas.ts` and the SDK's lexicon schema\n * (`ProfilePositionRecordSchema`) since sifa-sdk #184.\n */\nexport const PositionWriteSchema = z.object({\n company: z.string().min(1).max(256).nullable().optional(),\n entityRef: entityRefSchema,\n title: z.string().min(1).max(256),\n description: z.string().max(50000).nullable().optional(),\n employmentType: z.string().nullable().optional(),\n // Held-on-behalf-of disclosure for board and advisory roles. Nullable so a client\n // can clear it when a seat stops being a representative one.\n onBehalfOf: z.string().max(256).nullable().optional(),\n onBehalfOfDid: z.string().max(256).nullable().optional(),\n onBehalfOfEntityRef: entityRefSchema.nullable(),\n workplaceType: z.string().nullable().optional(),\n location: writeLocationSchema,\n startedAt: partialDateFieldSchema,\n endedAt: partialDateFieldSchema,\n skills: z.array(skillRefSchema).max(50).nullable().optional(),\n});\n\nexport type PositionWriteInput = z.infer<typeof PositionWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAeA,IAAM,sBAAsB,EAAE,OAAO;AAAA,EAC1C,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACxD,WAAW;AAAA,EACX,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAChC,aAAa,EAAE,OAAO,EAAE,IAAI,GAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA;AAAA;AAAA,EAG/C,YAAY,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACpD,eAAe,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,qBAAqB,gBAAgB,SAAS;AAAA,EAC9C,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC9C,UAAU;AAAA,EACV,WAAW;AAAA,EACX,SAAS;AAAA,EACT,QAAQ,EAAE,MAAM,cAAc,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS;AAC9D,CAAC;","names":[]}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
// src/schemas/write/profile-self.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { RPG_AVATAR_SOURCE } from "../../rpg/avatar.js";
|
|
4
|
+
import {
|
|
5
|
+
profileAboutSchema,
|
|
6
|
+
profileDisplayNameSchema,
|
|
7
|
+
profileHeadlineSchema,
|
|
8
|
+
profileNameSchema,
|
|
9
|
+
profilePronounsSchema
|
|
10
|
+
} from "../shared.js";
|
|
4
11
|
import { writeLocationSchema } from "./shared.js";
|
|
5
12
|
var ProfileSelfWriteSchema = z.object({
|
|
6
|
-
headline:
|
|
7
|
-
about:
|
|
8
|
-
givenName:
|
|
9
|
-
familyName:
|
|
10
|
-
namePronunciation:
|
|
13
|
+
headline: profileHeadlineSchema.optional(),
|
|
14
|
+
about: profileAboutSchema.optional(),
|
|
15
|
+
givenName: profileNameSchema.optional(),
|
|
16
|
+
familyName: profileNameSchema.optional(),
|
|
17
|
+
namePronunciation: profileNameSchema.optional(),
|
|
11
18
|
industries: z.array(
|
|
12
19
|
z.object({
|
|
13
20
|
industry: z.string().max(100),
|
|
@@ -29,7 +36,14 @@ var ProfileSelfWriteSchema = z.object({
|
|
|
29
36
|
*/
|
|
30
37
|
avatarSource: z.enum([RPG_AVATAR_SOURCE]).nullable().optional()
|
|
31
38
|
}).passthrough();
|
|
39
|
+
var ProfileOverrideWriteSchema = z.object({
|
|
40
|
+
headline: profileHeadlineSchema.nullish(),
|
|
41
|
+
about: profileAboutSchema.nullish(),
|
|
42
|
+
displayName: profileDisplayNameSchema.nullish(),
|
|
43
|
+
pronouns: profilePronounsSchema.nullish()
|
|
44
|
+
});
|
|
32
45
|
export {
|
|
46
|
+
ProfileOverrideWriteSchema,
|
|
33
47
|
ProfileSelfWriteSchema
|
|
34
48
|
};
|
|
35
49
|
//# sourceMappingURL=profile-self.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/write/profile-self.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { RPG_AVATAR_SOURCE } from '../../rpg/avatar.js';\nimport { writeLocationSchema } from './shared.js';\n\n/**\n * Schema enforced by `POST /profile/self` on sifa-api.\n *\n * `.passthrough()` so the API accepts fields not yet enumerated here (used for\n * gradual rollout of new profile-self keys without requiring lockstep bumps\n * between web/api). Note this means client validation on this schema will\n * NEVER reject \"unknown\" fields — the divergence is intentional.\n *\n *
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/write/profile-self.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { RPG_AVATAR_SOURCE } from '../../rpg/avatar.js';\nimport {\n profileAboutSchema,\n profileDisplayNameSchema,\n profileHeadlineSchema,\n profileNameSchema,\n profilePronounsSchema,\n} from '../shared.js';\nimport { writeLocationSchema } from './shared.js';\n\n/**\n * Schema enforced by `POST /profile/self` on sifa-api.\n *\n * `.passthrough()` so the API accepts fields not yet enumerated here (used for\n * gradual rollout of new profile-self keys without requiring lockstep bumps\n * between web/api). Note this means client validation on this schema will\n * NEVER reject \"unknown\" fields — the divergence is intentional.\n *\n * headline, about, givenName, familyName and namePronunciation match the\n * `id.sifa.profile.self` lexicon's grapheme and UTF-8 byte limits. Other fields\n * (for example `langs` formats) are not checked against the lexicon here.\n */\nexport const ProfileSelfWriteSchema = z\n .object({\n headline: profileHeadlineSchema.optional(),\n about: profileAboutSchema.optional(),\n givenName: profileNameSchema.optional(),\n familyName: profileNameSchema.optional(),\n namePronunciation: profileNameSchema.optional(),\n industries: z\n .array(\n z.object({\n industry: z.string().max(100),\n domain: z.string().max(100).optional(),\n }),\n )\n .max(10)\n .optional(),\n location: writeLocationSchema,\n openTo: z.array(z.string()).max(10).optional(),\n preferredWorkplace: z.array(z.string()).max(5).optional(),\n availableFromUtc: z.number().int().min(0).max(23).optional(),\n availableToUtc: z.number().int().min(0).max(23).optional(),\n langs: z.array(z.string()).max(3).optional(),\n discoverable: z.boolean().optional(),\n /**\n * `actor.rpg.sprite` uses the user's rpg.actor character as their avatar;\n * `null` turns it off (the uploaded avatar, or the Bluesky one, comes\n * back). Omitted leaves the current choice unchanged. Only values Sifa can\n * render are accepted.\n */\n avatarSource: z.enum([RPG_AVATAR_SOURCE]).nullable().optional(),\n })\n .passthrough();\n\nexport type ProfileSelfWriteInput = z.infer<typeof ProfileSelfWriteSchema>;\n\n/**\n * Override fields validated by sifa-api's profile override route. `displayName`\n * and `pronouns` are not part of `ProfileSelfWriteSchema`; every field is\n * nullish (`null` clears an override). Limits mirror `id.sifa.profile.self`.\n */\nexport const ProfileOverrideWriteSchema = z.object({\n headline: profileHeadlineSchema.nullish(),\n about: profileAboutSchema.nullish(),\n displayName: profileDisplayNameSchema.nullish(),\n pronouns: profilePronounsSchema.nullish(),\n});\n\nexport type ProfileOverrideWriteInput = z.infer<typeof ProfileOverrideWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,2BAA2B;AAc7B,IAAM,yBAAyB,EACnC,OAAO;AAAA,EACN,UAAU,sBAAsB,SAAS;AAAA,EACzC,OAAO,mBAAmB,SAAS;AAAA,EACnC,WAAW,kBAAkB,SAAS;AAAA,EACtC,YAAY,kBAAkB,SAAS;AAAA,EACvC,mBAAmB,kBAAkB,SAAS;AAAA,EAC9C,YAAY,EACT;AAAA,IACC,EAAE,OAAO;AAAA,MACP,UAAU,EAAE,OAAO,EAAE,IAAI,GAAG;AAAA,MAC5B,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,IACvC,CAAC;AAAA,EACH,EACC,IAAI,EAAE,EACN,SAAS;AAAA,EACZ,UAAU;AAAA,EACV,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,EAC7C,oBAAoB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACxD,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,EAC3D,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,EACzD,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EAC3C,cAAc,EAAE,QAAQ,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnC,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,EAAE,SAAS,EAAE,SAAS;AAChE,CAAC,EACA,YAAY;AASR,IAAM,6BAA6B,EAAE,OAAO;AAAA,EACjD,UAAU,sBAAsB,QAAQ;AAAA,EACxC,OAAO,mBAAmB,QAAQ;AAAA,EAClC,aAAa,yBAAyB,QAAQ;AAAA,EAC9C,UAAU,sBAAsB,QAAQ;AAC1C,CAAC;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/schemas/write/project.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { externalRecordRefSchema, optionalUrl } from "./shared.js";
|
|
3
|
+
import { externalRecordRefSchema, optionalUrl, partialDateFieldSchema } from "./shared.js";
|
|
4
4
|
var projectMemberWriteSchema = z.object({
|
|
5
5
|
did: z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID"),
|
|
6
6
|
role: z.string().max(256).nullable().optional(),
|
|
@@ -23,8 +23,8 @@ var ProjectWriteSchema = z.object({
|
|
|
23
23
|
sameAs: externalRecordRefSchema.optional(),
|
|
24
24
|
/** Calendar events this project organized or hosted. An empty list clears them. */
|
|
25
25
|
events: z.array(projectEventWriteSchema).max(200).optional(),
|
|
26
|
-
startedAt:
|
|
27
|
-
endedAt:
|
|
26
|
+
startedAt: partialDateFieldSchema,
|
|
27
|
+
endedAt: partialDateFieldSchema
|
|
28
28
|
});
|
|
29
29
|
export {
|
|
30
30
|
ProjectWriteSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/write/project.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { externalRecordRefSchema, optionalUrl } from './shared.js';\n\n/**\n * A person named as a member of the project. Naming someone is a claim: they\n * render as a bare handle until they publish an `id.sifa.confirmation`, and\n * confirming never puts this record on their profile. `role` is display only.\n */\nexport const projectMemberWriteSchema = z.object({\n did: z.string().regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID'),\n role: z.string().max(256).nullable().optional(),\n title: z.string().max(1280).nullable().optional(),\n});\n\n/**\n * One calendar event the project organized or hosted (lexicon `#projectEvent`).\n * `role` is the user's role at this occurrence when it differs from the\n * project's role.\n */\nexport const projectEventWriteSchema = z.object({\n event: externalRecordRefSchema,\n role: z.string().max(640).optional(),\n});\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.project`. */\nexport const ProjectWriteSchema = z.object({\n name: z.string().min(1).max(256),\n /** The user's own role on the project (#596), e.g. Maintainer. */\n role: z.string().max(256).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n url: optionalUrl(),\n members: z.array(projectMemberWriteSchema).max(50).optional(),\n /** The canonical project.self this entry corresponds to. Composition, not peer sameness. */\n projectRef: externalRecordRefSchema.optional(),\n /** The same project as recorded on another person's profile. */\n sameAs: externalRecordRefSchema.optional(),\n /** Calendar events this project organized or hosted. An empty list clears them. */\n events: z.array(projectEventWriteSchema).max(200).optional(),\n startedAt:
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/write/project.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { externalRecordRefSchema, optionalUrl, partialDateFieldSchema } from './shared.js';\n\n/**\n * A person named as a member of the project. Naming someone is a claim: they\n * render as a bare handle until they publish an `id.sifa.confirmation`, and\n * confirming never puts this record on their profile. `role` is display only.\n */\nexport const projectMemberWriteSchema = z.object({\n did: z.string().regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID'),\n role: z.string().max(256).nullable().optional(),\n title: z.string().max(1280).nullable().optional(),\n});\n\n/**\n * One calendar event the project organized or hosted (lexicon `#projectEvent`).\n * `role` is the user's role at this occurrence when it differs from the\n * project's role.\n */\nexport const projectEventWriteSchema = z.object({\n event: externalRecordRefSchema,\n role: z.string().max(640).optional(),\n});\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.project`. */\nexport const ProjectWriteSchema = z.object({\n name: z.string().min(1).max(256),\n /** The user's own role on the project (#596), e.g. Maintainer. */\n role: z.string().max(256).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n url: optionalUrl(),\n members: z.array(projectMemberWriteSchema).max(50).optional(),\n /** The canonical project.self this entry corresponds to. Composition, not peer sameness. */\n projectRef: externalRecordRefSchema.optional(),\n /** The same project as recorded on another person's profile. */\n sameAs: externalRecordRefSchema.optional(),\n /** Calendar events this project organized or hosted. An empty list clears them. */\n events: z.array(projectEventWriteSchema).max(200).optional(),\n startedAt: partialDateFieldSchema,\n endedAt: partialDateFieldSchema,\n});\n\nexport type ProjectWriteInput = z.infer<typeof ProjectWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,yBAAyB,aAAa,8BAA8B;AAOtE,IAAM,2BAA2B,EAAE,OAAO;AAAA,EAC/C,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,eAAe;AAAA,EAC5D,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAC9C,OAAO,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,SAAS,EAAE,SAAS;AAClD,CAAC;AAOM,IAAM,0BAA0B,EAAE,OAAO;AAAA,EAC9C,OAAO;AAAA,EACP,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS;AACrC,CAAC;AAGM,IAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA;AAAA,EAE/B,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAC9C,aAAa,EAAE,OAAO,EAAE,IAAI,GAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,KAAK,YAAY;AAAA,EACjB,SAAS,EAAE,MAAM,wBAAwB,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA;AAAA,EAE5D,YAAY,wBAAwB,SAAS;AAAA;AAAA,EAE7C,QAAQ,wBAAwB,SAAS;AAAA;AAAA,EAEzC,QAAQ,EAAE,MAAM,uBAAuB,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,EAC3D,WAAW;AAAA,EACX,SAAS;AACX,CAAC;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/schemas/write/publication.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { normalizeDoi } from "../../format/doi.js";
|
|
4
|
-
import { optionalUrl } from "./shared.js";
|
|
4
|
+
import { optionalUrl, partialDateFieldSchema } from "./shared.js";
|
|
5
5
|
var publicationAuthorWriteSchema = z.object({
|
|
6
6
|
name: z.string().min(1).max(100),
|
|
7
7
|
did: z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID").optional()
|
|
@@ -19,7 +19,7 @@ var PublicationWriteSchema = z.object({
|
|
|
19
19
|
publisher: z.string().max(256).nullable().optional(),
|
|
20
20
|
url: optionalUrl(),
|
|
21
21
|
description: z.string().max(5e4).nullable().optional(),
|
|
22
|
-
publishedAt:
|
|
22
|
+
publishedAt: partialDateFieldSchema,
|
|
23
23
|
// Absent here until now, so the write route stripped every co-author before
|
|
24
24
|
// it reached the PDS: the lexicon field, the indexer, the claim flattening
|
|
25
25
|
// and the editor all existed, and nothing joined them. An object schema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/write/publication.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { normalizeDoi } from '../../format/doi.js';\nimport { optionalUrl } from './shared.js';\n\n/**\n * A co-author named on the publication.\n *\n * Name-first, unlike a project member, and that is the lexicon's shape rather\n * than an inconsistency: a paper has co-authors whether or not they are on\n * atproto. A name alone is a complete entry that renders as written and claims\n * nothing about any account.\n *\n * `did` is the optional extra that turns the entry into a claim. The named\n * person renders as a bare name until they publish an `id.sifa.confirmation`,\n * and confirming never puts this record on their profile.\n */\nexport const publicationAuthorWriteSchema = z.object({\n name: z.string().min(1).max(100),\n did: z\n .string()\n .regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID')\n .optional(),\n});\n\n/**\n * A typed link to another version of the work (#590). A DOI identifier (the\n * default type) is stored bare, like the record's own `doi`, so it matches.\n */\nexport const relatedIdentifierWriteSchema = z\n .object({\n identifier: z.string().min(1).max(2048),\n identifierType: z.enum(['DOI', 'AT-URI', 'URL']).optional(),\n relationType: z.string().min(1).max(64),\n })\n .transform((rel) =>\n !rel.identifierType || rel.identifierType === 'DOI'\n ? { ...rel, identifier: normalizeDoi(rel.identifier) }\n : rel,\n );\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.publication`. */\nexport const PublicationWriteSchema = z.object({\n title: z.string().min(1).max(200),\n subtitle: z.string().max(2000).nullable().optional(),\n publisher: z.string().max(256).nullable().optional(),\n url: optionalUrl(),\n description: z.string().max(50000).nullable().optional(),\n publishedAt:
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/write/publication.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { normalizeDoi } from '../../format/doi.js';\nimport { optionalUrl, partialDateFieldSchema } from './shared.js';\n\n/**\n * A co-author named on the publication.\n *\n * Name-first, unlike a project member, and that is the lexicon's shape rather\n * than an inconsistency: a paper has co-authors whether or not they are on\n * atproto. A name alone is a complete entry that renders as written and claims\n * nothing about any account.\n *\n * `did` is the optional extra that turns the entry into a claim. The named\n * person renders as a bare name until they publish an `id.sifa.confirmation`,\n * and confirming never puts this record on their profile.\n */\nexport const publicationAuthorWriteSchema = z.object({\n name: z.string().min(1).max(100),\n did: z\n .string()\n .regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID')\n .optional(),\n});\n\n/**\n * A typed link to another version of the work (#590). A DOI identifier (the\n * default type) is stored bare, like the record's own `doi`, so it matches.\n */\nexport const relatedIdentifierWriteSchema = z\n .object({\n identifier: z.string().min(1).max(2048),\n identifierType: z.enum(['DOI', 'AT-URI', 'URL']).optional(),\n relationType: z.string().min(1).max(64),\n })\n .transform((rel) =>\n !rel.identifierType || rel.identifierType === 'DOI'\n ? { ...rel, identifier: normalizeDoi(rel.identifier) }\n : rel,\n );\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.publication`. */\nexport const PublicationWriteSchema = z.object({\n title: z.string().min(1).max(200),\n subtitle: z.string().max(2000).nullable().optional(),\n publisher: z.string().max(256).nullable().optional(),\n url: optionalUrl(),\n description: z.string().max(50000).nullable().optional(),\n publishedAt: partialDateFieldSchema,\n // Absent here until now, so the write route stripped every co-author before\n // it reached the PDS: the lexicon field, the indexer, the claim flattening\n // and the editor all existed, and nothing joined them. An object schema\n // drops unknown keys silently, so the editor reported success and wrote\n // nothing.\n authors: z.array(publicationAuthorWriteSchema).max(50).optional(),\n relatedIdentifiers: z.array(relatedIdentifierWriteSchema).max(20).optional(),\n doi: z\n .string()\n .max(256)\n .nullable()\n .optional()\n .transform((val) => (val ? normalizeDoi(val) : val)),\n // Open set. The known values are ORCID's work types (PUBLICATION_TYPE_OPTIONS),\n // and a value outside them is kept as written: a publication that reached Sifa\n // from Standard.site, RSS, or by hand need not fit ORCID's list.\n type: z.string().max(64).nullable().optional(),\n});\n\nexport type PublicationWriteInput = z.infer<typeof PublicationWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,oBAAoB;AAC7B,SAAS,aAAa,8BAA8B;AAc7C,IAAM,+BAA+B,EAAE,OAAO;AAAA,EACnD,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/B,KAAK,EACF,OAAO,EACP,MAAM,uBAAuB,eAAe,EAC5C,SAAS;AACd,CAAC;AAMM,IAAM,+BAA+B,EACzC,OAAO;AAAA,EACN,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI;AAAA,EACtC,gBAAgB,EAAE,KAAK,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,SAAS;AAAA,EAC1D,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AACxC,CAAC,EACA;AAAA,EAAU,CAAC,QACV,CAAC,IAAI,kBAAkB,IAAI,mBAAmB,QAC1C,EAAE,GAAG,KAAK,YAAY,aAAa,IAAI,UAAU,EAAE,IACnD;AACN;AAGK,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAChC,UAAU,EAAE,OAAO,EAAE,IAAI,GAAI,EAAE,SAAS,EAAE,SAAS;AAAA,EACnD,WAAW,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EACnD,KAAK,YAAY;AAAA,EACjB,aAAa,EAAE,OAAO,EAAE,IAAI,GAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMb,SAAS,EAAE,MAAM,4BAA4B,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,EAChE,oBAAoB,EAAE,MAAM,4BAA4B,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,EAC3E,KAAK,EACF,OAAO,EACP,IAAI,GAAG,EACP,SAAS,EACT,SAAS,EACT,UAAU,CAAC,QAAS,MAAM,aAAa,GAAG,IAAI,GAAI;AAAA;AAAA;AAAA;AAAA,EAIrD,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS;AAC/C,CAAC;","names":[]}
|
|
@@ -63,6 +63,11 @@ function isValidPartialDate(input) {
|
|
|
63
63
|
if (typeof input !== "string") return false;
|
|
64
64
|
return PARTIAL_DATE_RE.test(input) || isValidDateOnly(input);
|
|
65
65
|
}
|
|
66
|
+
var DATETIME_DAY_RE = /^(\d{4}-\d{2}-\d{2})T\d{2}:\d{2}/;
|
|
67
|
+
var partialDateFieldSchema = z.string().transform((v) => DATETIME_DAY_RE.exec(v)?.[1] ?? v).refine(
|
|
68
|
+
(v) => v === "" || isValidPartialDate(v),
|
|
69
|
+
"must be a valid YYYY, YYYY-MM or YYYY-MM-DD date"
|
|
70
|
+
).nullable().optional();
|
|
66
71
|
var entityRefSchema = z.string().url().refine((s) => /^https?:\/\//i.test(s), { message: "entityRef must be an http(s) URL" }).max(2048).optional();
|
|
67
72
|
var artifactLinkSchema = z.object({
|
|
68
73
|
url: z.string().max(2048).refine((v) => httpUrlOrNull(v) !== null, "must be an http(s) URL"),
|
|
@@ -89,6 +94,7 @@ export {
|
|
|
89
94
|
isValidPartialDate,
|
|
90
95
|
normalizeUrl,
|
|
91
96
|
optionalUrl,
|
|
97
|
+
partialDateFieldSchema,
|
|
92
98
|
presentationLinkSchema,
|
|
93
99
|
skillRefSchema,
|
|
94
100
|
writeLocationSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/write/shared.ts"],"sourcesContent":["import { z } from 'zod';\n\n/** Prepend `https://` if no scheme is present. */\nexport function normalizeUrl(val: string): string {\n const trimmed = val.trim();\n if (/^https?:\\/\\//i.test(trimmed)) return trimmed;\n return `https://${trimmed}`;\n}\n\n/**\n * Accept an http(s) URL string or silently drop it (returns `undefined`).\n * Preserves the write-time policy: bad URLs from imports are dropped, not\n * rejected. A dangerous scheme (`javascript:`, `data:`, ...) parses as a URL, so\n * this drops anything that is not http(s) via {@link httpUrlOrNull} rather than a\n * bare parse check, keeping a script-bearing scheme out of the stored record. All\n * consumers of this schema are web-link fields (project/publication/involvement/\n * certification URLs), so no non-http scheme is legitimate here.\n */\nexport const optionalUrl = () =>\n z\n .string()\n .optional()\n .transform((val) => {\n if (!val) return undefined;\n return httpUrlOrNull(val) ?? undefined;\n });\n\n/**\n * Location shape accepted by the sifa-api write endpoints.\n *\n * Accepts BOTH the legacy shape (`id.sifa.defs#locationAddress`: `countryCode`,\n * `region`, `city`) AND the new community shape\n * (`community.lexicon.location.address`: `country`, `region`, `locality`,\n * `street?`, `postalCode?`, `name?`). The frontend reads location records from\n * the API and echoes them back on save. The API serializer emits explicit `null`\n * for absent fields (not `undefined`), so every field uses `.nullish()`\n * (`string | null | undefined`) instead of `.optional()` (`string | undefined`).\n *\n * `buildPdsLocation` on the server handles conversion to the PDS shape (always\n * emitting the new community shape) and returns `undefined` when neither\n * `country` nor `countryCode` is usable.\n */\nexport const writeLocationSchema = z\n .union([\n z.object({\n country: z.string().nullish(),\n countryCode: z.string().length(2).nullish(),\n region: z.string().nullish(),\n city: z.string().nullish(),\n locality: z.string().nullish(),\n street: z.string().nullish(),\n postalCode: z.string().nullish(),\n name: z.string().nullish(),\n }),\n z.string(),\n ])\n .nullable()\n .optional();\n\n/** Skill reference: a strong ref to a canonical skill record. */\nexport const skillRefSchema = z.object({\n uri: z.string(),\n});\n\n/**\n * Platforms accepted by the external-account write endpoint.\n *\n * NOTE: this list intentionally differs from `PLATFORM_LABELS` in the SDK's\n * `/taxonomy` subpath. `VALID_PLATFORMS` is what sifa-api's `POST /external-accounts`\n * endpoint enforces; `PLATFORM_LABELS` is the display taxonomy used by the profile\n * UI. Reconciling them is a separate follow-up (see #TBD). For now the two are\n * mirrored verbatim from their prior definitions to preserve behavior.\n */\nexport const VALID_PLATFORMS = [\n 'rss',\n 'fediverse',\n 'twitter',\n 'instagram',\n 'github',\n 'codeberg',\n 'gitlab',\n 'forgejo',\n 'gitea',\n 'youtube',\n 'linkedin',\n 'substack',\n 'website',\n 'orcid',\n 'keyoxide',\n 'other',\n] as const;\n\nexport type ValidPlatform = (typeof VALID_PLATFORMS)[number];\n\n// ---- pure sanitization primitives (previously in sifa-api/src/lib/sanitize.ts) ----\n\n/**\n * Returns `input` when it is an http(s) URL string, else `null`. Blocks\n * dangerous schemes (`javascript:`, `data:`, etc.) from being stored and\n * later rendered.\n */\nexport function httpUrlOrNull(input: unknown): string | null {\n if (typeof input !== 'string') return null;\n try {\n const url = new URL(input);\n return url.protocol === 'http:' || url.protocol === 'https:' ? input : null;\n } catch {\n return null;\n }\n}\n\nconst DATE_ONLY_RE = /^\\d{4}-\\d{2}-\\d{2}$/;\n\n/**\n * Strict calendar-date validator. Returns `true` for `YYYY-MM-DD` strings\n * that name a real day, rejecting impossible values (`2024-02-30`, `2024-13-01`)\n * by requiring the JavaScript `Date` round-trip to preserve the input.\n */\nexport function isValidDateOnly(input: unknown): boolean {\n if (typeof input !== 'string' || !DATE_ONLY_RE.test(input)) return false;\n const parsed = new Date(`${input}T00:00:00Z`);\n return !Number.isNaN(parsed.getTime()) && parsed.toISOString().startsWith(input);\n}\n\nconst PARTIAL_DATE_RE = /^\\d{4}(-(0[1-9]|1[0-2]))?$/;\n\n/**\n * Partial calendar-date validator. Returns `true` for a year (`YYYY`), a month\n * (`YYYY-MM`, month 01-12), or a real day per {@link isValidDateOnly}. For\n * dates where the exact day is often unknown, such as a past talk session.\n */\nexport function isValidPartialDate(input: unknown): boolean {\n if (typeof input !== 'string') return false;\n return PARTIAL_DATE_RE.test(input) || isValidDateOnly(input);\n}\n\n// ---- shared write-schema fragments used by multiple sections ----\n\n/**\n * Portable org entity identifier (Wikidata / ROR / LEI / sifa.id URI) chosen\n * from the typeahead. Constrained to http(s) so a script-bearing scheme can't\n * be written to the PDS record. Absent for free-text / unlinked records.\n * Shared by the org-bearing sections (position, education, certification,\n * volunteering, course, honor).\n */\nexport const entityRefSchema = z\n .string()\n .url()\n .refine((s) => /^https?:\\/\\//i.test(s), { message: 'entityRef must be an http(s) URL' })\n .max(2048)\n .optional();\n\n/**\n * One proof link on an involvement record (`id.sifa.defs#artifactLink`).\n * Only http(s) URLs are accepted so a dangerous scheme is never written to\n * the PDS.\n */\nexport const artifactLinkSchema = z.object({\n url: z\n .string()\n .max(2048)\n .refine((v) => httpUrlOrNull(v) !== null, 'must be an http(s) URL'),\n kind: z.string().max(64).nullable().optional(),\n label: z.string().max(2000).nullable().optional(),\n});\n\n/**\n * Reference to a record by at-uri, with an optional CID\n * (`id.sifa.defs#externalRecordRef`).\n */\nexport const externalRecordRefSchema = z.object({\n uri: z.string().regex(/^at:\\/\\/[^/\\s]+\\/[^/\\s]+\\/[^/\\s]+$/, 'must be an at-uri'),\n // CIDv0 (`Qm…`) or CIDv1 (base32, `b…`). Loose but rejects arbitrary strings.\n cid: z\n .string()\n .max(256)\n .regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z2-7]+)$/, 'must be a CID')\n .optional(),\n});\n\n/** Link attached to a presentation record. */\nexport const presentationLinkSchema = z.object({\n uri: z\n .string()\n .max(2048)\n .refine((v) => httpUrlOrNull(v) !== null, 'must be an http(s) URL'),\n label: z.string().max(640).nullable().optional(),\n type: z.string().max(256).nullable().optional(),\n});\n"],"mappings":";AAAA,SAAS,SAAS;AAGX,SAAS,aAAa,KAAqB;AAChD,QAAM,UAAU,IAAI,KAAK;AACzB,MAAI,gBAAgB,KAAK,OAAO,EAAG,QAAO;AAC1C,SAAO,WAAW,OAAO;AAC3B;AAWO,IAAM,cAAc,MACzB,EACG,OAAO,EACP,SAAS,EACT,UAAU,CAAC,QAAQ;AAClB,MAAI,CAAC,IAAK,QAAO;AACjB,SAAO,cAAc,GAAG,KAAK;AAC/B,CAAC;AAiBE,IAAM,sBAAsB,EAChC,MAAM;AAAA,EACL,EAAE,OAAO;AAAA,IACP,SAAS,EAAE,OAAO,EAAE,QAAQ;AAAA,IAC5B,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,QAAQ;AAAA,IAC1C,QAAQ,EAAE,OAAO,EAAE,QAAQ;AAAA,IAC3B,MAAM,EAAE,OAAO,EAAE,QAAQ;AAAA,IACzB,UAAU,EAAE,OAAO,EAAE,QAAQ;AAAA,IAC7B,QAAQ,EAAE,OAAO,EAAE,QAAQ;AAAA,IAC3B,YAAY,EAAE,OAAO,EAAE,QAAQ;AAAA,IAC/B,MAAM,EAAE,OAAO,EAAE,QAAQ;AAAA,EAC3B,CAAC;AAAA,EACD,EAAE,OAAO;AACX,CAAC,EACA,SAAS,EACT,SAAS;AAGL,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,KAAK,EAAE,OAAO;AAChB,CAAC;AAWM,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAWO,SAAS,cAAc,OAA+B;AAC3D,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI;AACF,UAAM,MAAM,IAAI,IAAI,KAAK;AACzB,WAAO,IAAI,aAAa,WAAW,IAAI,aAAa,WAAW,QAAQ;AAAA,EACzE,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,IAAM,eAAe;AAOd,SAAS,gBAAgB,OAAyB;AACvD,MAAI,OAAO,UAAU,YAAY,CAAC,aAAa,KAAK,KAAK,EAAG,QAAO;AACnE,QAAM,SAAS,oBAAI,KAAK,GAAG,KAAK,YAAY;AAC5C,SAAO,CAAC,OAAO,MAAM,OAAO,QAAQ,CAAC,KAAK,OAAO,YAAY,EAAE,WAAW,KAAK;AACjF;AAEA,IAAM,kBAAkB;AAOjB,SAAS,mBAAmB,OAAyB;AAC1D,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,SAAO,gBAAgB,KAAK,KAAK,KAAK,gBAAgB,KAAK;AAC7D;
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/write/shared.ts"],"sourcesContent":["import { z } from 'zod';\n\n/** Prepend `https://` if no scheme is present. */\nexport function normalizeUrl(val: string): string {\n const trimmed = val.trim();\n if (/^https?:\\/\\//i.test(trimmed)) return trimmed;\n return `https://${trimmed}`;\n}\n\n/**\n * Accept an http(s) URL string or silently drop it (returns `undefined`).\n * Preserves the write-time policy: bad URLs from imports are dropped, not\n * rejected. A dangerous scheme (`javascript:`, `data:`, ...) parses as a URL, so\n * this drops anything that is not http(s) via {@link httpUrlOrNull} rather than a\n * bare parse check, keeping a script-bearing scheme out of the stored record. All\n * consumers of this schema are web-link fields (project/publication/involvement/\n * certification URLs), so no non-http scheme is legitimate here.\n */\nexport const optionalUrl = () =>\n z\n .string()\n .optional()\n .transform((val) => {\n if (!val) return undefined;\n return httpUrlOrNull(val) ?? undefined;\n });\n\n/**\n * Location shape accepted by the sifa-api write endpoints.\n *\n * Accepts BOTH the legacy shape (`id.sifa.defs#locationAddress`: `countryCode`,\n * `region`, `city`) AND the new community shape\n * (`community.lexicon.location.address`: `country`, `region`, `locality`,\n * `street?`, `postalCode?`, `name?`). The frontend reads location records from\n * the API and echoes them back on save. The API serializer emits explicit `null`\n * for absent fields (not `undefined`), so every field uses `.nullish()`\n * (`string | null | undefined`) instead of `.optional()` (`string | undefined`).\n *\n * `buildPdsLocation` on the server handles conversion to the PDS shape (always\n * emitting the new community shape) and returns `undefined` when neither\n * `country` nor `countryCode` is usable.\n */\nexport const writeLocationSchema = z\n .union([\n z.object({\n country: z.string().nullish(),\n countryCode: z.string().length(2).nullish(),\n region: z.string().nullish(),\n city: z.string().nullish(),\n locality: z.string().nullish(),\n street: z.string().nullish(),\n postalCode: z.string().nullish(),\n name: z.string().nullish(),\n }),\n z.string(),\n ])\n .nullable()\n .optional();\n\n/** Skill reference: a strong ref to a canonical skill record. */\nexport const skillRefSchema = z.object({\n uri: z.string(),\n});\n\n/**\n * Platforms accepted by the external-account write endpoint.\n *\n * NOTE: this list intentionally differs from `PLATFORM_LABELS` in the SDK's\n * `/taxonomy` subpath. `VALID_PLATFORMS` is what sifa-api's `POST /external-accounts`\n * endpoint enforces; `PLATFORM_LABELS` is the display taxonomy used by the profile\n * UI. Reconciling them is a separate follow-up (see #TBD). For now the two are\n * mirrored verbatim from their prior definitions to preserve behavior.\n */\nexport const VALID_PLATFORMS = [\n 'rss',\n 'fediverse',\n 'twitter',\n 'instagram',\n 'github',\n 'codeberg',\n 'gitlab',\n 'forgejo',\n 'gitea',\n 'youtube',\n 'linkedin',\n 'substack',\n 'website',\n 'orcid',\n 'keyoxide',\n 'other',\n] as const;\n\nexport type ValidPlatform = (typeof VALID_PLATFORMS)[number];\n\n// ---- pure sanitization primitives (previously in sifa-api/src/lib/sanitize.ts) ----\n\n/**\n * Returns `input` when it is an http(s) URL string, else `null`. Blocks\n * dangerous schemes (`javascript:`, `data:`, etc.) from being stored and\n * later rendered.\n */\nexport function httpUrlOrNull(input: unknown): string | null {\n if (typeof input !== 'string') return null;\n try {\n const url = new URL(input);\n return url.protocol === 'http:' || url.protocol === 'https:' ? input : null;\n } catch {\n return null;\n }\n}\n\nconst DATE_ONLY_RE = /^\\d{4}-\\d{2}-\\d{2}$/;\n\n/**\n * Strict calendar-date validator. Returns `true` for `YYYY-MM-DD` strings\n * that name a real day, rejecting impossible values (`2024-02-30`, `2024-13-01`)\n * by requiring the JavaScript `Date` round-trip to preserve the input.\n */\nexport function isValidDateOnly(input: unknown): boolean {\n if (typeof input !== 'string' || !DATE_ONLY_RE.test(input)) return false;\n const parsed = new Date(`${input}T00:00:00Z`);\n return !Number.isNaN(parsed.getTime()) && parsed.toISOString().startsWith(input);\n}\n\nconst PARTIAL_DATE_RE = /^\\d{4}(-(0[1-9]|1[0-2]))?$/;\n\n/**\n * Partial calendar-date validator. Returns `true` for a year (`YYYY`), a month\n * (`YYYY-MM`, month 01-12), or a real day per {@link isValidDateOnly}. For\n * dates where the exact day is often unknown, such as a past talk session.\n */\nexport function isValidPartialDate(input: unknown): boolean {\n if (typeof input !== 'string') return false;\n return PARTIAL_DATE_RE.test(input) || isValidDateOnly(input);\n}\n\nconst DATETIME_DAY_RE = /^(\\d{4}-\\d{2}-\\d{2})T\\d{2}:\\d{2}/;\n\n/**\n * Optional, clearable partial-date field (`YYYY`, `YYYY-MM` or `YYYY-MM-DD`,\n * no time) shared by the dated profile sections. `null` clears the date.\n *\n * Older records hold RFC 3339 datetimes and the editor sends a stored value\n * back unchanged, so a datetime is shortened to its calendar day rather than\n * rejected. An empty string stays accepted, as before this field was checked.\n */\nexport const partialDateFieldSchema = z\n .string()\n .transform((v) => DATETIME_DAY_RE.exec(v)?.[1] ?? v)\n .refine(\n (v) => v === '' || isValidPartialDate(v),\n 'must be a valid YYYY, YYYY-MM or YYYY-MM-DD date',\n )\n .nullable()\n .optional();\n\n// ---- shared write-schema fragments used by multiple sections ----\n\n/**\n * Portable org entity identifier (Wikidata / ROR / LEI / sifa.id URI) chosen\n * from the typeahead. Constrained to http(s) so a script-bearing scheme can't\n * be written to the PDS record. Absent for free-text / unlinked records.\n * Shared by the org-bearing sections (position, education, certification,\n * volunteering, course, honor).\n */\nexport const entityRefSchema = z\n .string()\n .url()\n .refine((s) => /^https?:\\/\\//i.test(s), { message: 'entityRef must be an http(s) URL' })\n .max(2048)\n .optional();\n\n/**\n * One proof link on an involvement record (`id.sifa.defs#artifactLink`).\n * Only http(s) URLs are accepted so a dangerous scheme is never written to\n * the PDS.\n */\nexport const artifactLinkSchema = z.object({\n url: z\n .string()\n .max(2048)\n .refine((v) => httpUrlOrNull(v) !== null, 'must be an http(s) URL'),\n kind: z.string().max(64).nullable().optional(),\n label: z.string().max(2000).nullable().optional(),\n});\n\n/**\n * Reference to a record by at-uri, with an optional CID\n * (`id.sifa.defs#externalRecordRef`).\n */\nexport const externalRecordRefSchema = z.object({\n uri: z.string().regex(/^at:\\/\\/[^/\\s]+\\/[^/\\s]+\\/[^/\\s]+$/, 'must be an at-uri'),\n // CIDv0 (`Qm…`) or CIDv1 (base32, `b…`). Loose but rejects arbitrary strings.\n cid: z\n .string()\n .max(256)\n .regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z2-7]+)$/, 'must be a CID')\n .optional(),\n});\n\n/** Link attached to a presentation record. */\nexport const presentationLinkSchema = z.object({\n uri: z\n .string()\n .max(2048)\n .refine((v) => httpUrlOrNull(v) !== null, 'must be an http(s) URL'),\n label: z.string().max(640).nullable().optional(),\n type: z.string().max(256).nullable().optional(),\n});\n"],"mappings":";AAAA,SAAS,SAAS;AAGX,SAAS,aAAa,KAAqB;AAChD,QAAM,UAAU,IAAI,KAAK;AACzB,MAAI,gBAAgB,KAAK,OAAO,EAAG,QAAO;AAC1C,SAAO,WAAW,OAAO;AAC3B;AAWO,IAAM,cAAc,MACzB,EACG,OAAO,EACP,SAAS,EACT,UAAU,CAAC,QAAQ;AAClB,MAAI,CAAC,IAAK,QAAO;AACjB,SAAO,cAAc,GAAG,KAAK;AAC/B,CAAC;AAiBE,IAAM,sBAAsB,EAChC,MAAM;AAAA,EACL,EAAE,OAAO;AAAA,IACP,SAAS,EAAE,OAAO,EAAE,QAAQ;AAAA,IAC5B,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,QAAQ;AAAA,IAC1C,QAAQ,EAAE,OAAO,EAAE,QAAQ;AAAA,IAC3B,MAAM,EAAE,OAAO,EAAE,QAAQ;AAAA,IACzB,UAAU,EAAE,OAAO,EAAE,QAAQ;AAAA,IAC7B,QAAQ,EAAE,OAAO,EAAE,QAAQ;AAAA,IAC3B,YAAY,EAAE,OAAO,EAAE,QAAQ;AAAA,IAC/B,MAAM,EAAE,OAAO,EAAE,QAAQ;AAAA,EAC3B,CAAC;AAAA,EACD,EAAE,OAAO;AACX,CAAC,EACA,SAAS,EACT,SAAS;AAGL,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,KAAK,EAAE,OAAO;AAChB,CAAC;AAWM,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAWO,SAAS,cAAc,OAA+B;AAC3D,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI;AACF,UAAM,MAAM,IAAI,IAAI,KAAK;AACzB,WAAO,IAAI,aAAa,WAAW,IAAI,aAAa,WAAW,QAAQ;AAAA,EACzE,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,IAAM,eAAe;AAOd,SAAS,gBAAgB,OAAyB;AACvD,MAAI,OAAO,UAAU,YAAY,CAAC,aAAa,KAAK,KAAK,EAAG,QAAO;AACnE,QAAM,SAAS,oBAAI,KAAK,GAAG,KAAK,YAAY;AAC5C,SAAO,CAAC,OAAO,MAAM,OAAO,QAAQ,CAAC,KAAK,OAAO,YAAY,EAAE,WAAW,KAAK;AACjF;AAEA,IAAM,kBAAkB;AAOjB,SAAS,mBAAmB,OAAyB;AAC1D,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,SAAO,gBAAgB,KAAK,KAAK,KAAK,gBAAgB,KAAK;AAC7D;AAEA,IAAM,kBAAkB;AAUjB,IAAM,yBAAyB,EACnC,OAAO,EACP,UAAU,CAAC,MAAM,gBAAgB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAClD;AAAA,EACC,CAAC,MAAM,MAAM,MAAM,mBAAmB,CAAC;AAAA,EACvC;AACF,EACC,SAAS,EACT,SAAS;AAWL,IAAM,kBAAkB,EAC5B,OAAO,EACP,IAAI,EACJ,OAAO,CAAC,MAAM,gBAAgB,KAAK,CAAC,GAAG,EAAE,SAAS,mCAAmC,CAAC,EACtF,IAAI,IAAI,EACR,SAAS;AAOL,IAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,KAAK,EACF,OAAO,EACP,IAAI,IAAI,EACR,OAAO,CAAC,MAAM,cAAc,CAAC,MAAM,MAAM,wBAAwB;AAAA,EACpE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS;AAAA,EAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,GAAI,EAAE,SAAS,EAAE,SAAS;AAClD,CAAC;AAMM,IAAM,0BAA0B,EAAE,OAAO;AAAA,EAC9C,KAAK,EAAE,OAAO,EAAE,MAAM,sCAAsC,mBAAmB;AAAA;AAAA,EAE/E,KAAK,EACF,OAAO,EACP,IAAI,GAAG,EACP,MAAM,gDAAgD,eAAe,EACrE,SAAS;AACd,CAAC;AAGM,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,KAAK,EACF,OAAO,EACP,IAAI,IAAI,EACR,OAAO,CAAC,MAAM,cAAc,CAAC,MAAM,MAAM,wBAAwB;AAAA,EACpE,OAAO,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAC/C,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAChD,CAAC;","names":[]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// src/schemas/write/volunteering.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { entityRefSchema } from "./shared.js";
|
|
3
|
+
import { entityRefSchema, partialDateFieldSchema } from "./shared.js";
|
|
4
4
|
var VolunteeringWriteSchema = z.object({
|
|
5
5
|
organization: z.string().min(1).max(256),
|
|
6
6
|
entityRef: entityRefSchema,
|
|
7
7
|
role: z.string().max(256).nullable().optional(),
|
|
8
8
|
cause: z.string().max(256).nullable().optional(),
|
|
9
9
|
description: z.string().max(5e4).nullable().optional(),
|
|
10
|
-
startedAt:
|
|
11
|
-
endedAt:
|
|
10
|
+
startedAt: partialDateFieldSchema,
|
|
11
|
+
endedAt: partialDateFieldSchema
|
|
12
12
|
});
|
|
13
13
|
export {
|
|
14
14
|
VolunteeringWriteSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/write/volunteering.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { entityRefSchema } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.volunteering`. */\nexport const VolunteeringWriteSchema = z.object({\n organization: z.string().min(1).max(256),\n entityRef: entityRefSchema,\n role: z.string().max(256).nullable().optional(),\n cause: z.string().max(256).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n startedAt:
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/write/volunteering.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { entityRefSchema, partialDateFieldSchema } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.volunteering`. */\nexport const VolunteeringWriteSchema = z.object({\n organization: z.string().min(1).max(256),\n entityRef: entityRefSchema,\n role: z.string().max(256).nullable().optional(),\n cause: z.string().max(256).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n startedAt: partialDateFieldSchema,\n endedAt: partialDateFieldSchema,\n});\n\nexport type VolunteeringWriteInput = z.infer<typeof VolunteeringWriteSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,SAAS,iBAAiB,8BAA8B;AAGjD,IAAM,0BAA0B,EAAE,OAAO;AAAA,EAC9C,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACvC,WAAW;AAAA,EACX,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAC9C,OAAO,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAAA,EAC/C,aAAa,EAAE,OAAO,EAAE,IAAI,GAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,WAAW;AAAA,EACX,SAAS;AACX,CAAC;","names":[]}
|
package/dist/testing/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { E as ExportContact } from '../export-contact-D_krcTBH.cjs';
|
|
2
|
-
import { c as Profile } from '../index-
|
|
2
|
+
import { c as Profile } from '../index-BKvI1Bvg.cjs';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import '../verification-providers-
|
|
4
|
+
import '../verification-providers-DQLIOSCK.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Shared test data for the apps built on the SDK.
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { E as ExportContact } from '../export-contact-D_krcTBH.js';
|
|
2
|
-
import { c as Profile } from '../index-
|
|
2
|
+
import { c as Profile } from '../index-BR8LDBo1.js';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import '../verification-providers-
|
|
4
|
+
import '../verification-providers-DQLIOSCK.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Shared test data for the apps built on the SDK.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as PresentationLinkView, b as PdsProviderInfo, Z as SkillSuggestion } from './index-
|
|
2
|
-
import { a as AccountVerification } from './verification-providers-
|
|
1
|
+
import { D as PresentationLinkView, b as PdsProviderInfo, Z as SkillSuggestion } from './index-BKvI1Bvg.cjs';
|
|
2
|
+
import { a as AccountVerification } from './verification-providers-DQLIOSCK.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as PresentationLinkView, b as PdsProviderInfo, Z as SkillSuggestion } from './index-
|
|
2
|
-
import { a as AccountVerification } from './verification-providers-
|
|
1
|
+
import { D as PresentationLinkView, b as PdsProviderInfo, Z as SkillSuggestion } from './index-BR8LDBo1.js';
|
|
2
|
+
import { a as AccountVerification } from './verification-providers-DQLIOSCK.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|