@asterdoc/schemas 0.0.0-stage → 0.10.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.
Files changed (42) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +76 -2
  3. package/dist/index.d.ts +3040 -0
  4. package/dist/index.js +2096 -0
  5. package/package.json +82 -3
  6. package/schemas/2026-10-28/address.json +53 -0
  7. package/schemas/2026-10-28/attachment.json +31 -0
  8. package/schemas/2026-10-28/bbox.json +22 -0
  9. package/schemas/2026-10-28/bundle-content-item.json +122 -0
  10. package/schemas/2026-10-28/bundle.json +267 -0
  11. package/schemas/2026-10-28/checklist-item.json +113 -0
  12. package/schemas/2026-10-28/checklist.json +300 -0
  13. package/schemas/2026-10-28/cond-expr.json +18 -0
  14. package/schemas/2026-10-28/content-ref.json +76 -0
  15. package/schemas/2026-10-28/coordinate.json +26 -0
  16. package/schemas/2026-10-28/defs-section.json +862 -0
  17. package/schemas/2026-10-28/document.json +292 -0
  18. package/schemas/2026-10-28/duration.json +8 -0
  19. package/schemas/2026-10-28/fieldset-field.json +49 -0
  20. package/schemas/2026-10-28/form-annex.json +33 -0
  21. package/schemas/2026-10-28/form-field.json +1037 -0
  22. package/schemas/2026-10-28/form-party.json +150 -0
  23. package/schemas/2026-10-28/form.json +369 -0
  24. package/schemas/2026-10-28/identification.json +44 -0
  25. package/schemas/2026-10-28/layer.json +556 -0
  26. package/schemas/2026-10-28/list-field.json +51 -0
  27. package/schemas/2026-10-28/metadata.json +35 -0
  28. package/schemas/2026-10-28/money.json +25 -0
  29. package/schemas/2026-10-28/organization.json +49 -0
  30. package/schemas/2026-10-28/person.json +49 -0
  31. package/schemas/2026-10-28/phone.json +32 -0
  32. package/schemas/2026-10-28/rule-severity.json +11 -0
  33. package/schemas/2026-10-28/rules-section.json +46 -0
  34. package/schemas/2026-10-28/signature.json +68 -0
  35. package/schemas/2026-10-28/validation-rule.json +34 -0
  36. package/schemas/2026-10-28.json +4636 -0
  37. package/schemas/config.json +174 -0
  38. package/schemas/lock.json +151 -0
  39. package/schemas/manifest.json +184 -0
  40. package/schemas/registry-item.json +488 -0
  41. package/schemas/registry.json +281 -0
  42. package/schemas/schema.json +4636 -0
