@moostjs/event-wf 0.6.22 → 0.6.24

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
@@ -232,12 +232,17 @@ const CONTEXT_TYPE = "WF";
232
232
  if (stepTTL !== void 0) {
233
233
  const wrapped = stepHandler;
234
234
  stepHandler = async () => {
235
- const result = await wrapped();
236
- if (result && typeof result === "object" && "inputRequired" in result) return {
237
- ...result,
238
- expires: Date.now() + stepTTL
239
- };
240
- return result;
235
+ try {
236
+ const result = await wrapped();
237
+ if (result && typeof result === "object" && "inputRequired" in result) return {
238
+ ...result,
239
+ expires: Date.now() + stepTTL
240
+ };
241
+ return result;
242
+ } catch (error) {
243
+ if (error && typeof error === "object" && "inputRequired" in error && error.expires === void 0) error.expires = Date.now() + stepTTL;
244
+ throw error;
245
+ }
241
246
  };
242
247
  }
243
248
  this.wfApp.step(targetPath, { handler: stepHandler });
package/dist/index.mjs CHANGED
@@ -231,12 +231,17 @@ const CONTEXT_TYPE = "WF";
231
231
  if (stepTTL !== void 0) {
232
232
  const wrapped = stepHandler;
233
233
  stepHandler = async () => {
234
- const result = await wrapped();
235
- if (result && typeof result === "object" && "inputRequired" in result) return {
236
- ...result,
237
- expires: Date.now() + stepTTL
238
- };
239
- return result;
234
+ try {
235
+ const result = await wrapped();
236
+ if (result && typeof result === "object" && "inputRequired" in result) return {
237
+ ...result,
238
+ expires: Date.now() + stepTTL
239
+ };
240
+ return result;
241
+ } catch (error) {
242
+ if (error && typeof error === "object" && "inputRequired" in error && error.expires === void 0) error.expires = Date.now() + stepTTL;
243
+ throw error;
244
+ }
240
245
  };
241
246
  }
242
247
  this.wfApp.step(targetPath, { handler: stepHandler });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moostjs/event-wf",
3
- "version": "0.6.22",
3
+ "version": "0.6.24",
4
4
  "description": "@moostjs/event-wf",
5
5
  "keywords": [
6
6
  "composables",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@prostojs/wf": "^0.2.1",
42
- "@wooksjs/event-wf": "^0.7.16"
42
+ "@wooksjs/event-wf": "^0.7.17"
43
43
  },
44
44
  "devDependencies": {
45
45
  "vitest": "3.2.4"
@@ -47,9 +47,9 @@
47
47
  "peerDependencies": {
48
48
  "@prostojs/infact": "^0.4.1",
49
49
  "@prostojs/mate": "^0.4.0",
50
- "@wooksjs/event-core": "^0.7.16",
51
- "wooks": "^0.7.16",
52
- "moost": "^0.6.22"
50
+ "@wooksjs/event-core": "^0.7.17",
51
+ "wooks": "^0.7.17",
52
+ "moost": "^0.6.24"
53
53
  },
54
54
  "scripts": {
55
55
  "pub": "pnpm publish --access public",