@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 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('//') ? '/' : ''}`; // explicit double slash "//" -> force url to end with slash
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 { StepRetriableError } from '@prostojs/wf';
3
- import { TFlowOutput } from '@prostojs/wf';
4
- import { TMoostAdapter } from 'moost';
5
- import { TMoostAdapterOptions } from 'moost';
6
- import { TWooksWfOptions } from '@wooksjs/event-wf';
7
- import { TWorkflowSchema } from '@prostojs/wf';
8
- import { TWorkflowSpy } from '@prostojs/wf';
9
- import { useWFContext } from '@wooksjs/event-wf';
10
- import { WooksWf } from '@wooksjs/event-wf';
11
-
12
- export declare class MoostWf<T> implements TMoostAdapter<TWfHandlerMeta> {
13
- protected opts?: TMoostWfOpts<T> | undefined;
14
- protected wfApp: WooksWf<T>;
15
- constructor(opts?: TMoostWfOpts<T> | undefined);
16
- onNotFound(): Promise<unknown>;
17
- protected moost?: Moost;
18
- protected toInit: (() => void)[];
19
- onInit(moost: Moost): void;
20
- getWfApp(): WooksWf<T>;
21
- attachSpy<I>(fn: TWorkflowSpy<T, I>): () => void;
22
- detachSpy<I>(fn: TWorkflowSpy<T, I>): void;
23
- start<I>(schemaId: string, initialContext: T, input?: I): Promise<TFlowOutput<T, I>>;
24
- resume<I>(schemaId: string, state: {
25
- context: T;
26
- indexes: number[];
27
- }, input?: I): Promise<TFlowOutput<T, I>>;
28
- bindHandler<T extends object = object>(opts: TMoostAdapterOptions<TWfHandlerMeta, T>): void;
29
- }
30
-
31
- export { StepRetriableError }
32
-
33
- export { TFlowOutput }
34
-
35
- export declare interface TMoostWfOpts<T> {
36
- /**
37
- * wooksWf options or instance
38
- */
39
- wooksWf?: WooksWf<T> | TWooksWfOptions;
40
- /**
41
- * more internal logs are printed when true
42
- */
43
- debug?: boolean;
44
- }
45
-
46
- export declare interface TWfHandlerMeta {
47
- path: string;
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('//') ? '/' : ''}`; // explicit double slash "//" -> force url to end with slash
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.11",
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.11",
40
- "wooks": "^0.4.11",
41
- "@wooksjs/event-core": "^0.4.11",
42
- "@wooksjs/event-wf": "^0.4.11",
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"