@zola_do/workflow-engine 0.2.15 → 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.
- package/README.md +13 -2
- package/package.json +1 -1
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
|
|
57
|
+
const result = this.workflowEngine.convertToStateMachine(uiJson);
|
|
58
58
|
|
|
59
59
|
return {
|
|
60
|
-
|
|
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
|
```
|