@onlineapps/conn-orch-cookbook 2.0.0 → 2.0.2

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 CHANGED
@@ -166,29 +166,30 @@ const cookbook = generator.generate(openApiSpec);
166
166
 
167
167
  ## 📖 Cookbook Structure
168
168
 
169
- ### Basic Example
169
+ ### Basic Example (v2.0 Schema)
170
170
  ```json
171
171
  {
172
- "version": "1.0.0",
172
+ "version": "2.0.0",
173
173
  "api_input": {
174
174
  "customer": "ACME Corp",
175
175
  "amount": 1000
176
176
  },
177
177
  "steps": [
178
178
  {
179
- "id": "invoice_step",
179
+ "step_id": "invoice_step",
180
180
  "type": "task",
181
- "service": "invoice_service",
181
+ "service": "invoice-service",
182
+ "operation": "createInvoice",
182
183
  "input": {
183
- "customer": "$api_input.customer",
184
- "amount": "$api_input.amount"
184
+ "customer": "${api_input.customer}",
185
+ "amount": "${api_input.amount}"
185
186
  },
186
187
  "output": {
187
- "invoice_id": "$.invoice_id"
188
+ "invoice_id": "${response.invoice_id}"
188
189
  },
189
190
  "retry": {
190
- "maxAttempts": 3,
191
- "delayMs": 2000
191
+ "max_attempts": 3,
192
+ "delay_ms": 2000
192
193
  }
193
194
  }
194
195
  ]
@@ -250,25 +251,33 @@ npm run test:integration # Integration tests
250
251
 
251
252
  ## ⚠️ Important Notes
252
253
 
253
- ### Schema Validation Strictness
254
- The current schema validation is very strict. See [Schema Audit Report](/shared/cookbook/cookbook-core/docs/SCHEMA_AUDIT.md) for detailed analysis and recommendations.
254
+ ### Schema v2.0 Update
255
+ The cookbook schema has been updated to version 2.0 with improved semantics and consistency:
255
256
 
256
- **Known Issues:**
257
- - All step types incorrectly require `service`, `input`, and `output` fields
258
- - `type` field should be required but isn't
259
- - Some control flow steps (foreach, switch) have unnecessary field requirements
257
+ **Major Changes:**
258
+ - All naming conventions now use snake_case (not camelCase)
259
+ - Field `id` renamed to `step_id` for clarity
260
+ - Field `operation` is now required only for task steps (maps to OpenAPI operationId)
261
+ - Removed explicit `queue` field (now implicit from service name)
262
+ - Added comprehensive error handling and compensation support
260
263
 
261
- **Workaround:** Until schema is updated, include all required fields even if not used:
264
+ **Example v2.0 step:**
262
265
  ```javascript
263
266
  {
267
+ step_id: 'process_items',
264
268
  type: 'foreach',
265
- service: 'dummy-service', // Not actually used
266
- input: {}, // Not actually used
267
- output: {}, // Optional but may be required by schema
268
- // ... actual foreach fields
269
+ iterator: '${api_input.items}',
270
+ steps: [
271
+ // nested steps
272
+ ],
273
+ output: {
274
+ processed_items: '${foreach.results}'
275
+ }
269
276
  }
270
277
  ```
271
278
 
279
+ See [Schema v2.0 Specification](/shared/cookbook/cookbook-core/docs/SCHEMA_FINAL_SPECIFICATION.md) for full details.
280
+
272
281
  ## 📄 License
273
282
 
274
283
  PROPRIETARY - All rights reserved
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/conn-orch-cookbook",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "Complete cookbook toolkit for all services - unified wrapper including core, executor, transformer, and router functionality",
5
5
  "main": "src/index.js",
6
6
  "repository": {
@@ -45,7 +45,13 @@
45
45
  "url": "https://github.com/onlineapps/connector-cookbook/issues"
46
46
  },
47
47
  "homepage": "https://github.com/onlineapps/connector-cookbook#readme",
48
- "dependencies": {},
48
+ "dependencies": {
49
+ "@onlineapps/cookbook-core": "^2.0.0",
50
+ "@onlineapps/cookbook-executor": "^1.0.0",
51
+ "@onlineapps/cookbook-router": "^1.0.0",
52
+ "@onlineapps/cookbook-transformer": "^1.0.0",
53
+ "jsonpath": "^1.1.1"
54
+ },
49
55
  "devDependencies": {
50
56
  "eslint": "^8.30.0",
51
57
  "eslint-config-prettier": "^8.5.0",
package/src/index.js CHANGED
@@ -16,10 +16,10 @@
16
16
  */
17
17
 
18
18
  // Import from shared cookbook modules - NO LOCAL IMPLEMENTATIONS!
19
- const cookbookCore = require('../../../cookbook/cookbook-core');
20
- const cookbookExecutor = require('../../../cookbook/cookbook-executor');
21
- const cookbookTransformer = require('../../../cookbook/cookbook-transformer');
22
- const cookbookRouter = require('../../../cookbook/cookbook-router');
19
+ const cookbookCore = require('@onlineapps/cookbook-core');
20
+ const cookbookExecutor = require('@onlineapps/cookbook-executor');
21
+ const cookbookTransformer = require('@onlineapps/cookbook-transformer');
22
+ const cookbookRouter = require('@onlineapps/cookbook-router');
23
23
 
24
24
  // Re-export all from cookbook-core (parser and validator)
25
25
  const {