@hypercerts-org/lexicon 0.2.0-beta.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/LICENSE +21 -0
- package/README.md +319 -0
- package/dist/index.cjs +1472 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2094 -0
- package/dist/index.mjs +1441 -0
- package/dist/index.mjs.map +1 -0
- package/lexicons/app/certified/defs.json +24 -0
- package/lexicons/app/certified/location.json +68 -0
- package/lexicons/com/atproto/repo/strongRef.json +15 -0
- package/lexicons/org/hypercerts/claim/contribution.json +57 -0
- package/lexicons/org/hypercerts/claim/evaluation.json +51 -0
- package/lexicons/org/hypercerts/claim/evidence.json +44 -0
- package/lexicons/org/hypercerts/claim/measurement.json +60 -0
- package/lexicons/org/hypercerts/claim/rights.json +36 -0
- package/lexicons/org/hypercerts/claim.json +95 -0
- package/lexicons/org/hypercerts/collection.json +62 -0
- package/package.json +66 -0
- package/src/index.ts +118 -0
- package/src/lexicons.ts +623 -0
- package/src/types/app/certified/defs.ts +18 -0
- package/src/types/app/certified/location.ts +49 -0
- package/src/types/com/atproto/repo/strongRef.ts +31 -0
- package/src/types/org/hypercerts/claim/contribution.ts +50 -0
- package/src/types/org/hypercerts/claim/evaluation.ts +51 -0
- package/src/types/org/hypercerts/claim/evidence.ts +49 -0
- package/src/types/org/hypercerts/claim/measurement.ts +50 -0
- package/src/types/org/hypercerts/claim/rights.ts +44 -0
- package/src/types/org/hypercerts/claim.ts +58 -0
- package/src/types/org/hypercerts/collection.ts +63 -0
- package/src/util.ts +82 -0
package/src/lexicons.ts
ADDED
|
@@ -0,0 +1,623 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
type LexiconDoc,
|
|
6
|
+
Lexicons,
|
|
7
|
+
ValidationError,
|
|
8
|
+
type ValidationResult,
|
|
9
|
+
} from '@atproto/lexicon'
|
|
10
|
+
import { type $Typed, is$typed, maybe$typed } from './util.js'
|
|
11
|
+
|
|
12
|
+
export const schemaDict = {
|
|
13
|
+
AppCertifiedDefs: {
|
|
14
|
+
lexicon: 1,
|
|
15
|
+
id: 'app.certified.defs',
|
|
16
|
+
defs: {
|
|
17
|
+
uri: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
format: 'uri',
|
|
20
|
+
maxGraphemes: 1000,
|
|
21
|
+
description: 'URI to external data',
|
|
22
|
+
},
|
|
23
|
+
smallBlob: {
|
|
24
|
+
type: 'blob',
|
|
25
|
+
accept: ['*/*'],
|
|
26
|
+
maxSize: 10485760,
|
|
27
|
+
description: 'Blob to external data (up to 10MB)',
|
|
28
|
+
},
|
|
29
|
+
largeBlob: {
|
|
30
|
+
type: 'blob',
|
|
31
|
+
accept: ['*/*'],
|
|
32
|
+
maxSize: 104857600,
|
|
33
|
+
description: 'Blob to external data (up to 100MB)',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
AppCertifiedLocation: {
|
|
38
|
+
lexicon: 1,
|
|
39
|
+
id: 'app.certified.location',
|
|
40
|
+
defs: {
|
|
41
|
+
main: {
|
|
42
|
+
type: 'record',
|
|
43
|
+
description: 'A location reference',
|
|
44
|
+
key: 'any',
|
|
45
|
+
record: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
required: [
|
|
48
|
+
'lpVersion',
|
|
49
|
+
'srs',
|
|
50
|
+
'locationType',
|
|
51
|
+
'location',
|
|
52
|
+
'createdAt',
|
|
53
|
+
],
|
|
54
|
+
properties: {
|
|
55
|
+
lpVersion: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
description: 'The version of the Location Protocol',
|
|
58
|
+
maxLength: 10,
|
|
59
|
+
},
|
|
60
|
+
srs: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
format: 'uri',
|
|
63
|
+
description:
|
|
64
|
+
'The Spatial Reference System URI (e.g., http://www.opengis.net/def/crs/OGC/1.3/CRS84) that defines the coordinate system.',
|
|
65
|
+
maxLength: 100,
|
|
66
|
+
},
|
|
67
|
+
locationType: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
description:
|
|
70
|
+
'An identifier for the format of the location data (e.g., coordinate-decimal, geojson-point)',
|
|
71
|
+
knownValues: ['coordinate-decimal', 'geojson-point'],
|
|
72
|
+
maxLength: 20,
|
|
73
|
+
},
|
|
74
|
+
location: {
|
|
75
|
+
type: 'union',
|
|
76
|
+
refs: [
|
|
77
|
+
'lex:app.certified.defs#uri',
|
|
78
|
+
'lex:app.certified.defs#smallBlob',
|
|
79
|
+
],
|
|
80
|
+
description:
|
|
81
|
+
'The location of where the work was performed as a URI or blob.',
|
|
82
|
+
},
|
|
83
|
+
name: {
|
|
84
|
+
type: 'string',
|
|
85
|
+
description: 'Optional name for this location',
|
|
86
|
+
maxLength: 1000,
|
|
87
|
+
maxGraphemes: 100,
|
|
88
|
+
},
|
|
89
|
+
description: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
description: 'Optional description for this location',
|
|
92
|
+
maxLength: 2000,
|
|
93
|
+
maxGraphemes: 500,
|
|
94
|
+
},
|
|
95
|
+
createdAt: {
|
|
96
|
+
type: 'string',
|
|
97
|
+
format: 'datetime',
|
|
98
|
+
description:
|
|
99
|
+
'Client-declared timestamp when this record was originally created',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
ComAtprotoRepoStrongRef: {
|
|
107
|
+
lexicon: 1,
|
|
108
|
+
id: 'com.atproto.repo.strongRef',
|
|
109
|
+
description: 'A URI with a content-hash fingerprint.',
|
|
110
|
+
defs: {
|
|
111
|
+
main: {
|
|
112
|
+
type: 'object',
|
|
113
|
+
required: ['uri', 'cid'],
|
|
114
|
+
properties: {
|
|
115
|
+
uri: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
format: 'at-uri',
|
|
118
|
+
},
|
|
119
|
+
cid: {
|
|
120
|
+
type: 'string',
|
|
121
|
+
format: 'cid',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
OrgHypercertsClaim: {
|
|
128
|
+
lexicon: 1,
|
|
129
|
+
id: 'org.hypercerts.claim',
|
|
130
|
+
defs: {
|
|
131
|
+
main: {
|
|
132
|
+
type: 'record',
|
|
133
|
+
description: 'A hypercert record tracking impact work.',
|
|
134
|
+
key: 'any',
|
|
135
|
+
record: {
|
|
136
|
+
type: 'object',
|
|
137
|
+
required: [
|
|
138
|
+
'title',
|
|
139
|
+
'shortDescription',
|
|
140
|
+
'createdAt',
|
|
141
|
+
'workScope',
|
|
142
|
+
'workTimeFrameFrom',
|
|
143
|
+
'workTimeFrameTo',
|
|
144
|
+
],
|
|
145
|
+
properties: {
|
|
146
|
+
title: {
|
|
147
|
+
type: 'string',
|
|
148
|
+
description: 'Title of the hypercert',
|
|
149
|
+
maxLength: 256,
|
|
150
|
+
},
|
|
151
|
+
shortDescription: {
|
|
152
|
+
type: 'string',
|
|
153
|
+
description: 'Short blurb of the impact work done.',
|
|
154
|
+
maxLength: 3000,
|
|
155
|
+
maxGraphemes: 300,
|
|
156
|
+
},
|
|
157
|
+
description: {
|
|
158
|
+
type: 'string',
|
|
159
|
+
description:
|
|
160
|
+
'Optional longer description of the impact work done.',
|
|
161
|
+
maxLength: 30000,
|
|
162
|
+
maxGraphemes: 3000,
|
|
163
|
+
},
|
|
164
|
+
image: {
|
|
165
|
+
type: 'union',
|
|
166
|
+
refs: [
|
|
167
|
+
'lex:app.certified.defs#uri',
|
|
168
|
+
'lex:app.certified.defs#smallBlob',
|
|
169
|
+
],
|
|
170
|
+
description:
|
|
171
|
+
'The hypercert visual representation as a URI or blob',
|
|
172
|
+
},
|
|
173
|
+
workScope: {
|
|
174
|
+
type: 'string',
|
|
175
|
+
description: 'Scope of the work performed',
|
|
176
|
+
maxLength: 5000,
|
|
177
|
+
maxGraphemes: 1000,
|
|
178
|
+
},
|
|
179
|
+
workTimeFrameFrom: {
|
|
180
|
+
type: 'string',
|
|
181
|
+
format: 'datetime',
|
|
182
|
+
description: 'When the work began',
|
|
183
|
+
},
|
|
184
|
+
workTimeFrameTo: {
|
|
185
|
+
type: 'string',
|
|
186
|
+
format: 'datetime',
|
|
187
|
+
description: 'When the work ended',
|
|
188
|
+
},
|
|
189
|
+
evidence: {
|
|
190
|
+
type: 'array',
|
|
191
|
+
description:
|
|
192
|
+
'Supporting evidence, documentation, or external data URIs',
|
|
193
|
+
items: {
|
|
194
|
+
type: 'ref',
|
|
195
|
+
ref: 'lex:com.atproto.repo.strongRef',
|
|
196
|
+
description:
|
|
197
|
+
'A strong reference to the evidence that supports this impact claim. The record referenced must conform with the org.hypercerts.claim.evidence lexicon',
|
|
198
|
+
},
|
|
199
|
+
maxLength: 100,
|
|
200
|
+
},
|
|
201
|
+
contributions: {
|
|
202
|
+
type: 'array',
|
|
203
|
+
description:
|
|
204
|
+
'A strong reference to the contributions done to create the impact in the hypercerts. The record referenced must conform with the lexicon org.hypercerts.claim.contributions',
|
|
205
|
+
items: {
|
|
206
|
+
type: 'ref',
|
|
207
|
+
ref: 'lex:com.atproto.repo.strongRef',
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
rights: {
|
|
211
|
+
type: 'ref',
|
|
212
|
+
ref: 'lex:com.atproto.repo.strongRef',
|
|
213
|
+
description:
|
|
214
|
+
'A strong reference to the rights that this hypercert has. The record referenced must conform with the lexicon org.hypercerts.claim.rights',
|
|
215
|
+
},
|
|
216
|
+
location: {
|
|
217
|
+
type: 'ref',
|
|
218
|
+
ref: 'lex:com.atproto.repo.strongRef',
|
|
219
|
+
description:
|
|
220
|
+
'A strong reference to the location where the work for done hypercert was located. The record referenced must conform with the lexicon org.hypercerts.claim.location',
|
|
221
|
+
},
|
|
222
|
+
createdAt: {
|
|
223
|
+
type: 'string',
|
|
224
|
+
format: 'datetime',
|
|
225
|
+
description:
|
|
226
|
+
'Client-declared timestamp when this record was originally created',
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
OrgHypercertsClaimContribution: {
|
|
234
|
+
lexicon: 1,
|
|
235
|
+
id: 'org.hypercerts.claim.contribution',
|
|
236
|
+
defs: {
|
|
237
|
+
main: {
|
|
238
|
+
type: 'record',
|
|
239
|
+
description: "A contribution made toward a hypercert's impact.",
|
|
240
|
+
key: 'any',
|
|
241
|
+
record: {
|
|
242
|
+
type: 'object',
|
|
243
|
+
required: ['hypercert', 'contributors', 'createdAt'],
|
|
244
|
+
properties: {
|
|
245
|
+
hypercert: {
|
|
246
|
+
type: 'ref',
|
|
247
|
+
ref: 'lex:com.atproto.repo.strongRef',
|
|
248
|
+
description:
|
|
249
|
+
'A strong reference to the hypercert this contribution is for. The record referenced must conform with the lexicon org.hypercerts.claim.',
|
|
250
|
+
},
|
|
251
|
+
role: {
|
|
252
|
+
type: 'string',
|
|
253
|
+
description: 'Role or title of the contributor(s).',
|
|
254
|
+
maxLength: 100,
|
|
255
|
+
},
|
|
256
|
+
contributors: {
|
|
257
|
+
type: 'array',
|
|
258
|
+
description:
|
|
259
|
+
'List of the contributors (names, pseudonyms, or DIDs). If multiple contributors are stored in the same hypercertContribution, then they would have the exact same role.',
|
|
260
|
+
items: {
|
|
261
|
+
type: 'string',
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
description: {
|
|
265
|
+
type: 'string',
|
|
266
|
+
description: 'What the contribution concretely achieved',
|
|
267
|
+
maxLength: 2000,
|
|
268
|
+
maxGraphemes: 500,
|
|
269
|
+
},
|
|
270
|
+
workTimeframeFrom: {
|
|
271
|
+
type: 'string',
|
|
272
|
+
format: 'datetime',
|
|
273
|
+
description:
|
|
274
|
+
'When this contribution started. This should be a subset of the hypercert timeframe.',
|
|
275
|
+
},
|
|
276
|
+
workTimeframeTo: {
|
|
277
|
+
type: 'string',
|
|
278
|
+
format: 'datetime',
|
|
279
|
+
description:
|
|
280
|
+
'When this contribution finished. This should be a subset of the hypercert timeframe.',
|
|
281
|
+
},
|
|
282
|
+
createdAt: {
|
|
283
|
+
type: 'string',
|
|
284
|
+
format: 'datetime',
|
|
285
|
+
description:
|
|
286
|
+
'Client-declared timestamp when this record was originally created',
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
OrgHypercertsClaimEvaluation: {
|
|
294
|
+
lexicon: 1,
|
|
295
|
+
id: 'org.hypercerts.claim.evaluation',
|
|
296
|
+
defs: {
|
|
297
|
+
main: {
|
|
298
|
+
type: 'record',
|
|
299
|
+
description: 'An evaluation of a hypercert or other claim',
|
|
300
|
+
key: 'tid',
|
|
301
|
+
record: {
|
|
302
|
+
type: 'object',
|
|
303
|
+
required: ['subject', 'evaluators', 'summary', 'createdAt'],
|
|
304
|
+
properties: {
|
|
305
|
+
subject: {
|
|
306
|
+
type: 'ref',
|
|
307
|
+
ref: 'lex:com.atproto.repo.strongRef',
|
|
308
|
+
description:
|
|
309
|
+
'A strong reference to the evaluated claim. (e.g measurement, hypercert, contribution, etc)',
|
|
310
|
+
},
|
|
311
|
+
evaluators: {
|
|
312
|
+
type: 'array',
|
|
313
|
+
description: 'DIDs of the evaluators',
|
|
314
|
+
items: {
|
|
315
|
+
type: 'string',
|
|
316
|
+
format: 'did',
|
|
317
|
+
},
|
|
318
|
+
maxLength: 100,
|
|
319
|
+
},
|
|
320
|
+
evaluations: {
|
|
321
|
+
type: 'array',
|
|
322
|
+
description:
|
|
323
|
+
'Evaluation data (URIs or blobs) containing detailed reports or methodology',
|
|
324
|
+
items: {
|
|
325
|
+
type: 'union',
|
|
326
|
+
refs: [
|
|
327
|
+
'lex:app.certified.defs#uri',
|
|
328
|
+
'lex:app.certified.defs#smallBlob',
|
|
329
|
+
],
|
|
330
|
+
},
|
|
331
|
+
maxLength: 100,
|
|
332
|
+
},
|
|
333
|
+
summary: {
|
|
334
|
+
type: 'string',
|
|
335
|
+
description: 'Brief evaluation summary',
|
|
336
|
+
maxLength: 5000,
|
|
337
|
+
maxGraphemes: 1000,
|
|
338
|
+
},
|
|
339
|
+
createdAt: {
|
|
340
|
+
type: 'string',
|
|
341
|
+
format: 'datetime',
|
|
342
|
+
description:
|
|
343
|
+
'Client-declared timestamp when this record was originally created',
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
OrgHypercertsClaimEvidence: {
|
|
351
|
+
lexicon: 1,
|
|
352
|
+
id: 'org.hypercerts.claim.evidence',
|
|
353
|
+
defs: {
|
|
354
|
+
main: {
|
|
355
|
+
type: 'record',
|
|
356
|
+
description: 'A piece of evidence supporting a hypercert claim',
|
|
357
|
+
key: 'any',
|
|
358
|
+
record: {
|
|
359
|
+
type: 'object',
|
|
360
|
+
required: ['content', 'shortDescription', 'createdAt'],
|
|
361
|
+
properties: {
|
|
362
|
+
content: {
|
|
363
|
+
type: 'union',
|
|
364
|
+
refs: [
|
|
365
|
+
'lex:app.certified.defs#uri',
|
|
366
|
+
'lex:app.certified.defs#smallBlob',
|
|
367
|
+
],
|
|
368
|
+
description:
|
|
369
|
+
'A piece of evidence (URI or blobs) supporting a hypercert claim',
|
|
370
|
+
},
|
|
371
|
+
title: {
|
|
372
|
+
type: 'string',
|
|
373
|
+
maxLength: 256,
|
|
374
|
+
description:
|
|
375
|
+
'Optional title to describe the nature of the evidence',
|
|
376
|
+
},
|
|
377
|
+
shortDescription: {
|
|
378
|
+
type: 'string',
|
|
379
|
+
maxLength: 3000,
|
|
380
|
+
maxGraphemes: 300,
|
|
381
|
+
description:
|
|
382
|
+
'Short description explaining what this evidence demonstrates or proves',
|
|
383
|
+
},
|
|
384
|
+
description: {
|
|
385
|
+
type: 'string',
|
|
386
|
+
description:
|
|
387
|
+
'Optional longer description describing the impact claim evidence.',
|
|
388
|
+
maxLength: 30000,
|
|
389
|
+
maxGraphemes: 3000,
|
|
390
|
+
},
|
|
391
|
+
createdAt: {
|
|
392
|
+
type: 'string',
|
|
393
|
+
format: 'datetime',
|
|
394
|
+
description:
|
|
395
|
+
'Client-declared timestamp when this hypercert claim was originally created',
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
OrgHypercertsClaimMeasurement: {
|
|
403
|
+
lexicon: 1,
|
|
404
|
+
id: 'org.hypercerts.claim.measurement',
|
|
405
|
+
defs: {
|
|
406
|
+
main: {
|
|
407
|
+
type: 'record',
|
|
408
|
+
description: 'External measurement data supporting a hypercert claim',
|
|
409
|
+
key: 'tid',
|
|
410
|
+
record: {
|
|
411
|
+
type: 'object',
|
|
412
|
+
required: ['hypercert', 'measurers', 'metric', 'value', 'createdAt'],
|
|
413
|
+
properties: {
|
|
414
|
+
hypercert: {
|
|
415
|
+
type: 'ref',
|
|
416
|
+
ref: 'lex:com.atproto.repo.strongRef',
|
|
417
|
+
description:
|
|
418
|
+
'A strong reference to the hypercert that this measurement is for. The record referenced must conform with the lexicon org.hypercerts.claim.',
|
|
419
|
+
},
|
|
420
|
+
measurers: {
|
|
421
|
+
type: 'array',
|
|
422
|
+
description:
|
|
423
|
+
'DIDs of the entity (or entities) that measured this data',
|
|
424
|
+
items: {
|
|
425
|
+
type: 'string',
|
|
426
|
+
format: 'did',
|
|
427
|
+
},
|
|
428
|
+
maxLength: 100,
|
|
429
|
+
},
|
|
430
|
+
metric: {
|
|
431
|
+
type: 'string',
|
|
432
|
+
description: 'The metric being measured',
|
|
433
|
+
maxLength: 500,
|
|
434
|
+
},
|
|
435
|
+
value: {
|
|
436
|
+
type: 'string',
|
|
437
|
+
description: 'The measured value',
|
|
438
|
+
maxLength: 500,
|
|
439
|
+
},
|
|
440
|
+
measurementMethodURI: {
|
|
441
|
+
type: 'string',
|
|
442
|
+
format: 'uri',
|
|
443
|
+
description:
|
|
444
|
+
'URI to methodology documentation, standard protocol, or measurement procedure',
|
|
445
|
+
},
|
|
446
|
+
evidenceURI: {
|
|
447
|
+
type: 'array',
|
|
448
|
+
description: 'URIs to supporting evidence or data',
|
|
449
|
+
items: {
|
|
450
|
+
type: 'string',
|
|
451
|
+
format: 'uri',
|
|
452
|
+
},
|
|
453
|
+
maxLength: 50,
|
|
454
|
+
},
|
|
455
|
+
createdAt: {
|
|
456
|
+
type: 'string',
|
|
457
|
+
format: 'datetime',
|
|
458
|
+
description:
|
|
459
|
+
'Client-declared timestamp when this record was originally created',
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
OrgHypercertsClaimRights: {
|
|
467
|
+
lexicon: 1,
|
|
468
|
+
id: 'org.hypercerts.claim.rights',
|
|
469
|
+
defs: {
|
|
470
|
+
main: {
|
|
471
|
+
type: 'record',
|
|
472
|
+
description:
|
|
473
|
+
'Describes the rights that a user has with a hypercert, such as whether it can be sold, transferred, and under what conditions.',
|
|
474
|
+
key: 'any',
|
|
475
|
+
record: {
|
|
476
|
+
type: 'object',
|
|
477
|
+
required: [
|
|
478
|
+
'rightsName',
|
|
479
|
+
'rightsType',
|
|
480
|
+
'rightsDescription',
|
|
481
|
+
'createdAt',
|
|
482
|
+
],
|
|
483
|
+
properties: {
|
|
484
|
+
rightsName: {
|
|
485
|
+
type: 'string',
|
|
486
|
+
description: 'Full name of the rights',
|
|
487
|
+
maxLength: 100,
|
|
488
|
+
},
|
|
489
|
+
rightsType: {
|
|
490
|
+
type: 'string',
|
|
491
|
+
description: 'Short rights identifier for easier search',
|
|
492
|
+
maxLength: 10,
|
|
493
|
+
},
|
|
494
|
+
rightsDescription: {
|
|
495
|
+
type: 'string',
|
|
496
|
+
description: 'Description of the rights of this hypercert',
|
|
497
|
+
},
|
|
498
|
+
createdAt: {
|
|
499
|
+
type: 'string',
|
|
500
|
+
format: 'datetime',
|
|
501
|
+
description:
|
|
502
|
+
'Client-declared timestamp when this record was originally created',
|
|
503
|
+
},
|
|
504
|
+
},
|
|
505
|
+
},
|
|
506
|
+
},
|
|
507
|
+
},
|
|
508
|
+
},
|
|
509
|
+
OrgHypercertsCollection: {
|
|
510
|
+
lexicon: 1,
|
|
511
|
+
id: 'org.hypercerts.collection',
|
|
512
|
+
defs: {
|
|
513
|
+
main: {
|
|
514
|
+
type: 'record',
|
|
515
|
+
description:
|
|
516
|
+
'A collection/group of hypercerts that have a specific property.',
|
|
517
|
+
key: 'tid',
|
|
518
|
+
record: {
|
|
519
|
+
type: 'object',
|
|
520
|
+
required: ['title', 'claims', 'createdAt'],
|
|
521
|
+
properties: {
|
|
522
|
+
title: {
|
|
523
|
+
type: 'string',
|
|
524
|
+
description: 'The title of this collection',
|
|
525
|
+
maxLength: 800,
|
|
526
|
+
maxGraphemes: 80,
|
|
527
|
+
},
|
|
528
|
+
shortDescription: {
|
|
529
|
+
type: 'string',
|
|
530
|
+
maxLength: 3000,
|
|
531
|
+
maxGraphemes: 300,
|
|
532
|
+
description: 'A short description of this collection',
|
|
533
|
+
},
|
|
534
|
+
coverPhoto: {
|
|
535
|
+
type: 'union',
|
|
536
|
+
refs: [
|
|
537
|
+
'lex:app.certified.defs#uri',
|
|
538
|
+
'lex:app.certified.defs#smallBlob',
|
|
539
|
+
],
|
|
540
|
+
description:
|
|
541
|
+
'The cover photo of this collection (either in URI format or in a blob).',
|
|
542
|
+
},
|
|
543
|
+
claims: {
|
|
544
|
+
type: 'array',
|
|
545
|
+
description:
|
|
546
|
+
'Array of claims with their associated weights in this collection',
|
|
547
|
+
items: {
|
|
548
|
+
type: 'ref',
|
|
549
|
+
ref: 'lex:org.hypercerts.collection#claimItem',
|
|
550
|
+
},
|
|
551
|
+
},
|
|
552
|
+
createdAt: {
|
|
553
|
+
type: 'string',
|
|
554
|
+
format: 'datetime',
|
|
555
|
+
description:
|
|
556
|
+
'Client-declared timestamp when this record was originally created',
|
|
557
|
+
},
|
|
558
|
+
},
|
|
559
|
+
},
|
|
560
|
+
},
|
|
561
|
+
claimItem: {
|
|
562
|
+
type: 'object',
|
|
563
|
+
required: ['claim', 'weight'],
|
|
564
|
+
properties: {
|
|
565
|
+
claim: {
|
|
566
|
+
type: 'ref',
|
|
567
|
+
ref: 'lex:com.atproto.repo.strongRef',
|
|
568
|
+
description:
|
|
569
|
+
'A strong reference to a hypercert claim record. This claim must conform to the lexicon org.hypercerts.claim.record',
|
|
570
|
+
},
|
|
571
|
+
weight: {
|
|
572
|
+
type: 'string',
|
|
573
|
+
description:
|
|
574
|
+
'The weight/importance of this hypercert claim in the collection (a percentage from 0-100, stored as a string to avoid float precision issues). The total claim weights should add up to 100.',
|
|
575
|
+
},
|
|
576
|
+
},
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
} as const satisfies Record<string, LexiconDoc>
|
|
581
|
+
export const schemas = Object.values(schemaDict) satisfies LexiconDoc[]
|
|
582
|
+
export const lexicons: Lexicons = new Lexicons(schemas)
|
|
583
|
+
|
|
584
|
+
export function validate<T extends { $type: string }>(
|
|
585
|
+
v: unknown,
|
|
586
|
+
id: string,
|
|
587
|
+
hash: string,
|
|
588
|
+
requiredType: true,
|
|
589
|
+
): ValidationResult<T>
|
|
590
|
+
export function validate<T extends { $type?: string }>(
|
|
591
|
+
v: unknown,
|
|
592
|
+
id: string,
|
|
593
|
+
hash: string,
|
|
594
|
+
requiredType?: false,
|
|
595
|
+
): ValidationResult<T>
|
|
596
|
+
export function validate(
|
|
597
|
+
v: unknown,
|
|
598
|
+
id: string,
|
|
599
|
+
hash: string,
|
|
600
|
+
requiredType?: boolean,
|
|
601
|
+
): ValidationResult {
|
|
602
|
+
return (requiredType ? is$typed : maybe$typed)(v, id, hash)
|
|
603
|
+
? lexicons.validate(`${id}#${hash}`, v)
|
|
604
|
+
: {
|
|
605
|
+
success: false,
|
|
606
|
+
error: new ValidationError(
|
|
607
|
+
`Must be an object with "${hash === 'main' ? id : `${id}#${hash}`}" $type property`,
|
|
608
|
+
),
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
export const ids = {
|
|
613
|
+
AppCertifiedDefs: 'app.certified.defs',
|
|
614
|
+
AppCertifiedLocation: 'app.certified.location',
|
|
615
|
+
ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef',
|
|
616
|
+
OrgHypercertsClaim: 'org.hypercerts.claim',
|
|
617
|
+
OrgHypercertsClaimContribution: 'org.hypercerts.claim.contribution',
|
|
618
|
+
OrgHypercertsClaimEvaluation: 'org.hypercerts.claim.evaluation',
|
|
619
|
+
OrgHypercertsClaimEvidence: 'org.hypercerts.claim.evidence',
|
|
620
|
+
OrgHypercertsClaimMeasurement: 'org.hypercerts.claim.measurement',
|
|
621
|
+
OrgHypercertsClaimRights: 'org.hypercerts.claim.rights',
|
|
622
|
+
OrgHypercertsCollection: 'org.hypercerts.collection',
|
|
623
|
+
} as const
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../lexicons'
|
|
7
|
+
import { type $Typed, is$typed as _is$typed, type OmitKey } from '../../../util'
|
|
8
|
+
|
|
9
|
+
const is$typed = _is$typed,
|
|
10
|
+
validate = _validate
|
|
11
|
+
const id = 'app.certified.defs'
|
|
12
|
+
|
|
13
|
+
/** URI to external data */
|
|
14
|
+
export type Uri = string
|
|
15
|
+
/** Blob to external data (up to 10MB) */
|
|
16
|
+
export type SmallBlob = BlobRef
|
|
17
|
+
/** Blob to external data (up to 100MB) */
|
|
18
|
+
export type LargeBlob = BlobRef
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../lexicons'
|
|
7
|
+
import { type $Typed, is$typed as _is$typed, type OmitKey } from '../../../util'
|
|
8
|
+
import type * as AppCertifiedDefs from './defs.js'
|
|
9
|
+
|
|
10
|
+
const is$typed = _is$typed,
|
|
11
|
+
validate = _validate
|
|
12
|
+
const id = 'app.certified.location'
|
|
13
|
+
|
|
14
|
+
export interface Main {
|
|
15
|
+
$type: 'app.certified.location'
|
|
16
|
+
/** The version of the Location Protocol */
|
|
17
|
+
lpVersion: string
|
|
18
|
+
/** The Spatial Reference System URI (e.g., http://www.opengis.net/def/crs/OGC/1.3/CRS84) that defines the coordinate system. */
|
|
19
|
+
srs: string
|
|
20
|
+
/** An identifier for the format of the location data (e.g., coordinate-decimal, geojson-point) */
|
|
21
|
+
locationType: 'coordinate-decimal' | 'geojson-point' | (string & {})
|
|
22
|
+
location:
|
|
23
|
+
| $Typed<AppCertifiedDefs.Uri>
|
|
24
|
+
| $Typed<AppCertifiedDefs.SmallBlob>
|
|
25
|
+
| { $type: string }
|
|
26
|
+
/** Optional name for this location */
|
|
27
|
+
name?: string
|
|
28
|
+
/** Optional description for this location */
|
|
29
|
+
description?: string
|
|
30
|
+
/** Client-declared timestamp when this record was originally created */
|
|
31
|
+
createdAt: string
|
|
32
|
+
[k: string]: unknown
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const hashMain = 'main'
|
|
36
|
+
|
|
37
|
+
export function isMain<V>(v: V) {
|
|
38
|
+
return is$typed(v, id, hashMain)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function validateMain<V>(v: V) {
|
|
42
|
+
return validate<Main & V>(v, id, hashMain, true)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
type Main as Record,
|
|
47
|
+
isMain as isRecord,
|
|
48
|
+
validateMain as validateRecord,
|
|
49
|
+
}
|