@genesislcap/foundation-state-machine 14.70.0

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.
Files changed (173) hide show
  1. package/README.md +26 -0
  2. package/dist/dts/core/actions.d.ts +61 -0
  3. package/dist/dts/core/actions.d.ts.map +1 -0
  4. package/dist/dts/core/binding.d.ts +37 -0
  5. package/dist/dts/core/binding.d.ts.map +1 -0
  6. package/dist/dts/core/errors.d.ts +41 -0
  7. package/dist/dts/core/errors.d.ts.map +1 -0
  8. package/dist/dts/core/guards.d.ts +67 -0
  9. package/dist/dts/core/guards.d.ts.map +1 -0
  10. package/dist/dts/core/index.d.ts +8 -0
  11. package/dist/dts/core/index.d.ts.map +1 -0
  12. package/dist/dts/core/inputs.d.ts +19 -0
  13. package/dist/dts/core/inputs.d.ts.map +1 -0
  14. package/dist/dts/core/machine.d.ts +338 -0
  15. package/dist/dts/core/machine.d.ts.map +1 -0
  16. package/dist/dts/core/state.d.ts +11 -0
  17. package/dist/dts/core/state.d.ts.map +1 -0
  18. package/dist/dts/index.d.ts +4 -0
  19. package/dist/dts/index.d.ts.map +1 -0
  20. package/dist/dts/index.federated.d.ts +1 -0
  21. package/dist/dts/index.federated.d.ts.map +1 -0
  22. package/dist/dts/machines/fetch/errors.d.ts +39 -0
  23. package/dist/dts/machines/fetch/errors.d.ts.map +1 -0
  24. package/dist/dts/machines/fetch/index.d.ts +5 -0
  25. package/dist/dts/machines/fetch/index.d.ts.map +1 -0
  26. package/dist/dts/machines/fetch/machine.d.ts +57 -0
  27. package/dist/dts/machines/fetch/machine.d.ts.map +1 -0
  28. package/dist/dts/machines/fetch/policies.d.ts +25 -0
  29. package/dist/dts/machines/fetch/policies.d.ts.map +1 -0
  30. package/dist/dts/machines/fetch/types.d.ts +118 -0
  31. package/dist/dts/machines/fetch/types.d.ts.map +1 -0
  32. package/dist/dts/machines/index.d.ts +2 -0
  33. package/dist/dts/machines/index.d.ts.map +1 -0
  34. package/dist/dts/tsdoc-metadata.json +11 -0
  35. package/dist/dts/utils/index.d.ts +2 -0
  36. package/dist/dts/utils/index.d.ts.map +1 -0
  37. package/dist/dts/utils/logger.d.ts +5 -0
  38. package/dist/dts/utils/logger.d.ts.map +1 -0
  39. package/dist/esm/core/actions.js +46 -0
  40. package/dist/esm/core/binding.js +16 -0
  41. package/dist/esm/core/errors.js +70 -0
  42. package/dist/esm/core/guards.js +73 -0
  43. package/dist/esm/core/index.js +7 -0
  44. package/dist/esm/core/inputs.js +10 -0
  45. package/dist/esm/core/machine.js +180 -0
  46. package/dist/esm/core/state.js +26 -0
  47. package/dist/esm/index.federated.js +1 -0
  48. package/dist/esm/index.js +3 -0
  49. package/dist/esm/machines/fetch/errors.js +46 -0
  50. package/dist/esm/machines/fetch/index.js +4 -0
  51. package/dist/esm/machines/fetch/machine.js +216 -0
  52. package/dist/esm/machines/fetch/policies.js +48 -0
  53. package/dist/esm/machines/fetch/types.js +48 -0
  54. package/dist/esm/machines/index.js +1 -0
  55. package/dist/esm/utils/index.js +1 -0
  56. package/dist/esm/utils/logger.js +5 -0
  57. package/dist/foundation-state-machine.api.json +5594 -0
  58. package/dist/foundation-state-machine.d.ts +884 -0
  59. package/docs/.gitattributes +2 -0
  60. package/docs/api/foundation-state-machine.abstractmachine.actor.md +18 -0
  61. package/docs/api/foundation-state-machine.abstractmachine.binding.md +27 -0
  62. package/docs/api/foundation-state-machine.abstractmachine.complete.md +13 -0
  63. package/docs/api/foundation-state-machine.abstractmachine.context.md +13 -0
  64. package/docs/api/foundation-state-machine.abstractmachine.error.md +13 -0
  65. package/docs/api/foundation-state-machine.abstractmachine.errors.md +13 -0
  66. package/docs/api/foundation-state-machine.abstractmachine.getfromcontainer.md +23 -0
  67. package/docs/api/foundation-state-machine.abstractmachine.hastag.md +28 -0
  68. package/docs/api/foundation-state-machine.abstractmachine.machine.md +18 -0
  69. package/docs/api/foundation-state-machine.abstractmachine.matches.md +28 -0
  70. package/docs/api/foundation-state-machine.abstractmachine.md +44 -0
  71. package/docs/api/foundation-state-machine.abstractmachine.onsendevent.md +13 -0
  72. package/docs/api/foundation-state-machine.abstractmachine.output.md +13 -0
  73. package/docs/api/foundation-state-machine.abstractmachine.provide.md +24 -0
  74. package/docs/api/foundation-state-machine.abstractmachine.send.md +24 -0
  75. package/docs/api/foundation-state-machine.abstractmachine.start.md +28 -0
  76. package/docs/api/foundation-state-machine.abstractmachine.startingcontext.md +13 -0
  77. package/docs/api/foundation-state-machine.abstractmachine.startingstate.md +13 -0
  78. package/docs/api/foundation-state-machine.abstractmachine.state.md +13 -0
  79. package/docs/api/foundation-state-machine.abstractmachine.stop.md +17 -0
  80. package/docs/api/foundation-state-machine.apierror._constructor_.md +22 -0
  81. package/docs/api/foundation-state-machine.apierror.data.md +11 -0
  82. package/docs/api/foundation-state-machine.apierror.md +32 -0
  83. package/docs/api/foundation-state-machine.apierror.status.md +11 -0
  84. package/docs/api/foundation-state-machine.assertevent.md +27 -0
  85. package/docs/api/foundation-state-machine.createerrorstatenode.md +13 -0
  86. package/docs/api/foundation-state-machine.createfetchpolicy.md +18 -0
  87. package/docs/api/foundation-state-machine.createresponsedataextractorwithdeserializer.md +13 -0
  88. package/docs/api/foundation-state-machine.defaultfetchconfig.md +13 -0
  89. package/docs/api/foundation-state-machine.defaultfetchmachine._constructor_.md +20 -0
  90. package/docs/api/foundation-state-machine.defaultfetchmachine.getfromcontainer.md +23 -0
  91. package/docs/api/foundation-state-machine.defaultfetchmachine.md +30 -0
  92. package/docs/api/foundation-state-machine.defaultfetchmachine.start.md +28 -0
  93. package/docs/api/foundation-state-machine.defaultfetchmachinecontext.md +13 -0
  94. package/docs/api/foundation-state-machine.defaultfetchpolicy.md +13 -0
  95. package/docs/api/foundation-state-machine.defaultresponsedataextractor.md +18 -0
  96. package/docs/api/foundation-state-machine.defaultresponseokchecker.md +13 -0
  97. package/docs/api/foundation-state-machine.defaultretrystatscodes.md +13 -0
  98. package/docs/api/foundation-state-machine.errorworkflowinput.md +15 -0
  99. package/docs/api/foundation-state-machine.escalateerror.md +42 -0
  100. package/docs/api/foundation-state-machine.fetchconfig.fetcher.md +13 -0
  101. package/docs/api/foundation-state-machine.fetchconfig.fetchpolicy.md +13 -0
  102. package/docs/api/foundation-state-machine.fetchconfig.md +23 -0
  103. package/docs/api/foundation-state-machine.fetchconfig.responsedataextractor.md +13 -0
  104. package/docs/api/foundation-state-machine.fetchconfig.responseokchecker.md +13 -0
  105. package/docs/api/foundation-state-machine.fetchmachine.md +15 -0
  106. package/docs/api/foundation-state-machine.fetchmachinecontext.controller.md +13 -0
  107. package/docs/api/foundation-state-machine.fetchmachinecontext.data.md +13 -0
  108. package/docs/api/foundation-state-machine.fetchmachinecontext.md +28 -0
  109. package/docs/api/foundation-state-machine.fetchmachinecontext.params.md +17 -0
  110. package/docs/api/foundation-state-machine.fetchmachinecontext.response.md +13 -0
  111. package/docs/api/foundation-state-machine.fetchmachineevent.md +24 -0
  112. package/docs/api/foundation-state-machine.fetchmachineeventmap.md +21 -0
  113. package/docs/api/foundation-state-machine.fetchmachineoutput.md +21 -0
  114. package/docs/api/foundation-state-machine.genesisservererror._constructor_.md +22 -0
  115. package/docs/api/foundation-state-machine.genesisservererror.getdetailserror.md +15 -0
  116. package/docs/api/foundation-state-machine.genesisservererror.getmessageerror.md +15 -0
  117. package/docs/api/foundation-state-machine.genesisservererror.haserrorcode.md +22 -0
  118. package/docs/api/foundation-state-machine.genesisservererror.isignorableerror.md +17 -0
  119. package/docs/api/foundation-state-machine.genesisservererror.md +41 -0
  120. package/docs/api/foundation-state-machine.genesisservererror.received.md +11 -0
  121. package/docs/api/foundation-state-machine.genesisservererror.sent.md +11 -0
  122. package/docs/api/foundation-state-machine.isaborterror.md +15 -0
  123. package/docs/api/foundation-state-machine.isactorerrorevent.md +13 -0
  124. package/docs/api/foundation-state-machine.isapierror.md +11 -0
  125. package/docs/api/foundation-state-machine.isdoneinvokeevent.md +13 -0
  126. package/docs/api/foundation-state-machine.iserrorcustomevent.md +18 -0
  127. package/docs/api/foundation-state-machine.iserrorevent.md +13 -0
  128. package/docs/api/foundation-state-machine.iserrortype.md +13 -0
  129. package/docs/api/foundation-state-machine.isgenesisservererror.md +11 -0
  130. package/docs/api/foundation-state-machine.ismappingerror.md +11 -0
  131. package/docs/api/foundation-state-machine.isnetworkerror.md +11 -0
  132. package/docs/api/foundation-state-machine.isnotfounderror.md +13 -0
  133. package/docs/api/foundation-state-machine.issyntaxerror.md +15 -0
  134. package/docs/api/foundation-state-machine.istypeerror.md +15 -0
  135. package/docs/api/foundation-state-machine.logger.md +12 -0
  136. package/docs/api/foundation-state-machine.machine.actor.md +18 -0
  137. package/docs/api/foundation-state-machine.machine.binding.md +47 -0
  138. package/docs/api/foundation-state-machine.machine.complete.md +13 -0
  139. package/docs/api/foundation-state-machine.machine.context.md +13 -0
  140. package/docs/api/foundation-state-machine.machine.error.md +13 -0
  141. package/docs/api/foundation-state-machine.machine.errors.md +13 -0
  142. package/docs/api/foundation-state-machine.machine.getfromcontainer.md +35 -0
  143. package/docs/api/foundation-state-machine.machine.hastag.md +35 -0
  144. package/docs/api/foundation-state-machine.machine.machine.md +18 -0
  145. package/docs/api/foundation-state-machine.machine.matches.md +35 -0
  146. package/docs/api/foundation-state-machine.machine.md +101 -0
  147. package/docs/api/foundation-state-machine.machine.onsendevent.md +24 -0
  148. package/docs/api/foundation-state-machine.machine.output.md +13 -0
  149. package/docs/api/foundation-state-machine.machine.provide.md +44 -0
  150. package/docs/api/foundation-state-machine.machine.send.md +24 -0
  151. package/docs/api/foundation-state-machine.machine.start.md +28 -0
  152. package/docs/api/foundation-state-machine.machine.startingcontext.md +13 -0
  153. package/docs/api/foundation-state-machine.machine.startingstate.md +13 -0
  154. package/docs/api/foundation-state-machine.machine.state.md +13 -0
  155. package/docs/api/foundation-state-machine.machine.stop.md +17 -0
  156. package/docs/api/foundation-state-machine.machinecontext.error.md +13 -0
  157. package/docs/api/foundation-state-machine.machinecontext.errors.md +13 -0
  158. package/docs/api/foundation-state-machine.machinecontext.md +36 -0
  159. package/docs/api/foundation-state-machine.mappingerror._constructor_.md +21 -0
  160. package/docs/api/foundation-state-machine.mappingerror.dto.md +11 -0
  161. package/docs/api/foundation-state-machine.mappingerror.md +27 -0
  162. package/docs/api/foundation-state-machine.md +81 -0
  163. package/docs/api/foundation-state-machine.networkerror._constructor_.md +21 -0
  164. package/docs/api/foundation-state-machine.networkerror.md +31 -0
  165. package/docs/api/foundation-state-machine.networkerror.url.md +11 -0
  166. package/docs/api/foundation-state-machine.responsedataextractor.md +18 -0
  167. package/docs/api/foundation-state-machine.responseokchecker.md +13 -0
  168. package/docs/api/foundation-state-machine.seterror.md +25 -0
  169. package/docs/api/foundation-state-machine.seterrorbykey.md +25 -0
  170. package/docs/api/index.md +12 -0
  171. package/docs/api-report.md +393 -0
  172. package/license.txt +46 -0
  173. package/package.json +60 -0
