@genesislcap/foundation-state-machine 15.15.2-FUI-2564.1 → 15.15.2-FUI-2603.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/core/actions.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ;;;;;;;CAYnB,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM;;;;;;;CAgBrC,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;CAA2C,CAAC"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/core/actions.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ;;;;;;;CAYnB,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM;;;;;;;CAkBrC,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;CAA2C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/core/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAI9C;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAC/B,KAAK,MAAM,EACX,cAAc,MAAM,EACpB,QAAO,OAAc,KACpB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CA4BpC,CAAC"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/core/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAG9C;;;;;;;GAOG;AACH,eAAO,MA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AGG;AACH,eAAO,MAAM,YAAY,oEAExB,CAAC"}
1
+ {"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../../src/machines/fetch/machine.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,OAAO,EACL,eAAe,EAOf,OAAO,EAER,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAEjB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAGjB;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,OAAO,EAAE,OAAO,KAAK,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3C;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;OAEG;IACH,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CAC/C;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,mEAAoC,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,OAAO,CAAC,mBAAmB,EAAE,iBAAiB,CAAC;CAAG;AAExF;;;GAGG;AACH,qBAAa,mBACX,SAAQ,eAAe,CAAC,mBAAmB,EAAE,iBAAiB,CAC9D,YAAW,YAAY;IAEY,OAAO,CAAC,MAAM;gBAAN,MAAM,cAAqB;IAwLtE,kCAAkC;IAClC,KAAK,CACH,OAAO,GAAE,kBAAkB,CAAC,OAAO,IAAI,CAAC,OAAO,CAE9C;IAKH,6CAA6C;IAC7C,gBAAgB,IAAI,IAAI;CAGzB;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,oEAExB,CAAC"}
@@ -36,13 +36,15 @@ export const setError = assign(({ event }) => {
36
36
  */
37
37
  export const setErrorByKey = (key) => assign(({ context, event }) => {
38
38
  var _a;
39
- let error;
40
- if (isErrorEvent(event)) {
41
- error = event.data;
42
- }
43
- else if (isDoneInvokeEvent(event)) {
44
- logger.debug(`setErrorByKey action called with non error event type.`, event);
45
- error = event.output instanceof Error ? event.output : context.error;
39
+ let error = context.error;
40
+ if (!error) {
41
+ if (isErrorEvent(event)) {
42
+ error = event.data;
43
+ }
44
+ else if (isDoneInvokeEvent(event)) {
45
+ logger.debug(`setErrorByKey action called with non error event type.`, event);
46
+ error = event.output instanceof Error ? event.output : undefined;
47
+ }
46
48
  }
47
49
  if (error) {
48
50
  const errors = (_a = context.errors) !== null && _a !== void 0 ? _a : createErrorMap(logger.error);
@@ -1,4 +1,4 @@
1
- import { escalateError, setErrorByKey } from './actions';
1
+ import { setErrorByKey } from './actions';
2
2
  /**
3
3
  * Creates an error state node.
4
4
  *
@@ -8,29 +8,15 @@ import { escalateError, setErrorByKey } from './actions';
8
8
  * @public
9
9
  */
10
10
  export const createErrorStateNode = (key, metaContent, final = true) => {
11
- /**
12
- * Raised question on reuse and dynamic parent detection, regarding error escalation.
13
- * https://github.com/statelyai/xstate/discussions/4268
14
- */
15
- let hasParentMachine = false;
16
- let sentToParentMachine = false;
17
11
  return {
18
12
  tags: ['error', key],
19
13
  meta: {
20
14
  content: metaContent ? metaContent : `${key} error.`,
21
15
  },
22
- entry: [
23
- setErrorByKey(`${key}-error`),
24
- (args) => (hasParentMachine = args.self._parent !== undefined),
25
- ],
26
- always: [
27
- {
28
- guard: () => hasParentMachine && !sentToParentMachine,
29
- actions: [escalateError, () => (sentToParentMachine = true)],
30
- },
31
- ],
16
+ entry: [setErrorByKey(`${key}-error`)],
32
17
  /**
33
18
  * Provide final output to parent machines.
19
+ * Notification of invoked parents is via this output / top-level `failed`, not escalate closures.
34
20
  */
35
21
  type: final ? 'final' : 'atomic',
36
22
  output: ({ context }) => context.error,
@@ -92,6 +92,12 @@ let DefaultFetchMachine = class DefaultFetchMachine extends AbstractMachine {
92
92
  abort: createErrorStateNode('abort', 'Abort error.'),
93
93
  syntax: createErrorStateNode('syntax', 'Syntax error.'),
94
94
  },
95
+ onDone: 'failed',
96
+ },
97
+ failed: {
98
+ tags: ['error'],
99
+ type: 'final',
100
+ output: ({ context }) => context.error,
95
101
  },
96
102
  },
97
103
  on: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-state-machine",
3
3
  "description": "Genesis Foundation State Machine",
4
- "version": "15.15.2-FUI-2564.1",
4
+ "version": "15.15.2-FUI-2603.8",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -54,18 +54,18 @@
54
54
  }
55
55
  },
56
56
  "devDependencies": {
57
- "@genesislcap/foundation-testing": "15.15.2-FUI-2564.1",
58
- "@genesislcap/genx": "15.15.2-FUI-2564.1",
59
- "@genesislcap/rollup-builder": "15.15.2-FUI-2564.1",
60
- "@genesislcap/ts-builder": "15.15.2-FUI-2564.1",
61
- "@genesislcap/uvu-playwright-builder": "15.15.2-FUI-2564.1",
62
- "@genesislcap/vite-builder": "15.15.2-FUI-2564.1",
63
- "@genesislcap/webpack-builder": "15.15.2-FUI-2564.1"
57
+ "@genesislcap/foundation-testing": "15.15.2-FUI-2603.8",
58
+ "@genesislcap/genx": "15.15.2-FUI-2603.8",
59
+ "@genesislcap/rollup-builder": "15.15.2-FUI-2603.8",
60
+ "@genesislcap/ts-builder": "15.15.2-FUI-2603.8",
61
+ "@genesislcap/uvu-playwright-builder": "15.15.2-FUI-2603.8",
62
+ "@genesislcap/vite-builder": "15.15.2-FUI-2603.8",
63
+ "@genesislcap/webpack-builder": "15.15.2-FUI-2603.8"
64
64
  },
65
65
  "dependencies": {
66
- "@genesislcap/foundation-comms": "15.15.2-FUI-2564.1",
67
- "@genesislcap/foundation-logger": "15.15.2-FUI-2564.1",
68
- "@genesislcap/foundation-utils": "15.15.2-FUI-2564.1",
66
+ "@genesislcap/foundation-comms": "15.15.2-FUI-2603.8",
67
+ "@genesislcap/foundation-logger": "15.15.2-FUI-2603.8",
68
+ "@genesislcap/foundation-utils": "15.15.2-FUI-2603.8",
69
69
  "@microsoft/fast-element": "1.14.0",
70
70
  "@microsoft/fast-foundation": "2.50.0",
71
71
  "cockatiel": "^3.1.1",
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "138fa84429b2d2ee038d23c3b91f3fe695737201"
83
+ "gitHead": "5a031de5ddf30696a674da64f8a7f832b7f4fc21"
84
84
  }