@moostjs/event-wf 0.7.4 → 0.7.5

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
@@ -150,6 +150,7 @@ const LOGGER_TITLE = "moost-wf";
150
150
  }
151
151
  onInit(moost$1) {
152
152
  this.moost = moost$1;
153
+ (0, moost.claimWooks)(moost$1, this.wfApp.getWooks(), this.name, { created: this.createdApp });
153
154
  this.toInit.forEach((fn) => {
154
155
  fn();
155
156
  });
@@ -293,12 +294,14 @@ const LOGGER_TITLE = "moost-wf";
293
294
  _define_property(this, "debug", void 0);
294
295
  _define_property(this, "name", void 0);
295
296
  _define_property(this, "wfApp", void 0);
297
+ /** No `WooksWf` was passed in: the one created routes through the global Wooks. */ _define_property(this, "createdApp", void 0);
296
298
  _define_property(this, "moost", void 0);
297
299
  _define_property(this, "toInit", void 0);
298
300
  this.opts = opts;
299
301
  this.debug = debug;
300
302
  this.name = "workflow";
301
303
  this.toInit = [];
304
+ this.createdApp = !(opts instanceof _wooksjs_event_wf.WooksWf);
302
305
  if (opts && opts instanceof _wooksjs_event_wf.WooksWf) this.wfApp = opts;
303
306
  else if (opts) this.wfApp = (0, _wooksjs_event_wf.createWfApp)(opts);
304
307
  else this.wfApp = (0, _wooksjs_event_wf.createWfApp)();
package/dist/index.d.ts CHANGED
@@ -101,6 +101,8 @@ declare class MoostWf<T = any, IR = any> implements TMoostAdapter<TWfHandlerMeta
101
101
  static readonly [MOOST_ADAPTER_BRAND] = "@moostjs/event-wf/MoostWf";
102
102
  readonly name = "workflow";
103
103
  protected wfApp: WooksWf<T, IR>;
104
+ /** No `WooksWf` was passed in: the one created routes through the global Wooks. */
105
+ private readonly createdApp;
104
106
  constructor(opts?: (WooksWf<T, IR> | TWooksWfOptions) | undefined, debug?: boolean | undefined);
105
107
  onNotFound(): Promise<unknown>;
106
108
  protected moost?: Moost;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WF_TRIGGER_ERRORS, WooksWf, createEmailOutlet, createHttpOutlet, createOutletHandler, createWfApp, handleWfOutletRequest, handleWfOutletRequest as handleWfOutletRequest$1, mintWfToken, mintWfToken as mintWfToken$1, normalizeWfId, swapStrategy, useWfFinished, useWfOutlet, useWfState, useWfState as useWfState$1, useWfStrategy, wfKind } from "@wooksjs/event-wf";
2
- import { MOOST_ADAPTER_BRAND, Resolve, defineMoostEventHandler, getMoostInfact, getMoostMate, setControllerContext, useScopeId } from "moost";
2
+ import { MOOST_ADAPTER_BRAND, Resolve, claimWooks, defineMoostEventHandler, getMoostInfact, getMoostMate, setControllerContext, useScopeId } from "moost";
3
3
  import { StepRetriableError } from "@prostojs/wf";
4
4
  import { EncapsulatedStateStrategy, HandleStateStrategy, WfStateStoreMemory, hashWfHandle, outlet, outletEmail, outletHttp } from "@prostojs/wf/outlets";
5
5
 
@@ -149,6 +149,7 @@ const LOGGER_TITLE = "moost-wf";
149
149
  }
150
150
  onInit(moost) {
151
151
  this.moost = moost;
152
+ claimWooks(moost, this.wfApp.getWooks(), this.name, { created: this.createdApp });
152
153
  this.toInit.forEach((fn) => {
153
154
  fn();
154
155
  });
@@ -292,12 +293,14 @@ const LOGGER_TITLE = "moost-wf";
292
293
  _define_property(this, "debug", void 0);
293
294
  _define_property(this, "name", void 0);
294
295
  _define_property(this, "wfApp", void 0);
296
+ /** No `WooksWf` was passed in: the one created routes through the global Wooks. */ _define_property(this, "createdApp", void 0);
295
297
  _define_property(this, "moost", void 0);
296
298
  _define_property(this, "toInit", void 0);
297
299
  this.opts = opts;
298
300
  this.debug = debug;
299
301
  this.name = "workflow";
300
302
  this.toInit = [];
303
+ this.createdApp = !(opts instanceof WooksWf);
301
304
  if (opts && opts instanceof WooksWf) this.wfApp = opts;
302
305
  else if (opts) this.wfApp = createWfApp(opts);
303
306
  else this.wfApp = createWfApp();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moostjs/event-wf",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "@moostjs/event-wf",
5
5
  "keywords": [
6
6
  "composables",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@prostojs/wf": "^0.3.0",
42
- "@wooksjs/event-wf": "^0.8.1"
42
+ "@wooksjs/event-wf": "^0.8.2"
43
43
  },
44
44
  "devDependencies": {
45
45
  "vitest": "4.1.12"
@@ -47,9 +47,9 @@
47
47
  "peerDependencies": {
48
48
  "@prostojs/infact": "^0.6.1",
49
49
  "@prostojs/mate": "^0.5.1",
50
- "@wooksjs/event-core": "^0.8.1",
51
- "wooks": "^0.8.1",
52
- "moost": "^0.7.4"
50
+ "@wooksjs/event-core": "^0.8.2",
51
+ "wooks": "^0.8.2",
52
+ "moost": "^0.7.5"
53
53
  },
54
54
  "scripts": {
55
55
  "pub": "pnpm publish --access public",