@@ -0,0 +1,30 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [DefaultFetchMachine](./foundation-state-machine.defaultfetchmachine.md)
4
+
5
+ ## DefaultFetchMachine class
6
+
7
+ Default FetchMachine.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export declare class DefaultFetchMachine extends AbstractMachine<FetchMachineContext, FetchMachineEvent> implements FetchMachine
13
+ ```
14
+ **Extends:** [AbstractMachine](./foundation-state-machine.abstractmachine.md)<!-- -->&lt;[FetchMachineContext](./foundation-state-machine.fetchmachinecontext.md)<!-- -->, [FetchMachineEvent](./foundation-state-machine.fetchmachineevent.md)<!-- -->&gt;
15
+
16
+ **Implements:** [FetchMachine](./foundation-state-machine.fetchmachine.md)
17
+
18
+ ## Constructors
19
+
20
+ | Constructor | Modifiers | Description |
21
+ | --- | --- | --- |
22
+ | [(constructor)(config)](./foundation-state-machine.defaultfetchmachine._constructor_.md) | | Constructs a new instance of the <code>DefaultFetchMachine</code> class |
23
+
24
+ ## Methods
25
+
26
+ | Method | Modifiers | Description |
27
+ | --- | --- | --- |
28
+ | [getFromContainer()](./foundation-state-machine.defaultfetchmachine.getfromcontainer.md) | | Gets the machine from the container. |
29
+ | [start(options)](./foundation-state-machine.defaultfetchmachine.start.md) | | Start the machine. |
30
+
@@ -0,0 +1,28 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [DefaultFetchMachine](./foundation-state-machine.defaultfetchmachine.md) &gt; [start](./foundation-state-machine.defaultfetchmachine.start.md)
4
+
5
+ ## DefaultFetchMachine.start() method
6
+
7
+ Start the machine.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ start(options?: InterpreterOptions<typeof this.machine>): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | options | InterpreterOptions&lt;typeof [this.machine](./foundation-state-machine.abstractmachine.machine.md)<!-- -->&gt; | _(Optional)_ Optional InterpreterOptions. Can be used to restore to a previously persisted state. |
20
+
21
+ **Returns:**
22
+
23
+ void
24
+
25
+ ## Remarks
26
+
27
+ Called to ready the machine and create the internal actor (interpreter). This is called internally after `createMachine` by convention, however it should also be called after calling [provide](./foundation-state-machine.machine.provide.md) when overriding logic. Calling `start` on an injected machine allows you to restart/reuse it if needed. This is okay for machines registered as `transient` in the DI, but care should be taken when creating a machine registered as a `singleton`<!-- -->. You may need to check the status of the machine and block re-starts.
28
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [defaultFetchMachineContext](./foundation-state-machine.defaultfetchmachinecontext.md)
4
+
5
+ ## defaultFetchMachineContext variable
6
+
7
+ Default FetchMachineContext.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ defaultFetchMachineContext: Partial<FetchMachineContext>
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [defaultFetchPolicy](./foundation-state-machine.defaultfetchpolicy.md)
4
+
5
+ ## defaultFetchPolicy variable
6
+
7
+ The default fetch policy.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ defaultFetchPolicy: import("cockatiel").IMergedPolicy<import("cockatiel").IRetryContext & import("cockatiel").ICancellationContext, never, [import("cockatiel").RetryPolicy, import("cockatiel").TimeoutPolicy]>
13
+ ```
@@ -0,0 +1,18 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [defaultResponseDataExtractor](./foundation-state-machine.defaultresponsedataextractor.md)
4
+
5
+ ## defaultResponseDataExtractor variable
6
+
7
+ ResponseDataExtractor type.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ defaultResponseDataExtractor: ResponseDataExtractor
13
+ ```
14
+
15
+ ## Remarks
16
+
17
+ Extracts data from the and processes it accordingly. The default data extractor will inspect `content-type` and call `JSON.parse()` if it includes `application/json`<!-- -->. Custom data extractors can be used here.
18
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [defaultResponseOkChecker](./foundation-state-machine.defaultresponseokchecker.md)
4
+
5
+ ## defaultResponseOkChecker variable
6
+
7
+ ResponseOkChecker type.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ defaultResponseOkChecker: ResponseOkChecker
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [defaultRetryStatsCodes](./foundation-state-machine.defaultretrystatscodes.md)
4
+
5
+ ## defaultRetryStatsCodes variable
6
+
7
+ Default retry stats codes.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ defaultRetryStatsCodes: StatusCodes[]
13
+ ```
@@ -0,0 +1,15 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [errorWorkflowInput](./foundation-state-machine.errorworkflowinput.md)
4
+
5
+ ## errorWorkflowInput variable
6
+
7
+ Error workflow input.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ errorWorkflowInput: (key: string) => ({ context }: {
13
+ context: any;
14
+ }) => ErrorWorkflowInput
15
+ ```
@@ -0,0 +1,42 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [escalateError](./foundation-state-machine.escalateerror.md)
4
+
5
+ ## escalateError variable
6
+
7
+ Escalate error action.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ escalateError: {
13
+ (_: import("xstate").ActionArgs<import("xstate").MachineContext, import("xstate").EventObject, import("xstate").ParameterizedObject>): void;
14
+ type: string;
15
+ to: string | import("xstate").AnyActorRef | ((args: import("xstate").UnifiedArg<import("xstate").MachineContext, import("xstate").EventObject>) => string | import("xstate").AnyActorRef);
16
+ event: any;
17
+ id: string;
18
+ delay: string | number | import("xstate").DelayExpr<import("xstate").MachineContext, import("xstate").EventObject>;
19
+ resolve: (actorContext: import("xstate").AnyActorContext, state: import("xstate").AnyState, args: import("xstate").ActionArgs<any, any, import("xstate").ParameterizedObject>, { to, event: eventOrExpr, id, delay }: {
20
+ to: string | import("xstate").AnyActorRef | ((args: import("xstate").UnifiedArg<import("xstate").MachineContext, import("xstate").EventObject>) => string | import("xstate").AnyActorRef);
21
+ event: import("xstate").EventObject | import("xstate").SendExpr<import("xstate").MachineContext, import("xstate").EventObject, import("xstate").EventObject>;
22
+ id: string;
23
+ delay: string | number | import("xstate").DelayExpr<import("xstate").MachineContext, import("xstate").EventObject>;
24
+ }) => (import("xstate").AnyState | {
25
+ to: import("xstate").AnyActorRef;
26
+ event: import("xstate").EventObject;
27
+ id: string;
28
+ delay: number;
29
+ })[];
30
+ execute: (actorContext: import("xstate").AnyActorContext, params: {
31
+ to: import("xstate").AnyActorRef;
32
+ event: import("xstate").EventObject;
33
+ id: string;
34
+ delay: number;
35
+ }) => void;
36
+ }
37
+ ```
38
+
39
+ ## Remarks
40
+
41
+ Guard this call with a parent check to avoid warnings when there's no parent.
42
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchConfig](./foundation-state-machine.fetchconfig.md) &gt; [fetcher](./foundation-state-machine.fetchconfig.fetcher.md)
4
+
5
+ ## FetchConfig.fetcher property
6
+
7
+ Defaults to .
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ fetcher: typeof fetch;
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchConfig](./foundation-state-machine.fetchconfig.md) &gt; [fetchPolicy](./foundation-state-machine.fetchconfig.fetchpolicy.md)
4
+
5
+ ## FetchConfig.fetchPolicy property
6
+
7
+ Defaults to [defaultFetchPolicy](./foundation-state-machine.defaultfetchpolicy.md)
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ fetchPolicy?: IMergedPolicy<any, any, any>;
13
+ ```
@@ -0,0 +1,23 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchConfig](./foundation-state-machine.fetchconfig.md)
4
+
5
+ ## FetchConfig interface
6
+
7
+ FetchConfig interface.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export interface FetchConfig
13
+ ```
14
+
15
+ ## Properties
16
+
17
+ | Property | Modifiers | Type | Description |
18
+ | --- | --- | --- | --- |
19
+ | [fetcher](./foundation-state-machine.fetchconfig.fetcher.md) | | typeof fetch | Defaults to . |
20
+ | [fetchPolicy?](./foundation-state-machine.fetchconfig.fetchpolicy.md) | | IMergedPolicy&lt;any, any, any&gt; | _(Optional)_ Defaults to [defaultFetchPolicy](./foundation-state-machine.defaultfetchpolicy.md) |
21
+ | [responseDataExtractor?](./foundation-state-machine.fetchconfig.responsedataextractor.md) | | [ResponseDataExtractor](./foundation-state-machine.responsedataextractor.md) | _(Optional)_ Defaults to [defaultResponseDataExtractor](./foundation-state-machine.defaultresponsedataextractor.md) |
22
+ | [responseOkChecker?](./foundation-state-machine.fetchconfig.responseokchecker.md) | | [ResponseOkChecker](./foundation-state-machine.responseokchecker.md) | _(Optional)_ Defaults to [defaultResponseOkChecker](./foundation-state-machine.defaultresponseokchecker.md) |
23
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchConfig](./foundation-state-machine.fetchconfig.md) &gt; [responseDataExtractor](./foundation-state-machine.fetchconfig.responsedataextractor.md)
4
+
5
+ ## FetchConfig.responseDataExtractor property
6
+
7
+ Defaults to [defaultResponseDataExtractor](./foundation-state-machine.defaultresponsedataextractor.md)
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ responseDataExtractor?: ResponseDataExtractor;
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchConfig](./foundation-state-machine.fetchconfig.md) &gt; [responseOkChecker](./foundation-state-machine.fetchconfig.responseokchecker.md)
4
+
5
+ ## FetchConfig.responseOkChecker property
6
+
7
+ Defaults to [defaultResponseOkChecker](./foundation-state-machine.defaultresponseokchecker.md)
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ responseOkChecker?: ResponseOkChecker;
13
+ ```
@@ -0,0 +1,15 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchMachine](./foundation-state-machine.fetchmachine.md)
4
+
5
+ ## FetchMachine interface
6
+
7
+ FetchMachine interface.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export interface FetchMachine extends Machine<FetchMachineContext, FetchMachineEvent>
13
+ ```
14
+ **Extends:** [Machine](./foundation-state-machine.machine.md)<!-- -->&lt;[FetchMachineContext](./foundation-state-machine.fetchmachinecontext.md)<!-- -->, [FetchMachineEvent](./foundation-state-machine.fetchmachineevent.md)<!-- -->&gt;
15
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchMachineContext](./foundation-state-machine.fetchmachinecontext.md) &gt; [controller](./foundation-state-machine.fetchmachinecontext.controller.md)
4
+
5
+ ## FetchMachineContext.controller property
6
+
7
+ The abort controller of the fetch request.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ controller: AbortController;
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchMachineContext](./foundation-state-machine.fetchmachinecontext.md) &gt; [data](./foundation-state-machine.fetchmachinecontext.data.md)
4
+
5
+ ## FetchMachineContext.data property
6
+
7
+ The extracted response data.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ data: any;
13
+ ```
@@ -0,0 +1,28 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchMachineContext](./foundation-state-machine.fetchmachinecontext.md)
4
+
5
+ ## FetchMachineContext interface
6
+
7
+ FetchMachineContext interface.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export interface FetchMachineContext extends MachineContext
13
+ ```
14
+ **Extends:** [MachineContext](./foundation-state-machine.machinecontext.md)
15
+
16
+ ## Remarks
17
+
18
+ Transient state during the machine's execution.
19
+
20
+ ## Properties
21
+
22
+ | Property | Modifiers | Type | Description |
23
+ | --- | --- | --- | --- |
24
+ | [controller](./foundation-state-machine.fetchmachinecontext.controller.md) | | AbortController | The abort controller of the fetch request. |
25
+ | [data](./foundation-state-machine.fetchmachinecontext.data.md) | | any | The extracted response data. |
26
+ | [params](./foundation-state-machine.fetchmachinecontext.params.md) | | { url: string; requestInit?: RequestInit \| CMRequestInit; fetchConfig?: [FetchConfig](./foundation-state-machine.fetchconfig.md)<!-- -->; } | The params of the fetch request. |
27
+ | [response](./foundation-state-machine.fetchmachinecontext.response.md) | | Response \| undefined | The fetch response. |
28
+
@@ -0,0 +1,17 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchMachineContext](./foundation-state-machine.fetchmachinecontext.md) &gt; [params](./foundation-state-machine.fetchmachinecontext.params.md)
4
+
5
+ ## FetchMachineContext.params property
6
+
7
+ The params of the fetch request.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ params: {
13
+ url: string;
14
+ requestInit?: RequestInit | CMRequestInit;
15
+ fetchConfig?: FetchConfig;
16
+ };
17
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchMachineContext](./foundation-state-machine.fetchmachinecontext.md) &gt; [response](./foundation-state-machine.fetchmachinecontext.response.md)
4
+
5
+ ## FetchMachineContext.response property
6
+
7
+ The fetch response.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ response: Response | undefined;
13
+ ```
@@ -0,0 +1,24 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchMachineEvent](./foundation-state-machine.fetchmachineevent.md)
4
+
5
+ ## FetchMachineEvent type
6
+
7
+ FetchMachineEvent type.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export type FetchMachineEvent = {
13
+ type: 'fetch';
14
+ params: FetchMachineContext['params'];
15
+ } | {
16
+ type: 'cancel';
17
+ } | DoneInvokeEvent<unknown> | ErrorEvent<unknown>;
18
+ ```
19
+ **References:** [FetchMachineContext](./foundation-state-machine.fetchmachinecontext.md)
20
+
21
+ ## Remarks
22
+
23
+ The send action events used to invoke the machine.
24
+
@@ -0,0 +1,21 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchMachineEventMap](./foundation-state-machine.fetchmachineeventmap.md)
4
+
5
+ ## FetchMachineEventMap type
6
+
7
+ FetchMachineEventMap type.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export type FetchMachineEventMap = {
13
+ 'fetch-machine-event': FetchMachineEvent;
14
+ };
15
+ ```
16
+ **References:** [FetchMachineEvent](./foundation-state-machine.fetchmachineevent.md)
17
+
18
+ ## Remarks
19
+
20
+ The mediation CustomEvent used to invoke machine actions.
21
+
@@ -0,0 +1,21 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [FetchMachineOutput](./foundation-state-machine.fetchmachineoutput.md)
4
+
5
+ ## FetchMachineOutput type
6
+
7
+ FetchMachineOutput type.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export type FetchMachineOutput<TData = any> = Partial<Pick<FetchMachineContext, 'response' | 'error'>> & {
13
+ data: TData;
14
+ };
15
+ ```
16
+ **References:** [FetchMachineContext](./foundation-state-machine.fetchmachinecontext.md)
17
+
18
+ ## Remarks
19
+
20
+ The output of the machine when it reaches it's final state, which is provided to host machines via handlers.
21
+
@@ -0,0 +1,22 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [GenesisServerError](./foundation-state-machine.genesisservererror.md) &gt; [(constructor)](./foundation-state-machine.genesisservererror._constructor_.md)
4
+
5
+ ## GenesisServerError.(constructor)
6
+
7
+ Constructs a new instance of the `GenesisServerError` class
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ constructor(sent?: Message, received?: Message, message?: string);
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | sent | Message | _(Optional)_ |
20
+ | received | Message | _(Optional)_ |
21
+ | message | string | _(Optional)_ |
22
+
@@ -0,0 +1,15 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [GenesisServerError](./foundation-state-machine.genesisservererror.md) &gt; [getDetailsError](./foundation-state-machine.genesisservererror.getdetailserror.md)
4
+
5
+ ## GenesisServerError.getDetailsError() method
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ getDetailsError(): string;
11
+ ```
12
+ **Returns:**
13
+
14
+ string
15
+
@@ -0,0 +1,15 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [GenesisServerError](./foundation-state-machine.genesisservererror.md) &gt; [getMessageError](./foundation-state-machine.genesisservererror.getmessageerror.md)
4
+
5
+ ## GenesisServerError.getMessageError() method
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ getMessageError(): string;
11
+ ```
12
+ **Returns:**
13
+
14
+ string
15
+
@@ -0,0 +1,22 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [GenesisServerError](./foundation-state-machine.genesisservererror.md) &gt; [hasErrorCode](./foundation-state-machine.genesisservererror.haserrorcode.md)
4
+
5
+ ## GenesisServerError.hasErrorCode() method
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ hasErrorCode(code: string): boolean;
11
+ ```
12
+
13
+ ## Parameters
14
+
15
+ | Parameter | Type | Description |
16
+ | --- | --- | --- |
17
+ | code | string | |
18
+
19
+ **Returns:**
20
+
21
+ boolean
22
+
@@ -0,0 +1,17 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [GenesisServerError](./foundation-state-machine.genesisservererror.md) &gt; [isIgnorableError](./foundation-state-machine.genesisservererror.isignorableerror.md)
4
+
5
+ ## GenesisServerError.isIgnorableError() method
6
+
7
+ Capture known edge cases.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ isIgnorableError(): boolean;
13
+ ```
14
+ **Returns:**
15
+
16
+ boolean
17
+
@@ -0,0 +1,41 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [GenesisServerError](./foundation-state-machine.genesisservererror.md)
4
+
5
+ ## GenesisServerError class
6
+
7
+ GenesisServerError.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export declare class GenesisServerError extends Error
13
+ ```
14
+ **Extends:** Error
15
+
16
+ ## Remarks
17
+
18
+ Represents an error received from a Genesis Server.
19
+
20
+ ## Constructors
21
+
22
+ | Constructor | Modifiers | Description |
23
+ | --- | --- | --- |
24
+ | [(constructor)(sent, received, message)](./foundation-state-machine.genesisservererror._constructor_.md) | | Constructs a new instance of the <code>GenesisServerError</code> class |
25
+
26
+ ## Properties
27
+
28
+ | Property | Modifiers | Type | Description |
29
+ | --- | --- | --- | --- |
30
+ | [received?](./foundation-state-machine.genesisservererror.received.md) | | Message | _(Optional)_ |
31
+ | [sent?](./foundation-state-machine.genesisservererror.sent.md) | | Message | _(Optional)_ |
32
+
33
+ ## Methods
34
+
35
+ | Method | Modifiers | Description |
36
+ | --- | --- | --- |
37
+ | [getDetailsError()](./foundation-state-machine.genesisservererror.getdetailserror.md) | | |
38
+ | [getMessageError()](./foundation-state-machine.genesisservererror.getmessageerror.md) | | |
39
+ | [hasErrorCode(code)](./foundation-state-machine.genesisservererror.haserrorcode.md) | | |
40
+ | [isIgnorableError()](./foundation-state-machine.genesisservererror.isignorableerror.md) | | Capture known edge cases. |
41
+
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [GenesisServerError](./foundation-state-machine.genesisservererror.md) &gt; [received](./foundation-state-machine.genesisservererror.received.md)
4
+
5
+ ## GenesisServerError.received property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ received?: Message;
11
+ ```
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [GenesisServerError](./foundation-state-machine.genesisservererror.md) &gt; [sent](./foundation-state-machine.genesisservererror.sent.md)
4
+
5
+ ## GenesisServerError.sent property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ sent?: Message;
11
+ ```
@@ -0,0 +1,15 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-state-machine](./foundation-state-machine.md) &gt; [isAbortError](./foundation-state-machine.isaborterror.md)
4
+
5
+ ## isAbortError variable
6
+
7
+ isAbortError.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ isAbortError: ({ event }: {
13
+ event: any;
14
+ }) => boolean
15
+ ```