@toolproof-core/schema 1.0.16 → 1.0.18

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 (40) hide show
  1. package/dist/generated/schemas/zod/Goal.d.ts +2 -0
  2. package/dist/generated/schemas/zod/Goal.js +5 -0
  3. package/dist/generated/schemas/zod/Job.d.ts +6 -0
  4. package/dist/generated/schemas/zod/Job.js +25 -0
  5. package/dist/generated/schemas/zod/RawStrategy.d.ts +12 -0
  6. package/dist/generated/schemas/zod/RawStrategy.js +66 -0
  7. package/dist/generated/schemas/zod/ResourceType.d.ts +2 -0
  8. package/dist/generated/schemas/zod/ResourceType.js +18 -0
  9. package/dist/generated/schemas/zod/RunnableStrategy.d.ts +12 -0
  10. package/dist/generated/schemas/zod/RunnableStrategy.js +74 -0
  11. package/dist/generated/schemas/zod/StrategyRun.d.ts +12 -0
  12. package/dist/generated/schemas/zod/StrategyRun.js +88 -0
  13. package/dist/generated/schemas/zod/index.d.ts +6 -0
  14. package/dist/generated/schemas/zod/index.js +7 -0
  15. package/dist/index.d.ts +11 -1
  16. package/dist/index.js +12 -0
  17. package/dist/internals/booleans.json +32 -0
  18. package/dist/internals/jobs.json +266 -0
  19. package/dist/internals/naturals.json +167 -0
  20. package/dist/scripts/_lib/config.d.ts +3 -0
  21. package/dist/scripts/_lib/config.js +9 -0
  22. package/dist/scripts/_lib/utils/jsonSchemaToZod.d.ts +18 -0
  23. package/dist/scripts/_lib/utils/jsonSchemaToZod.js +607 -0
  24. package/dist/scripts/generateStandaloneZodSchema.d.ts +1 -0
  25. package/dist/scripts/generateStandaloneZodSchema.js +116 -0
  26. package/package.json +6 -2
  27. package/src/generated/schemas/zod/Goal.ts +8 -0
  28. package/src/generated/schemas/zod/Job.ts +26 -0
  29. package/src/generated/schemas/zod/RawStrategy.ts +64 -0
  30. package/src/generated/schemas/zod/ResourceType.ts +13 -0
  31. package/src/generated/schemas/zod/RunnableStrategy.ts +69 -0
  32. package/src/generated/schemas/zod/StrategyRun.ts +83 -0
  33. package/src/generated/schemas/zod/index.ts +7 -0
  34. package/src/index.ts +15 -0
  35. package/src/internals/booleans.json +32 -0
  36. package/src/internals/jobs.json +266 -0
  37. package/src/internals/naturals.json +167 -0
  38. package/src/scripts/_lib/config.ts +12 -0
  39. package/src/scripts/_lib/utils/jsonSchemaToZod.ts +646 -0
  40. package/src/scripts/generateStandaloneZodSchema.ts +139 -0
