@wooksjs/event-wf 0.4.14 → 0.4.16
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 +5 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +5 -4
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -34,16 +34,17 @@ class WooksWorkflow extends wf.Workflow {
|
|
|
34
34
|
this.wooks = wooks;
|
|
35
35
|
}
|
|
36
36
|
resolveStep(stepId) {
|
|
37
|
+
const stepIdNorm = stepId[0] === '/' ? stepId : '/' + stepId;
|
|
37
38
|
try {
|
|
38
39
|
useWFContext();
|
|
39
|
-
const found = this.wooks.lookup('WF_STEP',
|
|
40
|
+
const found = this.wooks.lookup('WF_STEP', stepIdNorm);
|
|
40
41
|
if (found?.handlers?.length) {
|
|
41
42
|
return found.handlers[0]();
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
catch (e) {
|
|
45
46
|
const router = this.wooks.getRouter();
|
|
46
|
-
const found = router.lookup('WF_STEP',
|
|
47
|
+
const found = router.lookup('WF_STEP', stepIdNorm);
|
|
47
48
|
if (found?.route?.handlers?.length) {
|
|
48
49
|
return found.route.handlers[0]();
|
|
49
50
|
}
|
|
@@ -73,8 +74,8 @@ class WooksWf extends wooks.WooksAdapterBase {
|
|
|
73
74
|
const step = wf.createStep(id, opts);
|
|
74
75
|
return this.on('WF_STEP', id, () => step);
|
|
75
76
|
}
|
|
76
|
-
flow(id, schema, init) {
|
|
77
|
-
this.wf.register(id, schema);
|
|
77
|
+
flow(id, schema, prefix, init) {
|
|
78
|
+
this.wf.register(id, schema, prefix);
|
|
78
79
|
return this.on('WF_FLOW', id, () => ({ init, id }));
|
|
79
80
|
}
|
|
80
81
|
start(schemaId, inputContext, input, spy, cleanup) {
|
package/dist/index.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ declare class WooksWf<T> extends WooksAdapterBase {
|
|
|
115
115
|
input?: D;
|
|
116
116
|
handler: string | TStepHandler<T, I, D>;
|
|
117
117
|
}): _prostojs_router.TProstoRouterPathHandle<Record<string, string | string[]>>;
|
|
118
|
-
flow(id: string, schema: TWorkflowSchema<T>, init?: () => void | Promise<void>): _prostojs_router.TProstoRouterPathHandle<Record<string, string | string[]>>;
|
|
118
|
+
flow(id: string, schema: TWorkflowSchema<T>, prefix?: string, init?: () => void | Promise<void>): _prostojs_router.TProstoRouterPathHandle<Record<string, string | string[]>>;
|
|
119
119
|
start<I>(schemaId: string, inputContext: T, input?: I, spy?: TWorkflowSpy<T, I>, cleanup?: () => void): Promise<TFlowOutput<T, I>>;
|
|
120
120
|
resume<I>(schemaId: string, state: {
|
|
121
121
|
indexes: number[];
|
package/dist/index.mjs
CHANGED
|
@@ -32,16 +32,17 @@ class WooksWorkflow extends Workflow {
|
|
|
32
32
|
this.wooks = wooks;
|
|
33
33
|
}
|
|
34
34
|
resolveStep(stepId) {
|
|
35
|
+
const stepIdNorm = stepId[0] === '/' ? stepId : '/' + stepId;
|
|
35
36
|
try {
|
|
36
37
|
useWFContext();
|
|
37
|
-
const found = this.wooks.lookup('WF_STEP',
|
|
38
|
+
const found = this.wooks.lookup('WF_STEP', stepIdNorm);
|
|
38
39
|
if (found?.handlers?.length) {
|
|
39
40
|
return found.handlers[0]();
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
catch (e) {
|
|
43
44
|
const router = this.wooks.getRouter();
|
|
44
|
-
const found = router.lookup('WF_STEP',
|
|
45
|
+
const found = router.lookup('WF_STEP', stepIdNorm);
|
|
45
46
|
if (found?.route?.handlers?.length) {
|
|
46
47
|
return found.route.handlers[0]();
|
|
47
48
|
}
|
|
@@ -71,8 +72,8 @@ class WooksWf extends WooksAdapterBase {
|
|
|
71
72
|
const step = createStep(id, opts);
|
|
72
73
|
return this.on('WF_STEP', id, () => step);
|
|
73
74
|
}
|
|
74
|
-
flow(id, schema, init) {
|
|
75
|
-
this.wf.register(id, schema);
|
|
75
|
+
flow(id, schema, prefix, init) {
|
|
76
|
+
this.wf.register(id, schema, prefix);
|
|
76
77
|
return this.on('WF_FLOW', id, () => ({ init, id }));
|
|
77
78
|
}
|
|
78
79
|
start(schemaId, inputContext, input, spy, cleanup) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wooksjs/event-wf",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"description": "@wooksjs/event-wf",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"author": "Artem Maltsev",
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"wooks": "0.4.
|
|
37
|
-
"@wooksjs/event-core": "0.4.
|
|
36
|
+
"wooks": "0.4.16",
|
|
37
|
+
"@wooksjs/event-core": "0.4.16"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@prostojs/logger": "^0.4.0",
|
|
41
|
-
"@prostojs/wf": "^0.0.
|
|
41
|
+
"@prostojs/wf": "^0.0.12"
|
|
42
42
|
},
|
|
43
43
|
"bugs": {
|
|
44
44
|
"url": "https://github.com/wooksjs/wooksjs/issues"
|