@hyperscale0/udl 1.0.0-alpha.1

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 (97) hide show
  1. package/AUTHORS +8 -0
  2. package/CHANGELOG.md +36 -0
  3. package/LICENSE +661 -0
  4. package/LICENSING.md +51 -0
  5. package/README.md +163 -0
  6. package/SECURITY.md +42 -0
  7. package/TRADEMARKS.md +35 -0
  8. package/conformance/README.md +79 -0
  9. package/conformance/invalid/blank-title.expected.json +10 -0
  10. package/conformance/invalid/blank-title.udl +50 -0
  11. package/conformance/invalid/depth-budget.expected.json +10 -0
  12. package/conformance/invalid/depth-budget.udl +49 -0
  13. package/conformance/invalid/format-version.expected.json +10 -0
  14. package/conformance/invalid/format-version.udl +50 -0
  15. package/conformance/invalid/invalid-utf8.expected.json +10 -0
  16. package/conformance/invalid/invalid-utf8.udl +1 -0
  17. package/conformance/invalid/malformed-json.expected.json +10 -0
  18. package/conformance/invalid/malformed-json.udl +1 -0
  19. package/conformance/invalid/missing-create-verb.expected.json +10 -0
  20. package/conformance/invalid/missing-create-verb.udl +45 -0
  21. package/conformance/invalid/not-an-object.expected.json +10 -0
  22. package/conformance/invalid/not-an-object.udl +1 -0
  23. package/conformance/invalid/noun-id-not-snake-case.expected.json +10 -0
  24. package/conformance/invalid/noun-id-not-snake-case.udl +50 -0
  25. package/conformance/invalid/unknown-key.expected.json +10 -0
  26. package/conformance/invalid/unknown-key.udl +51 -0
  27. package/conformance/invalid/unreachable-state.expected.json +10 -0
  28. package/conformance/invalid/unreachable-state.udl +51 -0
  29. package/conformance/invalid/verb-without-transition.expected.json +10 -0
  30. package/conformance/invalid/verb-without-transition.udl +55 -0
  31. package/conformance/valid/cards.expected.json +5 -0
  32. package/conformance/valid/cards.udl +1092 -0
  33. package/conformance/valid/commerce-escrow.expected.json +5 -0
  34. package/conformance/valid/commerce-escrow.udl +1011 -0
  35. package/conformance/valid/hand-edited.expected.json +5 -0
  36. package/conformance/valid/hand-edited.udl +1 -0
  37. package/conformance/valid/insured-car-marketplace.expected.json +5 -0
  38. package/conformance/valid/insured-car-marketplace.udl +831 -0
  39. package/conformance/valid/insured-travel.expected.json +5 -0
  40. package/conformance/valid/insured-travel.udl +2621 -0
  41. package/conformance/valid/minimal.expected.json +5 -0
  42. package/conformance/valid/minimal.udl +50 -0
  43. package/conformance/valid/protection.expected.json +5 -0
  44. package/conformance/valid/protection.udl +1136 -0
  45. package/dist/canonical.d.ts +2 -0
  46. package/dist/canonical.d.ts.map +1 -0
  47. package/dist/canonical.js +35 -0
  48. package/dist/canonical.js.map +1 -0
  49. package/dist/cli.d.ts +3 -0
  50. package/dist/cli.d.ts.map +1 -0
  51. package/dist/cli.js +138 -0
  52. package/dist/cli.js.map +1 -0
  53. package/dist/duration.d.ts +3 -0
  54. package/dist/duration.d.ts.map +1 -0
  55. package/dist/duration.js +23 -0
  56. package/dist/duration.js.map +1 -0
  57. package/dist/evolution.d.ts +63 -0
  58. package/dist/evolution.d.ts.map +1 -0
  59. package/dist/evolution.js +345 -0
  60. package/dist/evolution.js.map +1 -0
  61. package/dist/finance.d.ts +53 -0
  62. package/dist/finance.d.ts.map +1 -0
  63. package/dist/finance.js +511 -0
  64. package/dist/finance.js.map +1 -0
  65. package/dist/index.d.ts +11 -0
  66. package/dist/index.d.ts.map +1 -0
  67. package/dist/index.js +8 -0
  68. package/dist/index.js.map +1 -0
  69. package/dist/limits.d.ts +33 -0
  70. package/dist/limits.d.ts.map +1 -0
  71. package/dist/limits.js +33 -0
  72. package/dist/limits.js.map +1 -0
  73. package/dist/parser.d.ts +4 -0
  74. package/dist/parser.d.ts.map +1 -0
  75. package/dist/parser.js +54 -0
  76. package/dist/parser.js.map +1 -0
  77. package/dist/schema.d.ts +757 -0
  78. package/dist/schema.d.ts.map +1 -0
  79. package/dist/schema.js +281 -0
  80. package/dist/schema.js.map +1 -0
  81. package/dist/validation.d.ts +64 -0
  82. package/dist/validation.d.ts.map +1 -0
  83. package/dist/validation.js +1323 -0
  84. package/dist/validation.js.map +1 -0
  85. package/package.json +84 -0
  86. package/spec/README.md +137 -0
  87. package/spec/udl.schema.json +1019 -0
  88. package/src/canonical.ts +41 -0
  89. package/src/cli.ts +148 -0
  90. package/src/duration.ts +26 -0
  91. package/src/evolution.ts +587 -0
  92. package/src/finance.ts +775 -0
  93. package/src/index.ts +59 -0
  94. package/src/limits.ts +32 -0
  95. package/src/parser.ts +61 -0
  96. package/src/schema.ts +339 -0
  97. package/src/validation.ts +2053 -0
