@toolproof-npm/schema 0.1.49 → 0.1.52

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 (27) hide show
  1. package/dist/genesis/generated/resource-envelopes/Genesis.d.ts +2 -0
  2. package/dist/genesis/generated/resource-envelopes/Genesis.js +2 -0
  3. package/dist/genesis/generated/resource-envelopes/Genesis.json +2337 -0
  4. package/dist/genesis/{resourceTypes → generated/resource-type-envelopes}/Genesis.json +223 -255
  5. package/dist/genesis/generated/resourceTypes/Genesis.d.ts +2 -0
  6. package/dist/genesis/generated/resourceTypes/Genesis.js +2 -0
  7. package/dist/genesis/generated/resourceTypes/Genesis.json +1757 -0
  8. package/dist/genesis/generated/resources/Genesis.json +157 -189
  9. package/dist/genesis/generated/schemas/Genesis.json +149 -181
  10. package/dist/genesis/generated/schemas/Job.json +20 -22
  11. package/dist/genesis/generated/schemas/ResourceFormat.json +14 -16
  12. package/dist/genesis/generated/schemas/ResourceType.json +28 -30
  13. package/dist/genesis/generated/schemas/StatefulStrategy.json +225 -251
  14. package/dist/genesis/generated/schemas/StatelessStrategy.json +103 -123
  15. package/dist/genesis/generated/types/types.d.ts +174 -86
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/scripts/_lib/config.d.ts +4 -0
  19. package/dist/scripts/_lib/config.js +18 -1
  20. package/dist/scripts/extractSchemas.js +2 -2
  21. package/dist/scripts/generateResourceEnvelopes.js +1 -1
  22. package/dist/scripts/generateSchemaShims.js +21 -0
  23. package/dist/scripts/generateTypes.js +58 -0
  24. package/dist/scripts/rewriteAnchors.js +4 -2
  25. package/package.json +1 -1
  26. /package/dist/genesis/{resourceTypes → generated/resource-type-envelopes}/Genesis.d.ts +0 -0
  27. /package/dist/genesis/{resourceTypes → generated/resource-type-envelopes}/Genesis.js +0 -0
@@ -8,31 +8,28 @@
8
8
  "allOf": [
9
9
  {
10
10
  "$ref": "#/$defs/StepKind"
11
- },
12
- {
13
- "type": "object",
14
- "properties": {
15
- "cases": {
16
- "type": "array",
17
- "items": {
18
- "$ref": "#/$defs/Conditional"
19
- },
20
- "minItems": 1,
21
- "uniqueItems": true
22
- },
23
- "identity": {
24
- "$ref": "#/$defs/BranchStepIdentity"
25
- },
26
- "kind": {
27
- "const": "branch"
28
- }
11
+ }
12
+ ],
13
+ "properties": {
14
+ "cases": {
15
+ "type": "array",
16
+ "items": {
17
+ "$ref": "#/$defs/Conditional"
29
18
  },
30
- "required": [
31
- "identity",
32
- "kind",
33
- "cases"
34
- ]
19
+ "minItems": 1,
20
+ "uniqueItems": true
21
+ },
22
+ "identity": {
23
+ "$ref": "#/$defs/BranchStepIdentity"
24
+ },
25
+ "kind": {
26
+ "const": "branch"
35
27
  }
28
+ },
29
+ "required": [
30
+ "identity",
31
+ "kind",
32
+ "cases"
36
33
  ],
37
34
  "$anchor": "BranchStep"
38
35
  },
@@ -123,26 +120,23 @@
123
120
  "$schema": "https://json-schema.org/draft/2020-12/schema",
124
121
  "type": "object",
