@orbytautomation/engine 0.2.4 → 0.3.0
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/README.md +1 -1
- package/dist/errors/ErrorCodes.d.ts +205 -6
- package/dist/errors/ErrorCodes.d.ts.map +1 -1
- package/dist/errors/ErrorCodes.js +398 -5
- package/dist/errors/ErrorCodes.js.map +1 -1
- package/dist/errors/ErrorDebugger.d.ts +98 -0
- package/dist/errors/ErrorDebugger.d.ts.map +1 -0
- package/dist/errors/ErrorDebugger.js +283 -0
- package/dist/errors/ErrorDebugger.js.map +1 -0
- package/dist/errors/ErrorDetector.d.ts +148 -0
- package/dist/errors/ErrorDetector.d.ts.map +1 -0
- package/dist/errors/ErrorDetector.js +358 -0
- package/dist/errors/ErrorDetector.js.map +1 -0
- package/dist/errors/ErrorFormatter.d.ts +92 -3
- package/dist/errors/ErrorFormatter.d.ts.map +1 -1
- package/dist/errors/ErrorFormatter.js +220 -4
- package/dist/errors/ErrorFormatter.js.map +1 -1
- package/dist/errors/ErrorHandler.d.ts +259 -0
- package/dist/errors/ErrorHandler.d.ts.map +1 -0
- package/dist/errors/ErrorHandler.js +378 -0
- package/dist/errors/ErrorHandler.js.map +1 -0
- package/dist/errors/FieldRegistry.d.ts +39 -0
- package/dist/errors/FieldRegistry.d.ts.map +1 -1
- package/dist/errors/FieldRegistry.js +172 -74
- package/dist/errors/FieldRegistry.js.map +1 -1
- package/dist/errors/OrbytError.d.ts +85 -3
- package/dist/errors/OrbytError.d.ts.map +1 -1
- package/dist/errors/OrbytError.js +151 -4
- package/dist/errors/OrbytError.js.map +1 -1
- package/dist/errors/SchedulerError.d.ts +93 -1
- package/dist/errors/SchedulerError.d.ts.map +1 -1
- package/dist/errors/SchedulerError.js +145 -1
- package/dist/errors/SchedulerError.js.map +1 -1
- package/dist/errors/SecurityErrors.d.ts +94 -12
- package/dist/errors/SecurityErrors.d.ts.map +1 -1
- package/dist/errors/SecurityErrors.js +162 -18
- package/dist/errors/SecurityErrors.js.map +1 -1
- package/dist/errors/StepError.d.ts +111 -1
- package/dist/errors/StepError.d.ts.map +1 -1
- package/dist/errors/StepError.js +182 -1
- package/dist/errors/StepError.js.map +1 -1
- package/dist/errors/WorkflowError.d.ts +139 -2
- package/dist/errors/WorkflowError.d.ts.map +1 -1
- package/dist/errors/WorkflowError.js +264 -22
- package/dist/errors/WorkflowError.js.map +1 -1
- package/dist/errors/index.d.ts +5 -1
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +7 -4
- package/dist/errors/index.js.map +1 -1
- package/dist/loader/WorkflowLoader.d.ts +83 -21
- package/dist/loader/WorkflowLoader.d.ts.map +1 -1
- package/dist/loader/WorkflowLoader.js +169 -55
- package/dist/loader/WorkflowLoader.js.map +1 -1
- package/dist/parser/SchemaValidator.d.ts.map +1 -1
- package/dist/parser/SchemaValidator.js +2 -1
- package/dist/parser/SchemaValidator.js.map +1 -1
- package/package.json +1 -1
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
* @module loader
|
|
46
46
|
*/
|
|
47
47
|
import { type ParsedWorkflow } from '../parser/WorkflowParser.js';
|
|
48
|
+
import type { EngineLogger } from '../core/EngineLogger.js';
|
|
48
49
|
/**
|
|
49
50
|
* Workflow loading options
|
|
50
51
|
*/
|
|
@@ -63,6 +64,10 @@ export interface WorkflowLoadOptions {
|
|
|
63
64
|
* Default: true
|
|
64
65
|
*/
|
|
65
66
|
validate?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Optional EngineLogger for structured error logging
|
|
69
|
+
*/
|
|
70
|
+
logger?: EngineLogger;
|
|
66
71
|
}
|
|
67
72
|
/**
|
|
68
73
|
* Workflow Loader
|
|
@@ -92,45 +97,63 @@ export declare class WorkflowLoader {
|
|
|
92
97
|
* Parse workflow from YAML string
|
|
93
98
|
*
|
|
94
99
|
* PIPELINE:
|
|
95
|
-
* 1.
|
|
96
|
-
* 2.
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
+
* 1. Phase 1: Loading - Parse YAML to object (syntax check only)
|
|
101
|
+
* 2. Phase 2: Validation - Validate security, schema, and steps
|
|
102
|
+
*
|
|
103
|
+
* This ensures the file is fully loaded before validation starts,
|
|
104
|
+
* preventing incomplete error detection.
|
|
100
105
|
*
|
|
101
106
|
* @param yamlContent - YAML string content
|
|
102
|
-
* @
|
|
103
|
-
* @
|
|
107
|
+
* @param filePath - Optional file path for better error messages
|
|
108
|
+
* @param logger - Optional EngineLogger for structured logging
|
|
109
|
+
* @returns Parsed and validated workflow
|
|
110
|
+
* @throws OrbytError with proper error code and debug info
|
|
104
111
|
*/
|
|
105
|
-
static fromYAML(yamlContent: string): ParsedWorkflow;
|
|
112
|
+
static fromYAML(yamlContent: string, filePath?: string, logger?: EngineLogger): ParsedWorkflow;
|
|
106
113
|
/**
|
|
107
114
|
* Parse workflow from JSON string
|
|
108
115
|
*
|
|
116
|
+
* PIPELINE:
|
|
117
|
+
* 1. Phase 1: Loading - Parse JSON to object (syntax check only)
|
|
118
|
+
* 2. Phase 2: Validation - Validate security, schema, and steps
|
|
119
|
+
*
|
|
109
120
|
* @param jsonContent - JSON string content
|
|
110
|
-
* @
|
|
111
|
-
* @
|
|
121
|
+
* @param filePath - Optional file path for better error messages
|
|
122
|
+
* @param logger - Optional EngineLogger for structured logging
|
|
123
|
+
* @returns Parsed and validated workflow
|
|
124
|
+
* @throws OrbytError with proper error code and debug info
|
|
112
125
|
*/
|
|
113
|
-
static fromJSON(jsonContent: string): ParsedWorkflow;
|
|
126
|
+
static fromJSON(jsonContent: string, filePath?: string, logger?: EngineLogger): ParsedWorkflow;
|
|
114
127
|
/**
|
|
115
128
|
* Parse workflow from object
|
|
116
129
|
*
|
|
117
|
-
* Useful when workflow is already parsed (e.g., from API request body)
|
|
130
|
+
* Useful when workflow is already parsed (e.g., from API request body).
|
|
131
|
+
*
|
|
132
|
+
* Since the object is already loaded, this goes directly to validation phase.
|
|
118
133
|
*
|
|
119
134
|
* @param workflowObject - Workflow object
|
|
120
|
-
* @
|
|
121
|
-
* @
|
|
135
|
+
* @param logger - Optional EngineLogger for structured logging
|
|
136
|
+
* @returns Parsed and validated workflow
|
|
137
|
+
* @throws OrbytError with proper error code and debug info
|
|
122
138
|
*/
|
|
123
|
-
static fromObject(workflowObject: unknown): ParsedWorkflow;
|
|
139
|
+
static fromObject(workflowObject: unknown, logger?: EngineLogger): ParsedWorkflow;
|
|
124
140
|
/**
|
|
125
|
-
* Validate a workflow
|
|
141
|
+
* Validate a workflow and return parsed result with metadata
|
|
126
142
|
*
|
|
127
|
-
*
|
|
143
|
+
* This is a convenience method that auto-detects the source type:
|
|
144
|
+
* - File path → load from file
|
|
145
|
+
* - YAML/JSON string → parse content
|
|
146
|
+
* - Object → validate object
|
|
147
|
+
*
|
|
148
|
+
* Returns ParsedWorkflow with metadata (name, description, steps count, etc.)
|
|
149
|
+
* so you can display info about the validated workflow.
|
|
128
150
|
*
|
|
129
151
|
* @param source - File path, YAML string, JSON string, or object
|
|
130
|
-
* @
|
|
131
|
-
* @
|
|
152
|
+
* @param logger - Optional EngineLogger for structured logging
|
|
153
|
+
* @returns ParsedWorkflow with metadata
|
|
154
|
+
* @throws OrbytError if invalid
|
|
132
155
|
*/
|
|
133
|
-
static validate(source: string | unknown): Promise<
|
|
156
|
+
static validate(source: string | unknown, logger?: EngineLogger): Promise<ParsedWorkflow>;
|
|
134
157
|
/**
|
|
135
158
|
* Check if a string is likely a file path
|
|
136
159
|
*
|
|
@@ -147,8 +170,47 @@ export declare class WorkflowLoader {
|
|
|
147
170
|
*
|
|
148
171
|
* @param source - File path or YAML/JSON content
|
|
149
172
|
* @param options - Load options
|
|
150
|
-
* @returns Parsed workflow
|
|
173
|
+
* @returns Parsed and validated workflow
|
|
174
|
+
* @throws OrbytError with proper error code and debug info
|
|
151
175
|
*/
|
|
152
176
|
static fromString(source: string, options?: WorkflowLoadOptions): Promise<ParsedWorkflow>;
|
|
177
|
+
/**
|
|
178
|
+
* Parse YAML content to plain object (Phase 1: Loading)
|
|
179
|
+
*
|
|
180
|
+
* This only checks YAML syntax, does NOT validate the schema.
|
|
181
|
+
*
|
|
182
|
+
* @param yamlContent - YAML string
|
|
183
|
+
* @param location - File path or location for error messages
|
|
184
|
+
* @returns Plain JavaScript object
|
|
185
|
+
* @throws OrbytError if YAML syntax is invalid
|
|
186
|
+
* @private
|
|
187
|
+
*/
|
|
188
|
+
private static parseYAMLToObject;
|
|
189
|
+
/**
|
|
190
|
+
* Parse JSON content to plain object (Phase 1: Loading)
|
|
191
|
+
*
|
|
192
|
+
* This only checks JSON syntax, does NOT validate the schema.
|
|
193
|
+
*
|
|
194
|
+
* @param jsonContent - JSON string
|
|
195
|
+
* @param location - File path or location for error messages
|
|
196
|
+
* @returns Plain JavaScript object
|
|
197
|
+
* @throws OrbytError if JSON syntax is invalid
|
|
198
|
+
* @private
|
|
199
|
+
*/
|
|
200
|
+
private static parseJSONToObject;
|
|
201
|
+
/**
|
|
202
|
+
* Validate and parse workflow object (Phase 2: Validation)
|
|
203
|
+
*
|
|
204
|
+
* This runs all validations: security, schema, steps.
|
|
205
|
+
* Errors are automatically enriched with debug info by ErrorDetector.
|
|
206
|
+
*
|
|
207
|
+
* @param workflowObject - Plain object from Phase 1
|
|
208
|
+
* @param location - File path or location for error messages
|
|
209
|
+
* @param logger - Optional EngineLogger for logging errors
|
|
210
|
+
* @returns Parsed and validated workflow
|
|
211
|
+
* @throws OrbytError if validation fails (with debug info attached)
|
|
212
|
+
* @private
|
|
213
|
+
*/
|
|
214
|
+
private static validateAndParse;
|
|
153
215
|
}
|
|
154
216
|
//# sourceMappingURL=WorkflowLoader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowLoader.d.ts","sourceRoot":"","sources":["../../src/loader/WorkflowLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;A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EAAE,MAAM,GAAG,OAAO,EACxB,MAAM,CAAC,EAAE,YAAY,GACpB,OAAO,CAAC,cAAc,CAAC;IAkB1B;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAW9C;;;;;;;;;;;OAWG;WACU,UAAU,CACrB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,cAAc,CAAC;IAc1B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAkBhC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAkBhC;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;CAsChC"}
|
|
@@ -49,6 +49,9 @@ import { existsSync } from 'fs';
|
|
|
49
49
|
import { resolve } from 'path';
|
|
50
50
|
import YAML from 'yaml';
|
|
51
51
|
import { WorkflowParser } from '../parser/WorkflowParser.js';
|
|
52
|
+
import { ErrorDetector } from '../errors/ErrorDetector.js';
|
|
53
|
+
import { OrbytError } from '../errors/OrbytError.js';
|
|
54
|
+
import { logErrorToEngine } from '../errors/ErrorFormatter.js';
|
|
52
55
|
/**
|
|
53
56
|
* Workflow Loader
|
|
54
57
|
*
|
|
@@ -92,18 +95,18 @@ export class WorkflowLoader {
|
|
|
92
95
|
const isJSON = filePath.endsWith('.json');
|
|
93
96
|
let parsed;
|
|
94
97
|
if (isYAML) {
|
|
95
|
-
parsed = this.fromYAML(content);
|
|
98
|
+
parsed = this.fromYAML(content, resolvedPath, options.logger);
|
|
96
99
|
}
|
|
97
100
|
else if (isJSON) {
|
|
98
|
-
parsed = this.fromJSON(content);
|
|
101
|
+
parsed = this.fromJSON(content, resolvedPath, options.logger);
|
|
99
102
|
}
|
|
100
103
|
else {
|
|
101
104
|
// Try YAML first (more common for workflows), fallback to JSON
|
|
102
105
|
try {
|
|
103
|
-
parsed = this.fromYAML(content);
|
|
106
|
+
parsed = this.fromYAML(content, resolvedPath, options.logger);
|
|
104
107
|
}
|
|
105
108
|
catch {
|
|
106
|
-
parsed = this.fromJSON(content);
|
|
109
|
+
parsed = this.fromJSON(content, resolvedPath, options.logger);
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
112
|
// Step 4: Apply variables if provided
|
|
@@ -116,91 +119,100 @@ export class WorkflowLoader {
|
|
|
116
119
|
* Parse workflow from YAML string
|
|
117
120
|
*
|
|
118
121
|
* PIPELINE:
|
|
119
|
-
* 1.
|
|
120
|
-
* 2.
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
122
|
+
* 1. Phase 1: Loading - Parse YAML to object (syntax check only)
|
|
123
|
+
* 2. Phase 2: Validation - Validate security, schema, and steps
|
|
124
|
+
*
|
|
125
|
+
* This ensures the file is fully loaded before validation starts,
|
|
126
|
+
* preventing incomplete error detection.
|
|
124
127
|
*
|
|
125
128
|
* @param yamlContent - YAML string content
|
|
126
|
-
* @
|
|
127
|
-
* @
|
|
129
|
+
* @param filePath - Optional file path for better error messages
|
|
130
|
+
* @param logger - Optional EngineLogger for structured logging
|
|
131
|
+
* @returns Parsed and validated workflow
|
|
132
|
+
* @throws OrbytError with proper error code and debug info
|
|
128
133
|
*/
|
|
129
|
-
static fromYAML(yamlContent) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
throw new Error(`Invalid YAML syntax: ${errorMsg}`);
|
|
138
|
-
}
|
|
139
|
-
// Step 2: Validate and parse through WorkflowParser
|
|
140
|
-
// This handles: security validation, schema validation, step parsing
|
|
141
|
-
return WorkflowParser.parse(parsedObject);
|
|
134
|
+
static fromYAML(yamlContent, filePath, logger) {
|
|
135
|
+
const location = filePath || 'YAML content';
|
|
136
|
+
// PHASE 1: LOADING
|
|
137
|
+
// Parse YAML syntax to plain object (no validation yet)
|
|
138
|
+
const workflowObject = this.parseYAMLToObject(yamlContent, location);
|
|
139
|
+
// PHASE 2: VALIDATION
|
|
140
|
+
// Now that file is fully loaded, validate the object
|
|
141
|
+
return this.validateAndParse(workflowObject, location, logger);
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
144
|
* Parse workflow from JSON string
|
|
145
145
|
*
|
|
146
|
+
* PIPELINE:
|
|
147
|
+
* 1. Phase 1: Loading - Parse JSON to object (syntax check only)
|
|
148
|
+
* 2. Phase 2: Validation - Validate security, schema, and steps
|
|
149
|
+
*
|
|
146
150
|
* @param jsonContent - JSON string content
|
|
147
|
-
* @
|
|
148
|
-
* @
|
|
151
|
+
* @param filePath - Optional file path for better error messages
|
|
152
|
+
* @param logger - Optional EngineLogger for structured logging
|
|
153
|
+
* @returns Parsed and validated workflow
|
|
154
|
+
* @throws OrbytError with proper error code and debug info
|
|
149
155
|
*/
|
|
150
|
-
static fromJSON(jsonContent) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
throw new Error(`Invalid JSON syntax: ${errorMsg}`);
|
|
159
|
-
}
|
|
160
|
-
// Step 2: Validate and parse through WorkflowParser
|
|
161
|
-
return WorkflowParser.parse(parsedObject);
|
|
156
|
+
static fromJSON(jsonContent, filePath, logger) {
|
|
157
|
+
const location = filePath || 'JSON content';
|
|
158
|
+
// PHASE 1: LOADING
|
|
159
|
+
// Parse JSON syntax to plain object (no validation yet)
|
|
160
|
+
const workflowObject = this.parseJSONToObject(jsonContent, location);
|
|
161
|
+
// PHASE 2: VALIDATION
|
|
162
|
+
// Now that file is fully loaded, validate the object
|
|
163
|
+
return this.validateAndParse(workflowObject, location, logger);
|
|
162
164
|
}
|
|
163
165
|
/**
|
|
164
166
|
* Parse workflow from object
|
|
165
167
|
*
|
|
166
|
-
* Useful when workflow is already parsed (e.g., from API request body)
|
|
168
|
+
* Useful when workflow is already parsed (e.g., from API request body).
|
|
169
|
+
*
|
|
170
|
+
* Since the object is already loaded, this goes directly to validation phase.
|
|
167
171
|
*
|
|
168
172
|
* @param workflowObject - Workflow object
|
|
169
|
-
* @
|
|
170
|
-
* @
|
|
173
|
+
* @param logger - Optional EngineLogger for structured logging
|
|
174
|
+
* @returns Parsed and validated workflow
|
|
175
|
+
* @throws OrbytError with proper error code and debug info
|
|
171
176
|
*/
|
|
172
|
-
static fromObject(workflowObject) {
|
|
173
|
-
|
|
177
|
+
static fromObject(workflowObject, logger) {
|
|
178
|
+
// Object is already loaded, go directly to validation
|
|
179
|
+
return this.validateAndParse(workflowObject, 'workflow object', logger);
|
|
174
180
|
}
|
|
175
181
|
/**
|
|
176
|
-
* Validate a workflow
|
|
182
|
+
* Validate a workflow and return parsed result with metadata
|
|
177
183
|
*
|
|
178
|
-
*
|
|
184
|
+
* This is a convenience method that auto-detects the source type:
|
|
185
|
+
* - File path → load from file
|
|
186
|
+
* - YAML/JSON string → parse content
|
|
187
|
+
* - Object → validate object
|
|
188
|
+
*
|
|
189
|
+
* Returns ParsedWorkflow with metadata (name, description, steps count, etc.)
|
|
190
|
+
* so you can display info about the validated workflow.
|
|
179
191
|
*
|
|
180
192
|
* @param source - File path, YAML string, JSON string, or object
|
|
181
|
-
* @
|
|
182
|
-
* @
|
|
193
|
+
* @param logger - Optional EngineLogger for structured logging
|
|
194
|
+
* @returns ParsedWorkflow with metadata
|
|
195
|
+
* @throws OrbytError if invalid
|
|
183
196
|
*/
|
|
184
|
-
static async validate(source) {
|
|
197
|
+
static async validate(source, logger) {
|
|
185
198
|
if (typeof source === 'string') {
|
|
186
199
|
// Check if it's a file path
|
|
187
200
|
if (existsSync(source)) {
|
|
188
|
-
await this.fromFile(source);
|
|
201
|
+
return await this.fromFile(source, { logger });
|
|
189
202
|
}
|
|
190
203
|
else {
|
|
191
204
|
// Try parsing as YAML/JSON
|
|
192
205
|
try {
|
|
193
|
-
this.fromYAML(source);
|
|
206
|
+
return this.fromYAML(source, undefined, logger);
|
|
194
207
|
}
|
|
195
208
|
catch {
|
|
196
|
-
this.fromJSON(source);
|
|
209
|
+
return this.fromJSON(source, undefined, logger);
|
|
197
210
|
}
|
|
198
211
|
}
|
|
199
212
|
}
|
|
200
213
|
else {
|
|
201
|
-
this.fromObject(source);
|
|
214
|
+
return this.fromObject(source, logger);
|
|
202
215
|
}
|
|
203
|
-
return true;
|
|
204
216
|
}
|
|
205
217
|
/**
|
|
206
218
|
* Check if a string is likely a file path
|
|
@@ -225,7 +237,8 @@ export class WorkflowLoader {
|
|
|
225
237
|
*
|
|
226
238
|
* @param source - File path or YAML/JSON content
|
|
227
239
|
* @param options - Load options
|
|
228
|
-
* @returns Parsed workflow
|
|
240
|
+
* @returns Parsed and validated workflow
|
|
241
|
+
* @throws OrbytError with proper error code and debug info
|
|
229
242
|
*/
|
|
230
243
|
static async fromString(source, options = {}) {
|
|
231
244
|
// Strategy: Check if it's a file path first
|
|
@@ -233,7 +246,108 @@ export class WorkflowLoader {
|
|
|
233
246
|
return this.fromFile(source, options);
|
|
234
247
|
}
|
|
235
248
|
// Otherwise parse as content
|
|
236
|
-
return this.fromYAML(source);
|
|
249
|
+
return this.fromYAML(source, 'inline YAML', options.logger);
|
|
250
|
+
}
|
|
251
|
+
// ============================================================================
|
|
252
|
+
// PRIVATE HELPER METHODS
|
|
253
|
+
// ============================================================================
|
|
254
|
+
/**
|
|
255
|
+
* Parse YAML content to plain object (Phase 1: Loading)
|
|
256
|
+
*
|
|
257
|
+
* This only checks YAML syntax, does NOT validate the schema.
|
|
258
|
+
*
|
|
259
|
+
* @param yamlContent - YAML string
|
|
260
|
+
* @param location - File path or location for error messages
|
|
261
|
+
* @returns Plain JavaScript object
|
|
262
|
+
* @throws OrbytError if YAML syntax is invalid
|
|
263
|
+
* @private
|
|
264
|
+
*/
|
|
265
|
+
static parseYAMLToObject(yamlContent, location) {
|
|
266
|
+
try {
|
|
267
|
+
return YAML.parse(yamlContent);
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
// Detect parse error with proper error code
|
|
271
|
+
const parseError = ErrorDetector.detect({
|
|
272
|
+
type: 'parse_error',
|
|
273
|
+
location,
|
|
274
|
+
rawMessage: error instanceof Error ? error.message : String(error),
|
|
275
|
+
data: {
|
|
276
|
+
content: yamlContent.substring(0, 200), // First 200 chars for context
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
throw parseError;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Parse JSON content to plain object (Phase 1: Loading)
|
|
284
|
+
*
|
|
285
|
+
* This only checks JSON syntax, does NOT validate the schema.
|
|
286
|
+
*
|
|
287
|
+
* @param jsonContent - JSON string
|
|
288
|
+
* @param location - File path or location for error messages
|
|
289
|
+
* @returns Plain JavaScript object
|
|
290
|
+
* @throws OrbytError if JSON syntax is invalid
|
|
291
|
+
* @private
|
|
292
|
+
*/
|
|
293
|
+
static parseJSONToObject(jsonContent, location) {
|
|
294
|
+
try {
|
|
295
|
+
return JSON.parse(jsonContent);
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
// Detect parse error with proper error code
|
|
299
|
+
const parseError = ErrorDetector.detect({
|
|
300
|
+
type: 'parse_error',
|
|
301
|
+
location,
|
|
302
|
+
rawMessage: error instanceof Error ? error.message : String(error),
|
|
303
|
+
data: {
|
|
304
|
+
content: jsonContent.substring(0, 200),
|
|
305
|
+
},
|
|
306
|
+
});
|
|
307
|
+
throw parseError;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Validate and parse workflow object (Phase 2: Validation)
|
|
312
|
+
*
|
|
313
|
+
* This runs all validations: security, schema, steps.
|
|
314
|
+
* Errors are automatically enriched with debug info by ErrorDetector.
|
|
315
|
+
*
|
|
316
|
+
* @param workflowObject - Plain object from Phase 1
|
|
317
|
+
* @param location - File path or location for error messages
|
|
318
|
+
* @param logger - Optional EngineLogger for logging errors
|
|
319
|
+
* @returns Parsed and validated workflow
|
|
320
|
+
* @throws OrbytError if validation fails (with debug info attached)
|
|
321
|
+
* @private
|
|
322
|
+
*/
|
|
323
|
+
static validateAndParse(workflowObject, location, logger) {
|
|
324
|
+
try {
|
|
325
|
+
// This runs all validation: security + schema + steps
|
|
326
|
+
return WorkflowParser.parse(workflowObject);
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
// Convert to OrbytError if not already
|
|
330
|
+
// ErrorDetector automatically enriches with debug info
|
|
331
|
+
let orbytError;
|
|
332
|
+
if (error instanceof OrbytError) {
|
|
333
|
+
orbytError = error;
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
// Detect and classify the error (auto-enriches with debug info)
|
|
337
|
+
orbytError = ErrorDetector.detectFromException(error instanceof Error ? error : new Error(String(error)), location);
|
|
338
|
+
}
|
|
339
|
+
// 1. Log to EngineLogger for structured logs (if available)
|
|
340
|
+
if (logger) {
|
|
341
|
+
logErrorToEngine(orbytError, logger);
|
|
342
|
+
}
|
|
343
|
+
// 2. Display detailed debug info that was attached by ErrorDetector
|
|
344
|
+
// The debug output includes: explanation, cause, fix steps, examples
|
|
345
|
+
const debugOutput = orbytError.__debugOutput;
|
|
346
|
+
if (debugOutput) {
|
|
347
|
+
console.error('\n' + debugOutput + '\n');
|
|
348
|
+
}
|
|
349
|
+
throw orbytError;
|
|
350
|
+
}
|
|
237
351
|
}
|
|
238
352
|
}
|
|
239
353
|
//# sourceMappingURL=WorkflowLoader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowLoader.js","sourceRoot":"","sources":["../../src/loader/WorkflowLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC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YACvD,IAAI,UAAsB,CAAC;YAE3B,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;gBAChC,UAAU,GAAG,KAAK,CAAC;YACrB,CAAC;iBAAM,CAAC;gBACN,gEAAgE;gBAChE,UAAU,GAAG,aAAa,CAAC,mBAAmB,CAC5C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EACzD,QAAQ,CACT,CAAC;YACJ,CAAC;YAED,4DAA4D;YAC5D,IAAI,MAAM,EAAE,CAAC;gBACX,gBAAgB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YACvC,CAAC;YAED,oEAAoE;YACpE,wEAAwE;YACxE,MAAM,WAAW,GAAI,UAAkB,CAAC,aAAa,CAAC;YACtD,IAAI,WAAW,EAAE,CAAC;gBAChB,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,WAAW,GAAG,IAAI,CAAC,CAAC;YAC3C,CAAC;YAED,MAAM,UAAU,CAAC;QACnB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaValidator.d.ts","sourceRoot":"","sources":["../../src/parser/SchemaValidator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,
|
|
1
|
+
{"version":3,"file":"SchemaValidator.d.ts","sourceRoot":"","sources":["../../src/parser/SchemaValidator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAIL,UAAU,EAEX,MAAM,oBAAoB,CAAC;AAG5B;;GAEG;AACH,qBAAa,eAAe;IAC1B;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,qBAAqB;IA2B5D;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAyFpC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAkBnC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAwChC;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO;IAS7C;;;;;OAKG;IACH,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE,OAAO,GAAG;QACtC,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,CAAC,EAAE,qBAAqB,CAAC;QAC7B,KAAK,CAAC,EAAE,UAAU,CAAC;KACpB;CAmBF"}
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import { OrbytWorkflowSchema } from '@dev-ecosystem/core';
|
|
11
|
-
import { SchemaError, findMatches, isLikelyTypo,
|
|
11
|
+
import { SchemaError, findMatches, isLikelyTypo, OrbytError, ErrorSeverity, } from '../errors/index.js';
|
|
12
|
+
import { getValidFields, isValidField } from '../errors/FieldRegistry.js';
|
|
12
13
|
/**
|
|
13
14
|
* Enhanced schema validator with diagnostic capabilities
|
|
14
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaValidator.js","sourceRoot":"","sources":["../../src/parser/SchemaValidator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAA8B,MAAM,qBAAqB,CAAC;AACtF,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"SchemaValidator.js","sourceRoot":"","sources":["../../src/parser/SchemaValidator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,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