@onlineapps/conn-orch-orchestrator 1.0.40 → 1.0.42

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/conn-orch-orchestrator",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
4
4
  "description": "Workflow orchestration connector for OA Drive - handles message routing and workflow execution",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -23,7 +23,7 @@
23
23
  "@onlineapps/conn-base-monitoring": "^1.0.0",
24
24
  "@onlineapps/conn-infra-mq": "1.1.54",
25
25
  "@onlineapps/conn-orch-api-mapper": "^1.0.0",
26
- "@onlineapps/conn-orch-cookbook": "^2.0.0",
26
+ "@onlineapps/conn-orch-cookbook": "2.0.4",
27
27
  "@onlineapps/conn-orch-registry": "^1.1.4"
28
28
  },
29
29
  "devDependencies": {
@@ -62,21 +62,28 @@ class WorkflowOrchestrator {
62
62
  }
63
63
 
64
64
  /**
65
- * Get steps as array (supports both V1 array and V2 object formats)
66
- * V2 FORMAT: steps is an object keyed by step_id
67
- * V1 FORMAT (deprecated): steps is an array
65
+ * Get steps as array (V2.1 is array, V2.0 object is deprecated)
66
+ * V2.1 FORMAT (required): steps is an ARRAY with step_id
67
+ * V2.0 FORMAT (deprecated): steps is an object keyed by step_id
68
+ * V1 FORMAT (banned): steps is an array with 'id' instead of 'step_id'
68
69
  * @private
69
70
  * @param {Object} cookbookDef - Cookbook definition
70
71
  * @returns {Array} Array of step objects
71
72
  */
72
73
  _getStepsArray(cookbookDef) {
73
74
  if (!cookbookDef?.steps) return [];
75
+
74
76
  if (Array.isArray(cookbookDef.steps)) {
75
- // V1 format (deprecated) - steps is already an array
76
- this.logger.warn('Using deprecated V1 cookbook format (steps as array). Please migrate to V2 (steps as object).');
77
+ // V2.1 format - steps is an array with step_id
78
+ // Check if it's actually V1 (array with 'id' instead of 'step_id')
79
+ if (cookbookDef.steps.length > 0 && cookbookDef.steps[0].id && !cookbookDef.steps[0].step_id) {
80
+ throw new Error('FAIL-FAST: V1 format (array with "id") is BANNED. Use V2.1 format with "step_id".');
81
+ }
77
82
  return cookbookDef.steps;
78
83
  }
79
- // V2 format - steps is an object keyed by step_id
84
+
85
+ // V2.0 format (deprecated) - steps is an object keyed by step_id
86
+ this.logger.warn('Using deprecated V2.0 cookbook format (steps as object). Please migrate to V2.1 (steps as array with step_id).');
80
87
  return Object.values(cookbookDef.steps);
81
88
  }
82
89