@wooksjs/event-wf 0.7.1 → 0.7.2
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 +10 -10
- package/dist/index.mjs +11 -11
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -74,13 +74,13 @@ const wfSeeds = (data) => ({
|
|
|
74
74
|
* composables from the parent scope (e.g. HTTP) via the parent chain.
|
|
75
75
|
*/
|
|
76
76
|
function createWfContext(data, options, parentCtx) {
|
|
77
|
-
const
|
|
77
|
+
const ctxOptions = parentCtx ? {
|
|
78
78
|
...options,
|
|
79
79
|
parent: parentCtx
|
|
80
|
-
} : options
|
|
81
|
-
return (fn) => (0, __wooksjs_event_core.
|
|
82
|
-
|
|
83
|
-
return
|
|
80
|
+
} : options;
|
|
81
|
+
return (fn) => (0, __wooksjs_event_core.createEventContext)(ctxOptions, wfKind, wfSeeds(data), () => {
|
|
82
|
+
(0, __wooksjs_event_core.current)().set(resumeKey, false);
|
|
83
|
+
return fn();
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
@@ -89,13 +89,13 @@ function createWfContext(data, options, parentCtx) {
|
|
|
89
89
|
* linked to the parent.
|
|
90
90
|
*/
|
|
91
91
|
function resumeWfContext(data, options, parentCtx) {
|
|
92
|
-
const
|
|
92
|
+
const ctxOptions = parentCtx ? {
|
|
93
93
|
...options,
|
|
94
94
|
parent: parentCtx
|
|
95
|
-
} : options
|
|
96
|
-
return (fn) => (0, __wooksjs_event_core.
|
|
97
|
-
|
|
98
|
-
return
|
|
95
|
+
} : options;
|
|
96
|
+
return (fn) => (0, __wooksjs_event_core.createEventContext)(ctxOptions, wfKind, wfSeeds(data), () => {
|
|
97
|
+
(0, __wooksjs_event_core.current)().set(resumeKey, true);
|
|
98
|
+
return fn();
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createEventContext, current, defineEventKind, key, slot, useLogger, useRouteParams } from "@wooksjs/event-core";
|
|
2
2
|
import { StepRetriableError, Workflow, createStep } from "@prostojs/wf";
|
|
3
3
|
import { WooksAdapterBase } from "wooks";
|
|
4
4
|
|
|
@@ -51,13 +51,13 @@ const wfSeeds = (data) => ({
|
|
|
51
51
|
* composables from the parent scope (e.g. HTTP) via the parent chain.
|
|
52
52
|
*/
|
|
53
53
|
function createWfContext(data, options, parentCtx) {
|
|
54
|
-
const
|
|
54
|
+
const ctxOptions = parentCtx ? {
|
|
55
55
|
...options,
|
|
56
56
|
parent: parentCtx
|
|
57
|
-
} : options
|
|
58
|
-
return (fn) =>
|
|
59
|
-
|
|
60
|
-
return
|
|
57
|
+
} : options;
|
|
58
|
+
return (fn) => createEventContext(ctxOptions, wfKind, wfSeeds(data), () => {
|
|
59
|
+
current().set(resumeKey, false);
|
|
60
|
+
return fn();
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
@@ -66,13 +66,13 @@ function createWfContext(data, options, parentCtx) {
|
|
|
66
66
|
* linked to the parent.
|
|
67
67
|
*/
|
|
68
68
|
function resumeWfContext(data, options, parentCtx) {
|
|
69
|
-
const
|
|
69
|
+
const ctxOptions = parentCtx ? {
|
|
70
70
|
...options,
|
|
71
71
|
parent: parentCtx
|
|
72
|
-
} : options
|
|
73
|
-
return (fn) =>
|
|
74
|
-
|
|
75
|
-
return
|
|
72
|
+
} : options;
|
|
73
|
+
return (fn) => createEventContext(ctxOptions, wfKind, wfSeeds(data), () => {
|
|
74
|
+
current().set(resumeKey, true);
|
|
75
|
+
return fn();
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wooksjs/event-wf",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "@wooksjs/event-wf",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"typescript": "^5.9.3",
|
|
49
49
|
"vitest": "^3.2.4",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
50
|
+
"@wooksjs/event-core": "^0.7.2",
|
|
51
|
+
"wooks": "^0.7.2"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@prostojs/logger": "^0.4.3",
|
|
55
|
-
"@wooksjs/event-core": "^0.7.
|
|
56
|
-
"wooks": "^0.7.
|
|
55
|
+
"@wooksjs/event-core": "^0.7.2",
|
|
56
|
+
"wooks": "^0.7.2"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "rolldown -c ../../rolldown.config.mjs",
|