@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,2 @@
1
+ *.md -diff
2
+ *.md linguist-generated
@@ -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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [actor](./foundation-state-machine.abstractmachine.actor.md)
4
+
5
+ ## AbstractMachine.actor property
6
+
7
+ Optional actor
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ actor: InterpreterFrom<StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>>;
13
+ ```
14
+
15
+ ## Remarks
16
+
17
+ Callers can decide to reuse/reference if set or create their own.
18
+
@@ -0,0 +1,27 @@
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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [binding](./foundation-state-machine.abstractmachine.binding.md)
4
+
5
+ ## AbstractMachine.binding() method
6
+
7
+ An api to allow the observation of values and arbitrary bindings outside the template engine.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ binding<TReturn = any, TParent = any>(token: ((target: this) => TReturn) | keyof this, subscriberChangeCallback?: SubscriberChangeCallback<TReturn> | undefined, isVolatileBinding?: boolean, context?: ExecutionContext): BindingObserver<this, TReturn, TParent>;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | token | ((target: this) =&gt; TReturn) \| keyof this | A target lookup token which can take various forms. |
20
+ | subscriberChangeCallback | SubscriberChangeCallback&lt;TReturn&gt; \| undefined | _(Optional)_ . |
21
+ | isVolatileBinding | boolean | _(Optional)_ Indicates the binding is volatile. |
22
+ | context | ExecutionContext | _(Optional)_ . |
23
+
24
+ **Returns:**
25
+
26
+ BindingObserver&lt;this, TReturn, TParent&gt;
27
+
@@ -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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [complete](./foundation-state-machine.abstractmachine.complete.md)
4
+
5
+ ## AbstractMachine.complete property
6
+
7
+ Indicates if the machine has completed the happy path.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ complete: boolean;
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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [context](./foundation-state-machine.abstractmachine.context.md)
4
+
5
+ ## AbstractMachine.context property
6
+
7
+ The current `context` of the machine. The data points in context may be considered transient in nature.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ context: Partial<TContext>;
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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [error](./foundation-state-machine.abstractmachine.error.md)
4
+
5
+ ## AbstractMachine.error property
6
+
7
+ A general machine error. Likely equal to `errors.lastError`<!-- -->.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ error: any;
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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [errors](./foundation-state-machine.abstractmachine.errors.md)
4
+
5
+ ## AbstractMachine.errors property
6
+
7
+ An of errors that may have occurred during the machine's workflows.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ errors: ErrorMap<ErrorDetailMap>;
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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [getFromContainer](./foundation-state-machine.abstractmachine.getfromcontainer.md)
4
+
5
+ ## AbstractMachine.getFromContainer() method
6
+
7
+ Gets the machine from the container.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ abstract getFromContainer(): this;
13
+ ```
14
+ **Returns:**
15
+
16
+ this
17
+
18
+ ## Remarks
19
+
20
+ Calling `getFromContainer` on an injected machine will return a new instance providing it was registered with the DI as `transient`<!-- -->. This is simply a convenience method, and may be useful as some machines contain 'final' states, meaning once they complete they can no longer receive events. However, if you want to continue to work with your injected machine reference, re-calling [start](./foundation-state-machine.machine.start.md) may also be a viable option.
21
+
22
+ Please note that machines are injected into other machines to form parts of complex workflows. In such cases, the parent machine will `invoke` or `spawn` the injected machine's `logic` directly to always create a new actor.
23
+
@@ -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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [hasTag](./foundation-state-machine.abstractmachine.hastag.md)
4
+
5
+ ## AbstractMachine.hasTag() method
6
+
7
+ Check `tags` contain provided tag.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ hasTag(tag: string): boolean;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | tag | string | A tag. |
20
+
21
+ **Returns:**
22
+
23
+ boolean
24
+
25
+ ## Remarks
26
+
27
+ This differs from `matches`<!-- -->, as multiple states may use common tags such as `pending` to indicate some async work is occurring. As with `matches`<!-- -->, `hasTag` can be useful if you need to conditionally run logic or render markup.
28
+
@@ -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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [machine](./foundation-state-machine.abstractmachine.machine.md)
4
+
5
+ ## AbstractMachine.machine property
6
+
7
+ Mandatory machine property.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ machine: StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>;
13
+ ```
14
+
15
+ ## Remarks
16
+
17
+ The logic / config that goes into a machine is not accessible from the outside, and is owned by the implementing class. However, consumers of that may provide custom `implementations` in the xstate sense via the `provide()` api.
18
+
@@ -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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [matches](./foundation-state-machine.abstractmachine.matches.md)
4
+
5
+ ## AbstractMachine.matches() method
6
+
7
+ Check `state` matches provided value.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ matches(value: StateValueFrom<typeof this.machine>): boolean;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | value | StateValueFrom&lt;typeof [this.machine](./foundation-state-machine.abstractmachine.machine.md)<!-- -->&gt; | A state value. |
20
+
21
+ **Returns:**
22
+
23
+ boolean
24
+
25
+ ## Remarks
26
+
27
+ Can be useful if you need to conditionally run logic or render markup.
28
+
@@ -0,0 +1,44 @@
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; [AbstractMachine](./foundation-state-machine.abstractmachine.md)
4
+
5
+ ## AbstractMachine class
6
+
7
+ AbstractMachine base class.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export declare abstract class AbstractMachine<TContext extends MachineContext, TEvent extends EventObject = AnyEventObject, TAction extends ParameterizedObject = ParameterizedObject, TActor extends ProvidedActor = ProvidedActor, TInput = any, TResolvedTypesMeta = ResolveTypegenMeta<TypegenDisabled, NoInfer<TEvent>, TAction, TActor>> implements Machine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>
13
+ ```
14
+ **Implements:** [Machine](./foundation-state-machine.machine.md)<!-- -->&lt;TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta&gt;
15
+
16
+ ## Properties
17
+
18
+ | Property | Modifiers | Type | Description |
19
+ | --- | --- | --- | --- |
20
+ | [actor](./foundation-state-machine.abstractmachine.actor.md) | | InterpreterFrom&lt;StateMachine&lt;TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta&gt;&gt; | Optional actor |
21
+ | [complete](./foundation-state-machine.abstractmachine.complete.md) | | boolean | Indicates if the machine has completed the happy path. |
22
+ | [context](./foundation-state-machine.abstractmachine.context.md) | | Partial&lt;TContext&gt; | The current <code>context</code> of the machine. The data points in context may be considered transient in nature. |
23
+ | [error](./foundation-state-machine.abstractmachine.error.md) | | any | A general machine error. Likely equal to <code>errors.lastError</code>. |
24
+ | [errors](./foundation-state-machine.abstractmachine.errors.md) | | ErrorMap&lt;ErrorDetailMap&gt; | An of errors that may have occurred during the machine's workflows. |
25
+ | [machine](./foundation-state-machine.abstractmachine.machine.md) | | StateMachine&lt;TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta&gt; | Mandatory machine property. |
26
+ | [onSendEvent](./foundation-state-machine.abstractmachine.onsendevent.md) | | (event: CustomEvent&lt;TEvent&gt;) =&gt; void | A custom event handler to send events to the machine. |
27
+ | [output](./foundation-state-machine.abstractmachine.output.md) | | any | Holds successful machine output if any. |
28
+ | [startingContext](./foundation-state-machine.abstractmachine.startingcontext.md) | | Partial&lt;TContext&gt; | The <code>context</code> of the machine when started. |
29
+ | [startingState](./foundation-state-machine.abstractmachine.startingstate.md) | | StateValue | The <code>state</code> of the machine when started. Allows consumers to start a machine from a persisted state. |
30
+ | [state](./foundation-state-machine.abstractmachine.state.md) | | StateValue | The current <code>state</code> of the machine itself. This is not to be confused with state in the data or store sense. |
31
+
32
+ ## Methods
33
+
34
+ | Method | Modifiers | Description |
35
+ | --- | --- | --- |
36
+ | [binding(token, subscriberChangeCallback, isVolatileBinding, context)](./foundation-state-machine.abstractmachine.binding.md) | | An api to allow the observation of values and arbitrary bindings outside the template engine. |
37
+ | [getFromContainer()](./foundation-state-machine.abstractmachine.getfromcontainer.md) | <code>abstract</code> | Gets the machine from the container. |
38
+ | [hasTag(tag)](./foundation-state-machine.abstractmachine.hastag.md) | | Check <code>tags</code> contain provided tag. |
39
+ | [matches(value)](./foundation-state-machine.abstractmachine.matches.md) | | Check <code>state</code> matches provided value. |
40
+ | [provide(implementations)](./foundation-state-machine.abstractmachine.provide.md) | | Recreate the internal machine with the provided implementations. |
41
+ | [send(event)](./foundation-state-machine.abstractmachine.send.md) | | An api to send events to the machine. |
42
+ | [start(options)](./foundation-state-machine.abstractmachine.start.md) | | Start the machine. |
43
+ | [stop()](./foundation-state-machine.abstractmachine.stop.md) | | Stop the machine. |
44
+
@@ -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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [onSendEvent](./foundation-state-machine.abstractmachine.onsendevent.md)
4
+
5
+ ## AbstractMachine.onSendEvent property
6
+
7
+ A custom event handler to send events to the machine.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ onSendEvent: (event: CustomEvent<TEvent>) => void;
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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [output](./foundation-state-machine.abstractmachine.output.md)
4
+
5
+ ## AbstractMachine.output property
6
+
7
+ Holds successful machine output if any.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ output: any;
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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [provide](./foundation-state-machine.abstractmachine.provide.md)
4
+
5
+ ## AbstractMachine.provide() method
6
+
7
+ Recreate the internal machine with the provided implementations.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ provide(implementations: InternalMachineImplementations<TContext, TEvent, TAction, TActor, TResolvedTypesMeta, true>): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | implementations | InternalMachineImplementations&lt;TContext, TEvent, TAction, TActor, TResolvedTypesMeta, true&gt; | <code>actions</code>, <code>guards</code>, <code>actors</code>... to merge with existing options. |
20
+
21
+ **Returns:**
22
+
23
+ void
24
+
@@ -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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [send](./foundation-state-machine.abstractmachine.send.md)
4
+
5
+ ## AbstractMachine.send() method
6
+
7
+ An api to send events to the machine.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ send(event: TEvent): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | event | TEvent | An event. |
20
+
21
+ **Returns:**
22
+
23
+ void
24
+
@@ -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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [start](./foundation-state-machine.abstractmachine.start.md)
4
+
5
+ ## AbstractMachine.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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [startingContext](./foundation-state-machine.abstractmachine.startingcontext.md)
4
+
5
+ ## AbstractMachine.startingContext property
6
+
7
+ The `context` of the machine when started.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ startingContext: Partial<TContext>;
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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [startingState](./foundation-state-machine.abstractmachine.startingstate.md)
4
+
5
+ ## AbstractMachine.startingState property
6
+
7
+ The `state` of the machine when started. Allows consumers to start a machine from a persisted state.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ startingState: StateValue;
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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [state](./foundation-state-machine.abstractmachine.state.md)
4
+
5
+ ## AbstractMachine.state property
6
+
7
+ The current `state` of the machine itself. This is not to be confused with state in the data or store sense.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ state: StateValue;
13
+ ```
@@ -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; [AbstractMachine](./foundation-state-machine.abstractmachine.md) &gt; [stop](./foundation-state-machine.abstractmachine.stop.md)
4
+
5
+ ## AbstractMachine.stop() method
6
+
7
+ Stop the machine.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ stop(): void;
13
+ ```
14
+ **Returns:**
15
+
16
+ void
17
+
@@ -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; [APIError](./foundation-state-machine.apierror.md) &gt; [(constructor)](./foundation-state-machine.apierror._constructor_.md)
4
+
5
+ ## APIError.(constructor)
6
+
7
+ Constructs a new instance of the `APIError` class
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ constructor(status: number, data?: unknown, message?: string);
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | status | number | |
20
+ | data | unknown | _(Optional)_ |
21
+ | message | string | _(Optional)_ |
22
+
@@ -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; [APIError](./foundation-state-machine.apierror.md) &gt; [data](./foundation-state-machine.apierror.data.md)
4
+
5
+ ## APIError.data property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ data?: unknown;
11
+ ```
@@ -0,0 +1,32 @@
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; [APIError](./foundation-state-machine.apierror.md)
4
+
5
+ ## APIError class
6
+
7
+ APIError.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export declare class APIError extends Error
13
+ ```
14
+ **Extends:** Error
15
+
16
+ ## Remarks
17
+
18
+ Bad server `Response`<!-- -->.
19
+
20
+ ## Constructors
21
+
22
+ | Constructor | Modifiers | Description |
23
+ | --- | --- | --- |
24
+ | [(constructor)(status, data, message)](./foundation-state-machine.apierror._constructor_.md) | | Constructs a new instance of the <code>APIError</code> class |
25
+
26
+ ## Properties
27
+
28
+ | Property | Modifiers | Type | Description |
29
+ | --- | --- | --- | --- |
30
+ | [data?](./foundation-state-machine.apierror.data.md) | | unknown | _(Optional)_ |
31
+ | [status](./foundation-state-machine.apierror.status.md) | | number | |
32
+
@@ -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; [APIError](./foundation-state-machine.apierror.md) &gt; [status](./foundation-state-machine.apierror.status.md)
4
+
5
+ ## APIError.status property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ status: number;
11
+ ```
@@ -0,0 +1,27 @@
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; [assertEvent](./foundation-state-machine.assertevent.md)
4
+
5
+ ## assertEvent() function
6
+
7
+ assertEvent.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export declare function assertEvent<TEvent extends EventObject = EventObject>(event: TEvent, type: TEvent['type']): asserts event is Extract<TEvent, {
13
+ type: TEvent['type'];
14
+ }>;
15
+ ```
16
+
17
+ ## Parameters
18
+
19
+ | Parameter | Type | Description |
20
+ | --- | --- | --- |
21
+ | event | TEvent | An event. |
22
+ | type | TEvent\['type'\] | An event type. |
23
+
24
+ **Returns:**
25
+
26
+ asserts event is Extract&lt;TEvent, { type: TEvent\['type'\]; }&gt;
27
+
@@ -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; [createErrorStateNode](./foundation-state-machine.createerrorstatenode.md)
4
+
5
+ ## createErrorStateNode variable
6
+
7
+ Creates an error state node.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ createErrorStateNode: (key: string, metaContent?: string, final?: boolean) => StateNodeConfig<any, any, any, any>
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; [createFetchPolicy](./foundation-state-machine.createfetchpolicy.md)
4
+
5
+ ## createFetchPolicy variable
6
+
7
+ A fetch policy factory.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ createFetchPolicy: (maxAttempts?: number, retryCodes?: StatusCodes[] | number[], backoff?: IBackoffFactory<IRetryBackoffContext<unknown>>, timeoutDuration?: number, logEvents?: boolean) => import("cockatiel").IMergedPolicy<import("cockatiel").IRetryContext & import("cockatiel").ICancellationContext, never, [import("cockatiel").RetryPolicy, import("cockatiel").TimeoutPolicy]>
13
+ ```
14
+
15
+ ## Remarks
16
+
17
+ Will retry network errors and responses with certain status codes up to the specified max attempts.
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; [createResponseDataExtractorWithDeserializer](./foundation-state-machine.createresponsedataextractorwithdeserializer.md)
4
+
5
+ ## createResponseDataExtractorWithDeserializer variable
6
+
7
+ Creates an extractor that applies a deserializer to the extracted response data.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ createResponseDataExtractorWithDeserializer: <TInput = any, TOutput = any>(deserializer: (data: TInput) => Promise<TOutput>, extractor?: 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; [defaultFetchConfig](./foundation-state-machine.defaultfetchconfig.md)
4
+
5
+ ## defaultFetchConfig variable
6
+
7
+ The default fetch config.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ defaultFetchConfig: FetchConfig
13
+ ```
@@ -0,0 +1,20 @@
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; [(constructor)](./foundation-state-machine.defaultfetchmachine._constructor_.md)
4
+
5
+ ## DefaultFetchMachine.(constructor)
6
+
7
+ Constructs a new instance of the `DefaultFetchMachine` class
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ constructor(config?: FetchConfig);
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | config | [FetchConfig](./foundation-state-machine.fetchconfig.md) | _(Optional)_ |
20
+
@@ -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; [DefaultFetchMachine](./foundation-state-machine.defaultfetchmachine.md) &gt; [getFromContainer](./foundation-state-machine.defaultfetchmachine.getfromcontainer.md)
4
+
5
+ ## DefaultFetchMachine.getFromContainer() method
6
+
7
+ Gets the machine from the container.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ getFromContainer(): this;
13
+ ```
14
+ **Returns:**
15
+
16
+ this
17
+
18
+ ## Remarks
19
+
20
+ Calling `getFromContainer` on an injected machine will return a new instance providing it was registered with the DI as `transient`<!-- -->. This is simply a convenience method, and may be useful as some machines contain 'final' states, meaning once they complete they can no longer receive events. However, if you want to continue to work with your injected machine reference, re-calling [start](./foundation-state-machine.machine.start.md) may also be a viable option.
21
+
22
+ Please note that machines are injected into other machines to form parts of complex workflows. In such cases, the parent machine will `invoke` or `spawn` the injected machine's `logic` directly to always create a new actor.
23
+