@@ -0,0 +1,1019 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/hyperscale0/hyperscale-udl/main/spec/udl.schema.json",
4
+ "title": "UDL document, format version 1",
5
+ "description": "Generated from the Zod grammar in src/schema.ts by scripts/emit-spec.ts. Edits belong in the grammar. This schema pins document shape only; the semantic laws it cannot express are pinned by conformance/.",
6
+ "type": "object",
7
+ "properties": {
8
+ "nouns": {
9
+ "minItems": 1,
10
+ "type": "array",
11
+ "items": {
12
+ "type": "object",
13
+ "properties": {
14
+ "aggregateInvariants": {
15
+ "minItems": 1,
16
+ "type": "array",
17
+ "items": {
18
+ "anyOf": [
19
+ {
20
+ "type": "object",
21
+ "properties": {
22
+ "childNounId": {
23
+ "type": "string",
24
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
25
+ },
26
+ "childRefField": {
27
+ "type": "string",
28
+ "pattern": "^[a-z][A-Za-z0-9]*$"
29
+ },
30
+ "childStatuses": {
31
+ "minItems": 1,
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string",
35
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
36
+ }
37
+ },
38
+ "parentField": {
39
+ "type": "string",
40
+ "pattern": "^[a-z][A-Za-z0-9]*$"
41
+ },
42
+ "childField": {
43
+ "type": "string",
44
+ "pattern": "^[a-z][A-Za-z0-9]*$"
45
+ }
46
+ },
47
+ "required": [
48
+ "childNounId",
49
+ "childRefField",
50
+ "childStatuses",
51
+ "parentField",
52
+ "childField"
53
+ ],
54
+ "additionalProperties": false
55
+ },
56
+ {
57
+ "type": "object",
58
+ "properties": {
59
+ "childNounId": {
60
+ "type": "string",
61
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
62
+ },
63
+ "childRefField": {
64
+ "type": "string",
65
+ "pattern": "^[a-z][A-Za-z0-9]*$"
66
+ },
67
+ "childStatuses": {
68
+ "minItems": 1,
69
+ "type": "array",
70
+ "items": {
71
+ "type": "string",
72
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
73
+ }
74
+ },
75
+ "parentField": {
76
+ "type": "string",
77
+ "pattern": "^[a-z][A-Za-z0-9]*$"
78
+ },
79
+ "count": {
80
+ "type": "boolean",
81
+ "const": true
82
+ },
83
+ "window": {
84
+ "type": "object",
85
+ "properties": {
86
+ "field": {
87
+ "type": "string",
88
+ "pattern": "^[a-z][A-Za-z0-9]*$"
89
+ },
90
+ "days": {
91
+ "type": "integer",
92
+ "minimum": 1,
93
+ "maximum": 3650
94
+ }
95
+ },
96
+ "required": ["field", "days"],
97
+ "additionalProperties": false
98
+ }
99
+ },
100
+ "required": [
101
+ "childNounId",
102
+ "childRefField",
103
+ "childStatuses",
104
+ "parentField",
105
+ "count"
106
+ ],
107
+ "additionalProperties": false
108
+ }
109
+ ]
110
+ }
111
+ },
112
+ "description": {
113
+ "type": "string"
114
+ },
115
+ "distinctParties": {
116
+ "type": "boolean",
117
+ "const": true
118
+ },
119
+ "fields": {
120
+ "type": "object",
121
+ "propertyNames": {
122
+ "type": "string",
123
+ "pattern": "^[a-z][A-Za-z0-9]*$"
124
+ },
125
+ "additionalProperties": {
126
+ "type": "object",
127
+ "propertyNames": {
128
+ "type": "string"
129
+ },
130
+ "additionalProperties": {
131
+ "$ref": "#/$defs/jsonValue"
132
+ }
133
+ }
134
+ },
135
+ "id": {
136
+ "type": "string",
137
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
138
+ },
139
+ "idPrefix": {
140
+ "type": "string",
141
+ "pattern": "^[a-z]{2,8}$"
142
+ },
143
+ "lifecycle": {
144
+ "type": "object",
145
+ "properties": {
146
+ "initial": {
147
+ "type": "string",
148
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
149
+ },
150
+ "states": {
151
+ "minItems": 1,
152
+ "type": "array",
153
+ "items": {
154
+ "type": "string",
155
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
156
+ }
157
+ },
158
+ "transitions": {
159
+ "type": "object",
160
+ "propertyNames": {
161
+ "type": "string",
162
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
163
+ },
164
+ "additionalProperties": {
165
+ "type": "object",
166
+ "properties": {
167
+ "from": {
168
+ "minItems": 1,
169
+ "type": "array",
170
+ "items": {
171
+ "type": "string",
172
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
173
+ }
174
+ },
175
+ "to": {
176
+ "type": "string",
177
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
178
+ }
179
+ },
180
+ "required": ["from", "to"],
181
+ "additionalProperties": false
182
+ }
183
+ }
184
+ },
185
+ "required": ["initial", "states", "transitions"],
186
+ "additionalProperties": false
187
+ },
188
+ "parties": {
189
+ "type": "object",
190
+ "properties": {
191
+ "beneficiary": {
192
+ "type": "string",
193
+ "pattern": "^[a-z][A-Za-z0-9]*$"
194
+ },
195
+ "payer": {
196
+ "type": "string",
197
+ "pattern": "^[a-z][A-Za-z0-9]*$"
198
+ },
199
+ "subjectHolder": {
200
+ "type": "string",
201
+ "pattern": "^[a-z][A-Za-z0-9]*$"
202
+ }
203
+ },
204
+ "additionalProperties": false
205
+ },
206
+ "partitions": {
207
+ "minItems": 1,
208
+ "type": "array",
209
+ "items": {
210
+ "type": "object",
211
+ "properties": {
212
+ "pieceFields": {
213
+ "minItems": 2,
214
+ "type": "array",
215
+ "items": {
216
+ "type": "string",
217
+ "pattern": "^[a-z][A-Za-z0-9]*$"
218
+ }
219
+ },
220
+ "totalField": {
221
+ "type": "string",
222
+ "pattern": "^[a-z][A-Za-z0-9]*$"
223
+ }
224
+ },
225
+ "required": ["pieceFields", "totalField"],
226
+ "additionalProperties": false
227
+ }
228
+ },
229
+ "required": {
230
+ "type": "array",
231
+ "items": {
232
+ "type": "string",
233
+ "pattern": "^[a-z][A-Za-z0-9]*$"
234
+ }
235
+ },
236
+ "subject": {
237
+ "type": "object",
238
+ "properties": {
239
+ "kinds": {
240
+ "minItems": 1,
241
+ "type": "array",
242
+ "items": {
243
+ "type": "string",
244
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
245
+ }
246
+ }
247
+ },
248
+ "required": ["kinds"],
249
+ "additionalProperties": false
250
+ },
251
+ "summary": {
252
+ "type": "string"
253
+ },
254
+ "title": {
255
+ "type": "string"
256
+ },
257
+ "unwind": {
258
+ "type": "object",
259
+ "properties": {
260
+ "beforeField": {
261
+ "type": "string",
262
+ "pattern": "^[a-z][A-Za-z0-9]*$"
263
+ },
264
+ "confirm": {
265
+ "type": "string",
266
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
267
+ },
268
+ "penalty": {
269
+ "minItems": 1,
270
+ "type": "array",
271
+ "items": {
272
+ "type": "object",
273
+ "properties": {
274
+ "bps": {
275
+ "type": "integer",
276
+ "minimum": 0,
277
+ "maximum": 9999
278
+ },
279
+ "withinOffset": {
280
+ "type": "string"
281
+ }
282
+ },
283
+ "required": ["bps"],
284
+ "additionalProperties": false
285
+ }
286
+ },
287
+ "quote": {
288
+ "type": "string",
289
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
290
+ },
291
+ "refundableField": {
292
+ "type": "string",
293
+ "pattern": "^[a-z][A-Za-z0-9]*$"
294
+ },
295
+ "refundDestinationField": {
296
+ "type": "string",
297
+ "pattern": "^[a-z][A-Za-z0-9]*$"
298
+ }
299
+ },
300
+ "required": [
301
+ "confirm",
302
+ "penalty",
303
+ "quote",
304
+ "refundableField",
305
+ "refundDestinationField"
306
+ ],
307
+ "additionalProperties": false
308
+ },
309
+ "update": {
310
+ "type": "object",
311
+ "properties": {
312
+ "fields": {
313
+ "minItems": 1,
314
+ "type": "array",
315
+ "items": {
316
+ "type": "string",
317
+ "pattern": "^[a-z][A-Za-z0-9]*$"
318
+ }
319
+ },
320
+ "states": {
321
+ "minItems": 1,
322
+ "type": "array",
323
+ "items": {
324
+ "type": "string",
325
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
326
+ }
327
+ }
328
+ },
329
+ "required": ["fields", "states"],
330
+ "additionalProperties": false
331
+ },
332
+ "verbs": {
333
+ "type": "object",
334
+ "propertyNames": {
335
+ "type": "string",
336
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
337
+ },
338
+ "additionalProperties": {
339
+ "type": "object",
340
+ "properties": {
341
+ "deadline": {
342
+ "type": "object",
343
+ "properties": {
344
+ "field": {
345
+ "type": "string",
346
+ "pattern": "^[a-z][A-Za-z0-9]*$"
347
+ },
348
+ "offset": {
349
+ "type": "string"
350
+ }
351
+ },
352
+ "required": ["field"],
353
+ "additionalProperties": false
354
+ },
355
+ "decision": {
356
+ "type": "object",
357
+ "properties": {
358
+ "capability": {
359
+ "type": "string",
360
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
361
+ },
362
+ "deadlineMs": {
363
+ "type": "integer",
364
+ "exclusiveMinimum": 0,
365
+ "maximum": 9007199254740991
366
+ },
367
+ "onTimeout": {
368
+ "type": "string",
369
+ "const": "decline"
370
+ }
371
+ },
372
+ "required": ["capability", "deadlineMs", "onTimeout"],
373
+ "additionalProperties": false
374
+ },
375
+ "description": {
376
+ "type": "string"
377
+ },
378
+ "due": {
379
+ "type": "object",
380
+ "properties": {
381
+ "every": {
382
+ "type": "object",
383
+ "properties": {
384
+ "countField": {
385
+ "type": "string",
386
+ "pattern": "^[a-z][A-Za-z0-9]*$"
387
+ },
388
+ "period": {
389
+ "anyOf": [
390
+ {
391
+ "type": "string"
392
+ },
393
+ {
394
+ "type": "object",
395
+ "properties": {
396
+ "calendar": {
397
+ "type": "string",
398
+ "enum": ["gregorian", "hijri"]
399
+ },
400
+ "months": {
401
+ "type": "integer",
402
+ "exclusiveMinimum": 0,
403
+ "maximum": 9007199254740991
404
+ }
405
+ },
406
+ "required": ["calendar", "months"],
407
+ "additionalProperties": false
408
+ }
409
+ ]
410
+ },
411
+ "untilField": {
412
+ "type": "string",
413
+ "pattern": "^[a-z][A-Za-z0-9]*$"
414
+ }
415
+ },
416
+ "required": ["period"],
417
+ "additionalProperties": false
418
+ },
419
+ "field": {
420
+ "type": "string",
421
+ "pattern": "^[a-z][A-Za-z0-9]*$"
422
+ },
423
+ "offset": {
424
+ "type": "string"
425
+ },
426
+ "whenParentStatus": {
427
+ "type": "object",
428
+ "properties": {
429
+ "nounId": {
430
+ "type": "string",
431
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
432
+ },
433
+ "refField": {
434
+ "type": "string",
435
+ "pattern": "^[a-z][A-Za-z0-9]*$"
436
+ },
437
+ "statuses": {
438
+ "minItems": 1,
439
+ "type": "array",
440
+ "items": {
441
+ "type": "string",
442
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
443
+ }
444
+ }
445
+ },
446
+ "required": ["nounId", "refField", "statuses"],
447
+ "additionalProperties": false
448
+ }
449
+ },
450
+ "required": ["field"],
451
+ "additionalProperties": false
452
+ },
453
+ "earnable": {
454
+ "type": "boolean"
455
+ },
456
+ "eventName": {
457
+ "type": "string",
458
+ "pattern": "^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)+$"
459
+ },
460
+ "examples": {
461
+ "minItems": 1,
462
+ "type": "array",
463
+ "items": {
464
+ "type": "object",
465
+ "properties": {
466
+ "input": {
467
+ "type": "object",
468
+ "propertyNames": {
469
+ "type": "string"
470
+ },
471
+ "additionalProperties": {
472
+ "$ref": "#/$defs/jsonValue"
473
+ }
474
+ },
475
+ "name": {
476
+ "type": "string"
477
+ },
478
+ "output": {
479
+ "$ref": "#/$defs/jsonValue"
480
+ }
481
+ },
482
+ "required": ["input", "name"],
483
+ "additionalProperties": false
484
+ }
485
+ },
486
+ "input": {
487
+ "type": "object",
488
+ "propertyNames": {
489
+ "type": "string"
490
+ },
491
+ "additionalProperties": {
492
+ "$ref": "#/$defs/jsonValue"
493
+ }
494
+ },
495
+ "moves": {
496
+ "default": [],
497
+ "type": "array",
498
+ "items": {
499
+ "type": "object",
500
+ "properties": {
501
+ "bind": {
502
+ "type": "object",
503
+ "propertyNames": {
504
+ "type": "string",
505
+ "pattern": "^[a-z][A-Za-z0-9]*(?:\\.[a-z][A-Za-z0-9]*)*$"
506
+ },
507
+ "additionalProperties": {
508
+ "oneOf": [
509
+ {
510
+ "type": "object",
511
+ "properties": {
512
+ "from": {
513
+ "type": "string",
514
+ "const": "const"
515
+ },
516
+ "value": {
517
+ "type": "string"
518
+ }
519
+ },
520
+ "required": ["from", "value"],
521
+ "additionalProperties": false
522
+ },
523
+ {
524
+ "type": "object",
525
+ "properties": {
526
+ "from": {
527
+ "type": "string",
528
+ "const": "instance"
529
+ },
530
+ "path": {
531
+ "type": "string",
532
+ "pattern": "^[a-z][A-Za-z0-9]*(?:\\.[a-z][A-Za-z0-9]*)*$"
533
+ }
534
+ },
535
+ "required": ["from", "path"],
536
+ "additionalProperties": false
537
+ },
538
+ {
539
+ "type": "object",
540
+ "properties": {
541
+ "from": {
542
+ "type": "string",
543
+ "const": "input"
544
+ },
545
+ "path": {
546
+ "type": "string",
547
+ "pattern": "^[a-z][A-Za-z0-9]*(?:\\.[a-z][A-Za-z0-9]*)*$"
548
+ }
549
+ },
550
+ "required": ["from", "path"],
551
+ "additionalProperties": false
552
+ }
553
+ ]
554
+ }
555
+ },
556
+ "capture": {
557
+ "type": "object",
558
+ "propertyNames": {
559
+ "type": "string"
560
+ },
561
+ "additionalProperties": {
562
+ "type": "string"
563
+ }
564
+ },
565
+ "key": {
566
+ "type": "string",
567
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
568
+ },
569
+ "operation": {
570
+ "type": "string",
571
+ "enum": [
572
+ "internal_transfer.create",
573
+ "internal_transfer.reserve",
574
+ "internal_transfer.post",
575
+ "internal_transfer.void"
576
+ ]
577
+ }
578
+ },
579
+ "required": ["bind", "key", "operation"],
580
+ "additionalProperties": false
581
+ }
582
+ },
583
+ "port": {
584
+ "type": "object",
585
+ "properties": {
586
+ "allowedParties": {
587
+ "minItems": 1,
588
+ "type": "array",
589
+ "items": {
590
+ "type": "string",
591
+ "enum": ["payer", "beneficiary", "subjectHolder"]
592
+ }
593
+ }
594
+ },
595
+ "required": ["allowedParties"],
596
+ "additionalProperties": false
597
+ },
598
+ "requiresAggregate": {
599
+ "minItems": 1,
600
+ "type": "array",
601
+ "items": {
602
+ "type": "object",
603
+ "properties": {
604
+ "check": {
605
+ "oneOf": [
606
+ {
607
+ "type": "object",
608
+ "properties": {
609
+ "amountField": {
610
+ "type": "string",
611
+ "pattern": "^[a-z][A-Za-z0-9]*$"
612
+ },
613
+ "kind": {
614
+ "type": "string",
615
+ "const": "sum_at_least"
616
+ },
617
+ "targetField": {
618
+ "type": "string",
619
+ "pattern": "^[a-z][A-Za-z0-9]*$"
620
+ }
621
+ },
622
+ "required": ["amountField", "kind", "targetField"],
623
+ "additionalProperties": false
624
+ },
625
+ {
626
+ "type": "object",
627
+ "properties": {
628
+ "amountField": {
629
+ "type": "string",
630
+ "pattern": "^[a-z][A-Za-z0-9]*$"
631
+ },
632
+ "kind": {
633
+ "type": "string",
634
+ "const": "sum_below"
635
+ },
636
+ "targetField": {
637
+ "type": "string",
638
+ "pattern": "^[a-z][A-Za-z0-9]*$"
639
+ }
640
+ },
641
+ "required": ["amountField", "kind", "targetField"],
642
+ "additionalProperties": false
643
+ },
644
+ {
645
+ "type": "object",
646
+ "properties": {
647
+ "amountField": {
648
+ "type": "string",
649
+ "pattern": "^[a-z][A-Za-z0-9]*$"
650
+ },
651
+ "kind": {
652
+ "type": "string",
653
+ "const": "sum_exactly"
654
+ },
655
+ "targetField": {
656
+ "type": "string",
657
+ "pattern": "^[a-z][A-Za-z0-9]*$"
658
+ }
659
+ },
660
+ "required": ["amountField", "kind", "targetField"],
661
+ "additionalProperties": false
662
+ },
663
+ {
664
+ "type": "object",
665
+ "properties": {
666
+ "amountField": {
667
+ "type": "string",
668
+ "pattern": "^[a-z][A-Za-z0-9]*$"
669
+ },
670
+ "anchorRef": {
671
+ "type": "string",
672
+ "pattern": "^[a-z][A-Za-z0-9]*$"
673
+ },
674
+ "kind": {
675
+ "type": "string",
676
+ "const": "sum_within_anchor_ref"
677
+ }
678
+ },
679
+ "required": ["amountField", "anchorRef", "kind"],
680
+ "additionalProperties": false
681
+ },
682
+ {
683
+ "type": "object",
684
+ "properties": {
685
+ "kind": {
686
+ "type": "string",
687
+ "const": "count_at_least"
688
+ },
689
+ "targetField": {
690
+ "type": "string",
691
+ "pattern": "^[a-z][A-Za-z0-9]*$"
692
+ }
693
+ },
694
+ "required": ["kind", "targetField"],
695
+ "additionalProperties": false
696
+ },
697
+ {
698
+ "type": "object",
699
+ "properties": {
700
+ "kind": {
701
+ "type": "string",
702
+ "const": "all_in"
703
+ }
704
+ },
705
+ "required": ["kind"],
706
+ "additionalProperties": false
707
+ },
708
+ {
709
+ "type": "object",
710
+ "properties": {
711
+ "field": {
712
+ "type": "string",
713
+ "pattern": "^[a-z][A-Za-z0-9]*$"
714
+ },
715
+ "kind": {
716
+ "type": "string",
717
+ "const": "count_equals_field"
718
+ }
719
+ },
720
+ "required": ["field", "kind"],
721
+ "additionalProperties": false
722
+ }
723
+ ]
724
+ },
725
+ "nounId": {
726
+ "type": "string",
727
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
728
+ },
729
+ "over": {
730
+ "type": "string",
731
+ "enum": ["children", "siblings"]
732
+ },
733
+ "refField": {
734
+ "type": "string",
735
+ "pattern": "^[a-z][A-Za-z0-9]*$"
736
+ },
737
+ "statuses": {
738
+ "minItems": 1,
739
+ "type": "array",
740
+ "items": {
741
+ "type": "string",
742
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
743
+ }
744
+ }
745
+ },
746
+ "required": ["check", "over", "refField", "statuses"],
747
+ "additionalProperties": false
748
+ }
749
+ },
750
+ "requiresDrainedAccount": {
751
+ "type": "object",
752
+ "properties": {
753
+ "path": {
754
+ "type": "string",
755
+ "pattern": "^[a-z][A-Za-z0-9]*(?:\\.[a-z][A-Za-z0-9]*)*$"
756
+ }
757
+ },
758
+ "required": ["path"],
759
+ "additionalProperties": false
760
+ },
761
+ "requiresRefs": {
762
+ "minItems": 1,
763
+ "type": "array",
764
+ "items": {
765
+ "type": "object",
766
+ "properties": {
767
+ "bind": {
768
+ "type": "object",
769
+ "propertyNames": {
770
+ "type": "string",
771
+ "pattern": "^[a-z][A-Za-z0-9]*$"
772
+ },
773
+ "additionalProperties": {
774
+ "type": "string",
775
+ "pattern": "^[a-z][A-Za-z0-9]*(?:\\.[a-z][A-Za-z0-9]*)*$"
776
+ }
777
+ },
778
+ "field": {
779
+ "type": "string",
780
+ "pattern": "^[a-z][A-Za-z0-9]*$"
781
+ },
782
+ "match": {
783
+ "type": "object",
784
+ "propertyNames": {
785
+ "type": "string",
786
+ "pattern": "^[a-z][A-Za-z0-9]*(?:\\.[a-z][A-Za-z0-9]*)*$"
787
+ },
788
+ "additionalProperties": {
789
+ "type": "string",
790
+ "pattern": "^[a-z][A-Za-z0-9]*(?:\\.[a-z][A-Za-z0-9]*)*$"
791
+ }
792
+ },
793
+ "optional": {
794
+ "type": "boolean",
795
+ "const": true
796
+ },
797
+ "statuses": {
798
+ "minItems": 1,
799
+ "type": "array",
800
+ "items": {
801
+ "type": "string",
802
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
803
+ }
804
+ },
805
+ "unique": {
806
+ "type": "boolean",
807
+ "const": true
808
+ }
809
+ },
810
+ "required": ["field", "statuses"],
811
+ "additionalProperties": false
812
+ }
813
+ },
814
+ "setsAt": {
815
+ "type": "object",
816
+ "properties": {
817
+ "field": {
818
+ "type": "string",
819
+ "pattern": "^[a-z][A-Za-z0-9]*$"
820
+ },
821
+ "offset": {
822
+ "type": "string"
823
+ }
824
+ },
825
+ "required": ["field", "offset"],
826
+ "additionalProperties": false
827
+ },
828
+ "steps": {
829
+ "type": "array",
830
+ "items": {
831
+ "type": "object",
832
+ "properties": {
833
+ "bind": {
834
+ "type": "object",
835
+ "propertyNames": {
836
+ "type": "string",
837
+ "pattern": "^[a-z][A-Za-z0-9]*(?:\\.[a-z][A-Za-z0-9]*)*$"
838
+ },
839
+ "additionalProperties": {
840
+ "oneOf": [
841
+ {
842
+ "type": "object",
843
+ "properties": {
844
+ "from": {
845
+ "type": "string",
846
+ "const": "const"
847
+ },
848
+ "value": {
849
+ "type": "string"
850
+ }
851
+ },
852
+ "required": ["from", "value"],
853
+ "additionalProperties": false
854
+ },
855
+ {
856
+ "type": "object",
857
+ "properties": {
858
+ "from": {
859
+ "type": "string",
860
+ "const": "instance"
861
+ },
862
+ "path": {
863
+ "type": "string",
864
+ "pattern": "^[a-z][A-Za-z0-9]*(?:\\.[a-z][A-Za-z0-9]*)*$"
865
+ }
866
+ },
867
+ "required": ["from", "path"],
868
+ "additionalProperties": false
869
+ },
870
+ {
871
+ "type": "object",
872
+ "properties": {
873
+ "from": {
874
+ "type": "string",
875
+ "const": "input"
876
+ },
877
+ "path": {
878
+ "type": "string",
879
+ "pattern": "^[a-z][A-Za-z0-9]*(?:\\.[a-z][A-Za-z0-9]*)*$"
880
+ }
881
+ },
882
+ "required": ["from", "path"],
883
+ "additionalProperties": false
884
+ }
885
+ ]
886
+ }
887
+ },
888
+ "capture": {
889
+ "type": "object",
890
+ "propertyNames": {
891
+ "type": "string"
892
+ },
893
+ "additionalProperties": {
894
+ "type": "string"
895
+ }
896
+ },
897
+ "operation": {
898
+ "type": "string",
899
+ "enum": [
900
+ "account.escrow.provision",
901
+ "account.freeze",
902
+ "account.unfreeze"
903
+ ]
904
+ }
905
+ },
906
+ "required": ["bind", "operation"],
907
+ "additionalProperties": false
908
+ }
909
+ },
910
+ "summary": {
911
+ "type": "string"
912
+ }
913
+ },
914
+ "required": ["steps", "summary"],
915
+ "additionalProperties": false
916
+ }
917
+ }
918
+ },
919
+ "required": [
920
+ "fields",
921
+ "id",
922
+ "idPrefix",
923
+ "lifecycle",
924
+ "required",
925
+ "summary",
926
+ "title",
927
+ "verbs"
928
+ ],
929
+ "additionalProperties": false
930
+ }
931
+ },
932
+ "product": {
933
+ "type": "string",
934
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
935
+ },
936
+ "subjects": {
937
+ "type": "array",
938
+ "items": {
939
+ "type": "object",
940
+ "properties": {
941
+ "declaredValue": {
942
+ "type": "string",
943
+ "enum": ["required", "optional", "none"]
944
+ },
945
+ "kind": {
946
+ "type": "string",
947
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"
948
+ },
949
+ "schema": {
950
+ "type": "object",
951
+ "propertyNames": {
952
+ "type": "string"
953
+ },
954
+ "additionalProperties": {
955
+ "$ref": "#/$defs/jsonValue"
956
+ }
957
+ },
958
+ "title": {
959
+ "type": "string"
960
+ },
961
+ "version": {
962
+ "type": "integer",
963
+ "exclusiveMinimum": 0,
964
+ "maximum": 9007199254740991
965
+ }
966
+ },
967
+ "required": ["declaredValue", "kind", "schema", "title", "version"],
968
+ "additionalProperties": false
969
+ }
970
+ },
971
+ "title": {
972
+ "type": "string"
973
+ },
974
+ "udl": {
975
+ "type": "number",
976
+ "const": 1
977
+ },
978
+ "version": {
979
+ "type": "integer",
980
+ "exclusiveMinimum": 0,
981
+ "maximum": 9007199254740991
982
+ }
983
+ },
984
+ "required": ["nouns", "product", "subjects", "title", "udl", "version"],
985
+ "additionalProperties": false,
986
+ "$defs": {
987
+ "jsonValue": {
988
+ "anyOf": [
989
+ {
990
+ "type": "string"
991
+ },
992
+ {
993
+ "type": "number"
994
+ },
995
+ {
996
+ "type": "boolean"
997
+ },
998
+ {
999
+ "type": "null"
1000
+ },
1001
+ {
1002
+ "type": "array",
1003
+ "items": {
1004
+ "$ref": "#/$defs/jsonValue"
1005
+ }
1006
+ },
1007
+ {
1008
+ "type": "object",
1009
+ "propertyNames": {
1010
+ "type": "string"
1011
+ },
1012
+ "additionalProperties": {
1013
+ "$ref": "#/$defs/jsonValue"
1014
+ }
1015
+ }
1016
+ ]
1017
+ }
1018
+ }
1019
+ }