@moostjs/event-wf 0.3.20 → 0.3.22
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 +16 -22
- package/dist/index.d.ts +5 -9
- package/dist/index.mjs +13 -15
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -110,26 +110,24 @@ class MoostWf {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
function
|
|
113
|
+
function Step(path) {
|
|
114
114
|
return getWfMate().decorate('handlers', { path, type: 'WF_STEP' }, true);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Workflow(path) {
|
|
117
117
|
return getWfMate().decorate('handlers', { path, type: 'WF_FLOW' }, true);
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function WorkflowSchema(schema) {
|
|
120
120
|
return getWfMate().decorate('wfSchema', schema);
|
|
121
121
|
}
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return typeof i !== 'undefined' ? (name ? i[name] : i) : undefined;
|
|
132
|
-
}, name || 'WfInput');
|
|
122
|
+
const WorkflowParam = (name) => {
|
|
123
|
+
switch (name) {
|
|
124
|
+
case 'resume': return moost.Resolve(() => eventWf.useWfState().resume, 'Workflow-Resume');
|
|
125
|
+
case 'indexes': return moost.Resolve(() => eventWf.useWfState().indexes, 'Workflow-Indexes');
|
|
126
|
+
case 'schemaId': return moost.Resolve(() => eventWf.useWfState().schemaId, 'Workflow-SchemaId');
|
|
127
|
+
case 'context': return moost.Resolve(() => eventWf.useWfState().ctx(), 'Workflow-Context');
|
|
128
|
+
case 'input': return moost.Resolve(() => eventWf.useWfState().input(), 'Workflow-Input');
|
|
129
|
+
}
|
|
130
|
+
};
|
|
133
131
|
|
|
134
132
|
Object.defineProperty(exports, "useWFContext", {
|
|
135
133
|
enumerable: true,
|
|
@@ -144,11 +142,7 @@ Object.defineProperty(exports, "StepRetriableError", {
|
|
|
144
142
|
get: function () { return wf.StepRetriableError; }
|
|
145
143
|
});
|
|
146
144
|
exports.MoostWf = MoostWf;
|
|
147
|
-
exports.
|
|
148
|
-
exports.
|
|
149
|
-
exports.
|
|
150
|
-
exports.
|
|
151
|
-
exports.WfIndexes = WfIndexes;
|
|
152
|
-
exports.WfInput = WfInput;
|
|
153
|
-
exports.WfResume = WfResume;
|
|
154
|
-
exports.WfSchemaId = WfSchemaId;
|
|
145
|
+
exports.Step = Step;
|
|
146
|
+
exports.Workflow = Workflow;
|
|
147
|
+
exports.WorkflowParam = WorkflowParam;
|
|
148
|
+
exports.WorkflowSchema = WorkflowSchema;
|
package/dist/index.d.ts
CHANGED
|
@@ -28,13 +28,9 @@ declare class MoostWf<T = any, IR = any> implements TMoostAdapter<TWfHandlerMeta
|
|
|
28
28
|
bindHandler<T extends object = object>(opts: TMoostAdapterOptions<TWfHandlerMeta, T>): void;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
declare function
|
|
32
|
-
declare function
|
|
33
|
-
declare function
|
|
34
|
-
declare const
|
|
35
|
-
declare const WfResume: () => ParameterDecorator & PropertyDecorator;
|
|
36
|
-
declare const WfIndexes: () => ParameterDecorator & PropertyDecorator;
|
|
37
|
-
declare const WfSchemaId: () => ParameterDecorator & PropertyDecorator;
|
|
38
|
-
declare const WfInput: (name?: string) => ParameterDecorator & PropertyDecorator;
|
|
31
|
+
declare function Step(path?: string): MethodDecorator;
|
|
32
|
+
declare function Workflow(path?: string): MethodDecorator;
|
|
33
|
+
declare function WorkflowSchema<T>(schema: TWorkflowSchema<T>): MethodDecorator;
|
|
34
|
+
declare const WorkflowParam: (name: 'resume' | 'indexes' | 'schemaId' | 'context' | 'input') => ParameterDecorator & PropertyDecorator;
|
|
39
35
|
|
|
40
|
-
export { MoostWf, type TWfHandlerMeta,
|
|
36
|
+
export { MoostWf, Step, type TWfHandlerMeta, Workflow, WorkflowParam, WorkflowSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -109,25 +109,23 @@ class MoostWf {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
function
|
|
112
|
+
function Step(path) {
|
|
113
113
|
return getWfMate().decorate('handlers', { path, type: 'WF_STEP' }, true);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Workflow(path) {
|
|
116
116
|
return getWfMate().decorate('handlers', { path, type: 'WF_FLOW' }, true);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function WorkflowSchema(schema) {
|
|
119
119
|
return getWfMate().decorate('wfSchema', schema);
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return typeof i !== 'undefined' ? (name ? i[name] : i) : undefined;
|
|
131
|
-
}, name || 'WfInput');
|
|
121
|
+
const WorkflowParam = (name) => {
|
|
122
|
+
switch (name) {
|
|
123
|
+
case 'resume': return Resolve(() => useWfState().resume, 'Workflow-Resume');
|
|
124
|
+
case 'indexes': return Resolve(() => useWfState().indexes, 'Workflow-Indexes');
|
|
125
|
+
case 'schemaId': return Resolve(() => useWfState().schemaId, 'Workflow-SchemaId');
|
|
126
|
+
case 'context': return Resolve(() => useWfState().ctx(), 'Workflow-Context');
|
|
127
|
+
case 'input': return Resolve(() => useWfState().input(), 'Workflow-Input');
|
|
128
|
+
}
|
|
129
|
+
};
|
|
132
130
|
|
|
133
|
-
export { MoostWf,
|
|
131
|
+
export { MoostWf, Step, Workflow, WorkflowParam, WorkflowSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moostjs/event-wf",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.22",
|
|
4
4
|
"description": "@moostjs/event-wf",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"moost": "0.3.
|
|
41
|
-
"wooks": "^0.4.
|
|
42
|
-
"@wooksjs/event-core": "^0.4.
|
|
43
|
-
"@wooksjs/event-wf": "^0.4.
|
|
40
|
+
"moost": "0.3.22",
|
|
41
|
+
"wooks": "^0.4.24",
|
|
42
|
+
"@wooksjs/event-core": "^0.4.24",
|
|
43
|
+
"@wooksjs/event-wf": "^0.4.24",
|
|
44
44
|
"@prostojs/infact": "^0.1.13",
|
|
45
45
|
"@prostojs/mate": "^0.2.1",
|
|
46
|
-
"@prostojs/wf": "^0.0.
|
|
46
|
+
"@prostojs/wf": "^0.0.17"
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/moostjs/moostjs/tree/main/packages/event-wf#readme"
|
|
49
49
|
}
|