@wooksjs/event-wf 0.4.31 → 0.4.33

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/dist/index.cjs CHANGED
@@ -48,9 +48,10 @@ class WooksWorkflow extends wf.Workflow {
48
48
  resolveStep(stepId) {
49
49
  const stepIdNorm = `/${stepId}`.replace(/\/\/+/g, '/');
50
50
  try {
51
- useWFContext();
51
+ const store = useWFContext().store('event');
52
52
  const found = this.wooks.lookup('WF_STEP', stepIdNorm);
53
53
  if (found.handlers?.length) {
54
+ store.set('stepId', stepIdNorm);
54
55
  return found.handlers[0]();
55
56
  }
56
57
  }
@@ -104,6 +105,7 @@ class WooksWf extends wooks.WooksAdapterBase {
104
105
  const { restoreCtx, clearCtx } = (resume ? resumeWfContext : createWfContext)({
105
106
  inputContext,
106
107
  schemaId,
108
+ stepId: null,
107
109
  indexes,
108
110
  input,
109
111
  }, this.mergeEventOptions(this.opts?.eventOptions));
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@ declare function useWfState(): {
16
16
 
17
17
  interface TWFEventData {
18
18
  schemaId: string;
19
+ stepId: string | null;
19
20
  inputContext: unknown;
20
21
  indexes?: number[];
21
22
  input?: unknown;
package/dist/index.mjs CHANGED
@@ -46,9 +46,10 @@ class WooksWorkflow extends Workflow {
46
46
  resolveStep(stepId) {
47
47
  const stepIdNorm = `/${stepId}`.replace(/\/\/+/g, '/');
48
48
  try {
49
- useWFContext();
49
+ const store = useWFContext().store('event');
50
50
  const found = this.wooks.lookup('WF_STEP', stepIdNorm);
51
51
  if (found.handlers?.length) {
52
+ store.set('stepId', stepIdNorm);
52
53
  return found.handlers[0]();
53
54
  }
54
55
  }
@@ -102,6 +103,7 @@ class WooksWf extends WooksAdapterBase {
102
103
  const { restoreCtx, clearCtx } = (resume ? resumeWfContext : createWfContext)({
103
104
  inputContext,
104
105
  schemaId,
106
+ stepId: null,
105
107
  indexes,
106
108
  input,
107
109
  }, this.mergeEventOptions(this.opts?.eventOptions));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wooksjs/event-wf",
3
- "version": "0.4.31",
3
+ "version": "0.4.33",
4
4
  "description": "@wooksjs/event-wf",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -33,8 +33,8 @@
33
33
  "author": "Artem Maltsev",
34
34
  "license": "MIT",
35
35
  "peerDependencies": {
36
- "wooks": "0.4.31",
37
- "@wooksjs/event-core": "0.4.31"
36
+ "wooks": "0.4.33",
37
+ "@wooksjs/event-core": "0.4.33"
38
38
  },
39
39
  "dependencies": {
40
40
  "@prostojs/logger": "^0.4.0",