@@ -0,0 +1,266 @@
1
+ [
2
+ {
3
+ "identity": "RESOURCE-Add",
4
+ "resourceTypeHandle": "TYPE-Job",
5
+ "creationContext": {
6
+ "resourceRoleHandle": "ROLE-Manual",
7
+ "jobStepHandle": "JOB_STEP-Genesis"
8
+ },
9
+ "resourceShellKind": "materialized",
10
+ "version": 1,
11
+ "path": "internals://job/add",
12
+ "timestamp": "2025-11-30T00:00:00.000Z",
13
+ "nucleus": {
14
+ "identity": "JOB-Add",
15
+ "name": "Add",
16
+ "description": "dummy-description",
17
+ "implementationUri": "http://34.39.42.71/add",
18
+ "roles": {
19
+ "inputDict": {
20
+ "ROLE-AddendOne": {
21
+ "resourceTypeHandle": "TYPE-Natural",
22
+ "name": "AddendOne",
23
+ "description": "dummy-description"
24
+ },
25
+ "ROLE-AddendTwo": {
26
+ "resourceTypeHandle": "TYPE-Natural",
27
+ "name": "AddendTwo",
28
+ "description": "dummy-description"
29
+ }
30
+ },
31
+ "outputDict": {
32
+ "ROLE-Sum": {
33
+ "resourceTypeHandle": "TYPE-Natural",
34
+ "name": "Sum",
35
+ "description": "dummy-description"
36
+ },
37
+ "ROLE-ErrorOutput": {
38
+ "resourceTypeHandle": "TYPE-Error",
39
+ "name": "ErrorOutput",
40
+ "description": "Represents error outputs from job runs."
41
+ }
42
+ }
43
+ }
44
+ }
45
+ },
46
+ {
47
+ "identity": "RESOURCE-Subtract",
48
+ "resourceTypeHandle": "TYPE-Job",
49
+ "creationContext": {
50
+ "resourceRoleHandle": "ROLE-Manual",
51
+ "jobStepHandle": "JOB_STEP-Genesis"
52
+ },
53
+ "resourceShellKind": "materialized",
54
+ "version": 1,
55
+ "path": "internals://job/subtract",
56
+ "timestamp": "2025-11-30T00:00:00.000Z",
57
+ "nucleus": {
58
+ "identity": "JOB-Subtract",
59
+ "name": "Subtract",
60
+ "description": "dummy-description",
61
+ "implementationUri": "http://34.39.42.71/subtract",
62
+ "roles": {
63
+ "inputDict": {
64
+ "ROLE-Minuend": {
65
+ "resourceTypeHandle": "TYPE-Natural",
66
+ "name": "Minuend",
67
+ "description": "dummy-description"
68
+ },
69
+ "ROLE-Subtrahend": {
70
+ "resourceTypeHandle": "TYPE-Natural",
71
+ "name": "Subtrahend",
72
+ "description": "dummy-description"
73
+ }
74
+ },
75
+ "outputDict": {
76
+ "ROLE-Difference": {
77
+ "resourceTypeHandle": "TYPE-Natural",
78
+ "name": "Difference",
79
+ "description": "dummy-description"
80
+ },
81
+ "ROLE-ErrorOutput": {
82
+ "resourceTypeHandle": "TYPE-Error",
83
+ "name": "ErrorOutput",
84
+ "description": "Represents error outputs from job runs."
85
+ }
86
+ }
87
+ }
88
+ }
89
+ },
90
+ {
91
+ "identity": "RESOURCE-Multiply",
92
+ "resourceTypeHandle": "TYPE-Job",
93
+ "creationContext": {
94
+ "resourceRoleHandle": "ROLE-Manual",
95
+ "jobStepHandle": "JOB_STEP-Genesis"
96
+ },
97
+ "resourceShellKind": "materialized",
98
+ "version": 1,
99
+ "path": "internals://job/multiply",
100
+ "timestamp": "2025-11-30T00:00:00.000Z",
101
+ "nucleus": {
102
+ "identity": "JOB-Multiply",
103
+ "name": "Multiply",
104
+ "description": "dummy-description",
105
+ "implementationUri": "http://34.39.42.71/multiply",
106
+ "roles": {
107
+ "inputDict": {
108
+ "ROLE-Multiplicand": {
109
+ "resourceTypeHandle": "TYPE-Natural",
110
+ "name": "Multiplicand",
111
+ "description": "dummy-description"
112
+ },
113
+ "ROLE-Multiplier": {
114
+ "resourceTypeHandle": "TYPE-Natural",
115
+ "name": "Multiplier",
116
+ "description": "dummy-description"
117
+ }
118
+ },
119
+ "outputDict": {
120
+ "ROLE-Product": {
121
+ "resourceTypeHandle": "TYPE-Natural",
122
+ "name": "Product",
123
+ "description": "dummy-description"
124
+ },
125
+ "ROLE-ErrorOutput": {
126
+ "resourceTypeHandle": "TYPE-Error",
127
+ "name": "ErrorOutput",
128
+ "description": "Represents error outputs from job runs."
129
+ }
130
+ }
131
+ }
132
+ }
133
+ },
134
+ {
135
+ "identity": "RESOURCE-Divide",
136
+ "resourceTypeHandle": "TYPE-Job",
137
+ "creationContext": {
138
+ "resourceRoleHandle": "ROLE-Manual",
139
+ "jobStepHandle": "JOB_STEP-Genesis"
140
+ },
141
+ "resourceShellKind": "materialized",
142
+ "version": 1,
143
+ "path": "internals://job/divide",
144
+ "timestamp": "2025-11-30T00:00:00.000Z",
145
+ "nucleus": {
146
+ "identity": "JOB-Divide",
147
+ "name": "Divide",
148
+ "description": "dummy-description",
149
+ "implementationUri": "http://34.39.42.71/divide",
150
+ "roles": {
151
+ "inputDict": {
152
+ "ROLE-Dividend": {
153
+ "resourceTypeHandle": "TYPE-Natural",
154
+ "name": "Dividend",
155
+ "description": "dummy-description"
156
+ },
157
+ "ROLE-Divisor": {
158
+ "resourceTypeHandle": "TYPE-Natural",
159
+ "name": "Divisor",
160
+ "description": "dummy-description"
161
+ }
162
+ },
163
+ "outputDict": {
164
+ "ROLE-Quotient": {
165
+ "resourceTypeHandle": "TYPE-Natural",
166
+ "name": "Quotient",
167
+ "description": "dummy-description"
168
+ },
169
+ "ROLE-Remainder": {
170
+ "resourceTypeHandle": "TYPE-Natural",
171
+ "name": "Remainder",
172
+ "description": "dummy-description"
173
+ },
174
+ "ROLE-ErrorOutput": {
175
+ "resourceTypeHandle": "TYPE-Error",
176
+ "name": "ErrorOutput",
177
+ "description": "Represents error outputs from job runs."
178
+ }
179
+ }
180
+ }
181
+ }
182
+ },
183
+ {
184
+ "identity": "RESOURCE-Double",
185
+ "resourceTypeHandle": "TYPE-Job",
186
+ "creationContext": {
187
+ "resourceRoleHandle": "ROLE-Manual",
188
+ "jobStepHandle": "JOB_STEP-Genesis"
189
+ },
190
+ "resourceShellKind": "materialized",
191
+ "version": 1,
192
+ "path": "internals://job/double",
193
+ "timestamp": "2025-11-30T00:00:00.000Z",
194
+ "nucleus": {
195
+ "identity": "JOB-Double",
196
+ "name": "Double",
197
+ "description": "dummy-description",
198
+ "implementationUri": "http://34.39.42.71/double",
199
+ "roles": {
200
+ "inputDict": {
201
+ "ROLE-N": {
202
+ "resourceTypeHandle": "TYPE-Natural",
203
+ "name": "N",
204
+ "description": "dummy-description"
205
+ }
206
+ },
207
+ "outputDict": {
208
+ "ROLE-Doubled": {
209
+ "resourceTypeHandle": "TYPE-Natural",
210
+ "name": "Doubled",
211
+ "description": "dummy-description"
212
+ },
213
+ "ROLE-ErrorOutput": {
214
+ "resourceTypeHandle": "TYPE-Error",
215
+ "name": "ErrorOutput",
216
+ "description": "Represents error outputs from job runs."
217
+ }
218
+ }
219
+ }
220
+ }
221
+ },
222
+ {
223
+ "identity": "RESOURCE-LessThan",
224
+ "resourceTypeHandle": "TYPE-Job",
225
+ "creationContext": {
226
+ "resourceRoleHandle": "ROLE-Manual",
227
+ "jobStepHandle": "JOB_STEP-Genesis"
228
+ },
229
+ "resourceShellKind": "materialized",
230
+ "version": 1,
231
+ "path": "internals://job/less-than",
232
+ "timestamp": "2025-11-30T00:00:00.000Z",
233
+ "nucleus": {
234
+ "identity": "JOB-LessThan",
235
+ "name": "LessThan",
236
+ "description": "dummy-description",
237
+ "implementationUri": "http://toolproof/internals/less-than",
238
+ "roles": {
239
+ "inputDict": {
240
+ "ROLE-LessThanSource": {
241
+ "resourceTypeHandle": "TYPE-Natural",
242
+ "name": "LessThanSource",
243
+ "description": "dummy-description"
244
+ },
245
+ "ROLE-LessThanTarget": {
246
+ "resourceTypeHandle": "TYPE-Natural",
247
+ "name": "LessThanTarget",
248
+ "description": "dummy-description"
249
+ }
250
+ },
251
+ "outputDict": {
252
+ "ROLE-LessThanDecision": {
253
+ "resourceTypeHandle": "TYPE-Boolean",
254
+ "name": "LessThanDecision",
255
+ "description": "dummy-description"
256
+ },
257
+ "ROLE-ErrorOutput": {
258
+ "resourceTypeHandle": "TYPE-Error",
259
+ "name": "ErrorOutput",
260
+ "description": "Represents error outputs from job runs."
261
+ }
262
+ }
263
+ }
264
+ }
265
+ }
266
+ ]
@@ -0,0 +1,167 @@
1
+ [
2
+ {
3
+ "identity": "RESOURCE-0",
4
+ "resourceTypeHandle": "TYPE-Natural",
5
+ "creationContext": {
6
+ "resourceRoleHandle": "ROLE-Manual",
7
+ "jobStepHandle": "JOB_STEP-Genesis"
8
+ },
9
+ "resourceShellKind": "materialized",
10
+ "version": 1,
11
+ "path": "internals://natural/0",
12
+ "timestamp": "2025-11-30T00:00:00.000Z",
13
+ "nucleus": {
14
+ "identity": 0
15
+ }
16
+ },
17
+ {
18
+ "identity": "RESOURCE-1",
19
+ "resourceTypeHandle": "TYPE-Natural",
20
+ "creationContext": {
21
+ "resourceRoleHandle": "ROLE-Manual",
22
+ "jobStepHandle": "JOB_STEP-Genesis"
23
+ },
24
+ "resourceShellKind": "materialized",
25
+ "version": 1,
26
+ "path": "internals://natural/1",
27
+ "timestamp": "2025-11-30T00:00:00.000Z",
28
+ "nucleus": {
29
+ "identity": 1
30
+ }
31
+ },
32
+ {
33
+ "identity": "RESOURCE-2",
34
+ "resourceTypeHandle": "TYPE-Natural",
35
+ "creationContext": {
36
+ "resourceRoleHandle": "ROLE-Manual",
37
+ "jobStepHandle": "JOB_STEP-Genesis"
38
+ },
39
+ "resourceShellKind": "materialized",
40
+ "version": 1,
41
+ "path": "internals://natural/2",
42
+ "timestamp": "2025-11-30T00:00:00.000Z",
43
+ "nucleus": {
44
+ "identity": 2
45
+ }
46
+ },
47
+ {
48
+ "identity": "RESOURCE-3",
49
+ "resourceTypeHandle": "TYPE-Natural",
50
+ "creationContext": {
51
+ "resourceRoleHandle": "ROLE-Manual",
52
+ "jobStepHandle": "JOB_STEP-Genesis"
53
+ },
54
+ "resourceShellKind": "materialized",
55
+ "version": 1,
56
+ "path": "internals://natural/3",
57
+ "timestamp": "2025-11-30T00:00:00.000Z",
58
+ "nucleus": {
59
+ "identity": 3
60
+ }
61
+ },
62
+ {
63
+ "identity": "RESOURCE-4",
64
+ "resourceTypeHandle": "TYPE-Natural",
65
+ "creationContext": {
66
+ "resourceRoleHandle": "ROLE-Manual",
67
+ "jobStepHandle": "JOB_STEP-Genesis"
68
+ },
69
+ "resourceShellKind": "materialized",
70
+ "version": 1,
71
+ "path": "internals://natural/4",
72
+ "timestamp": "2025-11-30T00:00:00.000Z",
73
+ "nucleus": {
74
+ "identity": 4
75
+ }
76
+ },
77
+ {
78
+ "identity": "RESOURCE-5",
79
+ "resourceTypeHandle": "TYPE-Natural",
80
+ "creationContext": {
81
+ "resourceRoleHandle": "ROLE-Manual",
82
+ "jobStepHandle": "JOB_STEP-Genesis"
83
+ },
84
+ "resourceShellKind": "materialized",
85
+ "version": 1,
86
+ "path": "internals://natural/5",
87
+ "timestamp": "2025-11-30T00:00:00.000Z",
88
+ "nucleus": {
89
+ "identity": 5
90
+ }
91
+ },
92
+ {
93
+ "identity": "RESOURCE-6",
94
+ "resourceTypeHandle": "TYPE-Natural",
95
+ "creationContext": {
96
+ "resourceRoleHandle": "ROLE-Manual",
97
+ "jobStepHandle": "JOB_STEP-Genesis"
98
+ },
99
+ "resourceShellKind": "materialized",
100
+ "version": 1,
101
+ "path": "internals://natural/6",
102
+ "timestamp": "2025-11-30T00:00:00.000Z",
103
+ "nucleus": {
104
+ "identity": 6
105
+ }
106
+ },
107
+ {
108
+ "identity": "RESOURCE-7",
109
+ "resourceTypeHandle": "TYPE-Natural",
110
+ "creationContext": {
111
+ "resourceRoleHandle": "ROLE-Manual",
112
+ "jobStepHandle": "JOB_STEP-Genesis"
113
+ },
114
+ "resourceShellKind": "materialized",
115
+ "version": 1,
116
+ "path": "internals://natural/7",
117
+ "timestamp": "2025-11-30T00:00:00.000Z",
118
+ "nucleus": {
119
+ "identity": 7
120
+ }
121
+ },
122
+ {
123
+ "identity": "RESOURCE-8",
124
+ "resourceTypeHandle": "TYPE-Natural",
125
+ "creationContext": {
126
+ "resourceRoleHandle": "ROLE-Manual",
127
+ "jobStepHandle": "JOB_STEP-Genesis"
128
+ },
129
+ "resourceShellKind": "materialized",
130
+ "version": 1,
131
+ "path": "internals://natural/8",
132
+ "timestamp": "2025-11-30T00:00:00.000Z",
133
+ "nucleus": {
134
+ "identity": 8
135
+ }
136
+ },
137
+ {
138
+ "identity": "RESOURCE-9",
139
+ "resourceTypeHandle": "TYPE-Natural",
140
+ "creationContext": {
141
+ "resourceRoleHandle": "ROLE-Manual",
142
+ "jobStepHandle": "JOB_STEP-Genesis"
143
+ },
144
+ "resourceShellKind": "materialized",
145
+ "version": 1,
146
+ "path": "internals://natural/9",
147
+ "timestamp": "2025-11-30T00:00:00.000Z",
148
+ "nucleus": {
149
+ "identity": 9
150
+ }
151
+ },
152
+ {
153
+ "identity": "RESOURCE-100",
154
+ "resourceTypeHandle": "TYPE-Natural",
155
+ "creationContext": {
156
+ "resourceRoleHandle": "ROLE-Manual",
157
+ "jobStepHandle": "JOB_STEP-Genesis"
158
+ },
159
+ "resourceShellKind": "materialized",
160
+ "version": 1,
161
+ "path": "internals://natural/100",
162
+ "timestamp": "2025-11-30T00:00:00.000Z",
163
+ "nucleus": {
164
+ "identity": 100
165
+ }
166
+ }
167
+ ]
@@ -24,6 +24,7 @@ export class SchemaConfig {
24
24
  private readonly sourceFile: string;
25
25
  private readonly normalizedDir: string;
26
26
  private readonly schemasDir: string;
27
+ private readonly zodSchemasDir: string;
27
28
  private readonly artifactsDir: string;
28
29
  private readonly resourcesDir: string;
29
30
  private readonly typesSrcDir: string;
@@ -40,6 +41,7 @@ export class SchemaConfig {
40
41
  this.sourceFile = getEnv('TP_SCHEMA_SOURCE_FILE', 'Genesis.json');
41
42
  this.normalizedDir = getEnv('TP_SCHEMA_NORMALIZED_DIR', 'src/generated/normalized');
42
43
  this.schemasDir = getEnv('TP_SCHEMA_SCHEMAS_DIR', 'src/generated/schemas');
44
+ this.zodSchemasDir = getEnv('TP_SCHEMA_ZOD_SCHEMAS_DIR', 'src/generated/schemas/zod');
43
45
  this.artifactsDir = getEnv('TP_SCHEMA_ARTIFACTS_DIR', 'src/generated/artifacts');
44
46
  this.resourcesDir = getEnv('TP_SCHEMA_RESOURCES_DIR', 'src/generated/resources');
45
47
  this.typesSrcDir = getEnv('TP_SCHEMA_TYPES_SRC_DIR', 'src/generated/types');
@@ -90,6 +92,16 @@ export class SchemaConfig {
90
92
  : path.join(this.root, this.schemasDir);
91
93
  }
92
94
 
95
+ getZodSchemasDir(): string {
96
+ return path.isAbsolute(this.zodSchemasDir)
97
+ ? this.zodSchemasDir
98
+ : path.join(this.root, this.zodSchemasDir);
99
+ }
100
+
101
+ getZodSchemaPath(filename: string): string {
102
+ return path.join(this.getZodSchemasDir(), filename);
103
+ }
104
+
93
105
  getSchemaPath(filename: string): string {
94
106
  return path.join(this.getSchemasDir(), filename);
95
107
  }