@toolproof-core/schema 1.0.2 → 1.0.4
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.
- package/dist/generated/normalized/Genesis.d.ts +2 -0
- package/dist/generated/normalized/Genesis.js +2 -0
- package/dist/generated/normalized/Genesis.json +2008 -0
- package/dist/generated/resources/Genesis.d.ts +2 -0
- package/dist/generated/resources/Genesis.js +2 -0
- package/dist/generated/resources/Genesis.json +2907 -0
- package/dist/generated/schemas/Genesis.d.ts +2 -0
- package/dist/generated/schemas/Genesis.js +2 -0
- package/dist/generated/schemas/Genesis.json +1466 -0
- package/dist/generated/schemas/standalone/Goal.d.ts +2 -0
- package/dist/generated/schemas/standalone/Goal.js +2 -0
- package/dist/generated/schemas/standalone/Goal.json +86 -0
- package/dist/generated/schemas/standalone/Job.d.ts +2 -0
- package/dist/generated/schemas/standalone/Job.js +2 -0
- package/dist/generated/schemas/standalone/Job.json +236 -0
- package/dist/generated/schemas/standalone/RawStrategy.d.ts +2 -0
- package/dist/generated/schemas/standalone/RawStrategy.js +2 -0
- package/dist/generated/schemas/standalone/RawStrategy.json +650 -0
- package/dist/generated/schemas/standalone/ResourceType.d.ts +2 -0
- package/dist/generated/schemas/standalone/ResourceType.js +2 -0
- package/dist/generated/schemas/standalone/ResourceType.json +140 -0
- package/dist/generated/schemas/standalone/RunnableStrategy.d.ts +2 -0
- package/dist/generated/schemas/standalone/RunnableStrategy.js +2 -0
- package/dist/generated/schemas/standalone/RunnableStrategy.json +720 -0
- package/dist/generated/schemas/standalone/StrategyRun.d.ts +2 -0
- package/dist/generated/schemas/standalone/StrategyRun.js +2 -0
- package/dist/generated/schemas/standalone/StrategyRun.json +1002 -0
- package/dist/generated/{types → typesTS}/standalone/Resource_Genesis.d.ts +1 -1
- package/{src/generated/types → dist/generated/typesTS}/standalone/Resource_Job.d.ts +1 -1
- package/{src/generated/types → dist/generated/typesTS}/standalone/Resource_RawStrategy.d.ts +1 -1
- package/{src/generated/types → dist/generated/typesTS}/standalone/Resource_ResourceType.d.ts +1 -1
- package/dist/generated/{types → typesTS}/standalone/Resource_RunnableStrategy.d.ts +1 -1
- package/dist/generated/typesTS/typesTS.d.ts +745 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +5 -0
- package/dist/scripts/_lib/config.d.ts +10 -10
- package/dist/scripts/_lib/config.js +23 -23
- package/dist/scripts/extractSchemasFromResourceTypeShells.js +109 -103
- package/dist/scripts/generateDependencies.js +15 -14
- package/dist/scripts/generateSchemaShims.js +76 -84
- package/dist/scripts/generateStandaloneSchema.js +47 -37
- package/dist/scripts/generateStandaloneTypeTS.js +108 -0
- package/dist/scripts/generateTypesTS.js +430 -0
- package/dist/scripts/normalizeAnchorsToPointers.js +37 -30
- package/dist/scripts/wrapResourceTypesWithResourceShells.js +14 -16
- package/package.json +11 -12
- package/src/Genesis.json +2007 -1999
- package/src/generated/{dependencyMap.json → dependencies/dependencyMap.json} +7 -6
- package/src/generated/normalized/Genesis.json +17 -9
- package/src/generated/resources/Genesis.json +19 -11
- package/src/generated/schemas/Genesis.json +15 -7
- package/src/generated/schemas/standalone/RawStrategy.json +15 -7
- package/src/generated/schemas/standalone/RunnableStrategy.json +15 -7
- package/src/generated/schemas/standalone/StrategyRun.json +15 -7
- package/src/generated/{types → typesTS}/standalone/Resource_Genesis.d.ts +1 -1
- package/{dist/generated/types → src/generated/typesTS}/standalone/Resource_Job.d.ts +1 -1
- package/{dist/generated/types → src/generated/typesTS}/standalone/Resource_RawStrategy.d.ts +1 -1
- package/{dist/generated/types → src/generated/typesTS}/standalone/Resource_ResourceType.d.ts +1 -1
- package/src/generated/{types → typesTS}/standalone/Resource_RunnableStrategy.d.ts +1 -1
- package/src/generated/typesTS/typesTS.d.ts +745 -0
- package/src/index.ts +67 -1
- package/src/scripts/_lib/config.ts +205 -205
- package/src/scripts/extractSchemasFromResourceTypeShells.ts +261 -218
- package/src/scripts/generateDependencies.ts +121 -120
- package/src/scripts/generateSchemaShims.ts +127 -135
- package/src/scripts/generateStandaloneSchema.ts +185 -175
- package/src/scripts/generateStandaloneTypeTS.ts +127 -0
- package/src/scripts/generateTypesTS.ts +532 -0
- package/src/scripts/normalizeAnchorsToPointers.ts +115 -123
- package/src/scripts/wrapResourceTypesWithResourceShells.ts +82 -84
- package/dist/generated/types/types.d.ts +0 -1723
- package/dist/scripts/generateStandaloneType.js +0 -102
- package/dist/scripts/generateTypes.js +0 -550
- package/src/generated/types/types.d.ts +0 -1723
- package/src/scripts/generateStandaloneType.ts +0 -119
- package/src/scripts/generateTypes.ts +0 -615
- /package/dist/generated/{types → typesTS}/standalone/Resource_Genesis.js +0 -0
- /package/dist/generated/{types → typesTS}/standalone/Resource_Job.js +0 -0
- /package/dist/generated/{types → typesTS}/standalone/Resource_RawStrategy.js +0 -0
- /package/dist/generated/{types → typesTS}/standalone/Resource_ResourceType.js +0 -0
- /package/dist/generated/{types → typesTS}/standalone/Resource_RunnableStrategy.js +0 -0
- /package/dist/generated/{types/types.js → typesTS/typesTS.js} +0 -0
- /package/dist/scripts/{generateStandaloneType.d.ts → generateStandaloneTypeTS.d.ts} +0 -0
- /package/dist/scripts/{generateTypes.d.ts → generateTypesTS.d.ts} +0 -0
- /package/src/generated/{types → typesTS}/standalone/Resource_Genesis.js +0 -0
- /package/src/generated/{types → typesTS}/standalone/Resource_Job.js +0 -0
- /package/src/generated/{types → typesTS}/standalone/Resource_RawStrategy.js +0 -0
- /package/src/generated/{types → typesTS}/standalone/Resource_ResourceType.js +0 -0
- /package/src/generated/{types → typesTS}/standalone/Resource_RunnableStrategy.js +0 -0
- /package/src/generated/{types/types.js → typesTS/typesTS.js} +0 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { compile } from 'json-schema-to-typescript';
|
|
4
|
+
import { getConfig } from './_lib/config.js';
|
|
5
|
+
// PURE: Format a JSON path for error messages.
|
|
6
|
+
function formatPath(pathSegments) {
|
|
7
|
+
let out = '';
|
|
8
|
+
for (const seg of pathSegments) {
|
|
9
|
+
if (typeof seg === 'number') {
|
|
10
|
+
out += `[${seg}]`;
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
out = out ? `${out}.${seg}` : seg;
|
|
14
|
+
}
|
|
15
|
+
return out || '<root>';
|
|
16
|
+
}
|
|
17
|
+
// PURE: Validate schema array-keyword shapes; returns a list of issues (no mutation, no I/O).
|
|
18
|
+
function validateSchemaArrayKeywords(node, parentKey, pathSegments = []) {
|
|
19
|
+
if (Array.isArray(node)) {
|
|
20
|
+
const issues = [];
|
|
21
|
+
for (let i = 0; i < node.length; i++) {
|
|
22
|
+
issues.push(...validateSchemaArrayKeywords(node[i], parentKey, pathSegments.concat([i])));
|
|
23
|
+
}
|
|
24
|
+
return issues;
|
|
25
|
+
}
|
|
26
|
+
if (!node || typeof node !== 'object')
|
|
27
|
+
return [];
|
|
28
|
+
// IMPORTANT:
|
|
29
|
+
// In meta-schemas we often have `properties: { required: { ...schema... } }`.
|
|
30
|
+
// Here, the key "required" is a *property name*, not the JSON-Schema keyword.
|
|
31
|
+
// So when we are iterating a property-name map, do not treat keys as schema keywords.
|
|
32
|
+
const isPropertyNameMap = parentKey === 'properties' ||
|
|
33
|
+
parentKey === 'patternProperties' ||
|
|
34
|
+
parentKey === '$defs' ||
|
|
35
|
+
parentKey === 'dependentSchemas' ||
|
|
36
|
+
parentKey === 'dependentRequired';
|
|
37
|
+
const arrayKeys = ['anyOf', 'allOf', 'oneOf', 'required', 'enum'];
|
|
38
|
+
const issues = [];
|
|
39
|
+
for (const [k, v] of Object.entries(node)) {
|
|
40
|
+
// Keyword sanity checks for schema objects (regardless of where they appear).
|
|
41
|
+
// These reduce the chance of feeding obviously malformed shapes into the generator.
|
|
42
|
+
if (k === 'properties' || k === 'patternProperties' || k === '$defs' || k === 'dependentSchemas') {
|
|
43
|
+
if (v === null || typeof v !== 'object' || Array.isArray(v)) {
|
|
44
|
+
issues.push(`${formatPath(pathSegments.concat([k]))}: expected \`${k}\` to be an object map, got ${v === null ? 'null' : Array.isArray(v) ? 'array' : typeof v}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (k === 'dependentRequired') {
|
|
48
|
+
if (v === null || typeof v !== 'object' || Array.isArray(v)) {
|
|
49
|
+
issues.push(`${formatPath(pathSegments.concat([k]))}: expected \`dependentRequired\` to be an object map, got ${v === null ? 'null' : Array.isArray(v) ? 'array' : typeof v}`);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
for (const [depKey, depVal] of Object.entries(v)) {
|
|
53
|
+
if (!Array.isArray(depVal)) {
|
|
54
|
+
issues.push(`${formatPath(pathSegments.concat([k, depKey]))}: expected dependentRequired entries to be string arrays, got ${depVal === null ? 'null' : typeof depVal}`);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
for (let i = 0; i < depVal.length; i++) {
|
|
58
|
+
if (typeof depVal[i] !== 'string') {
|
|
59
|
+
issues.push(`${formatPath(pathSegments.concat([k, depKey, i]))}: expected dependentRequired entries to be strings, got ${depVal[i] === null ? 'null' : typeof depVal[i]}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (!isPropertyNameMap && arrayKeys.includes(k) && Object.prototype.hasOwnProperty.call(node, k)) {
|
|
66
|
+
if (!Array.isArray(v)) {
|
|
67
|
+
issues.push(`${formatPath(pathSegments.concat([k]))}: expected \`${k}\` to be an array, got ${v === null ? 'null' : typeof v}`);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
if ((k === 'anyOf' || k === 'allOf' || k === 'oneOf') && v.length === 0) {
|
|
71
|
+
issues.push(`${formatPath(pathSegments.concat([k]))}: expected \`${k}\` to be a non-empty array`);
|
|
72
|
+
}
|
|
73
|
+
if (k === 'anyOf' || k === 'allOf' || k === 'oneOf') {
|
|
74
|
+
for (let i = 0; i < v.length; i++) {
|
|
75
|
+
const item = v[i];
|
|
76
|
+
const ok = typeof item === 'boolean' ||
|
|
77
|
+
(item !== null && typeof item === 'object' && !Array.isArray(item));
|
|
78
|
+
if (!ok) {
|
|
79
|
+
issues.push(`${formatPath(pathSegments.concat([k, i]))}: expected a schema (object or boolean), got ${item === null ? 'null' : Array.isArray(item) ? 'array' : typeof item}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (k === 'required') {
|
|
84
|
+
// `required` must be string[] when used as a JSON-Schema keyword.
|
|
85
|
+
const seen = new Set();
|
|
86
|
+
for (let i = 0; i < v.length; i++) {
|
|
87
|
+
if (typeof v[i] !== 'string') {
|
|
88
|
+
issues.push(`${formatPath(pathSegments.concat([k, i]))}: expected \`required\` entries to be strings, got ${v[i] === null ? 'null' : typeof v[i]}`);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (seen.has(v[i])) {
|
|
92
|
+
issues.push(`${formatPath(pathSegments.concat([k]))}: duplicate required entry \`${v[i]}\``);
|
|
93
|
+
}
|
|
94
|
+
seen.add(v[i]);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
issues.push(...validateSchemaArrayKeywords(v, k, pathSegments.concat([k])));
|
|
100
|
+
}
|
|
101
|
+
return issues;
|
|
102
|
+
}
|
|
103
|
+
// PURE: Move sibling object keywords into `allOf` overlays (returns a new tree; does not mutate inputs).
|
|
104
|
+
function normalizeAllOfSiblingObjectKeywords(node) {
|
|
105
|
+
if (Array.isArray(node)) {
|
|
106
|
+
let changed = false;
|
|
107
|
+
const out = node.map((item) => {
|
|
108
|
+
const next = normalizeAllOfSiblingObjectKeywords(item);
|
|
109
|
+
if (next !== item)
|
|
110
|
+
changed = true;
|
|
111
|
+
return next;
|
|
112
|
+
});
|
|
113
|
+
return changed ? out : node;
|
|
114
|
+
}
|
|
115
|
+
if (!node || typeof node !== 'object')
|
|
116
|
+
return node;
|
|
117
|
+
const hasAllOf = Array.isArray(node.allOf) && node.allOf.length > 0;
|
|
118
|
+
const looksLikeObjectSchema = node.type === 'object' ||
|
|
119
|
+
node.properties !== undefined ||
|
|
120
|
+
node.required !== undefined ||
|
|
121
|
+
node.unevaluatedProperties !== undefined ||
|
|
122
|
+
node.additionalProperties !== undefined;
|
|
123
|
+
const siblingKeys = [
|
|
124
|
+
'properties',
|
|
125
|
+
'required',
|
|
126
|
+
'additionalProperties',
|
|
127
|
+
'unevaluatedProperties',
|
|
128
|
+
'propertyNames',
|
|
129
|
+
'patternProperties',
|
|
130
|
+
'dependentRequired',
|
|
131
|
+
'dependentSchemas',
|
|
132
|
+
'minProperties',
|
|
133
|
+
'maxProperties'
|
|
134
|
+
];
|
|
135
|
+
let localNode = node;
|
|
136
|
+
if (hasAllOf && looksLikeObjectSchema) {
|
|
137
|
+
const hasSiblingObjectKeywords = siblingKeys.some((k) => k in localNode);
|
|
138
|
+
if (hasSiblingObjectKeywords) {
|
|
139
|
+
const overlay = {};
|
|
140
|
+
if (localNode.type === 'object')
|
|
141
|
+
overlay.type = 'object';
|
|
142
|
+
const nextNode = { ...localNode };
|
|
143
|
+
for (const k of siblingKeys) {
|
|
144
|
+
if (k in nextNode) {
|
|
145
|
+
overlay[k] = nextNode[k];
|
|
146
|
+
delete nextNode[k];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
nextNode.allOf = [overlay, ...nextNode.allOf];
|
|
150
|
+
localNode = nextNode;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
let changed = localNode !== node;
|
|
154
|
+
const out = localNode === node ? {} : { ...localNode };
|
|
155
|
+
for (const [k, v] of Object.entries(localNode)) {
|
|
156
|
+
const next = normalizeAllOfSiblingObjectKeywords(v);
|
|
157
|
+
if (next !== v) {
|
|
158
|
+
if (!changed) {
|
|
159
|
+
changed = true;
|
|
160
|
+
Object.assign(out, localNode);
|
|
161
|
+
}
|
|
162
|
+
out[k] = next;
|
|
163
|
+
}
|
|
164
|
+
else if (changed) {
|
|
165
|
+
out[k] = v;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return changed ? out : node;
|
|
169
|
+
}
|
|
170
|
+
// PURE: Clone + apply all generator-normalizations.
|
|
171
|
+
function normalizeSchemaForGenerator(schema) {
|
|
172
|
+
return normalizeAllOfSiblingObjectKeywords(schema);
|
|
173
|
+
}
|
|
174
|
+
// PURE: Convert a regex-ish pattern into a TS template literal when recognizable.
|
|
175
|
+
function deriveTemplateFromPattern(pattern) {
|
|
176
|
+
// Common (and currently canonical for identities): ^PREFIX-.+$ => `PREFIX-${string}`
|
|
177
|
+
const m1 = /^\^([^$]+)\.\+\$/.exec(pattern);
|
|
178
|
+
if (m1) {
|
|
179
|
+
const prefix = m1[1];
|
|
180
|
+
if (!/[`]/.test(prefix)) {
|
|
181
|
+
return '`' + prefix + '${string}`';
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
// PURE: Extract Identity template-literal aliases from a parsed schema.
|
|
187
|
+
function loadPatternTemplatesFromSchema(schema) {
|
|
188
|
+
const map = {};
|
|
189
|
+
const defs = schema?.$defs && typeof schema.$defs === 'object' ? schema.$defs : {};
|
|
190
|
+
for (const [defName, defVal] of Object.entries(defs)) {
|
|
191
|
+
const isPatternType = /Identity$/.test(defName);
|
|
192
|
+
if (!isPatternType)
|
|
193
|
+
continue;
|
|
194
|
+
const v = defVal;
|
|
195
|
+
if (v && v.type === 'string' && typeof v.pattern === 'string') {
|
|
196
|
+
const tmpl = deriveTemplateFromPattern(v.pattern);
|
|
197
|
+
if (tmpl)
|
|
198
|
+
map[defName] = tmpl;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return map;
|
|
202
|
+
}
|
|
203
|
+
// PURE: Remove duplicate union members from emitted `export type X = | ...` blocks.
|
|
204
|
+
function removeDuplicateUnionEntries(ts) {
|
|
205
|
+
return ts.replace(/export type ([A-Za-z0-9_]+) =([\s\S]*?);/g, (_m, typeName, body) => {
|
|
206
|
+
const lines = body.split(/\r?\n/);
|
|
207
|
+
const seen = new Set();
|
|
208
|
+
const kept = [];
|
|
209
|
+
for (const line of lines) {
|
|
210
|
+
const trimmed = line.trim();
|
|
211
|
+
const match = /^\|\s*([A-Za-z0-9_]+)\b/.exec(trimmed);
|
|
212
|
+
if (match) {
|
|
213
|
+
const name = match[1];
|
|
214
|
+
if (!seen.has(name)) {
|
|
215
|
+
seen.add(name);
|
|
216
|
+
kept.push(' | ' + name);
|
|
217
|
+
}
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
if (trimmed.length)
|
|
221
|
+
kept.push(line);
|
|
222
|
+
}
|
|
223
|
+
return `export type ${typeName} =\n` + kept.join('\n') + ';';
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
// PURE: Escape a string for use inside a RegExp pattern.
|
|
227
|
+
function escapeRegExpLiteral(value) {
|
|
228
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
229
|
+
}
|
|
230
|
+
// PURE: Fix a known json-schema-to-typescript edge case where a JSON-like recursive value union
|
|
231
|
+
// accidentally includes a direct self-reference (`| JsonData`) instead of the intended array case (`| JsonData[]`).
|
|
232
|
+
function fixJsonDataSelfReference(ts) {
|
|
233
|
+
const lines = ts.split(/\r?\n/);
|
|
234
|
+
const startIndex = lines.findIndex((l) => /^export\s+type\s+JsonData\s*=\s*$/.test(l.trimEnd()));
|
|
235
|
+
if (startIndex < 0)
|
|
236
|
+
return ts;
|
|
237
|
+
// This type currently ends with a union member object whose closing line is `};`.
|
|
238
|
+
// Find that terminator after the type header.
|
|
239
|
+
let endIndex = -1;
|
|
240
|
+
for (let i = startIndex + 1; i < lines.length; i++) {
|
|
241
|
+
if (/^\s*};\s*$/.test(lines[i])) {
|
|
242
|
+
endIndex = i;
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (endIndex < 0)
|
|
247
|
+
return ts;
|
|
248
|
+
for (let i = startIndex + 1; i < endIndex; i++) {
|
|
249
|
+
if (/^\s*\|\s*JsonData\s*$/.test(lines[i])) {
|
|
250
|
+
lines[i] = lines[i].replace(/\bJsonData\b/, 'JsonData[]');
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return lines.join('\n');
|
|
254
|
+
}
|
|
255
|
+
// PURE: Apply deterministic post-processing to the generator output (no I/O).
|
|
256
|
+
function postProcessEmittedTypes(ts, parsedSchema) {
|
|
257
|
+
// Remove permissive index signatures that make interfaces open-ended.
|
|
258
|
+
// Keep meaningful map-like signatures (e.g., `[k: string]: ResourceRoleValue`) intact.
|
|
259
|
+
// Robust single-pass: delete the entire line (with optional trailing newline) where the signature appears.
|
|
260
|
+
// This avoids introducing extra blank lines while handling CRLF/LF and varying indentation.
|
|
261
|
+
ts = ts.replace(/^\s*\[k:\s*string\]:\s*unknown;\s*(?:\r?\n)?/gm, '');
|
|
262
|
+
// Fix meta-schema types where json-schema-to-typescript can still incorrectly interpret
|
|
263
|
+
// schema definitions as literal values (or emit overly-restrictive `{}` objects).
|
|
264
|
+
// We do this as a broad post-pass on the emitted TS because the generator output varies
|
|
265
|
+
// (e.g. `allOf?: { }[];` vs `allOf?: [{type:"array"; ...}]`).
|
|
266
|
+
// `$defs?: { }` or `$defs: { }` -> map type (preserve required/optional marker)
|
|
267
|
+
// NOTE: We emit `Record<...>` instead of an index signature because later cleanup
|
|
268
|
+
// strips standalone `[k: string]: unknown;` lines.
|
|
269
|
+
ts = ts.replace(/^(\s*)(\$defs\??:\s*)\{\s*\r?\n\s*\};/gm, (_m, indent, head) => `${indent}${head}Record<string, unknown>;`);
|
|
270
|
+
// `properties?: { }` or `properties: { }` -> map type
|
|
271
|
+
ts = ts.replace(/^(\s*)(properties\??:\s*)\{\s*\r?\n\s*\};/gm, (_m, indent, head) => `${indent}${head}Record<string, unknown>;`);
|
|
272
|
+
// `allOf?: { }[];` (and similar for anyOf/oneOf) -> array of schema-ish objects
|
|
273
|
+
ts = ts.replace(/^(\s*)((?:allOf|anyOf|oneOf)\??:\s*)\{\s*\r?\n\s*\}\[\];/gm, (_m, indent, head) => `${indent}${head}Array<{[k: string]: unknown}>;`);
|
|
274
|
+
ts = removeDuplicateUnionEntries(ts);
|
|
275
|
+
// Strip URL-derived root schema interface names produced by json-schema-to-typescript
|
|
276
|
+
// (e.g. `HttpsSchemasToolproofComV2GenesisJson`). These are naming artifacts and not
|
|
277
|
+
// meaningful domain types.
|
|
278
|
+
const schemaId = parsedSchema?.$id;
|
|
279
|
+
if (typeof schemaId === 'string') {
|
|
280
|
+
const m = /\/([^/]+)\.json$/i.exec(schemaId);
|
|
281
|
+
const rootBaseName = m?.[1];
|
|
282
|
+
if (rootBaseName) {
|
|
283
|
+
const rootJsonSuffix = `${rootBaseName}Json`;
|
|
284
|
+
const rootJsonSuffixEsc = escapeRegExpLiteral(rootJsonSuffix);
|
|
285
|
+
// Remove the (typically empty) URL-derived root interface, if present.
|
|
286
|
+
ts = ts.replace(new RegExp(`^export interface Https[A-Za-z0-9_]*${rootJsonSuffixEsc}\\s*\\{\\s*\\}\\s*(?:\\r?\\n)?`, 'gm'), '');
|
|
287
|
+
// Replace remaining references to that URL-derived name in doc/comments.
|
|
288
|
+
ts = ts.replace(new RegExp(`\\bHttps[A-Za-z0-9_]*${rootJsonSuffixEsc}\\b`, 'g'), rootBaseName);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (!ts || !ts.trim()) {
|
|
292
|
+
throw new Error('Type generator emitted no output for Genesis schema.');
|
|
293
|
+
}
|
|
294
|
+
// Overlay Identity aliases with template literal types inferred from Genesis.json patterns.
|
|
295
|
+
// For each $defs entry ending with "Identity" that provides a `pattern`,
|
|
296
|
+
// derive a TS template literal; otherwise fall back to plain `string`.
|
|
297
|
+
const patternTemplates = loadPatternTemplatesFromSchema(parsedSchema);
|
|
298
|
+
// Replace any exported Identity aliases to use the inferred template literals where available.
|
|
299
|
+
// Handle the common `= string;` output from json-schema-to-typescript.
|
|
300
|
+
ts = ts.replace(/^(export\s+type\s+)([A-Za-z_][A-Za-z0-9_]*Identity)(\s*=\s*)string\s*;$/gm, (_m, p1, typeName, p3) => {
|
|
301
|
+
const tmpl = patternTemplates[typeName];
|
|
302
|
+
return `${p1}${typeName}${p3}${tmpl ?? 'string'};`;
|
|
303
|
+
});
|
|
304
|
+
// Post-process map-like interfaces to enforce key constraints via template literal Identity types.
|
|
305
|
+
// Replace index-signature interfaces with Record<KeyType, ValueType> so object literal keys are checked.
|
|
306
|
+
const resourceRoleKeyType = 'ResourceRoleIdentity';
|
|
307
|
+
const jobStepKeyType = 'JobStepIdentity';
|
|
308
|
+
const strategyThreadKeyType = 'StrategyThreadIdentity';
|
|
309
|
+
ts = ts.replace(/export interface RoleMap\s*{[^}]*}/g, `export type RoleMap = Record<${resourceRoleKeyType}, ResourceRoleValue>;`);
|
|
310
|
+
// Normalize StrategyState & related socket maps to identity-keyed Records.
|
|
311
|
+
// These are emitted as `[k: string]` by json-schema-to-typescript but are identity-keyed in practice.
|
|
312
|
+
// Per schema: JobStepSocket: Record<ResourceRoleIdentity, Resource>
|
|
313
|
+
// StrategyState: Record<JobStepIdentity, JobStepSocket>
|
|
314
|
+
const jobStepSocketValueType = 'Resource';
|
|
315
|
+
ts = ts.replace(/export interface JobStepSocket\s*\{\s*\[k:\s*string\]:\s*[^;]+;\s*\}/g, `export type JobStepSocket = Record<${resourceRoleKeyType}, ${jobStepSocketValueType}>;`);
|
|
316
|
+
ts = ts.replace(/export interface StrategyState\s*\{\s*\[k:\s*string\]:\s*JobStepSocket;\s*\}/g, `export type StrategyState = Record<${jobStepKeyType}, JobStepSocket>;`);
|
|
317
|
+
ts = ts.replace(/(strategyStateUpdate\??:\s*)\{\s*\[k:\s*string\]:\s*JobStepSocket;\s*\};/g, `$1Record<${jobStepKeyType}, JobStepSocket>;`);
|
|
318
|
+
// Ensure key constraints for strategyThreadMap are preserved as template-literal identity keys.
|
|
319
|
+
// json-schema-to-typescript emits `[k: string]: StepArray;`, but we want keys to be `StrategyThreadIdentity`.
|
|
320
|
+
ts = ts.replace(/export interface StrategyThreadMap\s*\{\s*\[k:\s*string\]:\s*StepArray;\s*\}/g, `export type StrategyThreadMap = Record<${strategyThreadKeyType}, StepArray>;`);
|
|
321
|
+
ts = fixJsonDataSelfReference(ts);
|
|
322
|
+
return ts;
|
|
323
|
+
}
|
|
324
|
+
// PURE: Add banner + formatting/guards to build the final .d.ts content.
|
|
325
|
+
function finalizeOutputDts(emittedTypesTs) {
|
|
326
|
+
const banner = '// Auto-generated from JSON schemas. Do not edit.\n';
|
|
327
|
+
let output = banner + '\n' + emittedTypesTs + '\n';
|
|
328
|
+
// Final guard: strip any lingering `[k: string]: unknown;` that might have been
|
|
329
|
+
// reintroduced by later transforms.
|
|
330
|
+
output = output.replace(/^\s*\[k:\s*string\]:\s*unknown;\s*$/gm, '');
|
|
331
|
+
// Cosmetic post-format: remove lone blank lines before closing braces and collapse excessive blank lines
|
|
332
|
+
// - Remove a single blank line before `};` and `}`
|
|
333
|
+
// - Collapse 3+ consecutive newlines into a maximum of 2
|
|
334
|
+
output = output
|
|
335
|
+
.replace(/\r?\n\s*\r?\n(\s*};)/g, '\n$1')
|
|
336
|
+
.replace(/\r?\n\s*\r?\n(\s*})/g, '\n$1')
|
|
337
|
+
.replace(/(\r?\n){3,}/g, '\n\n');
|
|
338
|
+
// As an additional safeguard, make sure the final .d.ts is treated as a module.
|
|
339
|
+
// If no export/interface/module is present, append an empty export.
|
|
340
|
+
if (!/\bexport\b|\bdeclare\s+module\b|\bdeclare\s+namespace\b/.test(output)) {
|
|
341
|
+
output += '\nexport {}\n';
|
|
342
|
+
}
|
|
343
|
+
return output;
|
|
344
|
+
}
|
|
345
|
+
// IMPURE: Main script entrypoint (config + filesystem I/O + console + process exit).
|
|
346
|
+
async function main() {
|
|
347
|
+
try {
|
|
348
|
+
const config = getConfig();
|
|
349
|
+
const inputDir = config.getSchemasDir();
|
|
350
|
+
const srcLibTypesDir = config.getTypesTsSrcDir();
|
|
351
|
+
const srcLibOutputPath = config.getTypesTsSrcPath('typesTS.d.ts');
|
|
352
|
+
fs.mkdirSync(srcLibTypesDir, { recursive: true });
|
|
353
|
+
const schemaFileName = config.getSourceFile();
|
|
354
|
+
const schemaPath = path.join(inputDir, schemaFileName);
|
|
355
|
+
if (!fs.existsSync(schemaPath)) {
|
|
356
|
+
throw new Error(`Root schema not found: ${schemaPath}\n` +
|
|
357
|
+
`Run the schema extraction step first (e.g. pnpm run extractSchemasFromResourceTypeShells).`);
|
|
358
|
+
}
|
|
359
|
+
const rawSchema = fs.readFileSync(schemaPath, 'utf8');
|
|
360
|
+
const parsedSchema = JSON.parse(rawSchema);
|
|
361
|
+
const validationIssues = validateSchemaArrayKeywords(parsedSchema);
|
|
362
|
+
if (validationIssues.length) {
|
|
363
|
+
throw new Error('Genesis schema is not in canonical form for type generation:\n' +
|
|
364
|
+
validationIssues.map((s) => `- ${s}`).join('\n'));
|
|
365
|
+
}
|
|
366
|
+
const normalizedSchema = normalizeSchemaForGenerator(parsedSchema);
|
|
367
|
+
let ts;
|
|
368
|
+
const rootName = path.basename(schemaFileName, path.extname(schemaFileName));
|
|
369
|
+
ts = await compile(normalizedSchema, rootName, {
|
|
370
|
+
bannerComment: '',
|
|
371
|
+
declareExternallyReferenced: true,
|
|
372
|
+
unreachableDefinitions: true,
|
|
373
|
+
$refOptions: {
|
|
374
|
+
resolve: {
|
|
375
|
+
file: { order: 2 },
|
|
376
|
+
http: false,
|
|
377
|
+
https: false
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
ts = postProcessEmittedTypes(ts, parsedSchema);
|
|
382
|
+
const output = finalizeOutputDts(ts);
|
|
383
|
+
// Write only under configured types output folder
|
|
384
|
+
try {
|
|
385
|
+
fs.writeFileSync(srcLibOutputPath, output, 'utf8');
|
|
386
|
+
console.log('Wrote', srcLibOutputPath);
|
|
387
|
+
}
|
|
388
|
+
catch (e) {
|
|
389
|
+
console.warn('Failed to write types to src/_lib:', e);
|
|
390
|
+
}
|
|
391
|
+
// Also write a copy into dist so consumers get the generated declarations
|
|
392
|
+
const distLibTypesDir = config.getTypesTsDistDir();
|
|
393
|
+
const distLibOutputPath = config.getTypesTsDistPath('typesTS.d.ts');
|
|
394
|
+
try {
|
|
395
|
+
fs.mkdirSync(distLibTypesDir, { recursive: true });
|
|
396
|
+
fs.writeFileSync(distLibOutputPath, output, 'utf8');
|
|
397
|
+
console.log('Wrote', distLibOutputPath);
|
|
398
|
+
}
|
|
399
|
+
catch (e) {
|
|
400
|
+
// If copying to dist fails, log but don't crash the generator.
|
|
401
|
+
console.warn('Failed to write types to dist:', e);
|
|
402
|
+
}
|
|
403
|
+
// Ensure there is a runtime-resolvable module next to `typesTS.d.ts`
|
|
404
|
+
// Some consumers and TS NodeNext resolution expect a concrete .js next to .d.ts
|
|
405
|
+
// The file is intentionally empty as all exports are types-only.
|
|
406
|
+
try {
|
|
407
|
+
const srcLibTypesJsPath = config.getTypesTsSrcPath('typesTS.js');
|
|
408
|
+
if (!fs.existsSync(srcLibTypesJsPath)) {
|
|
409
|
+
fs.writeFileSync(srcLibTypesJsPath, 'export {}\n', 'utf8');
|
|
410
|
+
console.log('Wrote', srcLibTypesJsPath);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
catch (e) {
|
|
414
|
+
console.warn('Failed to write typesTS.js to src/_lib:', e);
|
|
415
|
+
}
|
|
416
|
+
try {
|
|
417
|
+
const distLibTypesJsPath = config.getTypesTsDistPath('typesTS.js');
|
|
418
|
+
fs.writeFileSync(distLibTypesJsPath, 'export {}\n', 'utf8');
|
|
419
|
+
console.log('Wrote', distLibTypesJsPath);
|
|
420
|
+
}
|
|
421
|
+
catch (e) {
|
|
422
|
+
console.warn('Failed to write typesTS.js to dist/_lib:', e);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
catch (err) {
|
|
426
|
+
console.error(err);
|
|
427
|
+
process.exitCode = 1;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
void main();
|
|
@@ -2,14 +2,19 @@ import fs from 'fs';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { getConfig } from './_lib/config.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* Converts #AnchorName to #/$defs/AnchorName for compatibility with strict JSON Schema validators.
|
|
5
|
+
* Rewrite anchor-style references to JSON Pointer references in Genesis.json
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Converts #AnchorName to #/$defs/AnchorName for compatibility with strict
|
|
8
|
+
* JSON Schema validators and downstream tooling. This normalization step runs
|
|
9
|
+
* before both schema extraction and resource envelope generation.
|
|
10
|
+
*
|
|
11
|
+
* The rewritten file is saved under src/genesis/generated/resourceTypes/Genesis.json
|
|
12
|
+
* for use by other scripts.
|
|
13
|
+
*
|
|
14
|
+
* Usage: node ./dist/scripts/normalizeAnchorsToPointers.js
|
|
11
15
|
*/
|
|
12
|
-
|
|
16
|
+
// PURE: Rewrite anchor-style `$ref` strings (`#Anchor`) into JSON Pointer refs (`#/$defs/DefName`).
|
|
17
|
+
function normalizeAnchorsToPointers(input) {
|
|
13
18
|
if (!input || typeof input !== "object")
|
|
14
19
|
return input;
|
|
15
20
|
// Deep clone the input to ensure the function is pure (no side effects on input)
|
|
@@ -67,30 +72,32 @@ function normalizeAnchorsToPointersToPointers(input) {
|
|
|
67
72
|
walk(root);
|
|
68
73
|
return root;
|
|
69
74
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
// IMPURE: Script entrypoint (config + filesystem I/O + console + process exit code).
|
|
76
|
+
function main() {
|
|
77
|
+
try {
|
|
78
|
+
const config = getConfig();
|
|
79
|
+
const genesisSourcePath = config.getSourcePath();
|
|
80
|
+
// Create a generated/normalized version (anchor refs rewritten to pointers)
|
|
81
|
+
const normalizedPath = config.getNormalizedSourcePath();
|
|
82
|
+
if (!fs.existsSync(genesisSourcePath)) {
|
|
83
|
+
throw new Error(`Genesis source file not found at ${genesisSourcePath}`);
|
|
84
|
+
}
|
|
85
|
+
const raw = fs.readFileSync(genesisSourcePath, 'utf-8');
|
|
86
|
+
const genesis = JSON.parse(raw);
|
|
87
|
+
// Validate structure
|
|
88
|
+
if (!genesis.nucleusSchema || !genesis.nucleusSchema.$defs) {
|
|
89
|
+
throw new Error('Genesis.json must have nucleusSchema.$defs');
|
|
90
|
+
}
|
|
91
|
+
// Rewrite anchors in the nucleusSchema (pure function call)
|
|
92
|
+
genesis.nucleusSchema = normalizeAnchorsToPointers(genesis.nucleusSchema);
|
|
93
|
+
// Write normalized version
|
|
94
|
+
fs.mkdirSync(path.dirname(normalizedPath), { recursive: true });
|
|
95
|
+
fs.writeFileSync(normalizedPath, JSON.stringify(genesis, null, 4), 'utf-8');
|
|
96
|
+
console.log(`Wrote normalized Genesis with pointer refs to ${normalizedPath}`);
|
|
78
97
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (!genesis.nucleusSchema || !genesis.nucleusSchema.$defs) {
|
|
83
|
-
console.error('Genesis.json must have nucleusSchema.$defs');
|
|
84
|
-
process.exit(1);
|
|
98
|
+
catch (e) {
|
|
99
|
+
console.error(e);
|
|
100
|
+
process.exitCode = 1;
|
|
85
101
|
}
|
|
86
|
-
// Rewrite anchors in the nucleusSchema (pure function call)
|
|
87
|
-
genesis.nucleusSchema = normalizeAnchorsToPointersToPointers(genesis.nucleusSchema);
|
|
88
|
-
// Write normalized version
|
|
89
|
-
fs.mkdirSync(path.dirname(normalizedPath), { recursive: true });
|
|
90
|
-
fs.writeFileSync(normalizedPath, JSON.stringify(genesis, null, 4), 'utf-8');
|
|
91
|
-
console.log(`Wrote normalized Genesis with pointer refs to ${normalizedPath}`);
|
|
92
102
|
}
|
|
93
|
-
main()
|
|
94
|
-
console.error(e);
|
|
95
|
-
process.exit(1);
|
|
96
|
-
});
|
|
103
|
+
main();
|
|
@@ -5,6 +5,7 @@ import { getConfig } from './_lib/config.js';
|
|
|
5
5
|
* Wrap each ResourceType definition (from Genesis.nucleusSchema.$defs) with a Resource shell
|
|
6
6
|
* that conforms to the Resource.nucleusSchema pattern defined in Genesis.json.
|
|
7
7
|
*/
|
|
8
|
+
// PURE: Build Resource shell envelopes for each $defs entry (no I/O, no mutation of inputs).
|
|
8
9
|
function generateResourceShellLogic(genesis) {
|
|
9
10
|
if (!genesis.nucleusSchema || !genesis.nucleusSchema.$defs) {
|
|
10
11
|
throw new Error('Genesis.json must have nucleusSchema.$defs');
|
|
@@ -41,17 +42,17 @@ function generateResourceShellLogic(genesis) {
|
|
|
41
42
|
});
|
|
42
43
|
return resources;
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const genesisSourcePath = config.getNormalizedSourcePath();
|
|
47
|
-
const outputPath = path.join(config.getResourcesDir(), 'Genesis.json');
|
|
48
|
-
if (!fs.existsSync(genesisSourcePath)) {
|
|
49
|
-
console.error(`Genesis source file not found at ${genesisSourcePath}`);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
const raw = fs.readFileSync(genesisSourcePath, 'utf-8');
|
|
53
|
-
const genesis = JSON.parse(raw);
|
|
45
|
+
// IMPURE: Script entrypoint (config + filesystem I/O + console + process exit code).
|
|
46
|
+
function main() {
|
|
54
47
|
try {
|
|
48
|
+
const config = getConfig();
|
|
49
|
+
const genesisSourcePath = config.getNormalizedSourcePath();
|
|
50
|
+
const outputPath = path.join(config.getResourcesDir(), 'Genesis.json');
|
|
51
|
+
if (!fs.existsSync(genesisSourcePath)) {
|
|
52
|
+
throw new Error(`Genesis source file not found at ${genesisSourcePath}`);
|
|
53
|
+
}
|
|
54
|
+
const raw = fs.readFileSync(genesisSourcePath, 'utf-8');
|
|
55
|
+
const genesis = JSON.parse(raw);
|
|
55
56
|
const resources = generateResourceShellLogic(genesis);
|
|
56
57
|
const outputDir = path.dirname(outputPath);
|
|
57
58
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
@@ -59,11 +60,8 @@ async function main() {
|
|
|
59
60
|
console.log(`Generated ${Object.keys(resources).length} Resource envelopes -> ${outputPath}`);
|
|
60
61
|
}
|
|
61
62
|
catch (error) {
|
|
62
|
-
console.error(error
|
|
63
|
-
process.
|
|
63
|
+
console.error(error?.message ?? error);
|
|
64
|
+
process.exitCode = 1;
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
main()
|
|
67
|
-
console.error(e);
|
|
68
|
-
process.exit(1);
|
|
69
|
-
});
|
|
67
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolproof-core/schema",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "JSON schemas and TypeScript types for ToolProof",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,10 +18,15 @@
|
|
|
18
18
|
"keywords": [],
|
|
19
19
|
"author": "",
|
|
20
20
|
"license": "ISC",
|
|
21
|
-
"packageManager": "pnpm@10.15.0",
|
|
22
21
|
"publishConfig": {
|
|
23
22
|
"access": "public"
|
|
24
23
|
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^20.8.1",
|
|
26
|
+
"json-schema-to-typescript": "^15.0.4",
|
|
27
|
+
"rimraf": "^5.0.0",
|
|
28
|
+
"typescript": "^5.9.3"
|
|
29
|
+
},
|
|
25
30
|
"scripts": {
|
|
26
31
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
27
32
|
"build": "tsc -b",
|
|
@@ -29,18 +34,12 @@
|
|
|
29
34
|
"normalizeAnchorsToPointers": "node ./dist/scripts/normalizeAnchorsToPointers.js",
|
|
30
35
|
"extractSchemasFromResourceTypeShells": "node ./dist/scripts/extractSchemasFromResourceTypeShells.js",
|
|
31
36
|
"generateStandaloneSchema": "node ./dist/scripts/generateStandaloneSchema.js",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
37
|
+
"generateTypesTS": "node ./dist/scripts/generateTypesTS.js",
|
|
38
|
+
"generateStandaloneTypeTS": "node ./dist/scripts/generateStandaloneTypeTS.js",
|
|
34
39
|
"wrapResourceTypesWithResourceShells": "node ./dist/scripts/wrapResourceTypesWithResourceShells.js",
|
|
35
40
|
"generateSchemaShims": "node ./dist/scripts/generateSchemaShims.js",
|
|
36
41
|
"generateDependencies": "node ./dist/scripts/generateDependencies.js",
|
|
37
|
-
"generateResourceTypeGenesisType": "node ./dist/scripts/
|
|
38
|
-
"update": "rimraf /s /q dist && pnpm run build:scripts && pnpm run normalizeAnchorsToPointers && pnpm run extractSchemasFromResourceTypeShells && pnpm run generateStandaloneSchema -- --name Job && pnpm run generateStandaloneSchema -- --name ResourceType && pnpm run generateStandaloneSchema -- --name RawStrategy && pnpm run generateStandaloneSchema -- --name RunnableStrategy && pnpm run generateStandaloneSchema -- --name StrategyRun && pnpm run generateStandaloneSchema -- --name Goal && pnpm run wrapResourceTypesWithResourceShells && pnpm run generateSchemaShims && pnpm run
|
|
39
|
-
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@types/node": "^20.8.1",
|
|
42
|
-
"json-schema-to-typescript": "^15.0.4",
|
|
43
|
-
"rimraf": "^5.0.0",
|
|
44
|
-
"typescript": "^5.9.3"
|
|
42
|
+
"generateResourceTypeGenesisType": "node ./dist/scripts/generateStandaloneTypeTS.js --name Genesis",
|
|
43
|
+
"update": "rimraf /s /q dist && pnpm run build:scripts && pnpm run normalizeAnchorsToPointers && pnpm run extractSchemasFromResourceTypeShells && pnpm run generateStandaloneSchema -- --name Job && pnpm run generateStandaloneSchema -- --name ResourceType && pnpm run generateStandaloneSchema -- --name RawStrategy && pnpm run generateStandaloneSchema -- --name RunnableStrategy && pnpm run generateStandaloneSchema -- --name StrategyRun && pnpm run generateStandaloneSchema -- --name Goal && pnpm run wrapResourceTypesWithResourceShells && pnpm run generateSchemaShims && pnpm run generateTypesTS && pnpm run generateStandaloneTypeTS -- --name Job && pnpm run generateStandaloneTypeTS -- --name ResourceType && pnpm run generateStandaloneTypeTS -- --name RawStrategy && pnpm run generateStandaloneTypeTS -- --name RunnableStrategy && pnpm run generateResourceTypeGenesisType && pnpm run generateDependencies && pnpm run build"
|
|
45
44
|
}
|
|
46
45
|
}
|