125
122
  "allOf": [
126
- {
127
- "type": "object",
128
- "properties": {
129
- "identity": {
130
- "$ref": "#/$defs/ExecutionIdentity"
131
- },
132
- "jobRef": {
133
- "$ref": "#/$defs/JobIdentity"
134
- }
135
- },
136
- "required": [
137
- "identity",
138
- "jobRef"
139
- ]
140
- },
141
123
  {
142
124
  "$comment": "This will be overlayed at runtime to specify roleBindings corresponding to the roles of the underlying job.",
143
125
  "$ref": "#/$defs/RoleBindingsWrapper"
144
126
  }
145
127
  ],
128
+ "properties": {
129
+ "identity": {
130
+ "$ref": "#/$defs/ExecutionIdentity"
131
+ },
132
+ "jobRef": {
133
+ "$ref": "#/$defs/JobIdentity"
134
+ }
135
+ },
136
+ "required": [
137
+ "identity",
138
+ "jobRef"
139
+ ],
146
140
  "$anchor": "Execution"
147
141
  },
148
142
  "ExecutionIdentity": {
@@ -299,26 +293,23 @@
299
293
  "allOf": [
300
294
  {
301
295
  "$ref": "#/$defs/StepKind"
296
+ }
297
+ ],
298
+ "properties": {
299
+ "case": {
300
+ "$ref": "#/$defs/Conditional"
302
301
  },
303
- {
304
- "type": "object",
305
- "properties": {
306
- "case": {
307
- "$ref": "#/$defs/Conditional"
308
- },
309
- "identity": {
310
- "$ref": "#/$defs/ForStepIdentity"
311
- },
312
- "kind": {
313
- "const": "for"
314
- }
315
- },
316
- "required": [
317
- "identity",
318
- "kind",
319
- "case"
320
- ]
302
+ "identity": {
303
+ "$ref": "#/$defs/ForStepIdentity"
304
+ },
305
+ "kind": {
306
+ "const": "for"
321
307
  }
308
+ },
309
+ "required": [
310
+ "identity",
311
+ "kind",
312
+ "case"
322
313
  ],
323
314
  "$anchor": "ForStep"
324
315
  },
@@ -543,21 +534,6 @@
543
534
  "$schema": "https://json-schema.org/draft/2020-12/schema",
544
535
  "type": "object",
545
536
  "allOf": [
546
- {
547
- "properties": {
548
- "identity": {
549
- "$ref": "#/$defs/JobIdentity"
550
- },
551
- "implementationUri": {
552
- "type": "string",
553
- "format": "uri"
554
- }
555
- },
556
- "required": [
557
- "identity",
558
- "implementationUri"
559
- ]
560
- },
561
537
  {
562
538
  "$ref": "#/$defs/Documented"
563
539
  },
@@ -565,6 +541,19 @@
565
541
  "$ref": "#/$defs/RolesWrapper"
566
542
  }
567
543
  ],
544
+ "properties": {
545
+ "identity": {
546
+ "$ref": "#/$defs/JobIdentity"
547
+ },
548
+ "implementationUri": {
549
+ "type": "string",
550
+ "format": "uri"
551
+ }
552
+ },
553
+ "required": [
554
+ "identity",
555
+ "implementationUri"
556
+ ],
568
557
  "unevaluatedProperties": false,
569
558
  "$anchor": "Job"
570
559
  },
