@toolproof-npm/schema 0.1.34 → 0.1.36

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 (53) hide show
  1. package/dist/_lib/test.js +12 -12
  2. package/dist/_lib/types/Resource_Job.d.ts +55 -0
  3. package/dist/_lib/types/Resource_ResourceFormat.d.ts +40 -0
  4. package/dist/_lib/types/Resource_ResourceFormat.js +1 -0
  5. package/dist/_lib/types/Resource_ResourceType.d.ts +61 -0
  6. package/dist/_lib/types/Resource_ResourceType.js +1 -0
  7. package/dist/_lib/types/Resource_StatelessStrategy.d.ts +79 -0
  8. package/dist/_lib/types/Resource_StatelessStrategy.js +1 -0
  9. package/dist/_lib/types/types.d.ts +495 -355
  10. package/dist/genesis/generated/resources/Genesis.d.ts +2 -0
  11. package/dist/genesis/generated/resources/Genesis.js +2 -0
  12. package/dist/genesis/generated/resources/Genesis.json +2120 -0
  13. package/dist/{schemas → genesis/generated/schemas}/Genesis.json +273 -345
  14. package/dist/{schemas → genesis/generated/schemas}/Job.json +24 -26
  15. package/dist/genesis/generated/schemas/ResourceFormat.d.ts +2 -0
  16. package/dist/genesis/generated/schemas/ResourceFormat.js +2 -0
  17. package/dist/genesis/generated/schemas/ResourceFormat.json +74 -0
  18. package/dist/genesis/generated/schemas/ResourceType.d.ts +2 -0
  19. package/dist/genesis/generated/schemas/ResourceType.js +2 -0
  20. package/dist/genesis/generated/schemas/ResourceType.json +368 -0
  21. package/dist/genesis/generated/schemas/StatefulStrategy.d.ts +2 -0
  22. package/dist/genesis/generated/schemas/StatefulStrategy.js +2 -0
  23. package/dist/genesis/generated/schemas/StatefulStrategy.json +647 -0
  24. package/dist/genesis/generated/schemas/StatelessStrategy.d.ts +2 -0
  25. package/dist/genesis/generated/schemas/StatelessStrategy.js +2 -0
  26. package/dist/genesis/generated/schemas/StatelessStrategy.json +324 -0
  27. package/dist/genesis/resourceTypes/Genesis.d.ts +2 -0
  28. package/dist/genesis/resourceTypes/Genesis.js +2 -0
  29. package/dist/genesis/resourceTypes/Genesis.json +1530 -0
  30. package/dist/index.d.ts +8 -5
  31. package/dist/index.js +4 -3
  32. package/dist/scripts/_lib/config.d.ts +45 -0
  33. package/dist/scripts/_lib/config.js +109 -0
  34. package/dist/scripts/brandFactories.d.ts +5 -5
  35. package/dist/scripts/brandFactories.js +4 -5
  36. package/dist/scripts/extractSchemas.js +33 -8
  37. package/dist/scripts/extractSubschemaWithDefs.js +36 -7
  38. package/dist/scripts/generateResourceEnvelopes.js +77 -0
  39. package/dist/scripts/generateResourceTypeType.d.ts +1 -0
  40. package/dist/scripts/{generateResourceData.js → generateResourceTypeType.js} +21 -19
  41. package/dist/scripts/generateSchemaShims.d.ts +1 -0
  42. package/dist/scripts/generateSchemaShims.js +63 -0
  43. package/dist/scripts/generateTypes.js +125 -83
  44. package/dist/scripts/rewriteAnchors.d.ts +1 -0
  45. package/dist/scripts/rewriteAnchors.js +90 -0
  46. package/package.json +6 -3
  47. package/dist/_lib/types/ResourceData_Job.d.ts +0 -97
  48. /package/dist/_lib/types/{ResourceData_Job.js → Resource_Job.js} +0 -0
  49. /package/dist/{schemas → genesis/generated/schemas}/Genesis.d.ts +0 -0
  50. /package/dist/{schemas → genesis/generated/schemas}/Genesis.js +0 -0
  51. /package/dist/{schemas → genesis/generated/schemas}/Job.d.ts +0 -0
  52. /package/dist/{schemas → genesis/generated/schemas}/Job.js +0 -0
  53. /package/dist/scripts/{generateResourceData.d.ts → generateResourceEnvelopes.d.ts} +0 -0
