@singi-labs/sifa-sdk 0.12.2 → 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 +125 -1
- package/dist/schemas/write/index.cjs.map +1 -1
- package/dist/schemas/write/index.d.cts +203 -8
- package/dist/schemas/write/index.d.ts +203 -8
- package/dist/schemas/write/index.js +115 -2
- package/dist/schemas/write/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3366,7 +3366,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
|
|
|
3366
3366
|
});
|
|
3367
3367
|
|
|
3368
3368
|
// src/index.ts
|
|
3369
|
-
var SIFA_SDK_VERSION = "0.12.
|
|
3369
|
+
var SIFA_SDK_VERSION = "0.12.3";
|
|
3370
3370
|
|
|
3371
3371
|
exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
|
|
3372
3372
|
exports.ACTIVITY_VISIBILITY_RULES = ACTIVITY_VISIBILITY_RULES;
|
package/dist/index.js
CHANGED
|
@@ -3364,7 +3364,7 @@ var ProfileVolunteeringRecordSchema = z.object({
|
|
|
3364
3364
|
});
|
|
3365
3365
|
|
|
3366
3366
|
// src/index.ts
|
|
3367
|
-
var SIFA_SDK_VERSION = "0.12.
|
|
3367
|
+
var SIFA_SDK_VERSION = "0.12.3";
|
|
3368
3368
|
|
|
3369
3369
|
export { ACTIVITY_TIERS, ACTIVITY_VISIBILITY_RULES, ADULT_CONTENT_LABELS, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, ArtifactLinkSchema, AtmosphereFeedItemSchema, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, DIMENSIONS_MAX_SCORE, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, EndorsementConfirmationRecordSchema, EndorsementRecordSchema, EntityImportSearchResponseSchema, EntityMintDomainResponseSchema, EntityResolveDomainRequestSchema, EntityResolveDomainResponseSchema, EntitySearchResponseSchema, EntitySearchResultSchema, EntitySelectRequestSchema, EntitySelectResponseSchema, FEATURE_FLAGS, FeatureAllowlistEntrySchema, FeedActorSchema, FollowFeedItemSchema, FollowFeedPageSchema, FollowProfilePageSchema, FollowProfileSchema, GraphFollowRecordSchema, INDUSTRY_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, MIN_SKILLS, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PROFILE_INVOLVEMENT_NSID, PUBLISHERS, PresentationDurationSchema, PresentationLinkSchema, ProfileCertificationRecordSchema, ProfileCourseRecordSchema, ProfileEducationRecordSchema, ProfileExternalAccountRecordSchema, ProfileHonorRecordSchema, ProfileInvolvementRecordSchema, ProfileLanguageRecordSchema, ProfilePositionRecordSchema, ProfilePresentationDeliveryRecordSchema, ProfilePresentationRecordSchema, ProfileProjectRecordSchema, ProfilePublicationRecordSchema, ProfileSelfRecordSchema, ProfileSkillRecordSchema, ProfileVolunteeringRecordSchema, PublicationAuthorSchema, SECTION_GROUPS, SECTION_LABELS, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, SifaFeedItemSchema, VERIFICATION_PROVIDERS, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, atUriSchema, categoryForApp, certDateExtractor, cidSchema, classifyEntityRef, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countryCodeToFlag, dateRangeExtractor, datetimeSchema, decodeFeedCursor, dedupeSkills, detectPdsProvider, didSchema, dimensionsFromInputs, durationFromMinutes, encodeFeedCursor, entityDisambiguationLabel, entityResultKey, externalRecordRefSchema, filterHidden, findIndustry, formatCompanyName, formatDateRange, formatDistanceToNow, formatLocation, formatPresentationDuration, formatRelativeTime, formatTimelineDate, getActivityTaxonomyVersion, getActivityTier, getAppCategoryIcon, getAppIdForCollection, getArtifactLinkKindLabel, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getInvolvementKindHeading, getInvolvementKindLabel, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getVerificationProvider, getVisibleSectionIds, getWorkplaceTypeLabel, groupInvolvementByHeading, groupSkillsByCategory, hasAdultContent, hoistPrimary, isAppCategory, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isPseudoEmployer, isSectionPopulated, isValidRgbColor, isVisibleActivityItem, languageTagSchema, lexiconDateExtractor, limitCombiningMarks, looksLikeDomain, makeGraphFollowRecordSchema, maxGraphemes, meetsContrastAA, normalizeCompanyKey, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseIntendedAudiences, parseLocationString, parsePresentationDuration, partialDateSchema, pdsProviderFromApi, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, relativeLuminance, resolveCardHealth, resolveCardUrl, resolveVerifierProvider, rgbToString, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, selfLabelsSchema, singleDateExtractor, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, stripHtmlToText, strongRefSchema, summarizePresentationDeliveries, truncateGraphemes, uriSchema, visibleItems };
|
|
3370
3370
|
//# sourceMappingURL=index.js.map
|
|
@@ -51,9 +51,41 @@ var VALID_PLATFORMS = [
|
|
|
51
51
|
"keyoxide",
|
|
52
52
|
"other"
|
|
53
53
|
];
|
|
54
|
+
function httpUrlOrNull(input) {
|
|
55
|
+
if (typeof input !== "string") return null;
|
|
56
|
+
try {
|
|
57
|
+
const url = new URL(input);
|
|
58
|
+
return url.protocol === "http:" || url.protocol === "https:" ? input : null;
|
|
59
|
+
} catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
var DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
64
|
+
function isValidDateOnly(input) {
|
|
65
|
+
if (typeof input !== "string" || !DATE_ONLY_RE.test(input)) return false;
|
|
66
|
+
const parsed = /* @__PURE__ */ new Date(`${input}T00:00:00Z`);
|
|
67
|
+
return !Number.isNaN(parsed.getTime()) && parsed.toISOString().startsWith(input);
|
|
68
|
+
}
|
|
69
|
+
var entityRefSchema = zod.z.string().url().refine((s) => /^https?:\/\//i.test(s), { message: "entityRef must be an http(s) URL" }).max(2048).optional();
|
|
70
|
+
var artifactLinkSchema = zod.z.object({
|
|
71
|
+
url: zod.z.string().max(2048).refine((v) => httpUrlOrNull(v) !== null, "must be an http(s) URL"),
|
|
72
|
+
kind: zod.z.string().max(64).nullable().optional(),
|
|
73
|
+
label: zod.z.string().max(2e3).nullable().optional()
|
|
74
|
+
});
|
|
75
|
+
var externalRecordRefSchema = zod.z.object({
|
|
76
|
+
uri: zod.z.string().regex(/^at:\/\/[^/\s]+\/[^/\s]+\/[^/\s]+$/, "must be an at-uri"),
|
|
77
|
+
// CIDv0 (`Qm…`) or CIDv1 (base32, `b…`). Loose but rejects arbitrary strings.
|
|
78
|
+
cid: zod.z.string().max(256).regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z2-7]+)$/, "must be a CID").optional()
|
|
79
|
+
});
|
|
80
|
+
var presentationLinkSchema = zod.z.object({
|
|
81
|
+
uri: zod.z.string().max(2048).refine((v) => httpUrlOrNull(v) !== null, "must be an http(s) URL"),
|
|
82
|
+
label: zod.z.string().max(640).nullable().optional(),
|
|
83
|
+
type: zod.z.string().max(256).nullable().optional()
|
|
84
|
+
});
|
|
54
85
|
var CertificationWriteSchema = zod.z.object({
|
|
55
86
|
name: zod.z.string().min(1).max(256),
|
|
56
87
|
authority: zod.z.string().max(256).nullable().optional(),
|
|
88
|
+
entityRef: entityRefSchema,
|
|
57
89
|
credentialId: zod.z.string().max(256).nullable().optional(),
|
|
58
90
|
credentialUrl: optionalUrl(),
|
|
59
91
|
issuedAt: zod.z.string().nullable().optional(),
|
|
@@ -62,10 +94,24 @@ var CertificationWriteSchema = zod.z.object({
|
|
|
62
94
|
var CourseWriteSchema = zod.z.object({
|
|
63
95
|
name: zod.z.string().min(1).max(200),
|
|
64
96
|
number: zod.z.string().max(50).nullable().optional(),
|
|
65
|
-
institution: zod.z.string().max(256).nullable().optional()
|
|
97
|
+
institution: zod.z.string().max(256).nullable().optional(),
|
|
98
|
+
entityRef: entityRefSchema,
|
|
99
|
+
/**
|
|
100
|
+
* at-uri of the linked `id.sifa.profile.certification` record. Structurally
|
|
101
|
+
* validated (`at://authority/collection/rkey`) so a bad value can't be
|
|
102
|
+
* stored and later split into a bogus rkey.
|
|
103
|
+
*/
|
|
104
|
+
credential: zod.z.string().max(512).regex(/^at:\/\/[^/\s]+\/[^/\s]+\/[^/\s]+$/, "must be an at-uri").nullable().optional(),
|
|
105
|
+
/**
|
|
106
|
+
* RFC 3339 datetime the course was completed. The editor collects month
|
|
107
|
+
* granularity (YYYY-MM) and converts to a datetime before the write; stored
|
|
108
|
+
* and passed through as-is, mirroring `certification.issuedAt`.
|
|
109
|
+
*/
|
|
110
|
+
completedAt: zod.z.string().nullable().optional()
|
|
66
111
|
});
|
|
67
112
|
var EducationWriteSchema = zod.z.object({
|
|
68
113
|
institution: zod.z.string().min(1).max(256),
|
|
114
|
+
entityRef: entityRefSchema,
|
|
69
115
|
degree: zod.z.string().max(256).nullable().optional(),
|
|
70
116
|
fieldOfStudy: zod.z.string().max(256).nullable().optional(),
|
|
71
117
|
description: zod.z.string().max(5e4).nullable().optional(),
|
|
@@ -82,15 +128,53 @@ var ExternalAccountWriteSchema = zod.z.object({
|
|
|
82
128
|
var HonorWriteSchema = zod.z.object({
|
|
83
129
|
title: zod.z.string().min(1).max(200),
|
|
84
130
|
issuer: zod.z.string().max(256).nullable().optional(),
|
|
131
|
+
entityRef: entityRefSchema,
|
|
85
132
|
description: zod.z.string().max(5e4).nullable().optional(),
|
|
86
133
|
awardedAt: zod.z.string().nullable().optional()
|
|
87
134
|
});
|
|
135
|
+
var InvolvementWriteSchema = zod.z.object({
|
|
136
|
+
kind: zod.z.string().min(1).max(256),
|
|
137
|
+
upstream: zod.z.string().max(2560).nullable().optional(),
|
|
138
|
+
upstreamDid: zod.z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID").nullable().optional(),
|
|
139
|
+
upstreamUrl: optionalUrl(),
|
|
140
|
+
role: zod.z.string().max(2560).nullable().optional(),
|
|
141
|
+
description: zod.z.string().max(5e4).nullable().optional(),
|
|
142
|
+
// Freeform YYYY / YYYY-MM / YYYY-MM-DD; validated loosely so partial dates pass.
|
|
143
|
+
startedAt: zod.z.string().max(32).nullable().optional(),
|
|
144
|
+
endedAt: zod.z.string().max(32).nullable().optional(),
|
|
145
|
+
links: zod.z.array(artifactLinkSchema).max(50).nullable().optional(),
|
|
146
|
+
entityRef: entityRefSchema,
|
|
147
|
+
location: writeLocationSchema,
|
|
148
|
+
skills: zod.z.array(skillRefSchema).max(50).nullable().optional()
|
|
149
|
+
});
|
|
88
150
|
var LanguageWriteSchema = zod.z.object({
|
|
89
151
|
name: zod.z.string().min(1).max(64),
|
|
90
152
|
proficiency: zod.z.string().max(50).optional()
|
|
91
153
|
});
|
|
154
|
+
var OrgEmploymentAttestationWriteSchema = zod.z.object({
|
|
155
|
+
subject: zod.z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID"),
|
|
156
|
+
position: externalRecordRefSchema,
|
|
157
|
+
status: zod.z.enum(["current", "past"]),
|
|
158
|
+
title: zod.z.string().min(1).max(2560),
|
|
159
|
+
startedAt: zod.z.string().max(32),
|
|
160
|
+
entityRef: zod.z.string().max(2048).nullable().optional(),
|
|
161
|
+
companyDid: zod.z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID").nullable().optional(),
|
|
162
|
+
endedAt: zod.z.string().max(32).nullable().optional(),
|
|
163
|
+
comment: zod.z.string().max(3e3).nullable().optional(),
|
|
164
|
+
createdAt: zod.z.string()
|
|
165
|
+
});
|
|
166
|
+
var OrgProfileWriteSchema = zod.z.object({
|
|
167
|
+
name: zod.z.string().min(1).max(2e3),
|
|
168
|
+
description: zod.z.string().max(5e4).nullable().optional(),
|
|
169
|
+
logo: zod.z.unknown().nullable().optional(),
|
|
170
|
+
website: zod.z.string().max(2048).nullable().optional(),
|
|
171
|
+
entityRefs: zod.z.array(zod.z.string().max(2048)).max(20).nullable().optional(),
|
|
172
|
+
contact: zod.z.string().max(320).nullable().optional(),
|
|
173
|
+
createdAt: zod.z.string()
|
|
174
|
+
});
|
|
92
175
|
var PositionWriteSchema = zod.z.object({
|
|
93
176
|
company: zod.z.string().min(1).max(256).nullable().optional(),
|
|
177
|
+
entityRef: entityRefSchema,
|
|
94
178
|
title: zod.z.string().min(1).max(256),
|
|
95
179
|
description: zod.z.string().max(5e4).nullable().optional(),
|
|
96
180
|
employmentType: zod.z.string().nullable().optional(),
|
|
@@ -100,6 +184,33 @@ var PositionWriteSchema = zod.z.object({
|
|
|
100
184
|
endedAt: zod.z.string().nullable().optional(),
|
|
101
185
|
skills: zod.z.array(skillRefSchema).max(50).nullable().optional()
|
|
102
186
|
});
|
|
187
|
+
var PresentationDeliveryWriteSchema = zod.z.object({
|
|
188
|
+
presentationRef: externalRecordRefSchema.optional(),
|
|
189
|
+
title: zod.z.string().max(3e3).nullable().optional(),
|
|
190
|
+
role: zod.z.string().max(640).nullable().optional(),
|
|
191
|
+
eventName: zod.z.string().max(3e3).nullable().optional(),
|
|
192
|
+
date: zod.z.string().refine(isValidDateOnly, "must be a valid YYYY-MM-DD date").nullable().optional(),
|
|
193
|
+
location: zod.z.string().max(2560).nullable().optional(),
|
|
194
|
+
mode: zod.z.string().max(256).nullable().optional(),
|
|
195
|
+
status: zod.z.string().max(256).nullable().optional(),
|
|
196
|
+
links: zod.z.array(presentationLinkSchema).max(20).optional(),
|
|
197
|
+
eventRef: externalRecordRefSchema.optional(),
|
|
198
|
+
coSpeakers: zod.z.array(zod.z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID")).max(20).optional()
|
|
199
|
+
});
|
|
200
|
+
var PresentationWriteSchema = zod.z.object({
|
|
201
|
+
title: zod.z.string().min(1).max(3e3),
|
|
202
|
+
description: zod.z.string().max(5e4).nullable().optional(),
|
|
203
|
+
duration: zod.z.object({
|
|
204
|
+
minMinutes: zod.z.number().int().min(1),
|
|
205
|
+
maxMinutes: zod.z.number().int().min(1).optional()
|
|
206
|
+
}).refine((d) => d.maxMinutes === void 0 || d.maxMinutes >= d.minMinutes, {
|
|
207
|
+
message: "maxMinutes must be greater than or equal to minMinutes",
|
|
208
|
+
path: ["maxMinutes"]
|
|
209
|
+
}).optional(),
|
|
210
|
+
intendedAudiences: zod.z.array(zod.z.string().max(1e3)).max(20).optional(),
|
|
211
|
+
links: zod.z.array(presentationLinkSchema).max(20).optional(),
|
|
212
|
+
writeupRef: externalRecordRefSchema.optional()
|
|
213
|
+
});
|
|
103
214
|
var ProfileLocationWriteSchema = zod.z.object({
|
|
104
215
|
address: zod.z.object({
|
|
105
216
|
country: zod.z.string().nullish(),
|
|
@@ -143,6 +254,7 @@ var ProjectWriteSchema = zod.z.object({
|
|
|
143
254
|
});
|
|
144
255
|
var PublicationWriteSchema = zod.z.object({
|
|
145
256
|
title: zod.z.string().min(1).max(200),
|
|
257
|
+
subtitle: zod.z.string().max(2e3).nullable().optional(),
|
|
146
258
|
publisher: zod.z.string().max(256).nullable().optional(),
|
|
147
259
|
url: optionalUrl(),
|
|
148
260
|
description: zod.z.string().max(5e4).nullable().optional(),
|
|
@@ -154,6 +266,7 @@ var SkillWriteSchema = zod.z.object({
|
|
|
154
266
|
});
|
|
155
267
|
var VolunteeringWriteSchema = zod.z.object({
|
|
156
268
|
organization: zod.z.string().min(1).max(256),
|
|
269
|
+
entityRef: entityRefSchema,
|
|
157
270
|
role: zod.z.string().max(256).nullable().optional(),
|
|
158
271
|
cause: zod.z.string().max(256).nullable().optional(),
|
|
159
272
|
description: zod.z.string().max(5e4).nullable().optional(),
|
|
@@ -166,8 +279,13 @@ exports.CourseWriteSchema = CourseWriteSchema;
|
|
|
166
279
|
exports.EducationWriteSchema = EducationWriteSchema;
|
|
167
280
|
exports.ExternalAccountWriteSchema = ExternalAccountWriteSchema;
|
|
168
281
|
exports.HonorWriteSchema = HonorWriteSchema;
|
|
282
|
+
exports.InvolvementWriteSchema = InvolvementWriteSchema;
|
|
169
283
|
exports.LanguageWriteSchema = LanguageWriteSchema;
|
|
284
|
+
exports.OrgEmploymentAttestationWriteSchema = OrgEmploymentAttestationWriteSchema;
|
|
285
|
+
exports.OrgProfileWriteSchema = OrgProfileWriteSchema;
|
|
170
286
|
exports.PositionWriteSchema = PositionWriteSchema;
|
|
287
|
+
exports.PresentationDeliveryWriteSchema = PresentationDeliveryWriteSchema;
|
|
288
|
+
exports.PresentationWriteSchema = PresentationWriteSchema;
|
|
171
289
|
exports.ProfileLocationWriteSchema = ProfileLocationWriteSchema;
|
|
172
290
|
exports.ProfileSelfWriteSchema = ProfileSelfWriteSchema;
|
|
173
291
|
exports.ProjectWriteSchema = ProjectWriteSchema;
|
|
@@ -175,8 +293,14 @@ exports.PublicationWriteSchema = PublicationWriteSchema;
|
|
|
175
293
|
exports.SkillWriteSchema = SkillWriteSchema;
|
|
176
294
|
exports.VALID_PLATFORMS = VALID_PLATFORMS;
|
|
177
295
|
exports.VolunteeringWriteSchema = VolunteeringWriteSchema;
|
|
296
|
+
exports.artifactLinkSchema = artifactLinkSchema;
|
|
297
|
+
exports.entityRefSchema = entityRefSchema;
|
|
298
|
+
exports.externalRecordRefSchema = externalRecordRefSchema;
|
|
299
|
+
exports.httpUrlOrNull = httpUrlOrNull;
|
|
300
|
+
exports.isValidDateOnly = isValidDateOnly;
|
|
178
301
|
exports.normalizeUrl = normalizeUrl;
|
|
179
302
|
exports.optionalUrl = optionalUrl;
|
|
303
|
+
exports.presentationLinkSchema = presentationLinkSchema;
|
|
180
304
|
exports.skillRefSchema = skillRefSchema;
|
|
181
305
|
exports.writeLocationSchema = writeLocationSchema;
|
|
182
306
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/write/shared.ts","../../../src/schemas/write/certification.ts","../../../src/schemas/write/course.ts","../../../src/schemas/write/education.ts","../../../src/schemas/write/external-account.ts","../../../src/schemas/write/honor.ts","../../../src/schemas/write/language.ts","../../../src/schemas/write/position.ts","../../../src/schemas/write/profile-location.ts","../../../src/schemas/write/profile-self.ts","../../../src/schemas/write/project.ts","../../../src/schemas/write/publication.ts","../../../src/schemas/write/skill.ts","../../../src/schemas/write/volunteering.ts"],"names":["z"],"mappings":";;;;;AAGO,SAAS,aAAa,GAAA,EAAqB;AAChD,EAAA,MAAM,OAAA,GAAU,IAAI,IAAA,EAAK;AACzB,EAAA,IAAI,eAAA,CAAgB,IAAA,CAAK,OAA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HM,IAAM,uBAAA,GAA0BA,MAAE,MAAA,CAAO;AAAA,EAC9C,YAAA,EAAcA,MAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,GAAG,CAAA;AAAA,EACvC,IAAA,EAAMA,MAAE,MAAA,EAAO,CAAE,IAAI,GAAG,CAAA,CAAE,QAAA,EAAS,CAAE,QAAA,EAAS;AAAA,EAC9C,KAAA,EAAOA,MAAE,MAAA,EAAO,CAAE,IAAI,GAAG,CAAA,CAAE,QAAA,EAAS,CAAE,QAAA,EAAS;AAAA,EAC/C,WAAA,EAAaA,MAAE,MAAA,EAAO,CAAE,IAAI,GAAK,CAAA,CAAE,QAAA,EAAS,CAAE,QAAA,EAAS;AAAA,EACvD,WAAWA,KAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,GAAW,QAAA,EAAS;AAAA,EAC1C,SAASA,KAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,GAAW,QAAA;AACjC,CAAC","file":"index.cjs","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 a URL string or silently drop it if invalid (returns `undefined`).\n * Preserves the write-time policy: bad URLs from imports are dropped, not rejected.\n */\nexport const optionalUrl = () =>\n z\n .string()\n .optional()\n .transform((val) => {\n if (!val) return undefined;\n try {\n new URL(val);\n return val;\n } catch {\n return undefined;\n }\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","import { z } from 'zod';\n\nimport { optionalUrl } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.certification`. */\nexport const CertificationWriteSchema = z.object({\n name: z.string().min(1).max(256),\n authority: z.string().max(256).nullable().optional(),\n credentialId: z.string().max(256).nullable().optional(),\n credentialUrl: optionalUrl(),\n issuedAt: z.string().nullable().optional(),\n expiresAt: z.string().nullable().optional(),\n});\n\nexport type CertificationWriteInput = z.infer<typeof CertificationWriteSchema>;\n","import { z } from 'zod';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.course`. */\nexport const CourseWriteSchema = z.object({\n name: z.string().min(1).max(200),\n number: z.string().max(50).nullable().optional(),\n institution: z.string().max(256).nullable().optional(),\n});\n\nexport type CourseWriteInput = z.infer<typeof CourseWriteSchema>;\n","import { z } from 'zod';\n\n/** Schema enforced by `POST /profile/education` on sifa-api. */\nexport const EducationWriteSchema = z.object({\n institution: z.string().min(1).max(256),\n degree: z.string().max(256).nullable().optional(),\n fieldOfStudy: z.string().max(256).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n activities: z.string().max(1000).nullable().optional(),\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type EducationWriteInput = z.infer<typeof EducationWriteSchema>;\n","import { z } from 'zod';\n\nimport { VALID_PLATFORMS, normalizeUrl } from './shared.js';\n\n/** Schema enforced by `POST /external-accounts` on sifa-api. */\nexport const ExternalAccountWriteSchema = z.object({\n platform: z.enum(VALID_PLATFORMS),\n url: z.string().max(2000).transform(normalizeUrl).pipe(z.string().url()),\n label: z.string().max(100).optional(),\n feedUrl: z.string().max(2000).transform(normalizeUrl).pipe(z.string().url()).optional(),\n});\n\nexport type ExternalAccountWriteInput = z.infer<typeof ExternalAccountWriteSchema>;\n","import { z } from 'zod';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.honor`. */\nexport const HonorWriteSchema = z.object({\n title: z.string().min(1).max(200),\n issuer: z.string().max(256).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n awardedAt: z.string().nullable().optional(),\n});\n\nexport type HonorWriteInput = z.infer<typeof HonorWriteSchema>;\n","import { z } from 'zod';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.language`. */\nexport const LanguageWriteSchema = z.object({\n name: z.string().min(1).max(64),\n proficiency: z.string().max(50).optional(),\n});\n\nexport type LanguageWriteInput = z.infer<typeof LanguageWriteSchema>;\n","import { z } from 'zod';\n\nimport { skillRefSchema, writeLocationSchema } 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 intentionally optional to support freelancer / independent\n * employment types where the position has no employer. The current\n * `sifa-api/src/routes/schemas.ts` requires `company` (`.min(1)`); the\n * sifa-api adoption PR that consumes this schema will therefore be a\n * behavior change that unblocks the freelancer flow. The SDK's lexicon\n * schema (`ProfilePositionRecordSchema`) has treated `company` as optional\n * since sifa-sdk #184.\n */\nexport const PositionWriteSchema = z.object({\n company: z.string().min(1).max(256).nullable().optional(),\n title: z.string().min(1).max(256),\n description: z.string().max(50000).nullable().optional(),\n employmentType: z.string().nullable().optional(),\n workplaceType: z.string().nullable().optional(),\n location: writeLocationSchema,\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n skills: z.array(skillRefSchema).max(50).nullable().optional(),\n});\n\nexport type PositionWriteInput = z.infer<typeof PositionWriteSchema>;\n","import { z } from 'zod';\n\n/**\n * Schema enforced by `POST /profile/locations` on sifa-api.\n *\n * Mirrors the inner object of `writeLocationSchema`: accepts both the community\n * shape (`country`, `locality`) and the legacy shape (`countryCode`, `city`)\n * during the dual-read window. sifa-web #840 switched outbound writes to the\n * community shape; older clients may still send the legacy shape. All address\n * fields are `.nullish()` so explicit `null` from API echoes is accepted\n * (see sifa-api #426).\n *\n * The route handler hands `address` to `buildPdsLocation`, which normalizes\n * either input and enforces alpha-2 on the wire to PDS — returning a 400 with\n * `message: \"address.country (alpha-2) is required\"` when no usable code is\n * present. The schema stays permissive on country length here and lets\n * `buildPdsLocation` be the single enforcement point.\n */\nexport const ProfileLocationWriteSchema = z.object({\n address: 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 type: z.string().min(1),\n label: z.string().max(60).nullable().optional(),\n isPrimary: z.boolean().optional(),\n});\n\nexport type ProfileLocationWriteInput = z.infer<typeof ProfileLocationWriteSchema>;\n","import { z } from 'zod';\n\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 * Grapheme caps (e.g. 64 on given/familyName) are enforced client-side by the\n * SDK's lexicon schema; the write schema only guards the byte-length ceiling.\n */\nexport const ProfileSelfWriteSchema = z\n .object({\n headline: z.string().max(300).optional(),\n about: z.string().max(50000).optional(),\n givenName: z.string().max(640).optional(),\n familyName: z.string().max(640).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 .passthrough();\n\nexport type ProfileSelfWriteInput = z.infer<typeof ProfileSelfWriteSchema>;\n","import { z } from 'zod';\n\nimport { optionalUrl } from './shared.js';\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 description: z.string().max(50000).nullable().optional(),\n url: optionalUrl(),\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type ProjectWriteInput = z.infer<typeof ProjectWriteSchema>;\n","import { z } from 'zod';\n\nimport { optionalUrl } from './shared.js';\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 publisher: z.string().max(256).nullable().optional(),\n url: optionalUrl(),\n description: z.string().max(50000).nullable().optional(),\n publishedAt: z.string().nullable().optional(),\n});\n\nexport type PublicationWriteInput = z.infer<typeof PublicationWriteSchema>;\n","import { z } from 'zod';\n\n/** Schema enforced by `POST /profile/skills` on sifa-api. */\nexport const SkillWriteSchema = z.object({\n name: z.string().min(1).max(100),\n category: z.string().max(100).optional(),\n});\n\nexport type SkillWriteInput = z.infer<typeof SkillWriteSchema>;\n","import { z } from 'zod';\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 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: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type VolunteeringWriteInput = z.infer<typeof VolunteeringWriteSchema>;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/write/shared.ts","../../../src/schemas/write/certification.ts","../../../src/schemas/write/course.ts","../../../src/schemas/write/education.ts","../../../src/schemas/write/external-account.ts","../../../src/schemas/write/honor.ts","../../../src/schemas/write/involvement.ts","../../../src/schemas/write/language.ts","../../../src/schemas/write/org-employment-attestation.ts","../../../src/schemas/write/org-profile.ts","../../../src/schemas/write/position.ts","../../../src/schemas/write/presentation-delivery.ts","../../../src/schemas/write/presentation.ts","../../../src/schemas/write/profile-location.ts","../../../src/schemas/write/profile-self.ts","../../../src/schemas/write/project.ts","../../../src/schemas/write/publication.ts","../../../src/schemas/write/skill.ts","../../../src/schemas/write/volunteering.ts"],"names":["z"],"mappings":";;;;;AAGO,SAAS,aAAa,GAAA,EAAqB;AAChD,EAAA,MAAM,OAAA,GAAU,IAAI,IAAA,EAAK;AACzB,EAAA,IAAI,eAAA,CAAgB,IAAA,CAAK,OAAO,CAAA,EAAG,OAAO,OAAA;AAC1C,EAAA,OAAO,WAAW,OAAO,CAAA,CAAA;AAC3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QAAA;AAChC,CAAC;ACDM,IAAM,uBAAA,GAA0BA,MAAE,MAAA,CAAO;AAAA,EAC9C,YAAA,EAAcA,MAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,GAAG,CAAA;AAAA,EACvC,SAAA,EAAW,eAAA;AAAA,EACX,IAAA,EAAMA,MAAE,MAAA,EAAO,CAAE,IAAI,GAAG,CAAA,CAAE,QAAA,EAAS,CAAE,QAAA,EAAS;AAAA,EAC9C,KAAA,EAAOA,MAAE,MAAA,EAAO,CAAE,IAAI,GAAG,CAAA,CAAE,QAAA,EAAS,CAAE,QAAA,EAAS;AAAA,EAC/C,WAAA,EAAaA,MAAE,MAAA,EAAO,CAAE,IAAI,GAAK,CAAA,CAAE,QAAA,EAAS,CAAE,QAAA,EAAS;AAAA,EACvD,WAAWA,KAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,GAAW,QAAA,EAAS;AAAA,EAC1C,SAASA,KAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,GAAW,QAAA;AACjC,CAAC","file":"index.cjs","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 a URL string or silently drop it if invalid (returns `undefined`).\n * Preserves the write-time policy: bad URLs from imports are dropped, not rejected.\n */\nexport const optionalUrl = () =>\n z\n .string()\n .optional()\n .transform((val) => {\n if (!val) return undefined;\n try {\n new URL(val);\n return val;\n } catch {\n return undefined;\n }\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\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","import { z } from 'zod';\n\nimport { entityRefSchema, optionalUrl } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.certification`. */\nexport const CertificationWriteSchema = z.object({\n name: z.string().min(1).max(256),\n authority: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema,\n credentialId: z.string().max(256).nullable().optional(),\n credentialUrl: optionalUrl(),\n issuedAt: z.string().nullable().optional(),\n expiresAt: z.string().nullable().optional(),\n});\n\nexport type CertificationWriteInput = z.infer<typeof CertificationWriteSchema>;\n","import { z } from 'zod';\n\nimport { entityRefSchema } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.course`. */\nexport const CourseWriteSchema = z.object({\n name: z.string().min(1).max(200),\n number: z.string().max(50).nullable().optional(),\n institution: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema,\n /**\n * at-uri of the linked `id.sifa.profile.certification` record. Structurally\n * validated (`at://authority/collection/rkey`) so a bad value can't be\n * stored and later split into a bogus rkey.\n */\n credential: z\n .string()\n .max(512)\n .regex(/^at:\\/\\/[^/\\s]+\\/[^/\\s]+\\/[^/\\s]+$/, 'must be an at-uri')\n .nullable()\n .optional(),\n /**\n * RFC 3339 datetime the course was completed. The editor collects month\n * granularity (YYYY-MM) and converts to a datetime before the write; stored\n * and passed through as-is, mirroring `certification.issuedAt`.\n */\n completedAt: z.string().nullable().optional(),\n});\n\nexport type CourseWriteInput = z.infer<typeof CourseWriteSchema>;\n","import { z } from 'zod';\n\nimport { entityRefSchema } from './shared.js';\n\n/** Schema enforced by `POST /profile/education` on sifa-api. */\nexport const EducationWriteSchema = z.object({\n institution: z.string().min(1).max(256),\n entityRef: entityRefSchema,\n degree: z.string().max(256).nullable().optional(),\n fieldOfStudy: z.string().max(256).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n activities: z.string().max(1000).nullable().optional(),\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type EducationWriteInput = z.infer<typeof EducationWriteSchema>;\n","import { z } from 'zod';\n\nimport { VALID_PLATFORMS, normalizeUrl } from './shared.js';\n\n/** Schema enforced by `POST /external-accounts` on sifa-api. */\nexport const ExternalAccountWriteSchema = z.object({\n platform: z.enum(VALID_PLATFORMS),\n url: z.string().max(2000).transform(normalizeUrl).pipe(z.string().url()),\n label: z.string().max(100).optional(),\n feedUrl: z.string().max(2000).transform(normalizeUrl).pipe(z.string().url()).optional(),\n});\n\nexport type ExternalAccountWriteInput = z.infer<typeof ExternalAccountWriteSchema>;\n","import { z } from 'zod';\n\nimport { entityRefSchema } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.honor`. */\nexport const HonorWriteSchema = z.object({\n title: z.string().min(1).max(200),\n issuer: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema,\n description: z.string().max(50000).nullable().optional(),\n awardedAt: z.string().nullable().optional(),\n});\n\nexport type HonorWriteInput = z.infer<typeof HonorWriteSchema>;\n","import { z } from 'zod';\n\nimport {\n artifactLinkSchema,\n entityRefSchema,\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 // Freeform YYYY / YYYY-MM / YYYY-MM-DD; validated loosely so partial dates pass.\n startedAt: z.string().max(32).nullable().optional(),\n endedAt: z.string().max(32).nullable().optional(),\n links: z.array(artifactLinkSchema).max(50).nullable().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","import { z } from 'zod';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.language`. */\nexport const LanguageWriteSchema = z.object({\n name: z.string().min(1).max(64),\n proficiency: z.string().max(50).optional(),\n});\n\nexport type LanguageWriteInput = z.infer<typeof LanguageWriteSchema>;\n","import { z } from 'zod';\n\nimport { externalRecordRefSchema } from './shared.js';\n\n/**\n * Schema enforced by the org-employment-attestation write endpoint on sifa-api.\n *\n * An org attests that a Sifa user (`subject`) held a specific `position` record\n * with `title` between `startedAt` and `endedAt` (inclusive of \"current\" status).\n * The attestation itself is signed by the org's DID; `entityRef` / `companyDid`\n * optionally cross-link the org identifier(s) used at the time.\n */\nexport const OrgEmploymentAttestationWriteSchema = z.object({\n subject: z.string().regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID'),\n position: externalRecordRefSchema,\n status: z.enum(['current', 'past']),\n title: z.string().min(1).max(2560),\n startedAt: z.string().max(32),\n entityRef: z.string().max(2048).nullable().optional(),\n companyDid: z\n .string()\n .regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID')\n .nullable()\n .optional(),\n endedAt: z.string().max(32).nullable().optional(),\n comment: z.string().max(3000).nullable().optional(),\n createdAt: z.string(),\n});\n\nexport type OrgEmploymentAttestationWriteInput = z.infer<\n typeof OrgEmploymentAttestationWriteSchema\n>;\n","import { z } from 'zod';\n\n/**\n * Schema enforced by the org-profile write endpoint on sifa-api.\n *\n * Sifa-managed org identity: name + description + contact channel plus\n * `entityRefs` linking the org to portable identifiers (Wikidata / ROR /\n * LEI / sifa.id URI, http(s) enforced elsewhere).\n */\nexport const OrgProfileWriteSchema = z.object({\n name: z.string().min(1).max(2000),\n description: z.string().max(50000).nullable().optional(),\n logo: z.unknown().nullable().optional(),\n website: z.string().max(2048).nullable().optional(),\n entityRefs: z.array(z.string().max(2048)).max(20).nullable().optional(),\n contact: z.string().max(320).nullable().optional(),\n createdAt: z.string(),\n});\n\nexport type OrgProfileWriteInput = z.infer<typeof OrgProfileWriteSchema>;\n","import { z } from 'zod';\n\nimport { entityRefSchema, skillRefSchema, writeLocationSchema } 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 workplaceType: z.string().nullable().optional(),\n location: writeLocationSchema,\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n skills: z.array(skillRefSchema).max(50).nullable().optional(),\n});\n\nexport type PositionWriteInput = z.infer<typeof PositionWriteSchema>;\n","import { z } from 'zod';\n\nimport { externalRecordRefSchema, isValidDateOnly, presentationLinkSchema } from './shared.js';\n\n/**\n * Schema enforced by the generic-record write endpoint for `id.sifa.profile.presentationDelivery`.\n *\n * Records a specific delivery of a presentation (e.g., at a conference).\n * `presentationRef` optionally points at the parent `id.sifa.profile.presentation`\n * record; `eventRef` optionally links a Sifa event record; `coSpeakers` are\n * DIDs of people who delivered alongside the profile owner.\n */\nexport const PresentationDeliveryWriteSchema = z.object({\n presentationRef: externalRecordRefSchema.optional(),\n title: z.string().max(3000).nullable().optional(),\n role: z.string().max(640).nullable().optional(),\n eventName: z.string().max(3000).nullable().optional(),\n date: z.string().refine(isValidDateOnly, 'must be a valid YYYY-MM-DD date').nullable().optional(),\n location: z.string().max(2560).nullable().optional(),\n mode: z.string().max(256).nullable().optional(),\n status: z.string().max(256).nullable().optional(),\n links: z.array(presentationLinkSchema).max(20).optional(),\n eventRef: externalRecordRefSchema.optional(),\n coSpeakers: z\n .array(z.string().regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID'))\n .max(20)\n .optional(),\n});\n\nexport type PresentationDeliveryWriteInput = z.infer<typeof PresentationDeliveryWriteSchema>;\n","import { z } from 'zod';\n\nimport { externalRecordRefSchema, presentationLinkSchema } from './shared.js';\n\n/**\n * Schema enforced by the generic-record write endpoint for `id.sifa.profile.presentation`.\n *\n * Describes a talk / presentation the user can give. `duration` bounds the\n * runtime; `intendedAudiences` names who it's aimed at; `writeupRef` is an\n * optional at-uri pointer to a companion writeup record.\n */\nexport const PresentationWriteSchema = z.object({\n title: z.string().min(1).max(3000),\n description: z.string().max(50000).nullable().optional(),\n duration: z\n .object({\n minMinutes: z.number().int().min(1),\n maxMinutes: z.number().int().min(1).optional(),\n })\n .refine((d) => d.maxMinutes === undefined || d.maxMinutes >= d.minMinutes, {\n message: 'maxMinutes must be greater than or equal to minMinutes',\n path: ['maxMinutes'],\n })\n .optional(),\n intendedAudiences: z.array(z.string().max(1000)).max(20).optional(),\n links: z.array(presentationLinkSchema).max(20).optional(),\n writeupRef: externalRecordRefSchema.optional(),\n});\n\nexport type PresentationWriteInput = z.infer<typeof PresentationWriteSchema>;\n","import { z } from 'zod';\n\n/**\n * Schema enforced by `POST /profile/locations` on sifa-api.\n *\n * Mirrors the inner object of `writeLocationSchema`: accepts both the community\n * shape (`country`, `locality`) and the legacy shape (`countryCode`, `city`)\n * during the dual-read window. sifa-web #840 switched outbound writes to the\n * community shape; older clients may still send the legacy shape. All address\n * fields are `.nullish()` so explicit `null` from API echoes is accepted\n * (see sifa-api #426).\n *\n * The route handler hands `address` to `buildPdsLocation`, which normalizes\n * either input and enforces alpha-2 on the wire to PDS — returning a 400 with\n * `message: \"address.country (alpha-2) is required\"` when no usable code is\n * present. The schema stays permissive on country length here and lets\n * `buildPdsLocation` be the single enforcement point.\n */\nexport const ProfileLocationWriteSchema = z.object({\n address: 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 type: z.string().min(1),\n label: z.string().max(60).nullable().optional(),\n isPrimary: z.boolean().optional(),\n});\n\nexport type ProfileLocationWriteInput = z.infer<typeof ProfileLocationWriteSchema>;\n","import { z } from 'zod';\n\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 * Grapheme caps (e.g. 64 on given/familyName) are enforced client-side by the\n * SDK's lexicon schema; the write schema only guards the byte-length ceiling.\n */\nexport const ProfileSelfWriteSchema = z\n .object({\n headline: z.string().max(300).optional(),\n about: z.string().max(50000).optional(),\n givenName: z.string().max(640).optional(),\n familyName: z.string().max(640).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 .passthrough();\n\nexport type ProfileSelfWriteInput = z.infer<typeof ProfileSelfWriteSchema>;\n","import { z } from 'zod';\n\nimport { optionalUrl } from './shared.js';\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 description: z.string().max(50000).nullable().optional(),\n url: optionalUrl(),\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type ProjectWriteInput = z.infer<typeof ProjectWriteSchema>;\n","import { z } from 'zod';\n\nimport { optionalUrl } from './shared.js';\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: z.string().nullable().optional(),\n});\n\nexport type PublicationWriteInput = z.infer<typeof PublicationWriteSchema>;\n","import { z } from 'zod';\n\n/** Schema enforced by `POST /profile/skills` on sifa-api. */\nexport const SkillWriteSchema = z.object({\n name: z.string().min(1).max(100),\n category: z.string().max(100).optional(),\n});\n\nexport type SkillWriteInput = z.infer<typeof SkillWriteSchema>;\n","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: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type VolunteeringWriteInput = z.infer<typeof VolunteeringWriteSchema>;\n"]}
|
|
@@ -47,11 +47,56 @@ declare const skillRefSchema: z.ZodObject<{
|
|
|
47
47
|
*/
|
|
48
48
|
declare const VALID_PLATFORMS: readonly ["rss", "fediverse", "twitter", "instagram", "github", "codeberg", "gitlab", "forgejo", "gitea", "youtube", "linkedin", "substack", "website", "orcid", "keyoxide", "other"];
|
|
49
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>;
|
|
50
94
|
|
|
51
95
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.certification`. */
|
|
52
96
|
declare const CertificationWriteSchema: z.ZodObject<{
|
|
53
97
|
name: z.ZodString;
|
|
54
98
|
authority: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
55
100
|
credentialId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
101
|
credentialUrl: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
57
102
|
issuedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -64,12 +109,16 @@ declare const CourseWriteSchema: z.ZodObject<{
|
|
|
64
109
|
name: z.ZodString;
|
|
65
110
|
number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
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>>;
|
|
67
115
|
}, z.core.$strip>;
|
|
68
116
|
type CourseWriteInput = z.infer<typeof CourseWriteSchema>;
|
|
69
117
|
|
|
70
118
|
/** Schema enforced by `POST /profile/education` on sifa-api. */
|
|
71
119
|
declare const EducationWriteSchema: z.ZodObject<{
|
|
72
120
|
institution: z.ZodString;
|
|
121
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
73
122
|
degree: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
123
|
fieldOfStudy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
124
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -109,11 +158,51 @@ type ExternalAccountWriteInput = z.infer<typeof ExternalAccountWriteSchema>;
|
|
|
109
158
|
declare const HonorWriteSchema: z.ZodObject<{
|
|
110
159
|
title: z.ZodString;
|
|
111
160
|
issuer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
161
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
112
162
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
113
163
|
awardedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
164
|
}, z.core.$strip>;
|
|
115
165
|
type HonorWriteInput = z.infer<typeof HonorWriteSchema>;
|
|
116
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
|
+
|
|
117
206
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.language`. */
|
|
118
207
|
declare const LanguageWriteSchema: z.ZodObject<{
|
|
119
208
|
name: z.ZodString;
|
|
@@ -121,6 +210,52 @@ declare const LanguageWriteSchema: z.ZodObject<{
|
|
|
121
210
|
}, z.core.$strip>;
|
|
122
211
|
type LanguageWriteInput = z.infer<typeof LanguageWriteSchema>;
|
|
123
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
|
+
|
|
124
259
|
/**
|
|
125
260
|
* Schema enforced by `POST /profile/positions` on sifa-api.
|
|
126
261
|
*
|
|
@@ -129,16 +264,14 @@ type LanguageWriteInput = z.infer<typeof LanguageWriteSchema>;
|
|
|
129
264
|
* round-trip. If it passes here, the API will accept the write modulo
|
|
130
265
|
* transport / auth failures.
|
|
131
266
|
*
|
|
132
|
-
* `company` is
|
|
133
|
-
*
|
|
134
|
-
* `
|
|
135
|
-
* sifa-
|
|
136
|
-
* behavior change that unblocks the freelancer flow. The SDK's lexicon
|
|
137
|
-
* schema (`ProfilePositionRecordSchema`) has treated `company` as optional
|
|
138
|
-
* since sifa-sdk #184.
|
|
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.
|
|
139
271
|
*/
|
|
140
272
|
declare const PositionWriteSchema: z.ZodObject<{
|
|
141
273
|
company: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
274
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
142
275
|
title: z.ZodString;
|
|
143
276
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
277
|
employmentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -161,6 +294,66 @@ declare const PositionWriteSchema: z.ZodObject<{
|
|
|
161
294
|
}, z.core.$strip>;
|
|
162
295
|
type PositionWriteInput = z.infer<typeof PositionWriteSchema>;
|
|
163
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
|
+
|
|
164
357
|
/**
|
|
165
358
|
* Schema enforced by `POST /profile/locations` on sifa-api.
|
|
166
359
|
*
|
|
@@ -246,6 +439,7 @@ type ProjectWriteInput = z.infer<typeof ProjectWriteSchema>;
|
|
|
246
439
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.publication`. */
|
|
247
440
|
declare const PublicationWriteSchema: z.ZodObject<{
|
|
248
441
|
title: z.ZodString;
|
|
442
|
+
subtitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
249
443
|
publisher: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
250
444
|
url: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
251
445
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -263,6 +457,7 @@ type SkillWriteInput = z.infer<typeof SkillWriteSchema>;
|
|
|
263
457
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.volunteering`. */
|
|
264
458
|
declare const VolunteeringWriteSchema: z.ZodObject<{
|
|
265
459
|
organization: z.ZodString;
|
|
460
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
266
461
|
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
267
462
|
cause: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
268
463
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -271,4 +466,4 @@ declare const VolunteeringWriteSchema: z.ZodObject<{
|
|
|
271
466
|
}, z.core.$strip>;
|
|
272
467
|
type VolunteeringWriteInput = z.infer<typeof VolunteeringWriteSchema>;
|
|
273
468
|
|
|
274
|
-
export { type CertificationWriteInput, CertificationWriteSchema, type CourseWriteInput, CourseWriteSchema, type EducationWriteInput, EducationWriteSchema, type ExternalAccountWriteInput, ExternalAccountWriteSchema, type HonorWriteInput, HonorWriteSchema, type LanguageWriteInput, LanguageWriteSchema, type PositionWriteInput, PositionWriteSchema, type ProfileLocationWriteInput, ProfileLocationWriteSchema, type ProfileSelfWriteInput, ProfileSelfWriteSchema, type ProjectWriteInput, ProjectWriteSchema, type PublicationWriteInput, PublicationWriteSchema, type SkillWriteInput, SkillWriteSchema, VALID_PLATFORMS, type ValidPlatform, type VolunteeringWriteInput, VolunteeringWriteSchema, normalizeUrl, optionalUrl, skillRefSchema, writeLocationSchema };
|
|
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 };
|
|
@@ -47,11 +47,56 @@ declare const skillRefSchema: z.ZodObject<{
|
|
|
47
47
|
*/
|
|
48
48
|
declare const VALID_PLATFORMS: readonly ["rss", "fediverse", "twitter", "instagram", "github", "codeberg", "gitlab", "forgejo", "gitea", "youtube", "linkedin", "substack", "website", "orcid", "keyoxide", "other"];
|
|
49
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>;
|
|
50
94
|
|
|
51
95
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.certification`. */
|
|
52
96
|
declare const CertificationWriteSchema: z.ZodObject<{
|
|
53
97
|
name: z.ZodString;
|
|
54
98
|
authority: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
55
100
|
credentialId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
101
|
credentialUrl: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
57
102
|
issuedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -64,12 +109,16 @@ declare const CourseWriteSchema: z.ZodObject<{
|
|
|
64
109
|
name: z.ZodString;
|
|
65
110
|
number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
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>>;
|
|
67
115
|
}, z.core.$strip>;
|
|
68
116
|
type CourseWriteInput = z.infer<typeof CourseWriteSchema>;
|
|
69
117
|
|
|
70
118
|
/** Schema enforced by `POST /profile/education` on sifa-api. */
|
|
71
119
|
declare const EducationWriteSchema: z.ZodObject<{
|
|
72
120
|
institution: z.ZodString;
|
|
121
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
73
122
|
degree: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
123
|
fieldOfStudy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
124
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -109,11 +158,51 @@ type ExternalAccountWriteInput = z.infer<typeof ExternalAccountWriteSchema>;
|
|
|
109
158
|
declare const HonorWriteSchema: z.ZodObject<{
|
|
110
159
|
title: z.ZodString;
|
|
111
160
|
issuer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
161
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
112
162
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
113
163
|
awardedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
164
|
}, z.core.$strip>;
|
|
115
165
|
type HonorWriteInput = z.infer<typeof HonorWriteSchema>;
|
|
116
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
|
+
|
|
117
206
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.language`. */
|
|
118
207
|
declare const LanguageWriteSchema: z.ZodObject<{
|
|
119
208
|
name: z.ZodString;
|
|
@@ -121,6 +210,52 @@ declare const LanguageWriteSchema: z.ZodObject<{
|
|
|
121
210
|
}, z.core.$strip>;
|
|
122
211
|
type LanguageWriteInput = z.infer<typeof LanguageWriteSchema>;
|
|
123
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
|
+
|
|
124
259
|
/**
|
|
125
260
|
* Schema enforced by `POST /profile/positions` on sifa-api.
|
|
126
261
|
*
|
|
@@ -129,16 +264,14 @@ type LanguageWriteInput = z.infer<typeof LanguageWriteSchema>;
|
|
|
129
264
|
* round-trip. If it passes here, the API will accept the write modulo
|
|
130
265
|
* transport / auth failures.
|
|
131
266
|
*
|
|
132
|
-
* `company` is
|
|
133
|
-
*
|
|
134
|
-
* `
|
|
135
|
-
* sifa-
|
|
136
|
-
* behavior change that unblocks the freelancer flow. The SDK's lexicon
|
|
137
|
-
* schema (`ProfilePositionRecordSchema`) has treated `company` as optional
|
|
138
|
-
* since sifa-sdk #184.
|
|
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.
|
|
139
271
|
*/
|
|
140
272
|
declare const PositionWriteSchema: z.ZodObject<{
|
|
141
273
|
company: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
274
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
142
275
|
title: z.ZodString;
|
|
143
276
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
277
|
employmentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -161,6 +294,66 @@ declare const PositionWriteSchema: z.ZodObject<{
|
|
|
161
294
|
}, z.core.$strip>;
|
|
162
295
|
type PositionWriteInput = z.infer<typeof PositionWriteSchema>;
|
|
163
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
|
+
|
|
164
357
|
/**
|
|
165
358
|
* Schema enforced by `POST /profile/locations` on sifa-api.
|
|
166
359
|
*
|
|
@@ -246,6 +439,7 @@ type ProjectWriteInput = z.infer<typeof ProjectWriteSchema>;
|
|
|
246
439
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.publication`. */
|
|
247
440
|
declare const PublicationWriteSchema: z.ZodObject<{
|
|
248
441
|
title: z.ZodString;
|
|
442
|
+
subtitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
249
443
|
publisher: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
250
444
|
url: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
251
445
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -263,6 +457,7 @@ type SkillWriteInput = z.infer<typeof SkillWriteSchema>;
|
|
|
263
457
|
/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.volunteering`. */
|
|
264
458
|
declare const VolunteeringWriteSchema: z.ZodObject<{
|
|
265
459
|
organization: z.ZodString;
|
|
460
|
+
entityRef: z.ZodOptional<z.ZodString>;
|
|
266
461
|
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
267
462
|
cause: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
268
463
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -271,4 +466,4 @@ declare const VolunteeringWriteSchema: z.ZodObject<{
|
|
|
271
466
|
}, z.core.$strip>;
|
|
272
467
|
type VolunteeringWriteInput = z.infer<typeof VolunteeringWriteSchema>;
|
|
273
468
|
|
|
274
|
-
export { type CertificationWriteInput, CertificationWriteSchema, type CourseWriteInput, CourseWriteSchema, type EducationWriteInput, EducationWriteSchema, type ExternalAccountWriteInput, ExternalAccountWriteSchema, type HonorWriteInput, HonorWriteSchema, type LanguageWriteInput, LanguageWriteSchema, type PositionWriteInput, PositionWriteSchema, type ProfileLocationWriteInput, ProfileLocationWriteSchema, type ProfileSelfWriteInput, ProfileSelfWriteSchema, type ProjectWriteInput, ProjectWriteSchema, type PublicationWriteInput, PublicationWriteSchema, type SkillWriteInput, SkillWriteSchema, VALID_PLATFORMS, type ValidPlatform, type VolunteeringWriteInput, VolunteeringWriteSchema, normalizeUrl, optionalUrl, skillRefSchema, writeLocationSchema };
|
|
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 };
|
|
@@ -49,9 +49,41 @@ var VALID_PLATFORMS = [
|
|
|
49
49
|
"keyoxide",
|
|
50
50
|
"other"
|
|
51
51
|
];
|
|
52
|
+
function httpUrlOrNull(input) {
|
|
53
|
+
if (typeof input !== "string") return null;
|
|
54
|
+
try {
|
|
55
|
+
const url = new URL(input);
|
|
56
|
+
return url.protocol === "http:" || url.protocol === "https:" ? input : null;
|
|
57
|
+
} catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
var DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
62
|
+
function isValidDateOnly(input) {
|
|
63
|
+
if (typeof input !== "string" || !DATE_ONLY_RE.test(input)) return false;
|
|
64
|
+
const parsed = /* @__PURE__ */ new Date(`${input}T00:00:00Z`);
|
|
65
|
+
return !Number.isNaN(parsed.getTime()) && parsed.toISOString().startsWith(input);
|
|
66
|
+
}
|
|
67
|
+
var entityRefSchema = z.string().url().refine((s) => /^https?:\/\//i.test(s), { message: "entityRef must be an http(s) URL" }).max(2048).optional();
|
|
68
|
+
var artifactLinkSchema = z.object({
|
|
69
|
+
url: z.string().max(2048).refine((v) => httpUrlOrNull(v) !== null, "must be an http(s) URL"),
|
|
70
|
+
kind: z.string().max(64).nullable().optional(),
|
|
71
|
+
label: z.string().max(2e3).nullable().optional()
|
|
72
|
+
});
|
|
73
|
+
var externalRecordRefSchema = z.object({
|
|
74
|
+
uri: z.string().regex(/^at:\/\/[^/\s]+\/[^/\s]+\/[^/\s]+$/, "must be an at-uri"),
|
|
75
|
+
// CIDv0 (`Qm…`) or CIDv1 (base32, `b…`). Loose but rejects arbitrary strings.
|
|
76
|
+
cid: z.string().max(256).regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z2-7]+)$/, "must be a CID").optional()
|
|
77
|
+
});
|
|
78
|
+
var presentationLinkSchema = z.object({
|
|
79
|
+
uri: z.string().max(2048).refine((v) => httpUrlOrNull(v) !== null, "must be an http(s) URL"),
|
|
80
|
+
label: z.string().max(640).nullable().optional(),
|
|
81
|
+
type: z.string().max(256).nullable().optional()
|
|
82
|
+
});
|
|
52
83
|
var CertificationWriteSchema = z.object({
|
|
53
84
|
name: z.string().min(1).max(256),
|
|
54
85
|
authority: z.string().max(256).nullable().optional(),
|
|
86
|
+
entityRef: entityRefSchema,
|
|
55
87
|
credentialId: z.string().max(256).nullable().optional(),
|
|
56
88
|
credentialUrl: optionalUrl(),
|
|
57
89
|
issuedAt: z.string().nullable().optional(),
|
|
@@ -60,10 +92,24 @@ var CertificationWriteSchema = z.object({
|
|
|
60
92
|
var CourseWriteSchema = z.object({
|
|
61
93
|
name: z.string().min(1).max(200),
|
|
62
94
|
number: z.string().max(50).nullable().optional(),
|
|
63
|
-
institution: z.string().max(256).nullable().optional()
|
|
95
|
+
institution: z.string().max(256).nullable().optional(),
|
|
96
|
+
entityRef: entityRefSchema,
|
|
97
|
+
/**
|
|
98
|
+
* at-uri of the linked `id.sifa.profile.certification` record. Structurally
|
|
99
|
+
* validated (`at://authority/collection/rkey`) so a bad value can't be
|
|
100
|
+
* stored and later split into a bogus rkey.
|
|
101
|
+
*/
|
|
102
|
+
credential: z.string().max(512).regex(/^at:\/\/[^/\s]+\/[^/\s]+\/[^/\s]+$/, "must be an at-uri").nullable().optional(),
|
|
103
|
+
/**
|
|
104
|
+
* RFC 3339 datetime the course was completed. The editor collects month
|
|
105
|
+
* granularity (YYYY-MM) and converts to a datetime before the write; stored
|
|
106
|
+
* and passed through as-is, mirroring `certification.issuedAt`.
|
|
107
|
+
*/
|
|
108
|
+
completedAt: z.string().nullable().optional()
|
|
64
109
|
});
|
|
65
110
|
var EducationWriteSchema = z.object({
|
|
66
111
|
institution: z.string().min(1).max(256),
|
|
112
|
+
entityRef: entityRefSchema,
|
|
67
113
|
degree: z.string().max(256).nullable().optional(),
|
|
68
114
|
fieldOfStudy: z.string().max(256).nullable().optional(),
|
|
69
115
|
description: z.string().max(5e4).nullable().optional(),
|
|
@@ -80,15 +126,53 @@ var ExternalAccountWriteSchema = z.object({
|
|
|
80
126
|
var HonorWriteSchema = z.object({
|
|
81
127
|
title: z.string().min(1).max(200),
|
|
82
128
|
issuer: z.string().max(256).nullable().optional(),
|
|
129
|
+
entityRef: entityRefSchema,
|
|
83
130
|
description: z.string().max(5e4).nullable().optional(),
|
|
84
131
|
awardedAt: z.string().nullable().optional()
|
|
85
132
|
});
|
|
133
|
+
var InvolvementWriteSchema = z.object({
|
|
134
|
+
kind: z.string().min(1).max(256),
|
|
135
|
+
upstream: z.string().max(2560).nullable().optional(),
|
|
136
|
+
upstreamDid: z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID").nullable().optional(),
|
|
137
|
+
upstreamUrl: optionalUrl(),
|
|
138
|
+
role: z.string().max(2560).nullable().optional(),
|
|
139
|
+
description: z.string().max(5e4).nullable().optional(),
|
|
140
|
+
// Freeform YYYY / YYYY-MM / YYYY-MM-DD; validated loosely so partial dates pass.
|
|
141
|
+
startedAt: z.string().max(32).nullable().optional(),
|
|
142
|
+
endedAt: z.string().max(32).nullable().optional(),
|
|
143
|
+
links: z.array(artifactLinkSchema).max(50).nullable().optional(),
|
|
144
|
+
entityRef: entityRefSchema,
|
|
145
|
+
location: writeLocationSchema,
|
|
146
|
+
skills: z.array(skillRefSchema).max(50).nullable().optional()
|
|
147
|
+
});
|
|
86
148
|
var LanguageWriteSchema = z.object({
|
|
87
149
|
name: z.string().min(1).max(64),
|
|
88
150
|
proficiency: z.string().max(50).optional()
|
|
89
151
|
});
|
|
152
|
+
var OrgEmploymentAttestationWriteSchema = z.object({
|
|
153
|
+
subject: z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID"),
|
|
154
|
+
position: externalRecordRefSchema,
|
|
155
|
+
status: z.enum(["current", "past"]),
|
|
156
|
+
title: z.string().min(1).max(2560),
|
|
157
|
+
startedAt: z.string().max(32),
|
|
158
|
+
entityRef: z.string().max(2048).nullable().optional(),
|
|
159
|
+
companyDid: z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID").nullable().optional(),
|
|
160
|
+
endedAt: z.string().max(32).nullable().optional(),
|
|
161
|
+
comment: z.string().max(3e3).nullable().optional(),
|
|
162
|
+
createdAt: z.string()
|
|
163
|
+
});
|
|
164
|
+
var OrgProfileWriteSchema = z.object({
|
|
165
|
+
name: z.string().min(1).max(2e3),
|
|
166
|
+
description: z.string().max(5e4).nullable().optional(),
|
|
167
|
+
logo: z.unknown().nullable().optional(),
|
|
168
|
+
website: z.string().max(2048).nullable().optional(),
|
|
169
|
+
entityRefs: z.array(z.string().max(2048)).max(20).nullable().optional(),
|
|
170
|
+
contact: z.string().max(320).nullable().optional(),
|
|
171
|
+
createdAt: z.string()
|
|
172
|
+
});
|
|
90
173
|
var PositionWriteSchema = z.object({
|
|
91
174
|
company: z.string().min(1).max(256).nullable().optional(),
|
|
175
|
+
entityRef: entityRefSchema,
|
|
92
176
|
title: z.string().min(1).max(256),
|
|
93
177
|
description: z.string().max(5e4).nullable().optional(),
|
|
94
178
|
employmentType: z.string().nullable().optional(),
|
|
@@ -98,6 +182,33 @@ var PositionWriteSchema = z.object({
|
|
|
98
182
|
endedAt: z.string().nullable().optional(),
|
|
99
183
|
skills: z.array(skillRefSchema).max(50).nullable().optional()
|
|
100
184
|
});
|
|
185
|
+
var PresentationDeliveryWriteSchema = z.object({
|
|
186
|
+
presentationRef: externalRecordRefSchema.optional(),
|
|
187
|
+
title: z.string().max(3e3).nullable().optional(),
|
|
188
|
+
role: z.string().max(640).nullable().optional(),
|
|
189
|
+
eventName: z.string().max(3e3).nullable().optional(),
|
|
190
|
+
date: z.string().refine(isValidDateOnly, "must be a valid YYYY-MM-DD date").nullable().optional(),
|
|
191
|
+
location: z.string().max(2560).nullable().optional(),
|
|
192
|
+
mode: z.string().max(256).nullable().optional(),
|
|
193
|
+
status: z.string().max(256).nullable().optional(),
|
|
194
|
+
links: z.array(presentationLinkSchema).max(20).optional(),
|
|
195
|
+
eventRef: externalRecordRefSchema.optional(),
|
|
196
|
+
coSpeakers: z.array(z.string().regex(/^did:[a-z]+:[^\s]+$/, "must be a DID")).max(20).optional()
|
|
197
|
+
});
|
|
198
|
+
var PresentationWriteSchema = z.object({
|
|
199
|
+
title: z.string().min(1).max(3e3),
|
|
200
|
+
description: z.string().max(5e4).nullable().optional(),
|
|
201
|
+
duration: z.object({
|
|
202
|
+
minMinutes: z.number().int().min(1),
|
|
203
|
+
maxMinutes: z.number().int().min(1).optional()
|
|
204
|
+
}).refine((d) => d.maxMinutes === void 0 || d.maxMinutes >= d.minMinutes, {
|
|
205
|
+
message: "maxMinutes must be greater than or equal to minMinutes",
|
|
206
|
+
path: ["maxMinutes"]
|
|
207
|
+
}).optional(),
|
|
208
|
+
intendedAudiences: z.array(z.string().max(1e3)).max(20).optional(),
|
|
209
|
+
links: z.array(presentationLinkSchema).max(20).optional(),
|
|
210
|
+
writeupRef: externalRecordRefSchema.optional()
|
|
211
|
+
});
|
|
101
212
|
var ProfileLocationWriteSchema = z.object({
|
|
102
213
|
address: z.object({
|
|
103
214
|
country: z.string().nullish(),
|
|
@@ -141,6 +252,7 @@ var ProjectWriteSchema = z.object({
|
|
|
141
252
|
});
|
|
142
253
|
var PublicationWriteSchema = z.object({
|
|
143
254
|
title: z.string().min(1).max(200),
|
|
255
|
+
subtitle: z.string().max(2e3).nullable().optional(),
|
|
144
256
|
publisher: z.string().max(256).nullable().optional(),
|
|
145
257
|
url: optionalUrl(),
|
|
146
258
|
description: z.string().max(5e4).nullable().optional(),
|
|
@@ -152,6 +264,7 @@ var SkillWriteSchema = z.object({
|
|
|
152
264
|
});
|
|
153
265
|
var VolunteeringWriteSchema = z.object({
|
|
154
266
|
organization: z.string().min(1).max(256),
|
|
267
|
+
entityRef: entityRefSchema,
|
|
155
268
|
role: z.string().max(256).nullable().optional(),
|
|
156
269
|
cause: z.string().max(256).nullable().optional(),
|
|
157
270
|
description: z.string().max(5e4).nullable().optional(),
|
|
@@ -159,6 +272,6 @@ var VolunteeringWriteSchema = z.object({
|
|
|
159
272
|
endedAt: z.string().nullable().optional()
|
|
160
273
|
});
|
|
161
274
|
|
|
162
|
-
export { CertificationWriteSchema, CourseWriteSchema, EducationWriteSchema, ExternalAccountWriteSchema, HonorWriteSchema, LanguageWriteSchema, PositionWriteSchema, ProfileLocationWriteSchema, ProfileSelfWriteSchema, ProjectWriteSchema, PublicationWriteSchema, SkillWriteSchema, VALID_PLATFORMS, VolunteeringWriteSchema, normalizeUrl, optionalUrl, skillRefSchema, writeLocationSchema };
|
|
275
|
+
export { CertificationWriteSchema, CourseWriteSchema, EducationWriteSchema, ExternalAccountWriteSchema, HonorWriteSchema, InvolvementWriteSchema, LanguageWriteSchema, OrgEmploymentAttestationWriteSchema, OrgProfileWriteSchema, PositionWriteSchema, PresentationDeliveryWriteSchema, PresentationWriteSchema, ProfileLocationWriteSchema, ProfileSelfWriteSchema, ProjectWriteSchema, PublicationWriteSchema, SkillWriteSchema, VALID_PLATFORMS, VolunteeringWriteSchema, artifactLinkSchema, entityRefSchema, externalRecordRefSchema, httpUrlOrNull, isValidDateOnly, normalizeUrl, optionalUrl, presentationLinkSchema, skillRefSchema, writeLocationSchema };
|
|
163
276
|
//# sourceMappingURL=index.js.map
|
|
164
277
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/write/shared.ts","../../../src/schemas/write/certification.ts","../../../src/schemas/write/course.ts","../../../src/schemas/write/education.ts","../../../src/schemas/write/external-account.ts","../../../src/schemas/write/honor.ts","../../../src/schemas/write/language.ts","../../../src/schemas/write/position.ts","../../../src/schemas/write/profile-location.ts","../../../src/schemas/write/profile-self.ts","../../../src/schemas/write/project.ts","../../../src/schemas/write/publication.ts","../../../src/schemas/write/skill.ts","../../../src/schemas/write/volunteering.ts"],"names":["z"],"mappings":";;;AAGO,SAAS,aAAa,GAAA,EAAqB;AAChD,EAAA,MAAM,OAAA,GAAU,IAAI,IAAA,EAAK;AACzB,EAAA,IAAI,eAAA,CAAgB,IAAA,CAAK,OAAO,CAAA,EAAG,OAAO,OAAA;AAC1C,EAAA,OAAO,WAAW,OAAO,CAAA,CAAA;AAC3B;AAMO,IAAM,WAAA,GAAc,MACzB,CAAA,CACG,MAAA,GACA,QAAA,EAAS,CACT,SAAA,CAAU,CAAC,GAAA,KAAQ;AAClB,EAAA,IAAI,CAAC,KAAK,OAAO,MAAA;AACjB,EAAA,IAAI;AACF,IAAA,IAAI,IAAI,GAAG,CAAA;AACX,IAAA,OAAO,GAAA;AAAA,EACT,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,MAAA;AAAA,EACT;AACF,CAAC;AAiBE,IAAM,mBAAA,GAAsB,EAChC,KAAA,CAAM;AAAA,EACL,EAAE,MAAA,CAAO;AAAA,IACP,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE,OAAA,EAAQ;AAAA,I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AC1C,SAASA,CAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,GAAW,QAAA;AACjC,CAAC","file":"index.js","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 a URL string or silently drop it if invalid (returns `undefined`).\n * Preserves the write-time policy: bad URLs from imports are dropped, not rejected.\n */\nexport const optionalUrl = () =>\n z\n .string()\n .optional()\n .transform((val) => {\n if (!val) return undefined;\n try {\n new URL(val);\n return val;\n } catch {\n return undefined;\n }\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","import { z } from 'zod';\n\nimport { optionalUrl } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.certification`. */\nexport const CertificationWriteSchema = z.object({\n name: z.string().min(1).max(256),\n authority: z.string().max(256).nullable().optional(),\n credentialId: z.string().max(256).nullable().optional(),\n credentialUrl: optionalUrl(),\n issuedAt: z.string().nullable().optional(),\n expiresAt: z.string().nullable().optional(),\n});\n\nexport type CertificationWriteInput = z.infer<typeof CertificationWriteSchema>;\n","import { z } from 'zod';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.course`. */\nexport const CourseWriteSchema = z.object({\n name: z.string().min(1).max(200),\n number: z.string().max(50).nullable().optional(),\n institution: z.string().max(256).nullable().optional(),\n});\n\nexport type CourseWriteInput = z.infer<typeof CourseWriteSchema>;\n","import { z } from 'zod';\n\n/** Schema enforced by `POST /profile/education` on sifa-api. */\nexport const EducationWriteSchema = z.object({\n institution: z.string().min(1).max(256),\n degree: z.string().max(256).nullable().optional(),\n fieldOfStudy: z.string().max(256).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n activities: z.string().max(1000).nullable().optional(),\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type EducationWriteInput = z.infer<typeof EducationWriteSchema>;\n","import { z } from 'zod';\n\nimport { VALID_PLATFORMS, normalizeUrl } from './shared.js';\n\n/** Schema enforced by `POST /external-accounts` on sifa-api. */\nexport const ExternalAccountWriteSchema = z.object({\n platform: z.enum(VALID_PLATFORMS),\n url: z.string().max(2000).transform(normalizeUrl).pipe(z.string().url()),\n label: z.string().max(100).optional(),\n feedUrl: z.string().max(2000).transform(normalizeUrl).pipe(z.string().url()).optional(),\n});\n\nexport type ExternalAccountWriteInput = z.infer<typeof ExternalAccountWriteSchema>;\n","import { z } from 'zod';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.honor`. */\nexport const HonorWriteSchema = z.object({\n title: z.string().min(1).max(200),\n issuer: z.string().max(256).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n awardedAt: z.string().nullable().optional(),\n});\n\nexport type HonorWriteInput = z.infer<typeof HonorWriteSchema>;\n","import { z } from 'zod';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.language`. */\nexport const LanguageWriteSchema = z.object({\n name: z.string().min(1).max(64),\n proficiency: z.string().max(50).optional(),\n});\n\nexport type LanguageWriteInput = z.infer<typeof LanguageWriteSchema>;\n","import { z } from 'zod';\n\nimport { skillRefSchema, writeLocationSchema } 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 intentionally optional to support freelancer / independent\n * employment types where the position has no employer. The current\n * `sifa-api/src/routes/schemas.ts` requires `company` (`.min(1)`); the\n * sifa-api adoption PR that consumes this schema will therefore be a\n * behavior change that unblocks the freelancer flow. The SDK's lexicon\n * schema (`ProfilePositionRecordSchema`) has treated `company` as optional\n * since sifa-sdk #184.\n */\nexport const PositionWriteSchema = z.object({\n company: z.string().min(1).max(256).nullable().optional(),\n title: z.string().min(1).max(256),\n description: z.string().max(50000).nullable().optional(),\n employmentType: z.string().nullable().optional(),\n workplaceType: z.string().nullable().optional(),\n location: writeLocationSchema,\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n skills: z.array(skillRefSchema).max(50).nullable().optional(),\n});\n\nexport type PositionWriteInput = z.infer<typeof PositionWriteSchema>;\n","import { z } from 'zod';\n\n/**\n * Schema enforced by `POST /profile/locations` on sifa-api.\n *\n * Mirrors the inner object of `writeLocationSchema`: accepts both the community\n * shape (`country`, `locality`) and the legacy shape (`countryCode`, `city`)\n * during the dual-read window. sifa-web #840 switched outbound writes to the\n * community shape; older clients may still send the legacy shape. All address\n * fields are `.nullish()` so explicit `null` from API echoes is accepted\n * (see sifa-api #426).\n *\n * The route handler hands `address` to `buildPdsLocation`, which normalizes\n * either input and enforces alpha-2 on the wire to PDS — returning a 400 with\n * `message: \"address.country (alpha-2) is required\"` when no usable code is\n * present. The schema stays permissive on country length here and lets\n * `buildPdsLocation` be the single enforcement point.\n */\nexport const ProfileLocationWriteSchema = z.object({\n address: 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 type: z.string().min(1),\n label: z.string().max(60).nullable().optional(),\n isPrimary: z.boolean().optional(),\n});\n\nexport type ProfileLocationWriteInput = z.infer<typeof ProfileLocationWriteSchema>;\n","import { z } from 'zod';\n\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 * Grapheme caps (e.g. 64 on given/familyName) are enforced client-side by the\n * SDK's lexicon schema; the write schema only guards the byte-length ceiling.\n */\nexport const ProfileSelfWriteSchema = z\n .object({\n headline: z.string().max(300).optional(),\n about: z.string().max(50000).optional(),\n givenName: z.string().max(640).optional(),\n familyName: z.string().max(640).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 .passthrough();\n\nexport type ProfileSelfWriteInput = z.infer<typeof ProfileSelfWriteSchema>;\n","import { z } from 'zod';\n\nimport { optionalUrl } from './shared.js';\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 description: z.string().max(50000).nullable().optional(),\n url: optionalUrl(),\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type ProjectWriteInput = z.infer<typeof ProjectWriteSchema>;\n","import { z } from 'zod';\n\nimport { optionalUrl } from './shared.js';\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 publisher: z.string().max(256).nullable().optional(),\n url: optionalUrl(),\n description: z.string().max(50000).nullable().optional(),\n publishedAt: z.string().nullable().optional(),\n});\n\nexport type PublicationWriteInput = z.infer<typeof PublicationWriteSchema>;\n","import { z } from 'zod';\n\n/** Schema enforced by `POST /profile/skills` on sifa-api. */\nexport const SkillWriteSchema = z.object({\n name: z.string().min(1).max(100),\n category: z.string().max(100).optional(),\n});\n\nexport type SkillWriteInput = z.infer<typeof SkillWriteSchema>;\n","import { z } from 'zod';\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 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: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type VolunteeringWriteInput = z.infer<typeof VolunteeringWriteSchema>;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/write/shared.ts","../../../src/schemas/write/certification.ts","../../../src/schemas/write/course.ts","../../../src/schemas/write/education.ts","../../../src/schemas/write/external-account.ts","../../../src/schemas/write/honor.ts","../../../src/schemas/write/involvement.ts","../../../src/schemas/write/language.ts","../../../src/schemas/write/org-employment-attestation.ts","../../../src/schemas/write/org-profile.ts","../../../src/schemas/write/position.ts","../../../src/schemas/write/presentation-delivery.ts","../../../src/schemas/write/presentation.ts","../../../src/schemas/write/profile-location.ts","../../../src/schemas/write/profile-self.ts","../../../src/schemas/write/project.ts","../../../src/schemas/write/publication.ts","../../../src/schemas/write/skill.ts","../../../src/schemas/write/volunteering.ts"],"names":["z"],"mappings":";;;AAGO,SAAS,aAAa,GAAA,EAAqB;AAChD,EAAA,MAAM,OAAA,GAAU,IAAI,IAAA,EAAK;AACzB,EAAA,IAAI,eAAA,CAAgB,IAAA,CAAK,OAAO,CAAA,EAAG,OAAO,OAAA;AAC1C,EAAA,OAAO,WAAW,OAAO,CAAA,CAAA;AAC3B;AAMO,IAAM,WAAA,GAAc,MACzB,CAAA,CACG,MAAA,GACA,QAAA,EAAS,CACT,SAAA,CAAU,CAAC,GAAA,KAAQ;AAClB,EAAA,IAAI,CAAC,KAAK,OAAO,MAAA;AACjB,EAAA,IAAI;AACF,IAAA,IAAI,IAAI,GAAG,CAAA;AACX,IAAA,OAAO,GAAA;AAAA,EACT,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,MAAA;AAAA,EACT;AACF,CAAC;AAiBE,IAAM,mBAAA,GAAsB,EAChC,KAAA,CAAM;AAAA,EACL,EAAE,MAAA,CAAO;AAAA,IACP,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE,OAAA,EAAQ;AAAA,IAC5B,aAAa,CAAA,CAAE,MAAA,GAAS,MAAA,CAAO,CAAC,EAAE,OAAA,EAAQ;AAAA,IAC1C,MAAA,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AA,EAAS;AAAA,EAC1C,SAASA,CAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,GAAW,QAAA;AACjC,CAAC","file":"index.js","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 a URL string or silently drop it if invalid (returns `undefined`).\n * Preserves the write-time policy: bad URLs from imports are dropped, not rejected.\n */\nexport const optionalUrl = () =>\n z\n .string()\n .optional()\n .transform((val) => {\n if (!val) return undefined;\n try {\n new URL(val);\n return val;\n } catch {\n return undefined;\n }\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\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","import { z } from 'zod';\n\nimport { entityRefSchema, optionalUrl } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.certification`. */\nexport const CertificationWriteSchema = z.object({\n name: z.string().min(1).max(256),\n authority: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema,\n credentialId: z.string().max(256).nullable().optional(),\n credentialUrl: optionalUrl(),\n issuedAt: z.string().nullable().optional(),\n expiresAt: z.string().nullable().optional(),\n});\n\nexport type CertificationWriteInput = z.infer<typeof CertificationWriteSchema>;\n","import { z } from 'zod';\n\nimport { entityRefSchema } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.course`. */\nexport const CourseWriteSchema = z.object({\n name: z.string().min(1).max(200),\n number: z.string().max(50).nullable().optional(),\n institution: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema,\n /**\n * at-uri of the linked `id.sifa.profile.certification` record. Structurally\n * validated (`at://authority/collection/rkey`) so a bad value can't be\n * stored and later split into a bogus rkey.\n */\n credential: z\n .string()\n .max(512)\n .regex(/^at:\\/\\/[^/\\s]+\\/[^/\\s]+\\/[^/\\s]+$/, 'must be an at-uri')\n .nullable()\n .optional(),\n /**\n * RFC 3339 datetime the course was completed. The editor collects month\n * granularity (YYYY-MM) and converts to a datetime before the write; stored\n * and passed through as-is, mirroring `certification.issuedAt`.\n */\n completedAt: z.string().nullable().optional(),\n});\n\nexport type CourseWriteInput = z.infer<typeof CourseWriteSchema>;\n","import { z } from 'zod';\n\nimport { entityRefSchema } from './shared.js';\n\n/** Schema enforced by `POST /profile/education` on sifa-api. */\nexport const EducationWriteSchema = z.object({\n institution: z.string().min(1).max(256),\n entityRef: entityRefSchema,\n degree: z.string().max(256).nullable().optional(),\n fieldOfStudy: z.string().max(256).nullable().optional(),\n description: z.string().max(50000).nullable().optional(),\n activities: z.string().max(1000).nullable().optional(),\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type EducationWriteInput = z.infer<typeof EducationWriteSchema>;\n","import { z } from 'zod';\n\nimport { VALID_PLATFORMS, normalizeUrl } from './shared.js';\n\n/** Schema enforced by `POST /external-accounts` on sifa-api. */\nexport const ExternalAccountWriteSchema = z.object({\n platform: z.enum(VALID_PLATFORMS),\n url: z.string().max(2000).transform(normalizeUrl).pipe(z.string().url()),\n label: z.string().max(100).optional(),\n feedUrl: z.string().max(2000).transform(normalizeUrl).pipe(z.string().url()).optional(),\n});\n\nexport type ExternalAccountWriteInput = z.infer<typeof ExternalAccountWriteSchema>;\n","import { z } from 'zod';\n\nimport { entityRefSchema } from './shared.js';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.honor`. */\nexport const HonorWriteSchema = z.object({\n title: z.string().min(1).max(200),\n issuer: z.string().max(256).nullable().optional(),\n entityRef: entityRefSchema,\n description: z.string().max(50000).nullable().optional(),\n awardedAt: z.string().nullable().optional(),\n});\n\nexport type HonorWriteInput = z.infer<typeof HonorWriteSchema>;\n","import { z } from 'zod';\n\nimport {\n artifactLinkSchema,\n entityRefSchema,\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 // Freeform YYYY / YYYY-MM / YYYY-MM-DD; validated loosely so partial dates pass.\n startedAt: z.string().max(32).nullable().optional(),\n endedAt: z.string().max(32).nullable().optional(),\n links: z.array(artifactLinkSchema).max(50).nullable().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","import { z } from 'zod';\n\n/** Schema enforced by the generic-record write endpoint for `id.sifa.profile.language`. */\nexport const LanguageWriteSchema = z.object({\n name: z.string().min(1).max(64),\n proficiency: z.string().max(50).optional(),\n});\n\nexport type LanguageWriteInput = z.infer<typeof LanguageWriteSchema>;\n","import { z } from 'zod';\n\nimport { externalRecordRefSchema } from './shared.js';\n\n/**\n * Schema enforced by the org-employment-attestation write endpoint on sifa-api.\n *\n * An org attests that a Sifa user (`subject`) held a specific `position` record\n * with `title` between `startedAt` and `endedAt` (inclusive of \"current\" status).\n * The attestation itself is signed by the org's DID; `entityRef` / `companyDid`\n * optionally cross-link the org identifier(s) used at the time.\n */\nexport const OrgEmploymentAttestationWriteSchema = z.object({\n subject: z.string().regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID'),\n position: externalRecordRefSchema,\n status: z.enum(['current', 'past']),\n title: z.string().min(1).max(2560),\n startedAt: z.string().max(32),\n entityRef: z.string().max(2048).nullable().optional(),\n companyDid: z\n .string()\n .regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID')\n .nullable()\n .optional(),\n endedAt: z.string().max(32).nullable().optional(),\n comment: z.string().max(3000).nullable().optional(),\n createdAt: z.string(),\n});\n\nexport type OrgEmploymentAttestationWriteInput = z.infer<\n typeof OrgEmploymentAttestationWriteSchema\n>;\n","import { z } from 'zod';\n\n/**\n * Schema enforced by the org-profile write endpoint on sifa-api.\n *\n * Sifa-managed org identity: name + description + contact channel plus\n * `entityRefs` linking the org to portable identifiers (Wikidata / ROR /\n * LEI / sifa.id URI, http(s) enforced elsewhere).\n */\nexport const OrgProfileWriteSchema = z.object({\n name: z.string().min(1).max(2000),\n description: z.string().max(50000).nullable().optional(),\n logo: z.unknown().nullable().optional(),\n website: z.string().max(2048).nullable().optional(),\n entityRefs: z.array(z.string().max(2048)).max(20).nullable().optional(),\n contact: z.string().max(320).nullable().optional(),\n createdAt: z.string(),\n});\n\nexport type OrgProfileWriteInput = z.infer<typeof OrgProfileWriteSchema>;\n","import { z } from 'zod';\n\nimport { entityRefSchema, skillRefSchema, writeLocationSchema } 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 workplaceType: z.string().nullable().optional(),\n location: writeLocationSchema,\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n skills: z.array(skillRefSchema).max(50).nullable().optional(),\n});\n\nexport type PositionWriteInput = z.infer<typeof PositionWriteSchema>;\n","import { z } from 'zod';\n\nimport { externalRecordRefSchema, isValidDateOnly, presentationLinkSchema } from './shared.js';\n\n/**\n * Schema enforced by the generic-record write endpoint for `id.sifa.profile.presentationDelivery`.\n *\n * Records a specific delivery of a presentation (e.g., at a conference).\n * `presentationRef` optionally points at the parent `id.sifa.profile.presentation`\n * record; `eventRef` optionally links a Sifa event record; `coSpeakers` are\n * DIDs of people who delivered alongside the profile owner.\n */\nexport const PresentationDeliveryWriteSchema = z.object({\n presentationRef: externalRecordRefSchema.optional(),\n title: z.string().max(3000).nullable().optional(),\n role: z.string().max(640).nullable().optional(),\n eventName: z.string().max(3000).nullable().optional(),\n date: z.string().refine(isValidDateOnly, 'must be a valid YYYY-MM-DD date').nullable().optional(),\n location: z.string().max(2560).nullable().optional(),\n mode: z.string().max(256).nullable().optional(),\n status: z.string().max(256).nullable().optional(),\n links: z.array(presentationLinkSchema).max(20).optional(),\n eventRef: externalRecordRefSchema.optional(),\n coSpeakers: z\n .array(z.string().regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID'))\n .max(20)\n .optional(),\n});\n\nexport type PresentationDeliveryWriteInput = z.infer<typeof PresentationDeliveryWriteSchema>;\n","import { z } from 'zod';\n\nimport { externalRecordRefSchema, presentationLinkSchema } from './shared.js';\n\n/**\n * Schema enforced by the generic-record write endpoint for `id.sifa.profile.presentation`.\n *\n * Describes a talk / presentation the user can give. `duration` bounds the\n * runtime; `intendedAudiences` names who it's aimed at; `writeupRef` is an\n * optional at-uri pointer to a companion writeup record.\n */\nexport const PresentationWriteSchema = z.object({\n title: z.string().min(1).max(3000),\n description: z.string().max(50000).nullable().optional(),\n duration: z\n .object({\n minMinutes: z.number().int().min(1),\n maxMinutes: z.number().int().min(1).optional(),\n })\n .refine((d) => d.maxMinutes === undefined || d.maxMinutes >= d.minMinutes, {\n message: 'maxMinutes must be greater than or equal to minMinutes',\n path: ['maxMinutes'],\n })\n .optional(),\n intendedAudiences: z.array(z.string().max(1000)).max(20).optional(),\n links: z.array(presentationLinkSchema).max(20).optional(),\n writeupRef: externalRecordRefSchema.optional(),\n});\n\nexport type PresentationWriteInput = z.infer<typeof PresentationWriteSchema>;\n","import { z } from 'zod';\n\n/**\n * Schema enforced by `POST /profile/locations` on sifa-api.\n *\n * Mirrors the inner object of `writeLocationSchema`: accepts both the community\n * shape (`country`, `locality`) and the legacy shape (`countryCode`, `city`)\n * during the dual-read window. sifa-web #840 switched outbound writes to the\n * community shape; older clients may still send the legacy shape. All address\n * fields are `.nullish()` so explicit `null` from API echoes is accepted\n * (see sifa-api #426).\n *\n * The route handler hands `address` to `buildPdsLocation`, which normalizes\n * either input and enforces alpha-2 on the wire to PDS — returning a 400 with\n * `message: \"address.country (alpha-2) is required\"` when no usable code is\n * present. The schema stays permissive on country length here and lets\n * `buildPdsLocation` be the single enforcement point.\n */\nexport const ProfileLocationWriteSchema = z.object({\n address: 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 type: z.string().min(1),\n label: z.string().max(60).nullable().optional(),\n isPrimary: z.boolean().optional(),\n});\n\nexport type ProfileLocationWriteInput = z.infer<typeof ProfileLocationWriteSchema>;\n","import { z } from 'zod';\n\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 * Grapheme caps (e.g. 64 on given/familyName) are enforced client-side by the\n * SDK's lexicon schema; the write schema only guards the byte-length ceiling.\n */\nexport const ProfileSelfWriteSchema = z\n .object({\n headline: z.string().max(300).optional(),\n about: z.string().max(50000).optional(),\n givenName: z.string().max(640).optional(),\n familyName: z.string().max(640).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 .passthrough();\n\nexport type ProfileSelfWriteInput = z.infer<typeof ProfileSelfWriteSchema>;\n","import { z } from 'zod';\n\nimport { optionalUrl } from './shared.js';\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 description: z.string().max(50000).nullable().optional(),\n url: optionalUrl(),\n startedAt: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type ProjectWriteInput = z.infer<typeof ProjectWriteSchema>;\n","import { z } from 'zod';\n\nimport { optionalUrl } from './shared.js';\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: z.string().nullable().optional(),\n});\n\nexport type PublicationWriteInput = z.infer<typeof PublicationWriteSchema>;\n","import { z } from 'zod';\n\n/** Schema enforced by `POST /profile/skills` on sifa-api. */\nexport const SkillWriteSchema = z.object({\n name: z.string().min(1).max(100),\n category: z.string().max(100).optional(),\n});\n\nexport type SkillWriteInput = z.infer<typeof SkillWriteSchema>;\n","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: z.string().nullable().optional(),\n endedAt: z.string().nullable().optional(),\n});\n\nexport type VolunteeringWriteInput = z.infer<typeof VolunteeringWriteSchema>;\n"]}
|
package/package.json
CHANGED