@@ -842,21 +831,17 @@
842
831
  "ResourceBase": {
843
832
  "$schema": "https://json-schema.org/draft/2020-12/schema",
844
833
  "type": "object",
845
- "allOf": [
846
- {
847
- "properties": {
848
- "identity": {
849
- "$ref": "#/$defs/ResourceIdentity"
850
- },
851
- "resourceTypeRef": {
852
- "$ref": "#/$defs/ResourceTypeIdentity"
853
- }
854
- },
855
- "required": [
856
- "identity",
857
- "resourceTypeRef"
858
- ]
834
+ "properties": {
835
+ "identity": {
836
+ "$ref": "#/$defs/ResourceIdentity"
837
+ },
838
+ "resourceTypeRef": {
839
+ "$ref": "#/$defs/ResourceTypeIdentity"
859
840
  }
841
+ },
842
+ "required": [
843
+ "identity",
844
+ "resourceTypeRef"
860
845
  ],
861
846
  "$anchor": "ResourceBase"
862
847
  },
@@ -864,20 +849,18 @@
864
849
  "$schema": "https://json-schema.org/draft/2020-12/schema",
865
850
  "type": "object",
866
851
  "allOf": [
867
- {
868
- "properties": {
869
- "identity": {
870
- "$ref": "#/$defs/ResourceFormatIdentity"
871
- }
872
- },
873
- "required": [
874
- "identity"
875
- ]
876
- },
877
852
  {
878
853
  "$ref": "#/$defs/Documented"
879
854
  }
880
855
  ],
856
+ "properties": {
857
+ "identity": {
858
+ "$ref": "#/$defs/ResourceFormatIdentity"
859
+ }
860
+ },
861
+ "required": [
862
+ "identity"
863
+ ],
881
864
  "$anchor": "ResourceFormat"
882
865
  },
883
866
  "ResourceFormatIdentity": {
@@ -1059,20 +1042,6 @@
1059
1042
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1060
1043
  "type": "object",
1061
1044
  "allOf": [
1062
- {
1063
- "properties": {
1064
- "identity": {
1065
- "$ref": "#/$defs/ResourceTypeIdentity"
1066
- },
1067
- "resourceFormatRef": {
1068
- "$ref": "#/$defs/ResourceFormatIdentity"
1069
- }
1070
- },
1071
- "required": [
1072
- "identity",
1073
- "resourceFormatRef"
1074
- ]
1075
- },
1076
1045
  {
1077
1046
  "$ref": "#/$defs/Documented"
1078
1047
  },
@@ -1086,29 +1055,41 @@
1086
1055
  "const": "FORMAT-ApplicationJson"
1087
1056
  }
1088
1057
  },
1089
- "$comment": "If resourceFormatRef is FORMAT-ApplicationJson, then extractor must not be present, but if resourceFormatRef is not FORMAT-ApplicationJson, then extractor must be present. This is because resources of types with format FORMAT-ApplicationJson are self-contained and do not need an extractor."
1058
+ "$comment": "If resourceFormatRef is FORMAT-ApplicationJson, then extractorUri must not be present, but if resourceFormatRef is not FORMAT-ApplicationJson, then extractorUri must be present. This is because resources of types with format FORMAT-ApplicationJson are self-contained and do not need an extractor."
1090
1059
  },
1091
1060
  "then": {
1092
1061
  "not": {
1093
1062
  "required": [
1094
- "extractor"
1063
+ "extractorUri"
1095
1064
  ]
1096
1065
  }
1097
1066
  },
1098
1067
  "else": {
1099
1068
  "type": "object",
1100
1069
  "properties": {
1101
- "extractor": {
1070
+ "extractorUri": {
1102
1071
  "type": "string",
1103
1072
  "format": "uri"
1104
1073
  }
1105
1074
  },
1106
1075
  "required": [
1107
- "extractor"
1076
+ "extractorUri"
1108
1077
  ]
1109
1078
  }
1110
1079
  }
1111
1080
  ],
1081
+ "properties": {
1082
+ "identity": {
1083
+ "$ref": "#/$defs/ResourceTypeIdentity"
1084
+ },
1085
+ "resourceFormatRef": {
1086
+ "$ref": "#/$defs/ResourceFormatIdentity"
1087
+ }
1088
+ },
1089
+ "required": [
1090
+ "identity",
1091
+ "resourceFormatRef"
1092
+ ],
1112
1093
  "$anchor": "ResourceType"
1113
1094
  },
