@wooksjs/event-wf 0.5.13 → 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/README.md CHANGED
@@ -70,7 +70,7 @@ app.start('adding', { result: 0 })
70
70
 
71
71
  ## Documentation
72
72
 
73
- For more detailed documentation, please visit [wooks.moost.org](https://wooks.moost.org/wfapp/).
73
+ For more detailed documentation, please visit [wooks.moost.org](https://wooks.moost.org/wf/).
74
74
 
75
75
  ## Contributing
76
76
 
package/dist/index.cjs CHANGED
@@ -111,7 +111,7 @@ class WooksWf extends wooks.WooksAdapterBase {
111
111
  input,
112
112
  }, this.mergeEventOptions(this.opts?.eventOptions));
113
113
  return runInContext(async () => {
114
- const { handlers: foundHandlers } = this.wooks.lookup('WF_FLOW', `/${schemaId}`);
114
+ const { handlers: foundHandlers } = this.wooks.lookup('WF_FLOW', `/${schemaId}`.replace(/^\/+/, '/'));
115
115
  const handlers = foundHandlers || (this.opts?.onNotFound && [this.opts.onNotFound]) || null;
116
116
  if (handlers && handlers.length > 0) {
117
117
  let result = {};
@@ -147,6 +147,9 @@ class WooksWf extends wooks.WooksAdapterBase {
147
147
  throw error;
148
148
  }
149
149
  clean();
150
+ if (result.resume) {
151
+ result.resume = (_input) => this.resume(result.state, _input, spy, cleanup);
152
+ }
150
153
  return result;
151
154
  }
152
155
  clean();
package/dist/index.mjs CHANGED
@@ -109,7 +109,7 @@ class WooksWf extends WooksAdapterBase {
109
109
  input,
110
110
  }, this.mergeEventOptions(this.opts?.eventOptions));
111
111
  return runInContext(async () => {
112
- const { handlers: foundHandlers } = this.wooks.lookup('WF_FLOW', `/${schemaId}`);
112
+ const { handlers: foundHandlers } = this.wooks.lookup('WF_FLOW', `/${schemaId}`.replace(/^\/+/, '/'));
113
113
  const handlers = foundHandlers || (this.opts?.onNotFound && [this.opts.onNotFound]) || null;
114
114
  if (handlers && handlers.length > 0) {
115
115
  let result = {};
@@ -145,6 +145,9 @@ class WooksWf extends WooksAdapterBase {
145
145
  throw error;
146
146
  }
147
147
  clean();
148
+ if (result.resume) {
149
+ result.resume = (_input) => this.resume(result.state, _input, spy, cleanup);
150
+ }
148
151
  return result;
149
152
  }
150
153
  clean();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wooksjs/event-wf",
3
- "version": "0.5.13",
3
+ "version": "0.5.15",
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.5.13",
37
- "@wooksjs/event-core": "0.5.13"
36
+ "wooks": "0.5.15",
37
+ "@wooksjs/event-core": "0.5.15"
38
38
  },
39
39
  "dependencies": {
40
40
  "@prostojs/logger": "^0.4.0",