@atproto/lexicon 0.7.3 → 0.7.4

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/lexicons.d.ts +1 -1
  3. package/dist/lexicons.d.ts.map +1 -1
  4. package/dist/lexicons.js.map +1 -1
  5. package/dist/serialize.d.ts +1 -1
  6. package/dist/serialize.d.ts.map +1 -1
  7. package/dist/serialize.js +8 -7
  8. package/dist/serialize.js.map +1 -1
  9. package/dist/types.d.ts +1 -1
  10. package/dist/types.d.ts.map +1 -1
  11. package/dist/types.js.map +1 -1
  12. package/dist/validation.d.ts +1 -1
  13. package/dist/validation.d.ts.map +1 -1
  14. package/dist/validation.js +1 -0
  15. package/dist/validation.js.map +1 -1
  16. package/dist/validators/blob.d.ts +1 -1
  17. package/dist/validators/blob.d.ts.map +1 -1
  18. package/dist/validators/blob.js +1 -0
  19. package/dist/validators/blob.js.map +1 -1
  20. package/dist/validators/complex.d.ts +1 -1
  21. package/dist/validators/complex.d.ts.map +1 -1
  22. package/dist/validators/complex.js +2 -1
  23. package/dist/validators/complex.js.map +1 -1
  24. package/dist/validators/formats.d.ts +1 -1
  25. package/dist/validators/formats.d.ts.map +1 -1
  26. package/dist/validators/formats.js.map +1 -1
  27. package/dist/validators/primitives.d.ts +1 -1
  28. package/dist/validators/primitives.d.ts.map +1 -1
  29. package/dist/validators/primitives.js +2 -1
  30. package/dist/validators/primitives.js.map +1 -1
  31. package/dist/validators/xrpc.d.ts +1 -1
  32. package/dist/validators/xrpc.d.ts.map +1 -1
  33. package/dist/validators/xrpc.js +3 -2
  34. package/dist/validators/xrpc.js.map +1 -1
  35. package/package.json +18 -13
  36. package/jest.config.cjs +0 -21
  37. package/src/blob-refs.ts +0 -65
  38. package/src/index.ts +0 -4
  39. package/src/lexicons.ts +0 -253
  40. package/src/serialize.ts +0 -102
  41. package/src/types.ts +0 -483
  42. package/src/util.ts +0 -58
  43. package/src/validation.ts +0 -84
  44. package/src/validators/blob.ts +0 -19
  45. package/src/validators/complex.ts +0 -212
  46. package/src/validators/formats.ts +0 -72
  47. package/src/validators/primitives.ts +0 -416
  48. package/src/validators/xrpc.ts +0 -53
  49. package/tests/_scaffolds/lexicons.ts +0 -545
  50. package/tests/general.test.ts +0 -1243
  51. package/tsconfig.build.json +0 -8
  52. package/tsconfig.build.tsbuildinfo +0 -1
  53. package/tsconfig.json +0 -7
  54. package/tsconfig.tests.json +0 -7
