@moostjs/event-wf 0.3.11 → 0.3.12
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 +1 -1
- package/dist/index.d.ts +48 -70
- package/dist/index.mjs +1 -1
- package/package.json +6 -5
package/dist/index.cjs
CHANGED
|
@@ -75,7 +75,7 @@ class MoostWf {
|
|
|
75
75
|
: typeof opts.method === 'string'
|
|
76
76
|
? opts.method
|
|
77
77
|
: '';
|
|
78
|
-
const targetPath = `${opts.prefix || ''}/${path}`.replace(/\/\/+/g, '/') + `${path.endsWith('//') ? '/' : ''}`;
|
|
78
|
+
const targetPath = `${opts.prefix || ''}/${path}`.replace(/\/\/+/g, '/') + `${path.endsWith('//') ? '/' : ''}`;
|
|
79
79
|
if (!fn) {
|
|
80
80
|
fn = moost.defineMoostEventHandler({
|
|
81
81
|
contextType: CONTEXT_TYPE,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,70 +1,48 @@
|
|
|
1
|
-
import { Moost } from 'moost';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { TWorkflowSchema }
|
|
51
|
-
|
|
52
|
-
export { useWFContext }
|
|
53
|
-
|
|
54
|
-
export declare const WfCtx: (name?: string) => ParameterDecorator & PropertyDecorator;
|
|
55
|
-
|
|
56
|
-
export declare const WfIndexes: () => ParameterDecorator & PropertyDecorator;
|
|
57
|
-
|
|
58
|
-
export declare const WfInput: (name?: string) => ParameterDecorator & PropertyDecorator;
|
|
59
|
-
|
|
60
|
-
export declare function WFlow(path?: string): MethodDecorator;
|
|
61
|
-
|
|
62
|
-
export declare const WfResume: () => ParameterDecorator & PropertyDecorator;
|
|
63
|
-
|
|
64
|
-
export declare const WfSchemaId: () => ParameterDecorator & PropertyDecorator;
|
|
65
|
-
|
|
66
|
-
export declare function WSchema<T>(schema: TWorkflowSchema<T>): MethodDecorator;
|
|
67
|
-
|
|
68
|
-
export declare function WStep(path?: string): MethodDecorator;
|
|
69
|
-
|
|
70
|
-
export { }
|
|
1
|
+
import { TMoostAdapter, Moost, TMoostAdapterOptions } from 'moost';
|
|
2
|
+
import { WooksWf, TWooksWfOptions } from '@wooksjs/event-wf';
|
|
3
|
+
export { useWFContext } from '@wooksjs/event-wf';
|
|
4
|
+
import { TWorkflowSpy, TFlowOutput, TWorkflowSchema } from '@prostojs/wf';
|
|
5
|
+
export { StepRetriableError, TFlowOutput, TWorkflowSchema } from '@prostojs/wf';
|
|
6
|
+
|
|
7
|
+
interface TWfHandlerMeta {
|
|
8
|
+
path: string;
|
|
9
|
+
}
|
|
10
|
+
interface TMoostWfOpts<T> {
|
|
11
|
+
/**
|
|
12
|
+
* wooksWf options or instance
|
|
13
|
+
*/
|
|
14
|
+
wooksWf?: WooksWf<T> | TWooksWfOptions;
|
|
15
|
+
/**
|
|
16
|
+
* more internal logs are printed when true
|
|
17
|
+
*/
|
|
18
|
+
debug?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare class MoostWf<T> implements TMoostAdapter<TWfHandlerMeta> {
|
|
21
|
+
protected opts?: TMoostWfOpts<T> | undefined;
|
|
22
|
+
protected wfApp: WooksWf<T>;
|
|
23
|
+
constructor(opts?: TMoostWfOpts<T> | undefined);
|
|
24
|
+
onNotFound(): Promise<unknown>;
|
|
25
|
+
protected moost?: Moost;
|
|
26
|
+
protected toInit: (() => void)[];
|
|
27
|
+
onInit(moost: Moost): void;
|
|
28
|
+
getWfApp(): WooksWf<T>;
|
|
29
|
+
attachSpy<I>(fn: TWorkflowSpy<T, I>): () => void;
|
|
30
|
+
detachSpy<I>(fn: TWorkflowSpy<T, I>): void;
|
|
31
|
+
start<I>(schemaId: string, initialContext: T, input?: I): Promise<TFlowOutput<T, I>>;
|
|
32
|
+
resume<I>(schemaId: string, state: {
|
|
33
|
+
context: T;
|
|
34
|
+
indexes: number[];
|
|
35
|
+
}, input?: I): Promise<TFlowOutput<T, I>>;
|
|
36
|
+
bindHandler<T extends object = object>(opts: TMoostAdapterOptions<TWfHandlerMeta, T>): void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare function WStep(path?: string): MethodDecorator;
|
|
40
|
+
declare function WFlow(path?: string): MethodDecorator;
|
|
41
|
+
declare function WSchema<T>(schema: TWorkflowSchema<T>): MethodDecorator;
|
|
42
|
+
declare const WfCtx: (name?: string) => ParameterDecorator & PropertyDecorator;
|
|
43
|
+
declare const WfResume: () => ParameterDecorator & PropertyDecorator;
|
|
44
|
+
declare const WfIndexes: () => ParameterDecorator & PropertyDecorator;
|
|
45
|
+
declare const WfSchemaId: () => ParameterDecorator & PropertyDecorator;
|
|
46
|
+
declare const WfInput: (name?: string) => ParameterDecorator & PropertyDecorator;
|
|
47
|
+
|
|
48
|
+
export { MoostWf, type TMoostWfOpts, type TWfHandlerMeta, WFlow, WSchema, WStep, WfCtx, WfIndexes, WfInput, WfResume, WfSchemaId };
|
package/dist/index.mjs
CHANGED
|
@@ -74,7 +74,7 @@ class MoostWf {
|
|
|
74
74
|
: typeof opts.method === 'string'
|
|
75
75
|
? opts.method
|
|
76
76
|
: '';
|
|
77
|
-
const targetPath = `${opts.prefix || ''}/${path}`.replace(/\/\/+/g, '/') + `${path.endsWith('//') ? '/' : ''}`;
|
|
77
|
+
const targetPath = `${opts.prefix || ''}/${path}`.replace(/\/\/+/g, '/') + `${path.endsWith('//') ? '/' : ''}`;
|
|
78
78
|
if (!fn) {
|
|
79
79
|
fn = defineMoostEventHandler({
|
|
80
80
|
contextType: CONTEXT_TYPE,
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moostjs/event-wf",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"description": "@moostjs/event-wf",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"exports": {
|
|
10
|
+
"./package.json": "./package.json",
|
|
10
11
|
".": {
|
|
11
12
|
"import": "./dist/index.mjs",
|
|
12
13
|
"require": "./dist/index.cjs",
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"moost": "0.3.
|
|
40
|
-
"wooks": "^0.4.
|
|
41
|
-
"@wooksjs/event-core": "^0.4.
|
|
42
|
-
"@wooksjs/event-wf": "^0.4.
|
|
40
|
+
"moost": "0.3.12",
|
|
41
|
+
"wooks": "^0.4.13",
|
|
42
|
+
"@wooksjs/event-core": "^0.4.13",
|
|
43
|
+
"@wooksjs/event-wf": "^0.4.13",
|
|
43
44
|
"@prostojs/infact": "^0.1.13",
|
|
44
45
|
"@prostojs/mate": "^0.2.1",
|
|
45
46
|
"@prostojs/wf": "^0.0.10"
|