@@ -0,0 +1,647 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "allOf": [
5
+ {
6
+ "properties": {
7
+ "identity": {
8
+ "$ref": "#/$defs/StatefulStrategyId"
9
+ },
10
+ "statelessStrategy": {
11
+ "$ref": "#/$defs/StatelessStrategy"
12
+ }
13
+ },
14
+ "required": [
15
+ "identity",
16
+ "statelessStrategy"
17
+ ]
18
+ },
19
+ {
20
+ "$ref": "#/$defs/StrategyState"
21
+ }
22
+ ],
23
+ "$anchor": "StatefulStrategy",
24
+ "$defs": {
25
+ "StatefulStrategyId": {
26
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
27
+ "type": "string",
28
+ "$anchor": "StatefulStrategyId",
29
+ "pattern": "^STATEFULSTRATEGY-.+$"
30
+ },
31
+ "StatelessStrategy": {
32
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
33
+ "type": "object",
34
+ "allOf": [
35
+ {
36
+ "type": "object",
37
+ "properties": {
38
+ "identity": {
39
+ "$ref": "#/$defs/StatelessStrategyId"
40
+ },
41
+ "steps": {
42
+ "type": "array",
43
+ "items": {
44
+ "$ref": "#/$defs/Step"
45
+ },
46
+ "uniqueItems": true
47
+ }
48
+ },
49
+ "required": [
50
+ "identity",
51
+ "steps"
52
+ ]
53
+ }
54
+ ],
55
+ "unevaluatedProperties": false,
56
+ "$anchor": "StatelessStrategy"
57
+ },
58
+ "StrategyState": {
59
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
60
+ "type": "object",
61
+ "properties": {
62
+ "strategyState": {
63
+ "$ref": "#/$defs/StrategyStateValue"
64
+ }
65
+ },
66
+ "required": [
67
+ "strategyState"
68
+ ],
69
+ "$anchor": "StrategyState"
70
+ },
71
+ "StatelessStrategyId": {
72
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
73
+ "type": "string",
74
+ "$anchor": "StatelessStrategyId",
75
+ "pattern": "^STATELESSSTRATEGY-.+$"
76
+ },
77
+ "Step": {
78
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
79
+ "type": "object",
80
+ "oneOf": [
81
+ {
82
+ "$ref": "#/$defs/WorkStep"
83
+ },
84
+ {
85
+ "$ref": "#/$defs/BranchStep"
86
+ },
87
+ {
88
+ "$ref": "#/$defs/WhileStep"
89
+ },
90
+ {
91
+ "$ref": "#/$defs/ForStep"
92
+ }
93
+ ],
94
+ "unevaluatedProperties": false,
95
+ "$anchor": "Step"
96
+ },
97
+ "StrategyStateValue": {
98
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
99
+ "type": "object",
100
+ "additionalProperties": {
101
+ "type": "object",
102
+ "additionalProperties": {
103
+ "oneOf": [
104
+ {
105
+ "$ref": "#/$defs/ResourcePotentialInput"
106
+ },
107
+ {
108
+ "$ref": "#/$defs/ResourcePotentialOutput"
109
+ },
110
+ {
111
+ "$ref": "#/$defs/Resource"
112
+ }
113
+ ]
114
+ },
115
+ "propertyNames": {
116
+ "$ref": "#/$defs/ResourceRoleId"
117
+ }
118
+ },
119
+ "$anchor": "StrategyStateValue",
120
+ "propertyNames": {
121
+ "$ref": "#/$defs/ExecutionId"
122
+ }
123
+ },
124
+ "WorkStep": {
125
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
126
+ "type": "object",
127
+ "allOf": [
128
+ {
129
+ "$ref": "#/$defs/StepKind"
130
+ },
131
+ {
132
+ "type": "object",
133
+ "properties": {
134
+ "execution": {
135
+ "$ref": "#/$defs/Execution"
136
+ },
137
+ "identity": {
138
+ "$ref": "#/$defs/WorkStepId"
139
+ },
140
+ "kind": {
141
+ "const": "work"
142
+ }
143
+ },
144
+ "required": [
145
+ "identity",
146
+ "kind",
147
+ "execution"
148
+ ]
149
+ }
150
+ ],
151
+ "$anchor": "WorkStep"
152
+ },
153
+ "BranchStep": {
154
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
155
+ "type": "object",
156
+ "allOf": [
157
+ {
158
+ "$ref": "#/$defs/StepKind"
159
+ },
160
+ {
161
+ "type": "object",
162
+ "properties": {
163
+ "cases": {
164
+ "type": "array",
165
+ "items": {
166
+ "$ref": "#/$defs/ConditionalWrapper"
167
+ },
168
+ "minItems": 1,
169
+ "uniqueItems": true
170
+ },
171
+ "identity": {
172
+ "$ref": "#/$defs/BranchStepId"
173
+ },
174
+ "kind": {
175
+ "const": "branch"
176
+ }
177
+ },
178
+ "required": [
179
+ "identity",
180
+ "kind",
181
+ "cases"
182
+ ]
183
+ }
184
+ ],
185
+ "$anchor": "BranchStep"
186
+ },
187
+ "WhileStep": {
188
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
189
+ "type": "object",
190
+ "allOf": [
191
+ {
192
+ "$ref": "#/$defs/StepKind"
193
+ },
194
+ {
195
+ "type": "object",
196
+ "properties": {
197
+ "case": {
198
+ "$ref": "#/$defs/ConditionalWrapper"
199
+ },
200
+ "identity": {
201
+ "$ref": "#/$defs/WhileStepId"
202
+ },
203
+ "kind": {
204
+ "const": "while"
205
+ }
206
+ },
207
+ "required": [
208
+ "identity",
209
+ "kind",
210
+ "case"
211
+ ]
212
+ }
213
+ ],
214
+ "$anchor": "WhileStep"
215
+ },
216
+ "ForStep": {
217
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
218
+ "type": "object",
219
+ "allOf": [
220
+ {
221
+ "$ref": "#/$defs/StepKind"
222
+ },
223
+ {
224
+ "type": "object",
225
+ "properties": {
226
+ "case": {
227
+ "$ref": "#/$defs/ConditionalWrapper"
228
+ },
229
+ "identity": {
230
+ "$ref": "#/$defs/ForStepId"
231
+ },
232
+ "kind": {
233
+ "const": "for"
234
+ }
235
+ },
236
+ "required": [
237
+ "identity",
238
+ "kind",
239
+ "case"
240
+ ]
241
+ }
242
+ ],
243
+ "$anchor": "ForStep"
244
+ },
245
+ "ResourcePotentialInput": {
246
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
247
+ "type": "object",
248
+ "allOf": [
249
+ {
250
+ "$ref": "#/$defs/ResourceBase"
251
+ },
252
+ {
253
+ "$ref": "#/$defs/ResourceKind"
254
+ },
255
+ {
256
+ "properties": {
257
+ "kind": {
258
+ "const": "potential-input"
259
+ }
260
+ },
261
+ "required": [
262
+ "kind"
263
+ ]
264
+ },
265
+ {
266
+ "$ref": "#/$defs/PendingRef"
267
+ }
268
+ ],
269
+ "unevaluatedProperties": false,
270
+ "$anchor": "ResourcePotentialInput"
271
+ },
272
+ "ResourcePotentialOutput": {
273
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
274
+ "type": "object",
275
+ "allOf": [
276
+ {
277
+ "$ref": "#/$defs/ResourceBase"
278
+ },
279
+ {
280
+ "$ref": "#/$defs/ResourceKind"
281
+ },
282
+ {
283
+ "properties": {
284
+ "kind": {
285
+ "const": "potential-output"
286
+ }
287
+ },
288
+ "required": [
289
+ "kind"
290
+ ]
291
+ }
292
+ ],
293
+ "unevaluatedProperties": false,
294
+ "$anchor": "ResourcePotentialOutput"
295
+ },
296
+ "Resource": {
297
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
298
+ "type": "object",
299
+ "allOf": [
300
+ {
301
+ "$ref": "#/$defs/ResourceMetaBase"
302
+ },
303
+ {
304
+ "properties": {
305
+ "extractedData": {
306
+ "type": "object",
307
+ "additionalProperties": {
308
+ "$ref": "#/$defs/JsonValue"
309
+ },
310
+ "$comment": "This will be overlayed at runtime to match the data structure of the underlying type's extractionSchema. At compile time, we guarantee it has an identity property."
311
+ }
312
+ },
313
+ "required": [
314
+ "extractedData"
315
+ ]
316
+ }
317
+ ],
318
+ "unevaluatedProperties": false,
319
+ "$anchor": "Resource"
320
+ },
321
+ "ResourceRoleId": {
322
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
323
+ "type": "string",
324
+ "$anchor": "ResourceRoleId",
325
+ "pattern": "^ROLE-.+$"
326
+ },
327
+ "ExecutionId": {
328
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
329
+ "type": "string",
330
+ "$anchor": "ExecutionId",
331
+ "pattern": "^EXECUTION-.+$"
332
+ },
333
+ "StepKind": {
334
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
335
+ "type": "object",
336
+ "properties": {
337
+ "kind": {
338
+ "type": "string",
339
+ "enum": [
340
+ "work",
341
+ "branch",
342
+ "while",
343
+ "for"
344
+ ]
345
+ }
346
+ },
347
+ "required": [
348
+ "kind"
349
+ ],
350
+ "$anchor": "StepKind"
351
+ },
352
+ "Execution": {
353
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
354
+ "type": "object",
355
+ "allOf": [
356
+ {
357
+ "type": "object",
358
+ "properties": {
359
+ "identity": {
360
+ "$ref": "#/$defs/ExecutionId"
361
+ },
362
+ "jobId": {
363
+ "$ref": "#/$defs/ResourceId"
364
+ }
365
+ },
366
+ "required": [
367
+ "identity",
368
+ "jobId"
369
+ ]
370
+ },
371
+ {
372
+ "$comment": "This will be overlayed at runtime to specify roleBindings corresponding to the roles of the underlying job.",
373
+ "$ref": "#/$defs/RoleBindingsOuter"
374
+ }
375
+ ],
376
+ "$anchor": "Execution"
377
+ },
378
+ "WorkStepId": {
379
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
380
+ "type": "string",
381
+ "$anchor": "WorkStepId",
382
+ "pattern": "^WORKSTEP-.+$"
383
+ },
384
+ "ConditionalWrapper": {
385
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
386
+ "type": "object",
387
+ "properties": {
388
+ "what": {
389
+ "$ref": "#/$defs/WorkStep"
390
+ },
391
+ "when": {
392
+ "$ref": "#/$defs/WorkStep"
393
+ }
394
+ },
395
+ "required": [
396
+ "when",
397
+ "what"
398
+ ],
399
+ "unevaluatedProperties": false,
400
+ "$anchor": "ConditionalWrapper"
401
+ },
402
+ "BranchStepId": {
403
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
404
+ "type": "string",
405
+ "$anchor": "BranchStepId",
406
+ "pattern": "^BRANCHSTEP-.+$"
407
+ },
408
+ "WhileStepId": {
409
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
410
+ "type": "string",
411
+ "$anchor": "WhileStepId",
412
+ "pattern": "^WHILESTEP-.+$"
413
+ },
414
+ "ForStepId": {
415
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
416
+ "type": "string",
417
+ "$anchor": "ForStepId",
418
+ "pattern": "^FORSTEP-.+$"
419
+ },
420
+ "ResourceBase": {
421
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
422
+ "type": "object",
423
+ "allOf": [
424
+ {
425
+ "properties": {
426
+ "identity": {
427
+ "$ref": "#/$defs/ResourceId"
428
+ },
429
+ "resourceTypeId": {
430
+ "$ref": "#/$defs/ResourceTypeId"
431
+ }
432
+ },
433
+ "required": [
434
+ "identity",
435
+ "resourceTypeId"
436
+ ]
437
+ },
438
+ {
439
+ "$ref": "#/$defs/CreationContext"
440
+ }
441
+ ],
442
+ "$anchor": "ResourceBase"
443
+ },
444
+ "ResourceKind": {
445
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
446
+ "type": "object",
447
+ "properties": {
448
+ "kind": {
449
+ "enum": [
450
+ "potential-input",
451
+ "potential-output",
452
+ "materialized"
453
+ ]
454
+ }
455
+ },
456
+ "required": [
457
+ "kind"
458
+ ],
459
+ "$anchor": "ResourceKind"
460
+ },
461
+ "PendingRef": {
462
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
463
+ "type": "object",
464
+ "properties": {
465
+ "pendingRef": {
466
+ "$comment": "This points to a resource created at a previous step in the same workflow. This resource is not yet materialized at the time of defining the workflow, but will be materialized when the step using this resource is executed.The Engine resolves this ref at runtime.",
467
+ "$ref": "#/$defs/ResourceSocket"
468
+ }
469
+ },
470
+ "required": [
471
+ "pendingRef"
472
+ ],
473
+ "$anchor": "PendingRef"
474
+ },
475
+ "ResourceMetaBase": {
476
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
477
+ "type": "object",
478
+ "allOf": [
479
+ {
480
+ "$ref": "#/$defs/ResourceBase"
481
+ },
482
+ {
483
+ "$ref": "#/$defs/ResourceKind"
484
+ },
485
+ {
486
+ "properties": {
487
+ "kind": {
488
+ "const": "materialized"
489
+ }
490
+ },
491
+ "required": [
492
+ "kind"
493
+ ]
494
+ },
495
+ {
496
+ "$ref": "#/$defs/Timestamp"
497
+ },
498
+ {
499
+ "$ref": "#/$defs/Path"
500
+ }
501
+ ],
502
+ "$anchor": "ResourceMetaBase"
503
+ },
504
+ "JsonValue": {
505
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
506
+ "oneOf": [
507
+ {
508
+ "type": "null"
509
+ },
510
+ {
511
+ "type": "boolean"
512
+ },
513
+ {
514
+ "type": "number"
515
+ },
516
+ {
517
+ "type": "string"
518
+ },
519
+ {
520
+ "type": "array",
521
+ "items": {
522
+ "$ref": "#/$defs/JsonValue"
523
+ }
524
+ },
525
+ {
526
+ "type": "object",
527
+ "additionalProperties": {
528
+ "$ref": "#/$defs/JsonValue"
529
+ }
530
+ }
531
+ ],
532
+ "$anchor": "JsonValue"
533
+ },
534
+ "ResourceId": {
535
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
536
+ "type": "string",
537
+ "$anchor": "ResourceId",
538
+ "$comment": "",
539
+ "pattern": "^RESOURCE-.+$"
540
+ },
541
+ "RoleBindingsOuter": {
542
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
543
+ "type": "object",
544
+ "properties": {
545
+ "roleBindings": {
546
+ "$ref": "#/$defs/RoleBindingsInner"
547
+ }
548
+ },
549
+ "required": [
550
+ "roleBindings"
551
+ ],
552
+ "$anchor": "RoleBindingsOuter"
553
+ },
554
+ "ResourceTypeId": {
555
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
556
+ "type": "string",
557
+ "$anchor": "ResourceTypeId",
558
+ "pattern": "^TYPE-.+$"
559
+ },
560
+ "CreationContext": {
561
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
562
+ "type": "object",
563
+ "properties": {
564
+ "creationContext": {
565
+ "$ref": "#/$defs/ResourceSocket"
566
+ }
567
+ },
568
+ "required": [
569
+ "creationContext"
570
+ ],
571
+ "$anchor": "CreationContext"
572
+ },
573
+ "ResourceSocket": {
574
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
575
+ "type": "object",
576
+ "properties": {
577
+ "executionId": {
578
+ "$ref": "#/$defs/ExecutionId"
579
+ },
580
+ "resourceRoleId": {
581
+ "$ref": "#/$defs/ResourceRoleId"
582
+ }
583
+ },
584
+ "required": [
585
+ "resourceRoleId",
586
+ "executionId"
587
+ ],
588
+ "$anchor": "ResourceSocket"
589
+ },
590
+ "Timestamp": {
591
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
592
+ "type": "object",
593
+ "properties": {
594
+ "timestamp": {
595
+ "type": "string",
596
+ "format": "date-time"
597
+ }
598
+ },
599
+ "required": [
600
+ "timestamp"
601
+ ],
602
+ "$anchor": "Timestamp"
603
+ },
604
+ "Path": {
605
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
606
+ "type": "object",
607
+ "properties": {
608
+ "path": {
609
+ "type": "string"
610
+ }
611
+ },
612
+ "required": [
613
+ "path"
614
+ ],
615
+ "$anchor": "Path"
616
+ },
617
+ "RoleBindingsInner": {
618
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
619
+ "type": "object",
620
+ "properties": {
621
+ "inputBindingMap": {
622
+ "$ref": "#/$defs/RoleBindingMap"
623
+ },
624
+ "outputBindingMap": {
625
+ "$ref": "#/$defs/RoleBindingMap"
626
+ }
627
+ },
628
+ "required": [
629
+ "inputBindingMap",
630
+ "outputBindingMap"
631
+ ],
632
+ "unevaluatedProperties": false,
633
+ "$anchor": "RoleBindingsInner"
634
+ },
635
+ "RoleBindingMap": {
636
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
637
+ "type": "object",
638
+ "additionalProperties": {
639
+ "$ref": "#/$defs/ResourceId"
640
+ },
641
+ "$anchor": "RoleBindingMap",
642
+ "propertyNames": {
643
+ "$ref": "#/$defs/ResourceRoleId"
644
+ }
645
+ }
646
+ }
647
+ }
@@ -0,0 +1,2 @@
1
+ import schema from './StatelessStrategy.json';
2
+ export default schema;
@@ -0,0 +1,2 @@
1
+ import schema from './StatelessStrategy.json' with { type: 'json' };
2
+ export default schema;