@onlineapps/conn-orch-orchestrator 1.0.58 → 1.0.60
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/package.json +1 -1
- package/src/WorkflowOrchestrator.js +18 -9
package/package.json
CHANGED
|
@@ -153,8 +153,9 @@ class WorkflowOrchestrator {
|
|
|
153
153
|
};
|
|
154
154
|
|
|
155
155
|
// Execute the step (build full context for template resolution)
|
|
156
|
+
const stepsArrayCtx = this._getStepsArray(cookbookDef);
|
|
156
157
|
const stepsMap = {};
|
|
157
|
-
|
|
158
|
+
stepsArrayCtx.forEach((s) => {
|
|
158
159
|
const id = this._getStepId(s);
|
|
159
160
|
if (id) {
|
|
160
161
|
stepsMap[id] = s;
|
|
@@ -162,7 +163,8 @@ class WorkflowOrchestrator {
|
|
|
162
163
|
});
|
|
163
164
|
const stepContext = {
|
|
164
165
|
api_input: cookbookDef.api_input || {},
|
|
165
|
-
steps:
|
|
166
|
+
steps: stepsArrayCtx, // array (legacy consumers expect .map)
|
|
167
|
+
steps_by_id: stepsMap, // fast lookup by step_id for templating
|
|
166
168
|
_system: cookbookDef._system,
|
|
167
169
|
delivery: cookbookDef.delivery
|
|
168
170
|
};
|
|
@@ -571,13 +573,20 @@ class WorkflowOrchestrator {
|
|
|
571
573
|
const part = parts[i];
|
|
572
574
|
if (current === undefined || current === null) return undefined;
|
|
573
575
|
|
|
574
|
-
// Special handling for 'steps' array
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
576
|
+
// Special handling for 'steps' - support array (legacy) and map (steps_by_id)
|
|
577
|
+
if (parts[i - 1] === 'steps') {
|
|
578
|
+
// Disallow numeric/index access (must reference by step_id)
|
|
579
|
+
if (/^\\d+$/.test(part)) {
|
|
580
|
+
return undefined;
|
|
581
|
+
}
|
|
582
|
+
if (context.steps_by_id && context.steps_by_id[part]) {
|
|
583
|
+
current = context.steps_by_id[part];
|
|
584
|
+
} else if (Array.isArray(context.steps)) {
|
|
585
|
+
const step = context.steps.find(s => s.id === part || s.step_id === part);
|
|
586
|
+
current = step;
|
|
587
|
+
} else {
|
|
588
|
+
current = undefined;
|
|
589
|
+
}
|
|
581
590
|
} else {
|
|
582
591
|
current = current[part];
|
|
583
592
|
}
|