@moostjs/event-wf 0.5.12 → 0.5.15

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
@@ -132,7 +132,10 @@ class MoostWf {
132
132
  if (!wfSchema) {
133
133
  wfSchema = mate.read(opts.fakeInstance)?.wfSchema;
134
134
  }
135
- const _fn = fn;
135
+ const _fn = (async () => {
136
+ moost.setControllerContext(this.moost, 'bindHandler', targetPath);
137
+ return fn();
138
+ });
136
139
  this.toInit.push(() => {
137
140
  this.wfApp.flow(targetPath, wfSchema || [], opts.prefix === '/' ? '' : opts.prefix, _fn);
138
141
  opts.logHandler(`${''}(${handler.type})${''}${targetPath}`);
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { useWfState, WooksWf, createWfApp } from '@wooksjs/event-wf';
2
2
  export { useWFContext, useWfState } from '@wooksjs/event-wf';
3
- import { getMoostMate, Resolve, defineMoostEventHandler, getMoostInfact } from 'moost';
3
+ import { getMoostMate, Resolve, defineMoostEventHandler, getMoostInfact, setControllerContext } from 'moost';
4
4
  import { useEventId } from '@wooksjs/event-core';
5
5
  export { StepRetriableError } from '@prostojs/wf';
6
6
 
@@ -131,7 +131,10 @@ class MoostWf {
131
131
  if (!wfSchema) {
132
132
  wfSchema = mate.read(opts.fakeInstance)?.wfSchema;
133
133
  }
134
- const _fn = fn;
134
+ const _fn = (async () => {
135
+ setControllerContext(this.moost, 'bindHandler', targetPath);
136
+ return fn();
137
+ });
135
138
  this.toInit.push(() => {
136
139
  this.wfApp.flow(targetPath, wfSchema || [], opts.prefix === '/' ? '' : opts.prefix, _fn);
137
140
  opts.logHandler(`${''}(${handler.type})${''}${targetPath}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moostjs/event-wf",
3
- "version": "0.5.12",
3
+ "version": "0.5.15",
4
4
  "description": "@moostjs/event-wf",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -37,10 +37,10 @@
37
37
  },
38
38
  "peerDependencies": {},
39
39
  "dependencies": {
40
- "moost": "0.5.12",
41
- "wooks": "^0.5.19",
42
- "@wooksjs/event-core": "^0.5.19",
43
- "@wooksjs/event-wf": "^0.5.19",
40
+ "moost": "0.5.15",
41
+ "wooks": "^0.5.20",
42
+ "@wooksjs/event-core": "^0.5.20",
43
+ "@wooksjs/event-wf": "^0.5.20",
44
44
  "@prostojs/infact": "^0.3.0",
45
45
  "@prostojs/mate": "^0.3.3",
46
46
  "@prostojs/wf": "^0.0.18"