@haneinfo/state-machine 0.14.0 → 0.16.0
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 +68 -0
- package/agent-guide.md +68 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/data-fields.d.ts +25 -0
- package/dist/data-fields.d.ts.map +1 -0
- package/dist/data-fields.js +88 -0
- package/dist/data-fields.js.map +1 -0
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +9 -2
- package/dist/plugin.js.map +1 -1
- package/dist/prisma-store.d.ts.map +1 -1
- package/dist/prisma-store.js +11 -0
- package/dist/prisma-store.js.map +1 -1
- package/dist/runtime.service.d.ts +11 -0
- package/dist/runtime.service.d.ts.map +1 -1
- package/dist/runtime.service.js +112 -7
- package/dist/runtime.service.js.map +1 -1
- package/dist/state-machine.controller.d.ts +6 -0
- package/dist/state-machine.controller.d.ts.map +1 -1
- package/dist/state-machine.controller.js +12 -0
- package/dist/state-machine.controller.js.map +1 -1
- package/dist/store.d.ts +2 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +6 -1
- package/dist/store.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/haneinfo.plugin.json +10 -3
- package/package.json +5 -5
- package/prisma/concurrent-editing.sql +11 -0
- package/prisma/state-machine.prisma +1 -0
package/haneinfo.plugin.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"cardinality": "singleton",
|
|
6
6
|
"distribution": "official",
|
|
7
7
|
"engine": {
|
|
8
|
-
"haneinfoPluginApi": "^1.
|
|
8
|
+
"haneinfoPluginApi": "^1.18.0",
|
|
9
9
|
"node": ">=22.0.0",
|
|
10
10
|
"frameworks": {
|
|
11
11
|
"@nestjs/common": "^11.0.5",
|
|
@@ -58,7 +58,14 @@
|
|
|
58
58
|
"description": "List authorized recent applications with archived status and nullable submitterName wrapped as $userContent; deleted instances are excluded."
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
|
-
"agentGuide": "./agent-guide.md"
|
|
61
|
+
"agentGuide": "./agent-guide.md",
|
|
62
|
+
"events": [
|
|
63
|
+
{
|
|
64
|
+
"type": "state-machine.data.updated",
|
|
65
|
+
"schemaVersion": 1,
|
|
66
|
+
"description": "Data replaced or fields patched in the instance transaction; instanceId, revision and changed field ids only."
|
|
67
|
+
}
|
|
68
|
+
]
|
|
62
69
|
},
|
|
63
70
|
"prisma": {
|
|
64
71
|
"owns": [
|
|
@@ -68,7 +75,7 @@
|
|
|
68
75
|
"StateMachineInstanceReader"
|
|
69
76
|
],
|
|
70
77
|
"schemaFragment": "prisma/state-machine.prisma",
|
|
71
|
-
"schemaDigest": "sha256:
|
|
78
|
+
"schemaDigest": "sha256:caa47776fae529aba035589dce2461659795761ae08eb8a87bc65aa95e0cee81"
|
|
72
79
|
},
|
|
73
80
|
"permissions": {
|
|
74
81
|
"definitions": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haneinfo/state-machine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "State machine mechanism: StateMachine definitions (states, transitions, frozen states) and the runtime for business-object instances, registered with @haneinfo/definition-registry.",
|
|
6
6
|
"files": [
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"./package.json": "./package.json"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@haneinfo/plugin-api": "1.
|
|
42
|
-
"@haneinfo/form": "0.
|
|
41
|
+
"@haneinfo/plugin-api": "1.18.0",
|
|
42
|
+
"@haneinfo/form": "0.4.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@haneinfo/common": "^0.3.4 || ^0.4.0",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"typescript": "^5.9.3",
|
|
64
64
|
"vitest": "^4.1.11",
|
|
65
65
|
"zod": "^4.4.0",
|
|
66
|
-
"@haneinfo/plugin-testkit": "2.3.0",
|
|
67
66
|
"@haneinfo/common": "0.4.0",
|
|
68
|
-
"@haneinfo/definition-registry": "0.1.
|
|
67
|
+
"@haneinfo/definition-registry": "0.1.14",
|
|
68
|
+
"@haneinfo/plugin-testkit": "2.3.0",
|
|
69
69
|
"@haneinfo/plugin-host-nest": "2.1.0"
|
|
70
70
|
},
|
|
71
71
|
"license": "UNLICENSED",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
ALTER TABLE state_machine_instances
|
|
2
|
+
ADD COLUMN IF NOT EXISTS field_revisions JSONB NOT NULL DEFAULT '{}'::jsonb;
|
|
3
|
+
|
|
4
|
+
-- Fill only missing keys: reruns preserve later revisions and deletion tombstones.
|
|
5
|
+
UPDATE state_machine_instances AS instance
|
|
6
|
+
SET field_revisions = COALESCE((
|
|
7
|
+
SELECT jsonb_object_agg(key, instance.revision)
|
|
8
|
+
FROM jsonb_object_keys(
|
|
9
|
+
CASE WHEN jsonb_typeof(instance.data) = 'object' THEN instance.data ELSE '{}'::jsonb END
|
|
10
|
+
) AS fields(key)
|
|
11
|
+
), '{}'::jsonb) || instance.field_revisions;
|