@@ -0,0 +1,488 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.asterdoc.com/registry-item.json",
4
+ "type": "object",
5
+ "properties": {
6
+ "$schema": {
7
+ "type": "string",
8
+ "format": "uri",
9
+ "description": "JSON Schema URI for validation"
10
+ },
11
+ "kind": {
12
+ "anyOf": [
13
+ {
14
+ "type": "string",
15
+ "const": "form"
16
+ },
17
+ {
18
+ "type": "string",
19
+ "const": "document"
20
+ },
21
+ {
22
+ "type": "string",
23
+ "const": "checklist"
24
+ },
25
+ {
26
+ "type": "string",
27
+ "const": "bundle"
28
+ }
29
+ ],
30
+ "description": "Artifact kind"
31
+ },
32
+ "name": {
33
+ "type": "string",
34
+ "minLength": 1,
35
+ "maxLength": 128,
36
+ "pattern": "^[A-Za-z0-9]([A-Za-z0-9]|-[A-Za-z0-9])*$",
37
+ "description": "Artifact name"
38
+ },
39
+ "version": {
40
+ "type": "string",
41
+ "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
42
+ "description": "Semantic version"
43
+ },
44
+ "title": {
45
+ "type": "string",
46
+ "minLength": 1,
47
+ "maxLength": 200,
48
+ "description": "Human-readable title"
49
+ },
50
+ "description": {
51
+ "type": "string",
52
+ "maxLength": 2000,
53
+ "description": "Artifact description"
54
+ },
55
+ "layers": {
56
+ "type": "object",
57
+ "propertyNames": {
58
+ "type": "string",
59
+ "description": "Layer key"
60
+ },
61
+ "additionalProperties": {
62
+ "$ref": "#/$defs/RegistryLayer"
63
+ },
64
+ "description": "Available layers"
65
+ },
66
+ "defaultLayer": {
67
+ "type": "string",
68
+ "description": "Default layer key"
69
+ }
70
+ },
71
+ "required": [
72
+ "kind",
73
+ "name",
74
+ "version"
75
+ ],
76
+ "additionalProperties": {},
77
+ "title": "Asterdoc Registry Item",
78
+ "description": "Schema for registry item files (r/{name}.json)",
79
+ "$defs": {
80
+ "RegistryLayer": {
81
+ "oneOf": [
82
+ {
83
+ "$ref": "#/$defs/RegistryInlineLayer"
84
+ },
85
+ {
86
+ "$ref": "#/$defs/RegistryFileLayer"
87
+ }
88
+ ],
89
+ "title": "RegistryLayer",
90
+ "description": "Layer in a registry item - inline or file with URL",
91
+ "allOf": [
92
+ {
93
+ "if": {
94
+ "required": [
95
+ "font"
96
+ ]
97
+ },
98
+ "then": {
99
+ "properties": {
100
+ "mimeType": {
101
+ "pattern": "^[aA][pP][pP][lL][iI][cC][aA][tT][iI][oO][nN]/[pP][dD][fF]$"
102
+ }
103
+ }
104
+ }
105
+ },
106
+ {
107
+ "if": {
108
+ "required": [
109
+ "format"
110
+ ]
111
+ },
112
+ "then": {
113
+ "properties": {
114
+ "mimeType": {
115
+ "pattern": "^[aA][pP][pP][lL][iI][cC][aA][tT][iI][oO][nN]/[pP][dD][fF]$"
116
+ }
117
+ }
118
+ }
119
+ },
120
+ {
121
+ "if": {
122
+ "required": [
123
+ "bindings"
124
+ ]
125
+ },
126
+ "then": {
127
+ "properties": {
128
+ "mimeType": {
129
+ "pattern": "^[aA][pP][pP][lL][iI][cC][aA][tT][iI][oO][nN]/[pP][dD][fF]$"
130
+ }
131
+ }
132
+ }
133
+ },
134
+ {
135
+ "if": {
136
+ "required": [
137
+ "bindingsFrom"
138
+ ]
139
+ },
140
+ "then": {
141
+ "properties": {
142
+ "mimeType": {
143
+ "pattern": "^[aA][pP][pP][lL][iI][cC][aA][tT][iI][oO][nN]/[pP][dD][fF]$"
144
+ }
145
+ }
146
+ }
147
+ }
148
+ ]
149
+ },
150
+ "RegistryInlineLayer": {
151
+ "type": "object",
152
+ "properties": {
153
+ "mimeType": {
154
+ "type": "string",
155
+ "minLength": 1,
156
+ "maxLength": 100,
157
+ "description": "MIME type of the layer content"
158
+ },
159
+ "title": {
160
+ "type": "string",
161
+ "minLength": 1,
162
+ "maxLength": 200,
163
+ "description": "Human-readable title for this layer"
164
+ },
165
+ "description": {
166
+ "type": "string",
167
+ "minLength": 1,
168
+ "maxLength": 2000,
169
+ "description": "Description of what this layer represents"
170
+ },
171
+ "checksum": {
172
+ "type": "string",
173
+ "pattern": "^sha256:[a-f0-9]{64}$",
174
+ "description": "SHA-256 checksum for integrity verification"
175
+ },
176
+ "kind": {
177
+ "type": "string",
178
+ "const": "inline"
179
+ },
180
+ "text": {
181
+ "type": "string",
182
+ "minLength": 1,
183
+ "maxLength": 1000000,
184
+ "description": "Layer content with interpolation placeholders (e.g., {{fields.fieldName}})"
185
+ },
186
+ "bindings": {
187
+ "not": {}
188
+ },
189
+ "bindingsFrom": {
190
+ "not": {}
191
+ }
192
+ },
193
+ "required": [
194
+ "mimeType",
195
+ "kind",
196
+ "text"
197
+ ],
198
+ "additionalProperties": false,
199
+ "title": "RegistryInlineLayer",
200
+ "description": "Inline layer with embedded content"
201
+ },
202
+ "RegistryFileLayer": {
203
+ "type": "object",
204
+ "properties": {
205
+ "mimeType": {
206
+ "type": "string",
207
+ "minLength": 1,
208
+ "maxLength": 100,
209
+ "description": "MIME type of the layer content (e.g., text/markdown, application/pdf)"
210
+ },
211
+ "title": {
212
+ "type": "string",
213
+ "minLength": 1,
214
+ "maxLength": 200,
215
+ "description": "Human-readable title for this layer"
216
+ },
217
+ "description": {
218
+ "type": "string",
219
+ "minLength": 1,
220
+ "maxLength": 2000,
221
+ "description": "Description of what this layer represents"
222
+ },
223
+ "signatures": {
224
+ "type": "object",
225
+ "propertyNames": {
226
+ "type": "string",
227
+ "minLength": 1,
228
+ "maxLength": 100,
229
+ "description": "Slot ID"
230
+ },
231
+ "additionalProperties": {
232
+ "type": "object",
233
+ "properties": {
234
+ "party": {
235
+ "type": "object",
236
+ "properties": {
237
+ "role": {
238
+ "type": "string",
239
+ "minLength": 1,
240
+ "maxLength": 100,
241
+ "description": "Party role this slot binds to"
242
+ },
243
+ "index": {
244
+ "type": "integer",
245
+ "minimum": 0,
246
+ "maximum": 9007199254740991,
247
+ "description": "0-based index for multi-party roles; defaults to 0"
248
+ }
249
+ },
250
+ "required": [
251
+ "role"
252
+ ],
253
+ "additionalProperties": false
254
+ },
255
+ "type": {
256
+ "type": "string",
257
+ "enum": [
258
+ "signature",
259
+ "initials",
260
+ "date_signed",
261
+ "capacity",
262
+ "printed_name"
263
+ ],
264
+ "description": "Type of signing field: signature/initials (glyph), date_signed, capacity (signer role/title), or printed_name"
265
+ },
266
+ "required": {
267
+ "type": "boolean",
268
+ "description": "Whether this slot must be signed. Defaults to true"
269
+ },
270
+ "label": {
271
+ "type": "string",
272
+ "minLength": 1,
273
+ "maxLength": 200,
274
+ "description": "Human-readable label"
275
+ },
276
+ "placement": {
277
+ "anyOf": [
278
+ {
279
+ "type": "string",
280
+ "const": "flow",
281
+ "description": "In-flow: the field sits where the template content places it; located after conversion via an injected marker"
282
+ },
283
+ {
284
+ "type": "object",
285
+ "properties": {
286
+ "page": {
287
+ "type": "integer",
288
+ "minimum": 1,
289
+ "maximum": 9007199254740991,
290
+ "description": "1-based page number"
291
+ },
292
+ "x": {
293
+ "type": "number",
294
+ "minimum": 0,
295
+ "description": "X in points from the left page edge"
296
+ },
297
+ "y": {
298
+ "type": "number",
299
+ "minimum": 0,
300
+ "description": "Y in points from the top page edge"
301
+ },
302
+ "width": {
303
+ "type": "number",
304
+ "minimum": 1,
305
+ "description": "Width in points"
306
+ },
307
+ "height": {
308
+ "type": "number",
309
+ "minimum": 1,
310
+ "description": "Height in points"
311
+ }
312
+ },
313
+ "required": [
314
+ "page",
315
+ "x",
316
+ "y",
317
+ "width",
318
+ "height"
319
+ ],
320
+ "additionalProperties": false,
321
+ "title": "AbsolutePlacement"
322
+ },
323
+ {
324
+ "type": "object",
325
+ "properties": {
326
+ "anchor": {
327
+ "type": "object",
328
+ "properties": {
329
+ "text": {
330
+ "type": "string",
331
+ "minLength": 1,
332
+ "maxLength": 500,
333
+ "description": "Literal document text to find; must be unique unless occurrence is set"
334
+ },
335
+ "offsetX": {
336
+ "type": "number",
337
+ "description": "Horizontal offset in points from the left of the found text"
338
+ },
339
+ "offsetY": {
340
+ "type": "number",
341
+ "description": "Vertical offset in points from the top of the found text"
342
+ },
343
+ "occurrence": {
344
+ "type": "integer",
345
+ "minimum": 1,
346
+ "maximum": 9007199254740991,
347
+ "description": "1-based match index in reading order when the text repeats"
348
+ }
349
+ },
350
+ "required": [
351
+ "text"
352
+ ],
353
+ "additionalProperties": false
354
+ },
355
+ "width": {
356
+ "type": "number",
357
+ "minimum": 1,
358
+ "description": "Width in points"
359
+ },
360
+ "height": {
361
+ "type": "number",
362
+ "minimum": 1,
363
+ "description": "Height in points"
364
+ }
365
+ },
366
+ "required": [
367
+ "anchor",
368
+ "width",
369
+ "height"
370
+ ],
371
+ "additionalProperties": false,
372
+ "title": "AnchorPlacement"
373
+ }
374
+ ],
375
+ "description": "Placement: 'flow', absolute coordinates, or a text anchor"
376
+ }
377
+ },
378
+ "required": [
379
+ "party",
380
+ "type",
381
+ "placement"
382
+ ],
383
+ "additionalProperties": false,
384
+ "title": "SignatureSlot",
385
+ "description": "Signature slot binding a party to a placement on this layer"
386
+ },
387
+ "description": "Signature slots keyed by slot id"
388
+ },
389
+ "kind": {
390
+ "type": "string",
391
+ "const": "file"
392
+ },
393
+ "path": {
394
+ "type": "string",
395
+ "minLength": 1,
396
+ "maxLength": 1000,
397
+ "description": "Logical resolver path; the CLI resolves file-backed artifacts from their directory and stdin artifacts from cwd"
398
+ },
399
+ "checksum": {
400
+ "type": "string",
401
+ "pattern": "^sha256:[a-f0-9]{64}$",
402
+ "description": "SHA-256 checksum for integrity verification"
403
+ },
404
+ "font": {
405
+ "type": "object",
406
+ "properties": {
407
+ "path": {
408
+ "type": "string",
409
+ "minLength": 1,
410
+ "maxLength": 1000,
411
+ "description": "Logical resolver path of a TrueType-outline font program (.ttf), resolved like the layer path"
412
+ },
413
+ "checksum": {
414
+ "type": "string",
415
+ "pattern": "^sha256:[a-f0-9]{64}$",
416
+ "description": "SHA-256 checksum for integrity verification"
417
+ }
418
+ },
419
+ "required": [
420
+ "path"
421
+ ],
422
+ "additionalProperties": false,
423
+ "title": "LayerFont",
424
+ "description": "Font for filled values and overlay text; PDF layers only. It is tried after a font supplied at render time and before the form's own fonts"
425
+ },
426
+ "format": {
427
+ "type": "object",
428
+ "properties": {
429
+ "money": {
430
+ "type": "object",
431
+ "properties": {
432
+ "currencyDisplay": {
433
+ "type": "string",
434
+ "const": "none",
435
+ "description": "`none` prints the amount without a currency symbol or code, for a template that pre-prints the symbol beside each money box"
436
+ }
437
+ },
438
+ "required": [
439
+ "currencyDisplay"
440
+ ],
441
+ "additionalProperties": false,
442
+ "title": "LayerMoneyFormat",
443
+ "description": "How a PDF layer presents money values"
444
+ }
445
+ },
446
+ "additionalProperties": false,
447
+ "title": "LayerFormat",
448
+ "description": "Presentation the template requires of filled values; PDF layers only. It applies to this layer alone, not to a layer that reuses its bindings"
449
+ },
450
+ "bindings": {
451
+ "type": "object",
452
+ "propertyNames": {
453
+ "type": "string",
454
+ "minLength": 1,
455
+ "maxLength": 500,
456
+ "description": "AcroForm field name in the PDF template, fully qualified (e.g., topmostSubform[0].Page1[0].f1_01[0])"
457
+ },
458
+ "additionalProperties": {
459
+ "type": "string",
460
+ "minLength": 1,
461
+ "maxLength": 500,
462
+ "description": "Asterdoc path whose value fills the field (e.g., fields.name, parties.buyer.name)"
463
+ },
464
+ "description": "PDF layers only. Maps each AcroForm field name (key) to the Asterdoc path (value) that fills it"
465
+ },
466
+ "bindingsFrom": {
467
+ "type": "string",
468
+ "minLength": 1,
469
+ "maxLength": 128,
470
+ "description": "PDF layers only. Key of a sibling PDF layer whose bindings this layer reuses"
471
+ },
472
+ "url": {
473
+ "type": "string",
474
+ "format": "uri",
475
+ "description": "Optional URL to download the layer file from; clients otherwise resolve path relative to the registry item"
476
+ }
477
+ },
478
+ "required": [
479
+ "mimeType",
480
+ "kind",
481
+ "path"
482
+ ],
483
+ "additionalProperties": false,
484
+ "title": "RegistryFileLayer",
485
+ "description": "File-backed layer with download URL"
486
+ }
487
+ }
488
+ }