@singi-labs/sifa-sdk 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +189 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +165 -4
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.cjs +191 -0
- package/dist/schemas/index.cjs.map +1 -0
- package/dist/schemas/index.d.cts +294 -0
- package/dist/schemas/index.d.ts +294 -0
- package/dist/schemas/index.js +165 -0
- package/dist/schemas/index.js.map +1 -0
- package/package.json +14 -1
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var zod = require('zod');
|
|
4
|
+
|
|
5
|
+
// src/schemas/endorsement-confirmation.ts
|
|
6
|
+
function maxGraphemes(max) {
|
|
7
|
+
return (value) => {
|
|
8
|
+
const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
9
|
+
let count = 0;
|
|
10
|
+
for (const _ of segmenter.segment(value)) {
|
|
11
|
+
count++;
|
|
12
|
+
if (count > max) return false;
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
var didSchema = zod.z.string().regex(/^did:[a-z]+:[a-zA-Z0-9._:%-]+$/, "Invalid DID");
|
|
18
|
+
var datetimeSchema = zod.z.string().datetime({ offset: true });
|
|
19
|
+
var atUriSchema = zod.z.string().regex(/^at:\/\/[^\s]+$/, "Invalid AT-URI");
|
|
20
|
+
var cidSchema = zod.z.string().regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z0-9+/=]+)$/, "Invalid CID");
|
|
21
|
+
var languageTagSchema = zod.z.string().regex(/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/, "Invalid BCP 47 language tag");
|
|
22
|
+
var uriSchema = zod.z.string().url();
|
|
23
|
+
var strongRefSchema = zod.z.object({
|
|
24
|
+
uri: atUriSchema,
|
|
25
|
+
cid: cidSchema
|
|
26
|
+
});
|
|
27
|
+
var selfLabelsSchema = zod.z.object({
|
|
28
|
+
$type: zod.z.literal("com.atproto.label.defs#selfLabels").optional(),
|
|
29
|
+
values: zod.z.array(zod.z.object({ val: zod.z.string() }))
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// src/schemas/endorsement-confirmation.ts
|
|
33
|
+
var EndorsementConfirmationRecordSchema = zod.z.object({
|
|
34
|
+
endorsement: strongRefSchema,
|
|
35
|
+
createdAt: datetimeSchema
|
|
36
|
+
});
|
|
37
|
+
var EndorsementRecordSchema = zod.z.object({
|
|
38
|
+
subject: didSchema,
|
|
39
|
+
skill: strongRefSchema,
|
|
40
|
+
skillName: zod.z.string().min(1).refine(maxGraphemes(64)).max(640),
|
|
41
|
+
comment: zod.z.string().refine(maxGraphemes(300)).max(3e3).optional(),
|
|
42
|
+
createdAt: datetimeSchema
|
|
43
|
+
});
|
|
44
|
+
var GraphFollowRecordSchema = zod.z.object({
|
|
45
|
+
subject: didSchema,
|
|
46
|
+
createdAt: datetimeSchema
|
|
47
|
+
});
|
|
48
|
+
var ProfileCertificationRecordSchema = zod.z.object({
|
|
49
|
+
name: zod.z.string().min(1).refine(maxGraphemes(100)).max(1e3),
|
|
50
|
+
authority: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
51
|
+
authorityDid: didSchema.optional(),
|
|
52
|
+
credentialId: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
53
|
+
credentialUrl: uriSchema.optional(),
|
|
54
|
+
issuedAt: datetimeSchema.optional(),
|
|
55
|
+
expiresAt: datetimeSchema.optional(),
|
|
56
|
+
labels: selfLabelsSchema.optional(),
|
|
57
|
+
createdAt: datetimeSchema
|
|
58
|
+
});
|
|
59
|
+
var ProfileCourseRecordSchema = zod.z.object({
|
|
60
|
+
name: zod.z.string().min(1).refine(maxGraphemes(200)).max(2e3),
|
|
61
|
+
number: zod.z.string().refine(maxGraphemes(50)).max(500).optional(),
|
|
62
|
+
institution: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
63
|
+
education: strongRefSchema.optional(),
|
|
64
|
+
createdAt: datetimeSchema
|
|
65
|
+
});
|
|
66
|
+
var ProfileEducationRecordSchema = zod.z.object({
|
|
67
|
+
institution: zod.z.string().min(1).refine(maxGraphemes(100)).max(1e3),
|
|
68
|
+
institutionDid: didSchema.optional(),
|
|
69
|
+
degree: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
70
|
+
fieldOfStudy: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
71
|
+
grade: zod.z.string().refine(maxGraphemes(50)).max(500).optional(),
|
|
72
|
+
activities: zod.z.string().refine(maxGraphemes(1e3)).max(1e4).optional(),
|
|
73
|
+
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
74
|
+
location: zod.z.unknown().optional(),
|
|
75
|
+
startedAt: datetimeSchema.optional(),
|
|
76
|
+
endedAt: datetimeSchema.optional(),
|
|
77
|
+
labels: selfLabelsSchema.optional(),
|
|
78
|
+
createdAt: datetimeSchema
|
|
79
|
+
});
|
|
80
|
+
var ProfileExternalAccountRecordSchema = zod.z.object({
|
|
81
|
+
platform: zod.z.string(),
|
|
82
|
+
url: uriSchema,
|
|
83
|
+
label: zod.z.string().refine(maxGraphemes(64)).max(640).optional(),
|
|
84
|
+
feedUrl: uriSchema.optional(),
|
|
85
|
+
isPrimary: zod.z.boolean().optional(),
|
|
86
|
+
createdAt: datetimeSchema
|
|
87
|
+
});
|
|
88
|
+
var ProfileHonorRecordSchema = zod.z.object({
|
|
89
|
+
title: zod.z.string().min(1).refine(maxGraphemes(200)).max(2e3),
|
|
90
|
+
issuer: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
91
|
+
issuerDid: didSchema.optional(),
|
|
92
|
+
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
93
|
+
awardedAt: datetimeSchema.optional(),
|
|
94
|
+
createdAt: datetimeSchema
|
|
95
|
+
});
|
|
96
|
+
var ProfileLanguageRecordSchema = zod.z.object({
|
|
97
|
+
name: zod.z.string().min(1).refine(maxGraphemes(64)).max(640),
|
|
98
|
+
proficiency: zod.z.string().optional(),
|
|
99
|
+
createdAt: datetimeSchema
|
|
100
|
+
});
|
|
101
|
+
var ProfilePositionRecordSchema = zod.z.object({
|
|
102
|
+
company: zod.z.string().min(1).refine(maxGraphemes(100)).max(1e3),
|
|
103
|
+
companyDid: didSchema.optional(),
|
|
104
|
+
title: zod.z.string().min(1).refine(maxGraphemes(100)).max(1e3),
|
|
105
|
+
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
106
|
+
employmentType: zod.z.string().optional(),
|
|
107
|
+
workplaceType: zod.z.string().optional(),
|
|
108
|
+
location: zod.z.unknown().optional(),
|
|
109
|
+
startedAt: datetimeSchema,
|
|
110
|
+
endedAt: datetimeSchema.optional(),
|
|
111
|
+
skills: zod.z.array(strongRefSchema).max(50).optional(),
|
|
112
|
+
labels: selfLabelsSchema.optional(),
|
|
113
|
+
createdAt: datetimeSchema
|
|
114
|
+
});
|
|
115
|
+
var ProfileProjectRecordSchema = zod.z.object({
|
|
116
|
+
name: zod.z.string().min(1).refine(maxGraphemes(100)).max(1e3),
|
|
117
|
+
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
118
|
+
url: uriSchema.optional(),
|
|
119
|
+
position: strongRefSchema.optional(),
|
|
120
|
+
startedAt: datetimeSchema.optional(),
|
|
121
|
+
endedAt: datetimeSchema.optional(),
|
|
122
|
+
labels: selfLabelsSchema.optional(),
|
|
123
|
+
createdAt: datetimeSchema
|
|
124
|
+
});
|
|
125
|
+
var PublicationAuthorSchema = zod.z.object({
|
|
126
|
+
name: zod.z.string().min(1).refine(maxGraphemes(100)).max(1e3),
|
|
127
|
+
did: didSchema.optional()
|
|
128
|
+
});
|
|
129
|
+
var ProfilePublicationRecordSchema = zod.z.object({
|
|
130
|
+
title: zod.z.string().min(1).refine(maxGraphemes(200)).max(2e3),
|
|
131
|
+
publisher: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
132
|
+
url: uriSchema.optional(),
|
|
133
|
+
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
134
|
+
authors: zod.z.array(PublicationAuthorSchema).max(50).optional(),
|
|
135
|
+
publishedAt: datetimeSchema.optional(),
|
|
136
|
+
createdAt: datetimeSchema
|
|
137
|
+
});
|
|
138
|
+
var ProfileSelfRecordSchema = zod.z.object({
|
|
139
|
+
headline: zod.z.string().refine(maxGraphemes(120)).max(1200).optional(),
|
|
140
|
+
about: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
141
|
+
industry: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
142
|
+
location: zod.z.unknown().optional(),
|
|
143
|
+
openTo: zod.z.array(zod.z.string()).max(10).optional(),
|
|
144
|
+
preferredWorkplace: zod.z.array(zod.z.string()).max(3).optional(),
|
|
145
|
+
langs: zod.z.array(languageTagSchema).max(3).optional(),
|
|
146
|
+
labels: selfLabelsSchema.optional(),
|
|
147
|
+
createdAt: datetimeSchema
|
|
148
|
+
});
|
|
149
|
+
var ProfileSkillRecordSchema = zod.z.object({
|
|
150
|
+
name: zod.z.string().min(1).refine(maxGraphemes(64)).max(640),
|
|
151
|
+
category: zod.z.string().optional(),
|
|
152
|
+
createdAt: datetimeSchema
|
|
153
|
+
});
|
|
154
|
+
var ProfileVolunteeringRecordSchema = zod.z.object({
|
|
155
|
+
organization: zod.z.string().min(1).refine(maxGraphemes(100)).max(1e3),
|
|
156
|
+
organizationDid: didSchema.optional(),
|
|
157
|
+
role: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
158
|
+
cause: zod.z.string().refine(maxGraphemes(100)).max(1e3).optional(),
|
|
159
|
+
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
160
|
+
startedAt: datetimeSchema.optional(),
|
|
161
|
+
endedAt: datetimeSchema.optional(),
|
|
162
|
+
createdAt: datetimeSchema
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
exports.EndorsementConfirmationRecordSchema = EndorsementConfirmationRecordSchema;
|
|
166
|
+
exports.EndorsementRecordSchema = EndorsementRecordSchema;
|
|
167
|
+
exports.GraphFollowRecordSchema = GraphFollowRecordSchema;
|
|
168
|
+
exports.ProfileCertificationRecordSchema = ProfileCertificationRecordSchema;
|
|
169
|
+
exports.ProfileCourseRecordSchema = ProfileCourseRecordSchema;
|
|
170
|
+
exports.ProfileEducationRecordSchema = ProfileEducationRecordSchema;
|
|
171
|
+
exports.ProfileExternalAccountRecordSchema = ProfileExternalAccountRecordSchema;
|
|
172
|
+
exports.ProfileHonorRecordSchema = ProfileHonorRecordSchema;
|
|
173
|
+
exports.ProfileLanguageRecordSchema = ProfileLanguageRecordSchema;
|
|
174
|
+
exports.ProfilePositionRecordSchema = ProfilePositionRecordSchema;
|
|
175
|
+
exports.ProfileProjectRecordSchema = ProfileProjectRecordSchema;
|
|
176
|
+
exports.ProfilePublicationRecordSchema = ProfilePublicationRecordSchema;
|
|
177
|
+
exports.ProfileSelfRecordSchema = ProfileSelfRecordSchema;
|
|
178
|
+
exports.ProfileSkillRecordSchema = ProfileSkillRecordSchema;
|
|
179
|
+
exports.ProfileVolunteeringRecordSchema = ProfileVolunteeringRecordSchema;
|
|
180
|
+
exports.PublicationAuthorSchema = PublicationAuthorSchema;
|
|
181
|
+
exports.atUriSchema = atUriSchema;
|
|
182
|
+
exports.cidSchema = cidSchema;
|
|
183
|
+
exports.datetimeSchema = datetimeSchema;
|
|
184
|
+
exports.didSchema = didSchema;
|
|
185
|
+
exports.languageTagSchema = languageTagSchema;
|
|
186
|
+
exports.maxGraphemes = maxGraphemes;
|
|
187
|
+
exports.selfLabelsSchema = selfLabelsSchema;
|
|
188
|
+
exports.strongRefSchema = strongRefSchema;
|
|
189
|
+
exports.uriSchema = uriSchema;
|
|
190
|
+
//# sourceMappingURL=index.cjs.map
|
|
191
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/shared.ts","../../src/schemas/endorsement-confirmation.ts","../../src/schemas/endorsement.ts","../../src/schemas/graph-follow.ts","../../src/schemas/profile-certification.ts","../../src/schemas/profile-course.ts","../../src/schemas/profile-education.ts","../../src/schemas/profile-external-account.ts","../../src/schemas/profile-honor.ts","../../src/schemas/profile-language.ts","../../src/schemas/profile-position.ts","../../src/schemas/profile-project.ts","../../src/schemas/profile-publication.ts","../../src/schemas/profile-self.ts","../../src/schemas/profile-skill.ts","../../src/schemas/profile-volunteering.ts"],"names":["z"],"mappings":";;;;;AASO,SAAS,aAAa,GAAA,EAAa;AACxC,EAAA,OAAO,CAAC,KAAA,KAA2B;AACjC,IAAA,MAAM,SAAA,GAAY,IAAI,IAAA,CAAK,SAAA,CAAU,QAAW,EAAE,WAAA,EAAa,YAAY,CAAA;AAC3E,IAAA,IAAI,KAAA,GAAQ,CAAA;AACZ,IAAA,KAAA,MAAW,CAAA,IAAK,SAAA,CAAU,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxC,MAAA,KAAA,EAAA;AACA,MAAA,IAAI,KAAA,GAAQ,KAAK,OAAO,KAAA;AAAA,IAC1B;AACA,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AACF;AAGO,IAAM,YAAYA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA,CAAM,kCAAkC,aAAa;AAGlF,IAAM,cAAA,GAAiBA,MAAE,MAAA,EAAO,CAAE,SAAS,EAAE,MAAA,EAAQ,MAAM;AAG3D,IAAM,cAAcA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA,CAAM,mBAAmB,gBAAgB;AAGxE,IAAM,YAAYA,KAAA,CACtB,MAA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ACb,CAAC;ACXM,IAAM,wBAAA,GAA2BA,MAAE,MAAA,CAAO;AAAA,EAC/C,IAAA,EAAMA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,MAAA,CAAO,YAAA,CAAa,EAAE,CAAC,CAAA,CAAE,IAAI,GAAG,CAAA;AAAA,EACxD,QAAA,EAAUA,KAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC9B,SAAA,EAAW;AACb,CAAC;ACTM,IAAM,+BAAA,GAAkCA,MAAE,MAAA,CAAO;AAAA,EACtD,YAAA,EAAcA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,MAAA,CAAO,YAAA,CAAa,GAAG,CAAC,CAAA,CAAE,IAAI,GAAI,CAAA;AAAA,EAClE,eAAA,EAAiB,UAAU,QAAA,EAAS;AAAA,EACpC,IAAA,EAAMA,KAAAA,CAAE,MAAA,EAAO,CAAE,MAAA,CAAO,YAAA,CAAa,GAAG,CAAC,CAAA,CAAE,GAAA,CAAI,GAAI,CAAA,CAAE,QAAA,EAAS;AAAA,EAC9D,KAAA,EAAOA,KAAAA,CAAE,MAAA,EAAO,CAAE,MAAA,CAAO,YAAA,CAAa,GAAG,CAAC,CAAA,CAAE,GAAA,CAAI,GAAI,CAAA,CAAE,QAAA,EAAS;AAAA,EAC/D,WAAA,EAAaA,KAAAA,CAAE,MAAA,EAAO,CAAE,MAAA,CAAO,YAAA,CAAa,GAAI,CAAC,CAAA,CAAE,GAAA,CAAI,GAAK,CAAA,CAAE,QAAA,EAAS;AAAA,EACvE,SAAA,EAAW,eAAe,QAAA,EAAS;AAAA,EACnC,OAAA,EAAS,eAAe,QAAA,EAAS;AAAA,EACjC,SAAA,EAAW;AACb,CAAC","file":"index.cjs","sourcesContent":["import { z } from 'zod';\n\n/**\n * Grapheme-aware refinement matching the AT Protocol lexicon `maxGraphemes`\n * constraint. JS strings are sequences of UTF-16 code units, but lexicon\n * `maxGraphemes` counts user-perceived characters (grapheme clusters), so\n * emoji sequences, regional indicators, ZWJ joins, and combining marks all\n * count as one unit each. We use `Intl.Segmenter` to enforce this correctly.\n */\nexport function maxGraphemes(max: number) {\n return (value: string): boolean => {\n const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n let count = 0;\n for (const _ of segmenter.segment(value)) {\n count++;\n if (count > max) return false;\n }\n return true;\n };\n}\n\n/** Decentralized identifier, AT Protocol `format: did`. */\nexport const didSchema = z.string().regex(/^did:[a-z]+:[a-zA-Z0-9._:%-]+$/, 'Invalid DID');\n\n/** RFC 3339 datetime with timezone offset, AT Protocol `format: datetime`. */\nexport const datetimeSchema = z.string().datetime({ offset: true });\n\n/** Generic AT-URI, AT Protocol `format: at-uri`. */\nexport const atUriSchema = z.string().regex(/^at:\\/\\/[^\\s]+$/, 'Invalid AT-URI');\n\n/** Content identifier, AT Protocol `format: cid`. Loose validation -- accepts CIDv0 and CIDv1. */\nexport const cidSchema = z\n .string()\n .regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z0-9+/=]+)$/, 'Invalid CID');\n\n/** BCP 47 language tag, AT Protocol `format: language`. */\nexport const languageTagSchema = z\n .string()\n .regex(/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/, 'Invalid BCP 47 language tag');\n\n/** Generic URI, AT Protocol `format: uri`. */\nexport const uriSchema = z.string().url();\n\n/**\n * StrongRef shape from `com.atproto.repo.strongRef` -- pins a record by both\n * AT-URI (identity) and CID (version).\n */\nexport const strongRefSchema = z.object({\n uri: atUriSchema,\n cid: cidSchema,\n});\n\n/**\n * Self-labels shape from `com.atproto.label.defs#selfLabels`. Modelled\n * permissively because clients rarely construct this directly; the AppView\n * handles label validation.\n */\nexport const selfLabelsSchema = z.object({\n $type: z.literal('com.atproto.label.defs#selfLabels').optional(),\n values: z.array(z.object({ val: z.string() })),\n});\n","import { z } from 'zod';\n\nimport { datetimeSchema, strongRefSchema } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.endorsement.confirmation` records.\n * Lives in the endorsee's PDS to approve display of an endorsement.\n */\nexport const EndorsementConfirmationRecordSchema = z.object({\n endorsement: strongRefSchema,\n createdAt: datetimeSchema,\n});\n\nexport type EndorsementConfirmationRecord = z.infer<typeof EndorsementConfirmationRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes, strongRefSchema } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.endorsement` records. Lives in the endorser's PDS;\n * the endorser identity is implicit (whoever owns the repository).\n */\nexport const EndorsementRecordSchema = z.object({\n subject: didSchema,\n skill: strongRefSchema,\n skillName: z.string().min(1).refine(maxGraphemes(64)).max(640),\n comment: z.string().refine(maxGraphemes(300)).max(3000).optional(),\n createdAt: datetimeSchema,\n});\n\nexport type EndorsementRecord = z.infer<typeof EndorsementRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.graph.follow` records.\n * One-way professional follow; lives in the follower's PDS.\n */\nexport const GraphFollowRecordSchema = z.object({\n subject: didSchema,\n createdAt: datetimeSchema,\n});\n\nexport type GraphFollowRecord = z.infer<typeof GraphFollowRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes, selfLabelsSchema, uriSchema } from './shared.js';\n\n/** Zod schema for `id.sifa.profile.certification` records. */\nexport const ProfileCertificationRecordSchema = z.object({\n name: z.string().min(1).refine(maxGraphemes(100)).max(1000),\n authority: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n authorityDid: didSchema.optional(),\n credentialId: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n credentialUrl: uriSchema.optional(),\n issuedAt: datetimeSchema.optional(),\n expiresAt: datetimeSchema.optional(),\n labels: selfLabelsSchema.optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ProfileCertificationRecord = z.infer<typeof ProfileCertificationRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, maxGraphemes, strongRefSchema } from './shared.js';\n\n/** Zod schema for `id.sifa.profile.course` records. */\nexport const ProfileCourseRecordSchema = z.object({\n name: z.string().min(1).refine(maxGraphemes(200)).max(2000),\n number: z.string().refine(maxGraphemes(50)).max(500).optional(),\n institution: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n education: strongRefSchema.optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ProfileCourseRecord = z.infer<typeof ProfileCourseRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes, selfLabelsSchema } from './shared.js';\n\n/** Zod schema for `id.sifa.profile.education` records. */\nexport const ProfileEducationRecordSchema = z.object({\n institution: z.string().min(1).refine(maxGraphemes(100)).max(1000),\n institutionDid: didSchema.optional(),\n degree: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n fieldOfStudy: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n grade: z.string().refine(maxGraphemes(50)).max(500).optional(),\n activities: z.string().refine(maxGraphemes(1000)).max(10000).optional(),\n description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n location: z.unknown().optional(),\n startedAt: datetimeSchema.optional(),\n endedAt: datetimeSchema.optional(),\n labels: selfLabelsSchema.optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ProfileEducationRecord = z.infer<typeof ProfileEducationRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, maxGraphemes, uriSchema } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.profile.externalAccount` records.\n *\n * `platform` is advisory (`knownValues` in the lexicon) -- known values live\n * under `id.sifa.defs#platform*` but unknown values are accepted.\n */\nexport const ProfileExternalAccountRecordSchema = z.object({\n platform: z.string(),\n url: uriSchema,\n label: z.string().refine(maxGraphemes(64)).max(640).optional(),\n feedUrl: uriSchema.optional(),\n isPrimary: z.boolean().optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ProfileExternalAccountRecord = z.infer<typeof ProfileExternalAccountRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes } from './shared.js';\n\n/** Zod schema for `id.sifa.profile.honor` records. */\nexport const ProfileHonorRecordSchema = z.object({\n title: z.string().min(1).refine(maxGraphemes(200)).max(2000),\n issuer: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n issuerDid: didSchema.optional(),\n description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n awardedAt: datetimeSchema.optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ProfileHonorRecord = z.infer<typeof ProfileHonorRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, maxGraphemes } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.profile.language` records.\n *\n * `proficiency` is advisory (`knownValues` in the lexicon) -- known values\n * are the five-level LinkedIn-compatible scale under `id.sifa.defs#*`.\n */\nexport const ProfileLanguageRecordSchema = z.object({\n name: z.string().min(1).refine(maxGraphemes(64)).max(640),\n proficiency: z.string().optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ProfileLanguageRecord = z.infer<typeof ProfileLanguageRecordSchema>;\n","import { z } from 'zod';\n\nimport {\n datetimeSchema,\n didSchema,\n maxGraphemes,\n selfLabelsSchema,\n strongRefSchema,\n} from './shared.js';\n\n/** Zod schema for `id.sifa.profile.position` records. */\nexport const ProfilePositionRecordSchema = z.object({\n company: z.string().min(1).refine(maxGraphemes(100)).max(1000),\n companyDid: didSchema.optional(),\n title: z.string().min(1).refine(maxGraphemes(100)).max(1000),\n description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n employmentType: z.string().optional(),\n workplaceType: z.string().optional(),\n location: z.unknown().optional(),\n startedAt: datetimeSchema,\n endedAt: datetimeSchema.optional(),\n skills: z.array(strongRefSchema).max(50).optional(),\n labels: selfLabelsSchema.optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ProfilePositionRecord = z.infer<typeof ProfilePositionRecordSchema>;\n","import { z } from 'zod';\n\nimport {\n datetimeSchema,\n maxGraphemes,\n selfLabelsSchema,\n strongRefSchema,\n uriSchema,\n} from './shared.js';\n\n/** Zod schema for `id.sifa.profile.project` records. */\nexport const ProfileProjectRecordSchema = z.object({\n name: z.string().min(1).refine(maxGraphemes(100)).max(1000),\n description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n url: uriSchema.optional(),\n position: strongRefSchema.optional(),\n startedAt: datetimeSchema.optional(),\n endedAt: datetimeSchema.optional(),\n labels: selfLabelsSchema.optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ProfileProjectRecord = z.infer<typeof ProfileProjectRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes, uriSchema } from './shared.js';\n\n/** Author shape from `id.sifa.profile.publication#author`. */\nexport const PublicationAuthorSchema = z.object({\n name: z.string().min(1).refine(maxGraphemes(100)).max(1000),\n did: didSchema.optional(),\n});\n\nexport type PublicationAuthor = z.infer<typeof PublicationAuthorSchema>;\n\n/** Zod schema for `id.sifa.profile.publication` records. */\nexport const ProfilePublicationRecordSchema = z.object({\n title: z.string().min(1).refine(maxGraphemes(200)).max(2000),\n publisher: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n url: uriSchema.optional(),\n description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n authors: z.array(PublicationAuthorSchema).max(50).optional(),\n publishedAt: datetimeSchema.optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ProfilePublicationRecord = z.infer<typeof ProfilePublicationRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, languageTagSchema, maxGraphemes, selfLabelsSchema } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.profile.self` records. Singleton (record key `self`).\n *\n * `knownValues` on `openTo` and `preferredWorkplace` are advisory per the\n * lexicon spec -- unknown values are allowed, but documented options live\n * under the `id.sifa.defs#*` namespace.\n */\nexport const ProfileSelfRecordSchema = z.object({\n headline: z.string().refine(maxGraphemes(120)).max(1200).optional(),\n about: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n industry: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n location: z.unknown().optional(),\n openTo: z.array(z.string()).max(10).optional(),\n preferredWorkplace: z.array(z.string()).max(3).optional(),\n langs: z.array(languageTagSchema).max(3).optional(),\n labels: selfLabelsSchema.optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ProfileSelfRecord = z.infer<typeof ProfileSelfRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, maxGraphemes } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.profile.skill` records.\n *\n * `category` is advisory (`knownValues` in the lexicon) -- known values live\n * under `id.sifa.defs#*` but unknown values are accepted.\n */\nexport const ProfileSkillRecordSchema = z.object({\n name: z.string().min(1).refine(maxGraphemes(64)).max(640),\n category: z.string().optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ProfileSkillRecord = z.infer<typeof ProfileSkillRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes } from './shared.js';\n\n/** Zod schema for `id.sifa.profile.volunteering` records. */\nexport const ProfileVolunteeringRecordSchema = z.object({\n organization: z.string().min(1).refine(maxGraphemes(100)).max(1000),\n organizationDid: didSchema.optional(),\n role: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n cause: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n startedAt: datetimeSchema.optional(),\n endedAt: datetimeSchema.optional(),\n createdAt: datetimeSchema,\n});\n\nexport type ProfileVolunteeringRecord = z.infer<typeof ProfileVolunteeringRecordSchema>;\n"]}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Zod schema for `id.sifa.endorsement.confirmation` records.
|
|
5
|
+
* Lives in the endorsee's PDS to approve display of an endorsement.
|
|
6
|
+
*/
|
|
7
|
+
declare const EndorsementConfirmationRecordSchema: z.ZodObject<{
|
|
8
|
+
endorsement: z.ZodObject<{
|
|
9
|
+
uri: z.ZodString;
|
|
10
|
+
cid: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
createdAt: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
type EndorsementConfirmationRecord = z.infer<typeof EndorsementConfirmationRecordSchema>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Zod schema for `id.sifa.endorsement` records. Lives in the endorser's PDS;
|
|
18
|
+
* the endorser identity is implicit (whoever owns the repository).
|
|
19
|
+
*/
|
|
20
|
+
declare const EndorsementRecordSchema: z.ZodObject<{
|
|
21
|
+
subject: z.ZodString;
|
|
22
|
+
skill: z.ZodObject<{
|
|
23
|
+
uri: z.ZodString;
|
|
24
|
+
cid: z.ZodString;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
skillName: z.ZodString;
|
|
27
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
28
|
+
createdAt: z.ZodString;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
type EndorsementRecord = z.infer<typeof EndorsementRecordSchema>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Zod schema for `id.sifa.graph.follow` records.
|
|
34
|
+
* One-way professional follow; lives in the follower's PDS.
|
|
35
|
+
*/
|
|
36
|
+
declare const GraphFollowRecordSchema: z.ZodObject<{
|
|
37
|
+
subject: z.ZodString;
|
|
38
|
+
createdAt: z.ZodString;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
type GraphFollowRecord = z.infer<typeof GraphFollowRecordSchema>;
|
|
41
|
+
|
|
42
|
+
/** Zod schema for `id.sifa.profile.certification` records. */
|
|
43
|
+
declare const ProfileCertificationRecordSchema: z.ZodObject<{
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
authority: z.ZodOptional<z.ZodString>;
|
|
46
|
+
authorityDid: z.ZodOptional<z.ZodString>;
|
|
47
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
48
|
+
credentialUrl: z.ZodOptional<z.ZodString>;
|
|
49
|
+
issuedAt: z.ZodOptional<z.ZodString>;
|
|
50
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
51
|
+
labels: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
$type: z.ZodOptional<z.ZodLiteral<"com.atproto.label.defs#selfLabels">>;
|
|
53
|
+
values: z.ZodArray<z.ZodObject<{
|
|
54
|
+
val: z.ZodString;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
createdAt: z.ZodString;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
type ProfileCertificationRecord = z.infer<typeof ProfileCertificationRecordSchema>;
|
|
60
|
+
|
|
61
|
+
/** Zod schema for `id.sifa.profile.course` records. */
|
|
62
|
+
declare const ProfileCourseRecordSchema: z.ZodObject<{
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
number: z.ZodOptional<z.ZodString>;
|
|
65
|
+
institution: z.ZodOptional<z.ZodString>;
|
|
66
|
+
education: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
uri: z.ZodString;
|
|
68
|
+
cid: z.ZodString;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
createdAt: z.ZodString;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
type ProfileCourseRecord = z.infer<typeof ProfileCourseRecordSchema>;
|
|
73
|
+
|
|
74
|
+
/** Zod schema for `id.sifa.profile.education` records. */
|
|
75
|
+
declare const ProfileEducationRecordSchema: z.ZodObject<{
|
|
76
|
+
institution: z.ZodString;
|
|
77
|
+
institutionDid: z.ZodOptional<z.ZodString>;
|
|
78
|
+
degree: z.ZodOptional<z.ZodString>;
|
|
79
|
+
fieldOfStudy: z.ZodOptional<z.ZodString>;
|
|
80
|
+
grade: z.ZodOptional<z.ZodString>;
|
|
81
|
+
activities: z.ZodOptional<z.ZodString>;
|
|
82
|
+
description: z.ZodOptional<z.ZodString>;
|
|
83
|
+
location: z.ZodOptional<z.ZodUnknown>;
|
|
84
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
85
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
86
|
+
labels: z.ZodOptional<z.ZodObject<{
|
|
87
|
+
$type: z.ZodOptional<z.ZodLiteral<"com.atproto.label.defs#selfLabels">>;
|
|
88
|
+
values: z.ZodArray<z.ZodObject<{
|
|
89
|
+
val: z.ZodString;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
createdAt: z.ZodString;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
type ProfileEducationRecord = z.infer<typeof ProfileEducationRecordSchema>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Zod schema for `id.sifa.profile.externalAccount` records.
|
|
98
|
+
*
|
|
99
|
+
* `platform` is advisory (`knownValues` in the lexicon) -- known values live
|
|
100
|
+
* under `id.sifa.defs#platform*` but unknown values are accepted.
|
|
101
|
+
*/
|
|
102
|
+
declare const ProfileExternalAccountRecordSchema: z.ZodObject<{
|
|
103
|
+
platform: z.ZodString;
|
|
104
|
+
url: z.ZodString;
|
|
105
|
+
label: z.ZodOptional<z.ZodString>;
|
|
106
|
+
feedUrl: z.ZodOptional<z.ZodString>;
|
|
107
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
createdAt: z.ZodString;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
type ProfileExternalAccountRecord = z.infer<typeof ProfileExternalAccountRecordSchema>;
|
|
111
|
+
|
|
112
|
+
/** Zod schema for `id.sifa.profile.honor` records. */
|
|
113
|
+
declare const ProfileHonorRecordSchema: z.ZodObject<{
|
|
114
|
+
title: z.ZodString;
|
|
115
|
+
issuer: z.ZodOptional<z.ZodString>;
|
|
116
|
+
issuerDid: z.ZodOptional<z.ZodString>;
|
|
117
|
+
description: z.ZodOptional<z.ZodString>;
|
|
118
|
+
awardedAt: z.ZodOptional<z.ZodString>;
|
|
119
|
+
createdAt: z.ZodString;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
type ProfileHonorRecord = z.infer<typeof ProfileHonorRecordSchema>;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Zod schema for `id.sifa.profile.language` records.
|
|
125
|
+
*
|
|
126
|
+
* `proficiency` is advisory (`knownValues` in the lexicon) -- known values
|
|
127
|
+
* are the five-level LinkedIn-compatible scale under `id.sifa.defs#*`.
|
|
128
|
+
*/
|
|
129
|
+
declare const ProfileLanguageRecordSchema: z.ZodObject<{
|
|
130
|
+
name: z.ZodString;
|
|
131
|
+
proficiency: z.ZodOptional<z.ZodString>;
|
|
132
|
+
createdAt: z.ZodString;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
type ProfileLanguageRecord = z.infer<typeof ProfileLanguageRecordSchema>;
|
|
135
|
+
|
|
136
|
+
/** Zod schema for `id.sifa.profile.position` records. */
|
|
137
|
+
declare const ProfilePositionRecordSchema: z.ZodObject<{
|
|
138
|
+
company: z.ZodString;
|
|
139
|
+
companyDid: z.ZodOptional<z.ZodString>;
|
|
140
|
+
title: z.ZodString;
|
|
141
|
+
description: z.ZodOptional<z.ZodString>;
|
|
142
|
+
employmentType: z.ZodOptional<z.ZodString>;
|
|
143
|
+
workplaceType: z.ZodOptional<z.ZodString>;
|
|
144
|
+
location: z.ZodOptional<z.ZodUnknown>;
|
|
145
|
+
startedAt: z.ZodString;
|
|
146
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
147
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
148
|
+
uri: z.ZodString;
|
|
149
|
+
cid: z.ZodString;
|
|
150
|
+
}, z.core.$strip>>>;
|
|
151
|
+
labels: z.ZodOptional<z.ZodObject<{
|
|
152
|
+
$type: z.ZodOptional<z.ZodLiteral<"com.atproto.label.defs#selfLabels">>;
|
|
153
|
+
values: z.ZodArray<z.ZodObject<{
|
|
154
|
+
val: z.ZodString;
|
|
155
|
+
}, z.core.$strip>>;
|
|
156
|
+
}, z.core.$strip>>;
|
|
157
|
+
createdAt: z.ZodString;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
type ProfilePositionRecord = z.infer<typeof ProfilePositionRecordSchema>;
|
|
160
|
+
|
|
161
|
+
/** Zod schema for `id.sifa.profile.project` records. */
|
|
162
|
+
declare const ProfileProjectRecordSchema: z.ZodObject<{
|
|
163
|
+
name: z.ZodString;
|
|
164
|
+
description: z.ZodOptional<z.ZodString>;
|
|
165
|
+
url: z.ZodOptional<z.ZodString>;
|
|
166
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
uri: z.ZodString;
|
|
168
|
+
cid: z.ZodString;
|
|
169
|
+
}, z.core.$strip>>;
|
|
170
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
171
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
172
|
+
labels: z.ZodOptional<z.ZodObject<{
|
|
173
|
+
$type: z.ZodOptional<z.ZodLiteral<"com.atproto.label.defs#selfLabels">>;
|
|
174
|
+
values: z.ZodArray<z.ZodObject<{
|
|
175
|
+
val: z.ZodString;
|
|
176
|
+
}, z.core.$strip>>;
|
|
177
|
+
}, z.core.$strip>>;
|
|
178
|
+
createdAt: z.ZodString;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
type ProfileProjectRecord = z.infer<typeof ProfileProjectRecordSchema>;
|
|
181
|
+
|
|
182
|
+
/** Author shape from `id.sifa.profile.publication#author`. */
|
|
183
|
+
declare const PublicationAuthorSchema: z.ZodObject<{
|
|
184
|
+
name: z.ZodString;
|
|
185
|
+
did: z.ZodOptional<z.ZodString>;
|
|
186
|
+
}, z.core.$strip>;
|
|
187
|
+
type PublicationAuthor = z.infer<typeof PublicationAuthorSchema>;
|
|
188
|
+
/** Zod schema for `id.sifa.profile.publication` records. */
|
|
189
|
+
declare const ProfilePublicationRecordSchema: z.ZodObject<{
|
|
190
|
+
title: z.ZodString;
|
|
191
|
+
publisher: z.ZodOptional<z.ZodString>;
|
|
192
|
+
url: z.ZodOptional<z.ZodString>;
|
|
193
|
+
description: z.ZodOptional<z.ZodString>;
|
|
194
|
+
authors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
195
|
+
name: z.ZodString;
|
|
196
|
+
did: z.ZodOptional<z.ZodString>;
|
|
197
|
+
}, z.core.$strip>>>;
|
|
198
|
+
publishedAt: z.ZodOptional<z.ZodString>;
|
|
199
|
+
createdAt: z.ZodString;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
type ProfilePublicationRecord = z.infer<typeof ProfilePublicationRecordSchema>;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Zod schema for `id.sifa.profile.self` records. Singleton (record key `self`).
|
|
205
|
+
*
|
|
206
|
+
* `knownValues` on `openTo` and `preferredWorkplace` are advisory per the
|
|
207
|
+
* lexicon spec -- unknown values are allowed, but documented options live
|
|
208
|
+
* under the `id.sifa.defs#*` namespace.
|
|
209
|
+
*/
|
|
210
|
+
declare const ProfileSelfRecordSchema: z.ZodObject<{
|
|
211
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
212
|
+
about: z.ZodOptional<z.ZodString>;
|
|
213
|
+
industry: z.ZodOptional<z.ZodString>;
|
|
214
|
+
location: z.ZodOptional<z.ZodUnknown>;
|
|
215
|
+
openTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
216
|
+
preferredWorkplace: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
217
|
+
langs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
218
|
+
labels: z.ZodOptional<z.ZodObject<{
|
|
219
|
+
$type: z.ZodOptional<z.ZodLiteral<"com.atproto.label.defs#selfLabels">>;
|
|
220
|
+
values: z.ZodArray<z.ZodObject<{
|
|
221
|
+
val: z.ZodString;
|
|
222
|
+
}, z.core.$strip>>;
|
|
223
|
+
}, z.core.$strip>>;
|
|
224
|
+
createdAt: z.ZodString;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
|
+
type ProfileSelfRecord = z.infer<typeof ProfileSelfRecordSchema>;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Zod schema for `id.sifa.profile.skill` records.
|
|
230
|
+
*
|
|
231
|
+
* `category` is advisory (`knownValues` in the lexicon) -- known values live
|
|
232
|
+
* under `id.sifa.defs#*` but unknown values are accepted.
|
|
233
|
+
*/
|
|
234
|
+
declare const ProfileSkillRecordSchema: z.ZodObject<{
|
|
235
|
+
name: z.ZodString;
|
|
236
|
+
category: z.ZodOptional<z.ZodString>;
|
|
237
|
+
createdAt: z.ZodString;
|
|
238
|
+
}, z.core.$strip>;
|
|
239
|
+
type ProfileSkillRecord = z.infer<typeof ProfileSkillRecordSchema>;
|
|
240
|
+
|
|
241
|
+
/** Zod schema for `id.sifa.profile.volunteering` records. */
|
|
242
|
+
declare const ProfileVolunteeringRecordSchema: z.ZodObject<{
|
|
243
|
+
organization: z.ZodString;
|
|
244
|
+
organizationDid: z.ZodOptional<z.ZodString>;
|
|
245
|
+
role: z.ZodOptional<z.ZodString>;
|
|
246
|
+
cause: z.ZodOptional<z.ZodString>;
|
|
247
|
+
description: z.ZodOptional<z.ZodString>;
|
|
248
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
249
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
250
|
+
createdAt: z.ZodString;
|
|
251
|
+
}, z.core.$strip>;
|
|
252
|
+
type ProfileVolunteeringRecord = z.infer<typeof ProfileVolunteeringRecordSchema>;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Grapheme-aware refinement matching the AT Protocol lexicon `maxGraphemes`
|
|
256
|
+
* constraint. JS strings are sequences of UTF-16 code units, but lexicon
|
|
257
|
+
* `maxGraphemes` counts user-perceived characters (grapheme clusters), so
|
|
258
|
+
* emoji sequences, regional indicators, ZWJ joins, and combining marks all
|
|
259
|
+
* count as one unit each. We use `Intl.Segmenter` to enforce this correctly.
|
|
260
|
+
*/
|
|
261
|
+
declare function maxGraphemes(max: number): (value: string) => boolean;
|
|
262
|
+
/** Decentralized identifier, AT Protocol `format: did`. */
|
|
263
|
+
declare const didSchema: z.ZodString;
|
|
264
|
+
/** RFC 3339 datetime with timezone offset, AT Protocol `format: datetime`. */
|
|
265
|
+
declare const datetimeSchema: z.ZodString;
|
|
266
|
+
/** Generic AT-URI, AT Protocol `format: at-uri`. */
|
|
267
|
+
declare const atUriSchema: z.ZodString;
|
|
268
|
+
/** Content identifier, AT Protocol `format: cid`. Loose validation -- accepts CIDv0 and CIDv1. */
|
|
269
|
+
declare const cidSchema: z.ZodString;
|
|
270
|
+
/** BCP 47 language tag, AT Protocol `format: language`. */
|
|
271
|
+
declare const languageTagSchema: z.ZodString;
|
|
272
|
+
/** Generic URI, AT Protocol `format: uri`. */
|
|
273
|
+
declare const uriSchema: z.ZodString;
|
|
274
|
+
/**
|
|
275
|
+
* StrongRef shape from `com.atproto.repo.strongRef` -- pins a record by both
|
|
276
|
+
* AT-URI (identity) and CID (version).
|
|
277
|
+
*/
|
|
278
|
+
declare const strongRefSchema: z.ZodObject<{
|
|
279
|
+
uri: z.ZodString;
|
|
280
|
+
cid: z.ZodString;
|
|
281
|
+
}, z.core.$strip>;
|
|
282
|
+
/**
|
|
283
|
+
* Self-labels shape from `com.atproto.label.defs#selfLabels`. Modelled
|
|
284
|
+
* permissively because clients rarely construct this directly; the AppView
|
|
285
|
+
* handles label validation.
|
|
286
|
+
*/
|
|
287
|
+
declare const selfLabelsSchema: z.ZodObject<{
|
|
288
|
+
$type: z.ZodOptional<z.ZodLiteral<"com.atproto.label.defs#selfLabels">>;
|
|
289
|
+
values: z.ZodArray<z.ZodObject<{
|
|
290
|
+
val: z.ZodString;
|
|
291
|
+
}, z.core.$strip>>;
|
|
292
|
+
}, z.core.$strip>;
|
|
293
|
+
|
|
294
|
+
export { type EndorsementConfirmationRecord, EndorsementConfirmationRecordSchema, type EndorsementRecord, EndorsementRecordSchema, type GraphFollowRecord, GraphFollowRecordSchema, type ProfileCertificationRecord, ProfileCertificationRecordSchema, type ProfileCourseRecord, ProfileCourseRecordSchema, type ProfileEducationRecord, ProfileEducationRecordSchema, type ProfileExternalAccountRecord, ProfileExternalAccountRecordSchema, type ProfileHonorRecord, ProfileHonorRecordSchema, type ProfileLanguageRecord, ProfileLanguageRecordSchema, type ProfilePositionRecord, ProfilePositionRecordSchema, type ProfileProjectRecord, ProfileProjectRecordSchema, type ProfilePublicationRecord, ProfilePublicationRecordSchema, type ProfileSelfRecord, ProfileSelfRecordSchema, type ProfileSkillRecord, ProfileSkillRecordSchema, type ProfileVolunteeringRecord, ProfileVolunteeringRecordSchema, type PublicationAuthor, PublicationAuthorSchema, atUriSchema, cidSchema, datetimeSchema, didSchema, languageTagSchema, maxGraphemes, selfLabelsSchema, strongRefSchema, uriSchema };
|