@zola_do/workflow-engine 0.2.14 → 0.2.16

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.
Files changed (2) hide show
  1. package/README.md +13 -2
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -54,16 +54,27 @@ export class WorkflowController {
54
54
  async compileWorkflow(@Param('id') id: string) {
55
55
  const uiJson = await this.workflowService.getUiJson(id);
56
56
 
57
- const stateMachine = this.workflowEngine.convertToStateMachine(uiJson);
57
+ const result = this.workflowEngine.convertToStateMachine(uiJson);
58
58
 
59
59
  return {
60
- definition: stateMachine,
60
+ schemaVersion: result.schemaVersion, // currently `1`
61
+ definition: result.definition,
61
62
  xstateReady: true,
62
63
  };
63
64
  }
64
65
  }
65
66
  ```
66
67
 
68
+ ## `schemaVersion` contract
69
+
70
+ `convertToStateMachine()` returns:
71
+
72
+ ```typescript
73
+ { schemaVersion: 1, definition: /* XState-compatible machine */ }
74
+ ```
75
+
76
+ Downstream apps can branch on `schemaVersion` when persisting or replaying compiled workflows. The version increments only on breaking output shape changes.
77
+
67
78
  ## Workflow Architecture
68
79
 
69
80
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zola_do/workflow-engine",
3
- "version": "0.2.14",
3
+ "version": "0.2.16",
4
4
  "description": "State machine workflow converter for NestJS",
5
5
  "author": "zolaDO",
6
6
  "license": "ISC",
@@ -27,8 +27,8 @@
27
27
  "scripts": {
28
28
  "clean": "rimraf dist",
29
29
  "typecheck": "tsc --noEmit",
30
- "build": "npm run clean && tsc",
31
- "prepublishOnly": "npm run build"
30
+ "build": "rimraf dist && tsc",
31
+ "prepublishOnly": "rimraf dist && tsc"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@nestjs/common": "^10.0.0 || ^11.0.0",