@telorun/analyzer 0.8.0 → 0.8.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.
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +21 -19
- package/package.json +2 -2
- package/src/analyzer.ts +29 -27
package/dist/analyzer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAa9B,OAAO,EAAsB,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAa9B,OAAO,EAAsB,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAgX/F,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,OAAO,GAAE,qBAA0B;IAI/C,OAAO,CACL,SAAS,EAAE,gBAAgB,EAAE,EAC7B,OAAO,CAAC,EAAE,eAAe,EACzB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,kBAAkB,EAAE;IAmUvB,aAAa,CACX,SAAS,EAAE,gBAAgB,EAAE,EAC7B,OAAO,CAAC,EAAE,eAAe,EACzB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,kBAAkB,EAAE;IAMvB,SAAS,CAAC,SAAS,EAAE,gBAAgB,EAAE,EAAE,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,EAAE;IAKxF,OAAO,CACL,SAAS,EAAE,gBAAgB,EAAE,EAC7B,QAAQ,EAAE,gBAAgB,GACzB;QAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;CAiB5F"}
|
package/dist/analyzer.js
CHANGED
|
@@ -178,28 +178,30 @@ function buildStepContextSchema(manifest, defSchema, allManifests, defs, aliases
|
|
|
178
178
|
continue;
|
|
179
179
|
const s = step;
|
|
180
180
|
const name = s.name;
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
const invoke = s[invokeField];
|
|
182
|
+
// Only invoke steps register a `steps.<name>.result` entry — control-flow
|
|
183
|
+
// wrappers (try/if/while/switch/throw) don't produce a result and must
|
|
184
|
+
// not shadow real entries with a permissive `additionalProperties: true`,
|
|
185
|
+
// or unknown step references slip through chain validation.
|
|
186
|
+
if (typeof name === "string" && invoke && typeof invoke === "object") {
|
|
183
187
|
let outputSchema;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
outputSchema = resolveTypeFieldToSchema(invokedManifest[outputTypeField], allManifests);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
outputSchema = resolveTypeFieldToSchema(invoke[outputTypeField], allManifests);
|
|
196
|
-
}
|
|
197
|
-
// Fallback: pull outputType from the kind's Telo.Definition. The
|
|
198
|
-
// resource manifest typically doesn't carry outputType; the def does.
|
|
199
|
-
if (!outputSchema && invokedKind) {
|
|
200
|
-
outputSchema = lookupDefinitionTypeField(invokedKind, outputTypeField, defs, aliases, allManifests);
|
|
188
|
+
const invokedKind = invoke.kind;
|
|
189
|
+
const invokedName = invoke.name;
|
|
190
|
+
if (invokedName) {
|
|
191
|
+
const invokedManifest = allManifests.find((m) => m.metadata?.name === invokedName &&
|
|
192
|
+
(!invokedKind || m.kind === invokedKind));
|
|
193
|
+
if (invokedManifest) {
|
|
194
|
+
outputSchema = resolveTypeFieldToSchema(invokedManifest[outputTypeField], allManifests);
|
|
201
195
|
}
|
|
202
196
|
}
|
|
197
|
+
else {
|
|
198
|
+
outputSchema = resolveTypeFieldToSchema(invoke[outputTypeField], allManifests);
|
|
199
|
+
}
|
|
200
|
+
// Fallback: pull outputType from the kind's Telo.Definition. The
|
|
201
|
+
// resource manifest typically doesn't carry outputType; the def does.
|
|
202
|
+
if (!outputSchema && invokedKind) {
|
|
203
|
+
outputSchema = lookupDefinitionTypeField(invokedKind, outputTypeField, defs, aliases, allManifests);
|
|
204
|
+
}
|
|
203
205
|
stepProperties[name] = {
|
|
204
206
|
type: "object",
|
|
205
207
|
properties: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telorun/analyzer",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Telo Analyzer - Static manifest validator for Telo manifests.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"telo",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"jsonpath-plus": "^10.3.0",
|
|
43
43
|
"yaml": "^2.8.3",
|
|
44
44
|
"@telorun/sdk": "0.7.0",
|
|
45
|
-
"@telorun/templating": "0.2.
|
|
45
|
+
"@telorun/templating": "0.2.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^20.0.0",
|
package/src/analyzer.ts
CHANGED
|
@@ -232,35 +232,37 @@ function buildStepContextSchema(
|
|
|
232
232
|
if (!step || typeof step !== "object") continue;
|
|
233
233
|
const s = step as Record<string, any>;
|
|
234
234
|
const name = s.name;
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
const invoke = s[invokeField] as Record<string, any> | undefined;
|
|
236
|
+
// Only invoke steps register a `steps.<name>.result` entry — control-flow
|
|
237
|
+
// wrappers (try/if/while/switch/throw) don't produce a result and must
|
|
238
|
+
// not shadow real entries with a permissive `additionalProperties: true`,
|
|
239
|
+
// or unknown step references slip through chain validation.
|
|
240
|
+
if (typeof name === "string" && invoke && typeof invoke === "object") {
|
|
237
241
|
let outputSchema: Record<string, any> | undefined;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
(m)
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
outputSchema = resolveTypeFieldToSchema(invokedManifest[outputTypeField], allManifests);
|
|
249
|
-
}
|
|
250
|
-
} else {
|
|
251
|
-
outputSchema = resolveTypeFieldToSchema(invoke[outputTypeField], allManifests);
|
|
252
|
-
}
|
|
253
|
-
// Fallback: pull outputType from the kind's Telo.Definition. The
|
|
254
|
-
// resource manifest typically doesn't carry outputType; the def does.
|
|
255
|
-
if (!outputSchema && invokedKind) {
|
|
256
|
-
outputSchema = lookupDefinitionTypeField(
|
|
257
|
-
invokedKind,
|
|
258
|
-
outputTypeField,
|
|
259
|
-
defs,
|
|
260
|
-
aliases,
|
|
261
|
-
allManifests,
|
|
262
|
-
);
|
|
242
|
+
const invokedKind = invoke.kind as string | undefined;
|
|
243
|
+
const invokedName = invoke.name as string | undefined;
|
|
244
|
+
if (invokedName) {
|
|
245
|
+
const invokedManifest = allManifests.find(
|
|
246
|
+
(m) =>
|
|
247
|
+
(m.metadata as any)?.name === invokedName &&
|
|
248
|
+
(!invokedKind || m.kind === invokedKind),
|
|
249
|
+
) as Record<string, any> | undefined;
|
|
250
|
+
if (invokedManifest) {
|
|
251
|
+
outputSchema = resolveTypeFieldToSchema(invokedManifest[outputTypeField], allManifests);
|
|
263
252
|
}
|
|
253
|
+
} else {
|
|
254
|
+
outputSchema = resolveTypeFieldToSchema(invoke[outputTypeField], allManifests);
|
|
255
|
+
}
|
|
256
|
+
// Fallback: pull outputType from the kind's Telo.Definition. The
|
|
257
|
+
// resource manifest typically doesn't carry outputType; the def does.
|
|
258
|
+
if (!outputSchema && invokedKind) {
|
|
259
|
+
outputSchema = lookupDefinitionTypeField(
|
|
260
|
+
invokedKind,
|
|
261
|
+
outputTypeField,
|
|
262
|
+
defs,
|
|
263
|
+
aliases,
|
|
264
|
+
allManifests,
|
|
265
|
+
);
|
|
264
266
|
}
|
|
265
267
|
stepProperties[name] = {
|
|
266
268
|
type: "object",
|