@@ -1,545 +0,0 @@
1
- import { LexiconDoc } from '../../src/index.js'
2
-
3
- const lexicons: LexiconDoc[] = [
4
- {
5
- lexicon: 1,
6
- id: 'com.example.kitchenSink',
7
- defs: {
8
- main: {
9
- type: 'record',
10
- description: 'A record',
11
- key: 'tid',
12
- record: {
13
- type: 'object',
14
- required: [
15
- 'object',
16
- 'array',
17
- 'boolean',
18
- 'integer',
19
- 'string',
20
- 'bytes',
21
- 'cidLink',
22
- ],
23
- properties: {
24
- object: { type: 'ref', ref: '#object' },
25
- array: { type: 'array', items: { type: 'string' } },
26
- boolean: { type: 'boolean' },
27
- integer: { type: 'integer' },
28
- string: { type: 'string' },
29
- bytes: { type: 'bytes' },
30
- cidLink: { type: 'cid-link' },
31
- },
32
- },
33
- },
34
- object: {
35
- type: 'object',
36
- required: ['object', 'array', 'boolean', 'integer', 'string'],
37
- properties: {
38
- object: { type: 'ref', ref: '#subobject' },
39
- array: { type: 'array', items: { type: 'string' } },
40
- boolean: { type: 'boolean' },
41
- integer: { type: 'integer' },
42
- string: { type: 'string' },
43
- },
44
- },
45
- subobject: {
46
- type: 'object',
47
- required: ['boolean'],
48
- properties: {
49
- boolean: { type: 'boolean' },
50
- },
51
- },
52
- },
53
- },
54
- {
55
- lexicon: 1,
56
- id: 'com.example.query',
57
- defs: {
58
- main: {
59
- type: 'query',
60
- description: 'A query',
61
- parameters: {
62
- type: 'params',
63
- required: ['boolean', 'integer'],
64
- properties: {
65
- boolean: { type: 'boolean' },
66
- integer: { type: 'integer' },
67
- string: { type: 'string' },
68
- array: { type: 'array', items: { type: 'string' } },
69
- def: { type: 'integer', default: 0 },
70
- },
71
- },
72
- output: {
73
- encoding: 'application/json',
74
- schema: { type: 'ref', ref: 'com.example.kitchenSink#object' },
75
- },
76
- },
77
- },
78
- },
79
- {
80
- lexicon: 1,
81
- id: 'com.example.procedure',
82
- defs: {
83
- main: {
84
- type: 'procedure',
85
- description: 'A procedure',
86
- parameters: {
87
- type: 'params',
88
- required: ['boolean', 'integer'],
89
- properties: {
90
- boolean: { type: 'boolean' },
91
- integer: { type: 'integer' },
92
- string: { type: 'string' },
93
- array: { type: 'array', items: { type: 'string' } },
94
- },
95
- },
96
- input: {
97
- encoding: 'application/json',
98
- schema: { type: 'ref', ref: 'com.example.kitchenSink#object' },
99
- },
100
- output: {
101
- encoding: 'application/json',
102
- schema: { type: 'ref', ref: 'com.example.kitchenSink#object' },
103
- },
104
- },
105
- },
106
- },
107
- {
108
- lexicon: 1,
109
- id: 'com.example.optional',
110
- defs: {
111
- main: {
112
- type: 'record',
113
- record: {
114
- type: 'object',
115
- properties: {
116
- object: { type: 'ref', ref: 'com.example.kitchenSink#object' },
117
- array: { type: 'array', items: { type: 'string' } },
118
- boolean: { type: 'boolean' },
119
- integer: { type: 'integer' },
120
- string: { type: 'string' },
121
- },
122
- },
123
- },
124
- },
125
- },
126
- {
127
- lexicon: 1,
128
- id: 'com.example.default',
129
- defs: {
130
- main: {
131
- type: 'record',
132
- record: {
133
- type: 'object',
134
- required: ['boolean'],
135
- properties: {
136
- boolean: { type: 'boolean', default: false },
137
- integer: { type: 'integer', default: 0 },
138
- string: { type: 'string', default: '' },
139
- object: { type: 'ref', ref: '#object' },
140
- },
141
- },
142
- },
143
- object: {
144
- type: 'object',
145
- properties: {
146
- boolean: { type: 'boolean', default: true },
147
- integer: { type: 'integer', default: 1 },
148
- string: { type: 'string', default: 'x' },
149
- },
150
- },
151
- },
152
- },
153
- {
154
- lexicon: 1,
155
- id: 'com.example.union',
156
- defs: {
157
- main: {
158
- type: 'record',
159
- description: 'A record',
160
- key: 'tid',
161
- record: {
162
- type: 'object',
163
- required: ['unionOpen', 'unionClosed'],
164
- properties: {
165
- unionOpen: {
166
- type: 'union',
167
- refs: [
168
- 'com.example.kitchenSink#object',
169
- 'com.example.kitchenSink#subobject',
170
- ],
171
- },
172
- unionClosed: {
173
- type: 'union',
174
- closed: true,
175
- refs: [
176
- 'com.example.kitchenSink#object',
177
- 'com.example.kitchenSink#subobject',
178
- ],
179
- },
180
- },
181
- },
182
- },
183
- },
184
- },
185
- {
186
- lexicon: 1,
187
- id: 'com.example.unknown',
188
- defs: {
189
- main: {
190
- type: 'record',
191
- description: 'A record',
192
- key: 'tid',
193
- record: {
194
- type: 'object',
195
- required: ['unknown'],
196
- properties: {
197
- unknown: { type: 'unknown' },
198
- optUnknown: { type: 'unknown' },
199
- },
200
- },
201
- },
202
- },
203
- },
204
- {
205
- lexicon: 1,
206
- id: 'com.example.arrayLength',
207
- defs: {
208
- main: {
209
- type: 'record',
210
- record: {
211
- type: 'object',
212
- properties: {
213
- array: {
214
- type: 'array',
215
- minLength: 2,
216
- maxLength: 4,
217
- items: { type: 'integer' },
218
- },
219
- },
220
- },
221
- },
222
- },
223
- },
224
- {
225
- lexicon: 1,
226
- id: 'com.example.boolConst',
227
- defs: {
228
- main: {
229
- type: 'record',
230
- record: {
231
- type: 'object',
232
- properties: {
233
- boolean: {
234
- type: 'boolean',
235
- const: false,
236
- },
237
- },
238
- },
239
- },
240
- },
241
- },
242
- {
243
- lexicon: 1,
244
- id: 'com.example.integerRange',
245
- defs: {
246
- main: {
247
- type: 'record',
248
- record: {
249
- type: 'object',
250
- properties: {
251
- integer: {
252
- type: 'integer',
253
- minimum: 2,
254
- maximum: 4,
255
- },
256
- },
257
- },
258
- },
259
- },
260
- },
261
- {
262
- lexicon: 1,
263
- id: 'com.example.integerEnum',
264
- defs: {
265
- main: {
266
- type: 'record',
267
- record: {
268
- type: 'object',
269
- properties: {
270
- integer: {
271
- type: 'integer',
272
- enum: [1, 2],
273
- },
274
- },
275
- },
276
- },
277
- },
278
- },
279
- {
280
- lexicon: 1,
281
- id: 'com.example.integerConst',
282
- defs: {
283
- main: {
284
- type: 'record',
285
- record: {
286
- type: 'object',
287
- properties: {
288
- integer: {
289
- type: 'integer',
290
- const: 0,
291
- },
292
- },
293
- },
294
- },
295
- },
296
- },
297
- {
298
- lexicon: 1,
299
- id: 'com.example.stringLength',
300
- defs: {
301
- main: {
302
- type: 'record',
303
- record: {
304
- type: 'object',
305
- properties: {
306
- string: {
307
- type: 'string',
308
- minLength: 2,
309
- maxLength: 4,
310
- },
311
- },
312
- },
313
- },
314
- },
315
- },
316
- {
317
- lexicon: 1,
318
- id: 'com.example.stringLengthNoMinLength',
319
- defs: {
320
- main: {
321
- type: 'record',
322
- record: {
323
- type: 'object',
324
- properties: {
325
- string: {
326
- type: 'string',
327
- maxLength: 4,
328
- },
329
- },
330
- },
331
- },
332
- },
333
- },
334
- {
335
- lexicon: 1,
336
- id: 'com.example.stringLengthGrapheme',
337
- defs: {
338
- main: {
339
- type: 'record',
340
- record: {
341
- type: 'object',
342
- properties: {
343
- string: {
344
- type: 'string',
345
- minGraphemes: 2,
346
- maxGraphemes: 4,
347
- },
348
- },
349
- },
350
- },
351
- },
352
- },
353
- {
354
- lexicon: 1,
355
- id: 'com.example.stringEnum',
356
- defs: {
357
- main: {
358
- type: 'record',
359
- record: {
360
- type: 'object',
361
- properties: {
362
- string: {
363
- type: 'string',
364
- enum: ['a', 'b'],
365
- },
366
- },
367
- },
368
- },
369
- },
370
- },
371
- {
372
- lexicon: 1,
373
- id: 'com.example.stringConst',
374
- defs: {
375
- main: {
376
- type: 'record',
377
- record: {
378
- type: 'object',
379
- properties: {
380
- string: {
381
- type: 'string',
382
- const: 'a',
383
- },
384
- },
385
- },
386
- },
387
- },
388
- },
389
- {
390
- lexicon: 1,
391
- id: 'com.example.datetime',
392
- defs: {
393
- main: {
394
- type: 'record',
395
- record: {
396
- type: 'object',
397
- properties: {
398
- datetime: { type: 'string', format: 'datetime' },
399
- },
400
- },
401
- },
402
- },
403
- },
404
- {
405
- lexicon: 1,
406
- id: 'com.example.uri',
407
- defs: {
408
- main: {
409
- type: 'record',
410
- record: {
411
- type: 'object',
412
- properties: {
413
- uri: { type: 'string', format: 'uri' },
414
- },
415
- },
416
- },
417
- },
418
- },
419
- {
420
- lexicon: 1,
421
- id: 'com.example.atUri',
422
- defs: {
423
- main: {
424
- type: 'record',
425
- record: {
426
- type: 'object',
427
- properties: {
428
- atUri: { type: 'string', format: 'at-uri' },
429
- },
430
- },
431
- },
432
- },
433
- },
434
- {
435
- lexicon: 1,
436
- id: 'com.example.did',
437
- defs: {
438
- main: {
439
- type: 'record',
440
- record: {
441
- type: 'object',
442
- properties: {
443
- did: { type: 'string', format: 'did' },
444
- },
445
- },
446
- },
447
- },
448
- },
449
- {
450
- lexicon: 1,
451
- id: 'com.example.handle',
452
- defs: {
453
- main: {
454
- type: 'record',
455
- record: {
456
- type: 'object',
457
- properties: {
458
- handle: { type: 'string', format: 'handle' },
459
- },
460
- },
461
- },
462
- },
463
- },
464
- {
465
- lexicon: 1,
466
- id: 'com.example.atIdentifier',
467
- defs: {
468
- main: {
469
- type: 'record',
470
- record: {
471
- type: 'object',
472
- properties: {
473
- atIdentifier: { type: 'string', format: 'at-identifier' },
474
- },
475
- },
476
- },
477
- },
478
- },
479
- {
480
- lexicon: 1,
481
- id: 'com.example.nsid',
482
- defs: {
483
- main: {
484
- type: 'record',
485
- record: {
486
- type: 'object',
487
- properties: {
488
- nsid: { type: 'string', format: 'nsid' },
489
- },
490
- },
491
- },
492
- },
493
- },
494
- {
495
- lexicon: 1,
496
- id: 'com.example.cid',
497
- defs: {
498
- main: {
499
- type: 'record',
500
- record: {
501
- type: 'object',
502
- properties: {
503
- cid: { type: 'string', format: 'cid' },
504
- },
505
- },
506
- },
507
- },
508
- },
509
- {
510
- lexicon: 1,
511
- id: 'com.example.language',
512
- defs: {
513
- main: {
514
- type: 'record',
515
- record: {
516
- type: 'object',
517
- properties: {
518
- language: { type: 'string', format: 'language' },
519
- },
520
- },
521
- },
522
- },
523
- },
524
- {
525
- lexicon: 1,
526
- id: 'com.example.byteLength',
527
- defs: {
528
- main: {
529
- type: 'record',
530
- record: {
531
- type: 'object',
532
- properties: {
533
- bytes: {
534
- type: 'bytes',
535
- minLength: 2,
536
- maxLength: 4,
537
- },
538
- },
539
- },
540
- },
541
- },
542
- },
543
- ]
544
-
545
- export default lexicons