1114
1095
  "ResourceTypeIdentity": {
@@ -1205,24 +1186,22 @@
1205
1186
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1206
1187
  "type": "object",
1207
1188
  "allOf": [
1208
- {
1209
- "properties": {
1210
- "identity": {
1211
- "$ref": "#/$defs/StatefulStrategyIdentity"
1212
- },
1213
- "statelessStrategy": {
1214
- "$ref": "#/$defs/StatelessStrategy"
1215
- }
1216
- },
1217
- "required": [
1218
- "identity",
1219
- "statelessStrategy"
1220
- ]
1221
- },
1222
1189
  {
1223
1190
  "$ref": "#/$defs/StrategyStateWrapper"
1224
1191
  }
1225
1192
  ],
1193
+ "properties": {
1194
+ "identity": {
1195
+ "$ref": "#/$defs/StatefulStrategyIdentity"
1196
+ },
1197
+ "statelessStrategy": {
1198
+ "$ref": "#/$defs/StatelessStrategy"
1199
+ }
1200
+ },
1201
+ "required": [
1202
+ "identity",
1203
+ "statelessStrategy"
1204
+ ],
1226
1205
  "$anchor": "StatefulStrategy"
1227
1206
  },
1228
1207
  "StatefulStrategyIdentity": {
@@ -1234,26 +1213,21 @@
1234
1213
  "StatelessStrategy": {
1235
1214
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1236
1215
  "type": "object",
1237
- "allOf": [
1238
- {
1239
- "type": "object",
1240
- "properties": {
1241
- "identity": {
1242
- "$ref": "#/$defs/StatelessStrategyIdentity"
1243
- },
1244
- "steps": {
1245
- "type": "array",
1246
- "items": {
1247
- "$ref": "#/$defs/Step"
1248
- },
1249
- "uniqueItems": true
1250
- }
1216
+ "properties": {
1217
+ "identity": {
1218
+ "$ref": "#/$defs/StatelessStrategyIdentity"
1219
+ },
1220
+ "steps": {
1221
+ "type": "array",
1222
+ "items": {
1223
+ "$ref": "#/$defs/Step"
1251
1224
  },
1252
- "required": [
1253
- "identity",
1254
- "steps"
1255
- ]
1225
+ "uniqueItems": true
1256
1226
  }
1227
+ },
1228
+ "required": [
1229
+ "identity",
1230
+ "steps"
1257
1231
  ],
1258
1232
  "unevaluatedProperties": false,
1259
1233
  "$anchor": "StatelessStrategy"
@@ -1366,26 +1340,23 @@
1366
1340
  "allOf": [
1367
1341
  {
1368
1342
  "$ref": "#/$defs/StepKind"
1343
+ }
1344
+ ],
1345
+ "properties": {
1346
+ "case": {
1347
+ "$ref": "#/$defs/Conditional"
1369
1348
  },
1370
- {
1371
- "type": "object",
1372
- "properties": {
1373
- "case": {
1374
- "$ref": "#/$defs/Conditional"
1375
- },
1376
- "identity": {
1377
- "$ref": "#/$defs/WhileStepIdentity"
1378
- },
1379
- "kind": {
1380
- "const": "while"
1381
- }
1382
- },
1383
- "required": [
1384
- "identity",
1385
- "kind",
1386
- "case"
1387
- ]
1349
+ "identity": {
1350
+ "$ref": "#/$defs/WhileStepIdentity"
1351
+ },
1352
+ "kind": {
1353
+ "const": "while"
1388
1354
  }
1355
+ },
1356
+ "required": [
1357
+ "identity",
1358
+ "kind",
1359
+ "case"
1389
1360
  ],
1390
1361
  "$anchor": "WhileStep"
1391
1362
  },
@@ -1401,26 +1372,23 @@
1401
1372
  "allOf": [
1402
1373
  {
1403
1374
  "$ref": "#/$defs/StepKind"
1375
+ }
1376
+ ],
1377
+ "properties": {
1378
+ "execution": {
1379
+ "$ref": "#/$defs/Execution"
1404
1380
  },
1405
- {
1406
- "type": "object",
1407
- "properties": {
1408
- "execution": {
1409
- "$ref": "#/$defs/Execution"
1410
- },
1411
- "identity": {
1412
- "$ref": "#/$defs/WorkStepIdentity"
1413
- },
1414
- "kind": {
1415
- "const": "work"
1416
- }
1417
- },
1418
- "required": [
1419
- "identity",
1420
- "kind",
1421
- "execution"
1422
- ]
1381
+ "identity": {
1382
+ "$ref": "#/$defs/WorkStepIdentity"
1383
+ },
1384
+ "kind": {
1385
+ "const": "work"
1423
1386
  }
1387
+ },
1388
+ "required": [
1389
+ "identity",
1390
+ "kind",
1391
+ "execution"
1424
1392
  ],
1425
1393
  "$anchor": "WorkStep"
1426
1394
  },
@@ -2,21 +2,6 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "type": "object",
4
4
  "allOf": [
5
- {
6
- "properties": {
7
- "identity": {
8
- "$ref": "#/$defs/JobIdentity"
9
- },
10
- "implementationUri": {
11
- "type": "string",
12
- "format": "uri"
13
- }
14
- },
15
- "required": [
16
- "identity",
17
- "implementationUri"
18
- ]
19
- },
20
5
  {
21
6
  "$ref": "#/$defs/Documented"
22
7
  },
@@ -24,16 +9,22 @@
24
9
  "$ref": "#/$defs/RolesWrapper"
25
10
  }
26
11
  ],
12
+ "properties": {
13
+ "identity": {
14
+ "$ref": "#/$defs/JobIdentity"
15
+ },
16
+ "implementationUri": {
17
+ "type": "string",
18
+ "format": "uri"
19
+ }
20
+ },
21
+ "required": [
22
+ "identity",
23
+ "implementationUri"
24
+ ],
27
25
  "unevaluatedProperties": false,
28
26
  "$anchor": "Job",
29
27
  "$defs": {
30
- "JobIdentity": {
31
- "$schema": "https://json-schema.org/draft/2020-12/schema",
32
- "type": "string",
33
- "$anchor": "JobIdentity",
34
- "$comment": "",
35
- "pattern": "^JOB-.+$"
36
- },
37
28
  "Documented": {
38
29
  "$schema": "https://json-schema.org/draft/2020-12/schema",
39
30
  "type": "object",
@@ -60,6 +51,13 @@
60
51
  ],
61
52
  "$anchor": "RolesWrapper"
62
53
  },
54
+ "JobIdentity": {
55
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
56
+ "type": "string",
57
+ "$anchor": "JobIdentity",
58
+ "$comment": "",
59
+ "pattern": "^JOB-.+$"
60
+ },
63
61
  "Named": {
64
62
  "$schema": "https://json-schema.org/draft/2020-12/schema",
65
63
  "type": "object",
@@ -2,28 +2,20 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "type": "object",
4
4
  "allOf": [
5
- {
6
- "properties": {
7
- "identity": {
8
- "$ref": "#/$defs/ResourceFormatIdentity"
9
- }
10
- },
11
- "required": [
12
- "identity"
13
- ]
14
- },
15
5
  {
16
6
  "$ref": "#/$defs/Documented"
17
7
  }
18
8
  ],
9
+ "properties": {
10
+ "identity": {
11
+ "$ref": "#/$defs/ResourceFormatIdentity"
12
+ }
13
+ },
14
+ "required": [
15
+ "identity"
16
+ ],
19
17
  "$anchor": "ResourceFormat",
20
18
  "$defs": {
21
- "ResourceFormatIdentity": {
22
- "$schema": "https://json-schema.org/draft/2020-12/schema",
23
- "type": "string",
24
- "$anchor": "ResourceFormatIdentity",
25
- "pattern": "^FORMAT-.+$"
26
- },
27
19
  "Documented": {
28
20
  "$schema": "https://json-schema.org/draft/2020-12/schema",
29
21
  "type": "object",
@@ -37,6 +29,12 @@
37
29
  ],
38
30
  "$anchor": "Documented"
39
31
  },
32
+ "ResourceFormatIdentity": {
33
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
34
+ "type": "string",
35
+ "$anchor": "ResourceFormatIdentity",
36
+ "pattern": "^FORMAT-.+$"
37
+ },
40
38
  "Named": {
41
39
  "$schema": "https://json-schema.org/draft/2020-12/schema",
42
40
  "type": "object",
@@ -2,20 +2,6 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "type": "object",
4
4
  "allOf": [
5
- {
6
- "properties": {
7
- "identity": {
8
- "$ref": "#/$defs/ResourceTypeIdentity"
9
- },
10
- "resourceFormatRef": {
11
- "$ref": "#/$defs/ResourceFormatIdentity"
12
- }
13
- },
14
- "required": [
15
- "identity",
16
- "resourceFormatRef"
17
- ]
18
- },
19
5
  {
20
6
  "$ref": "#/$defs/Documented"
21
7
  },
@@ -29,43 +15,43 @@
29
15
  "const": "FORMAT-ApplicationJson"
30
16
  }
31
17
  },
32
- "$comment": "If resourceFormatRef is FORMAT-ApplicationJson, then extractor must not be present, but if resourceFormatRef is not FORMAT-ApplicationJson, then extractor must be present. This is because resources of types with format FORMAT-ApplicationJson are self-contained and do not need an extractor."
18
+ "$comment": "If resourceFormatRef is FORMAT-ApplicationJson, then extractorUri must not be present, but if resourceFormatRef is not FORMAT-ApplicationJson, then extractorUri must be present. This is because resources of types with format FORMAT-ApplicationJson are self-contained and do not need an extractor."
33
19
  },
34
20
  "then": {
35
21
  "not": {
36
22
  "required": [
37
- "extractor"
23
+ "extractorUri"
38
24
  ]
39
25
  }
40
26
  },
41
27
  "else": {
42
28
  "type": "object",
43
29
  "properties": {
44
- "extractor": {
30
+ "extractorUri": {
45
31
  "type": "string",
46
32
  "format": "uri"
47
33
  }
48
34
  },
49
35
  "required": [
50
- "extractor"
36
+ "extractorUri"
51
37
  ]
52
38
  }
53
39
  }
54
40
  ],
41
+ "properties": {
42
+ "identity": {
43
+ "$ref": "#/$defs/ResourceTypeIdentity"
44
+ },
45
+ "resourceFormatRef": {
46
+ "$ref": "#/$defs/ResourceFormatIdentity"
47
+ }
48
+ },
49
+ "required": [
50
+ "identity",
51
+ "resourceFormatRef"
52
+ ],
55
53
  "$anchor": "ResourceType",
56
54
  "$defs": {
57
- "ResourceTypeIdentity": {
58
- "$schema": "https://json-schema.org/draft/2020-12/schema",
59
- "type": "string",
60
- "$anchor": "ResourceTypeIdentity",
61
- "pattern": "^TYPE-.+$"
62
- },
63
- "ResourceFormatIdentity": {
64
- "$schema": "https://json-schema.org/draft/2020-12/schema",
65
- "type": "string",
66
- "$anchor": "ResourceFormatIdentity",
67
- "pattern": "^FORMAT-.+$"
68
- },
69
55
  "Documented": {
70
56
  "$schema": "https://json-schema.org/draft/2020-12/schema",
71
57
  "type": "object",
@@ -92,6 +78,18 @@
92
78
  ],
93
79
  "$anchor": "ExtractionSchemaWrapper"
94
80
  },
81
+ "ResourceTypeIdentity": {
82
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
83
+ "type": "string",
84
+ "$anchor": "ResourceTypeIdentity",
85
+ "pattern": "^TYPE-.+$"
86
+ },
87
+ "ResourceFormatIdentity": {
88
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
89
+ "type": "string",
90
+ "$anchor": "ResourceFormatIdentity",
91
+ "pattern": "^FORMAT-.+$"
92
+ },
95
93
  "Named": {
96
94
  "$schema": "https://json-schema.org/draft/2020-12/schema",
97
95
  "type": "object",