@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.
- package/README.md +26 -0
- package/dist/dts/core/actions.d.ts +61 -0
- package/dist/dts/core/actions.d.ts.map +1 -0
- package/dist/dts/core/binding.d.ts +37 -0
- package/dist/dts/core/binding.d.ts.map +1 -0
- package/dist/dts/core/errors.d.ts +41 -0
- package/dist/dts/core/errors.d.ts.map +1 -0
- package/dist/dts/core/guards.d.ts +67 -0
- package/dist/dts/core/guards.d.ts.map +1 -0
- package/dist/dts/core/index.d.ts +8 -0
- package/dist/dts/core/index.d.ts.map +1 -0
- package/dist/dts/core/inputs.d.ts +19 -0
- package/dist/dts/core/inputs.d.ts.map +1 -0
- package/dist/dts/core/machine.d.ts +338 -0
- package/dist/dts/core/machine.d.ts.map +1 -0
- package/dist/dts/core/state.d.ts +11 -0
- package/dist/dts/core/state.d.ts.map +1 -0
- package/dist/dts/index.d.ts +4 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/index.federated.d.ts +1 -0
- package/dist/dts/index.federated.d.ts.map +1 -0
- package/dist/dts/machines/fetch/errors.d.ts +39 -0
- package/dist/dts/machines/fetch/errors.d.ts.map +1 -0
- package/dist/dts/machines/fetch/index.d.ts +5 -0
- package/dist/dts/machines/fetch/index.d.ts.map +1 -0
- package/dist/dts/machines/fetch/machine.d.ts +57 -0
- package/dist/dts/machines/fetch/machine.d.ts.map +1 -0
- package/dist/dts/machines/fetch/policies.d.ts +25 -0
- package/dist/dts/machines/fetch/policies.d.ts.map +1 -0
- package/dist/dts/machines/fetch/types.d.ts +118 -0
- package/dist/dts/machines/fetch/types.d.ts.map +1 -0
- package/dist/dts/machines/index.d.ts +2 -0
- package/dist/dts/machines/index.d.ts.map +1 -0
- package/dist/dts/tsdoc-metadata.json +11 -0
- package/dist/dts/utils/index.d.ts +2 -0
- package/dist/dts/utils/index.d.ts.map +1 -0
- package/dist/dts/utils/logger.d.ts +5 -0
- package/dist/dts/utils/logger.d.ts.map +1 -0
- package/dist/esm/core/actions.js +46 -0
- package/dist/esm/core/binding.js +16 -0
- package/dist/esm/core/errors.js +70 -0
- package/dist/esm/core/guards.js +73 -0
- package/dist/esm/core/index.js +7 -0
- package/dist/esm/core/inputs.js +10 -0
- package/dist/esm/core/machine.js +180 -0
- package/dist/esm/core/state.js +26 -0
- package/dist/esm/index.federated.js +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/machines/fetch/errors.js +46 -0
- package/dist/esm/machines/fetch/index.js +4 -0
- package/dist/esm/machines/fetch/machine.js +216 -0
- package/dist/esm/machines/fetch/policies.js +48 -0
- package/dist/esm/machines/fetch/types.js +48 -0
- package/dist/esm/machines/index.js +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/logger.js +5 -0
- package/dist/foundation-state-machine.api.json +5594 -0
- package/dist/foundation-state-machine.d.ts +884 -0
- package/docs/.gitattributes +2 -0
- package/docs/api/foundation-state-machine.abstractmachine.actor.md +18 -0
- package/docs/api/foundation-state-machine.abstractmachine.binding.md +27 -0
- package/docs/api/foundation-state-machine.abstractmachine.complete.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.context.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.error.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.errors.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.getfromcontainer.md +23 -0
- package/docs/api/foundation-state-machine.abstractmachine.hastag.md +28 -0
- package/docs/api/foundation-state-machine.abstractmachine.machine.md +18 -0
- package/docs/api/foundation-state-machine.abstractmachine.matches.md +28 -0
- package/docs/api/foundation-state-machine.abstractmachine.md +44 -0
- package/docs/api/foundation-state-machine.abstractmachine.onsendevent.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.output.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.provide.md +24 -0
- package/docs/api/foundation-state-machine.abstractmachine.send.md +24 -0
- package/docs/api/foundation-state-machine.abstractmachine.start.md +28 -0
- package/docs/api/foundation-state-machine.abstractmachine.startingcontext.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.startingstate.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.state.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.stop.md +17 -0
- package/docs/api/foundation-state-machine.apierror._constructor_.md +22 -0
- package/docs/api/foundation-state-machine.apierror.data.md +11 -0
- package/docs/api/foundation-state-machine.apierror.md +32 -0
- package/docs/api/foundation-state-machine.apierror.status.md +11 -0
- package/docs/api/foundation-state-machine.assertevent.md +27 -0
- package/docs/api/foundation-state-machine.createerrorstatenode.md +13 -0
- package/docs/api/foundation-state-machine.createfetchpolicy.md +18 -0
- package/docs/api/foundation-state-machine.createresponsedataextractorwithdeserializer.md +13 -0
- package/docs/api/foundation-state-machine.defaultfetchconfig.md +13 -0
- package/docs/api/foundation-state-machine.defaultfetchmachine._constructor_.md +20 -0
- package/docs/api/foundation-state-machine.defaultfetchmachine.getfromcontainer.md +23 -0
- package/docs/api/foundation-state-machine.defaultfetchmachine.md +30 -0
- package/docs/api/foundation-state-machine.defaultfetchmachine.start.md +28 -0
- package/docs/api/foundation-state-machine.defaultfetchmachinecontext.md +13 -0
- package/docs/api/foundation-state-machine.defaultfetchpolicy.md +13 -0
- package/docs/api/foundation-state-machine.defaultresponsedataextractor.md +18 -0
- package/docs/api/foundation-state-machine.defaultresponseokchecker.md +13 -0
- package/docs/api/foundation-state-machine.defaultretrystatscodes.md +13 -0
- package/docs/api/foundation-state-machine.errorworkflowinput.md +15 -0
- package/docs/api/foundation-state-machine.escalateerror.md +42 -0
- package/docs/api/foundation-state-machine.fetchconfig.fetcher.md +13 -0
- package/docs/api/foundation-state-machine.fetchconfig.fetchpolicy.md +13 -0
- package/docs/api/foundation-state-machine.fetchconfig.md +23 -0
- package/docs/api/foundation-state-machine.fetchconfig.responsedataextractor.md +13 -0
- package/docs/api/foundation-state-machine.fetchconfig.responseokchecker.md +13 -0
- package/docs/api/foundation-state-machine.fetchmachine.md +15 -0
- package/docs/api/foundation-state-machine.fetchmachinecontext.controller.md +13 -0
- package/docs/api/foundation-state-machine.fetchmachinecontext.data.md +13 -0
- package/docs/api/foundation-state-machine.fetchmachinecontext.md +28 -0
- package/docs/api/foundation-state-machine.fetchmachinecontext.params.md +17 -0
- package/docs/api/foundation-state-machine.fetchmachinecontext.response.md +13 -0
- package/docs/api/foundation-state-machine.fetchmachineevent.md +24 -0
- package/docs/api/foundation-state-machine.fetchmachineeventmap.md +21 -0
- package/docs/api/foundation-state-machine.fetchmachineoutput.md +21 -0
- package/docs/api/foundation-state-machine.genesisservererror._constructor_.md +22 -0
- package/docs/api/foundation-state-machine.genesisservererror.getdetailserror.md +15 -0
- package/docs/api/foundation-state-machine.genesisservererror.getmessageerror.md +15 -0
- package/docs/api/foundation-state-machine.genesisservererror.haserrorcode.md +22 -0
- package/docs/api/foundation-state-machine.genesisservererror.isignorableerror.md +17 -0
- package/docs/api/foundation-state-machine.genesisservererror.md +41 -0
- package/docs/api/foundation-state-machine.genesisservererror.received.md +11 -0
- package/docs/api/foundation-state-machine.genesisservererror.sent.md +11 -0
- package/docs/api/foundation-state-machine.isaborterror.md +15 -0
- package/docs/api/foundation-state-machine.isactorerrorevent.md +13 -0
- package/docs/api/foundation-state-machine.isapierror.md +11 -0
- package/docs/api/foundation-state-machine.isdoneinvokeevent.md +13 -0
- package/docs/api/foundation-state-machine.iserrorcustomevent.md +18 -0
- package/docs/api/foundation-state-machine.iserrorevent.md +13 -0
- package/docs/api/foundation-state-machine.iserrortype.md +13 -0
- package/docs/api/foundation-state-machine.isgenesisservererror.md +11 -0
- package/docs/api/foundation-state-machine.ismappingerror.md +11 -0
- package/docs/api/foundation-state-machine.isnetworkerror.md +11 -0
- package/docs/api/foundation-state-machine.isnotfounderror.md +13 -0
- package/docs/api/foundation-state-machine.issyntaxerror.md +15 -0
- package/docs/api/foundation-state-machine.istypeerror.md +15 -0
- package/docs/api/foundation-state-machine.logger.md +12 -0
- package/docs/api/foundation-state-machine.machine.actor.md +18 -0
- package/docs/api/foundation-state-machine.machine.binding.md +47 -0
- package/docs/api/foundation-state-machine.machine.complete.md +13 -0
- package/docs/api/foundation-state-machine.machine.context.md +13 -0
- package/docs/api/foundation-state-machine.machine.error.md +13 -0
- package/docs/api/foundation-state-machine.machine.errors.md +13 -0
- package/docs/api/foundation-state-machine.machine.getfromcontainer.md +35 -0
- package/docs/api/foundation-state-machine.machine.hastag.md +35 -0
- package/docs/api/foundation-state-machine.machine.machine.md +18 -0
- package/docs/api/foundation-state-machine.machine.matches.md +35 -0
- package/docs/api/foundation-state-machine.machine.md +101 -0
- package/docs/api/foundation-state-machine.machine.onsendevent.md +24 -0
- package/docs/api/foundation-state-machine.machine.output.md +13 -0
- package/docs/api/foundation-state-machine.machine.provide.md +44 -0
- package/docs/api/foundation-state-machine.machine.send.md +24 -0
- package/docs/api/foundation-state-machine.machine.start.md +28 -0
- package/docs/api/foundation-state-machine.machine.startingcontext.md +13 -0
- package/docs/api/foundation-state-machine.machine.startingstate.md +13 -0
- package/docs/api/foundation-state-machine.machine.state.md +13 -0
- package/docs/api/foundation-state-machine.machine.stop.md +17 -0
- package/docs/api/foundation-state-machine.machinecontext.error.md +13 -0
- package/docs/api/foundation-state-machine.machinecontext.errors.md +13 -0
- package/docs/api/foundation-state-machine.machinecontext.md +36 -0
- package/docs/api/foundation-state-machine.mappingerror._constructor_.md +21 -0
- package/docs/api/foundation-state-machine.mappingerror.dto.md +11 -0
- package/docs/api/foundation-state-machine.mappingerror.md +27 -0
- package/docs/api/foundation-state-machine.md +81 -0
- package/docs/api/foundation-state-machine.networkerror._constructor_.md +21 -0
- package/docs/api/foundation-state-machine.networkerror.md +31 -0
- package/docs/api/foundation-state-machine.networkerror.url.md +11 -0
- package/docs/api/foundation-state-machine.responsedataextractor.md +18 -0
- package/docs/api/foundation-state-machine.responseokchecker.md +13 -0
- package/docs/api/foundation-state-machine.seterror.md +25 -0
- package/docs/api/foundation-state-machine.seterrorbykey.md +25 -0
- package/docs/api/index.md +12 -0
- package/docs/api-report.md +393 -0
- package/license.txt +46 -0
- package/package.json +60 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [Machine](./foundation-state-machine.machine.md) > [start](./foundation-state-machine.machine.start.md)
|
|
4
|
+
|
|
5
|
+
## Machine.start() method
|
|
6
|
+
|
|
7
|
+
Start the machine.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
start(options?: InterpreterOptions<StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>>): any;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| options | InterpreterOptions<StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>> | _(Optional)_ Optional InterpreterOptions. Can be used to restore to a previously persisted state. |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
any
|
|
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) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [Machine](./foundation-state-machine.machine.md) > [startingContext](./foundation-state-machine.machine.startingcontext.md)
|
|
4
|
+
|
|
5
|
+
## Machine.startingContext property
|
|
6
|
+
|
|
7
|
+
The `context` of the machine when started.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
readonly 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) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [Machine](./foundation-state-machine.machine.md) > [startingState](./foundation-state-machine.machine.startingstate.md)
|
|
4
|
+
|
|
5
|
+
## Machine.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
|
+
readonly 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) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [Machine](./foundation-state-machine.machine.md) > [state](./foundation-state-machine.machine.state.md)
|
|
4
|
+
|
|
5
|
+
## Machine.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
|
+
readonly 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) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [Machine](./foundation-state-machine.machine.md) > [stop](./foundation-state-machine.machine.stop.md)
|
|
4
|
+
|
|
5
|
+
## Machine.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,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [MachineContext](./foundation-state-machine.machinecontext.md) > [error](./foundation-state-machine.machinecontext.error.md)
|
|
4
|
+
|
|
5
|
+
## MachineContext.error property
|
|
6
|
+
|
|
7
|
+
A general machine error. Maybe equal to `errors.lastError`<!-- -->.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
readonly 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) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [MachineContext](./foundation-state-machine.machinecontext.md) > [errors](./foundation-state-machine.machinecontext.errors.md)
|
|
4
|
+
|
|
5
|
+
## MachineContext.errors property
|
|
6
|
+
|
|
7
|
+
A `ErrorMap` of errors that may have occurred during the machine's workflows.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
readonly errors: ErrorMap<ErrorDetailMap>;
|
|
13
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [MachineContext](./foundation-state-machine.machinecontext.md)
|
|
4
|
+
|
|
5
|
+
## MachineContext interface
|
|
6
|
+
|
|
7
|
+
MachineContext interface.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export interface MachineContext extends XMachineContext
|
|
13
|
+
```
|
|
14
|
+
**Extends:** XMachineContext
|
|
15
|
+
|
|
16
|
+
## Remarks
|
|
17
|
+
|
|
18
|
+
The interface of our xstate based machine contexts that include `error` and `errors` properties. Should be extended.
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
|
|
22
|
+
Creating a machine context.
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
export interface MyMachineContext extends MachineContext {
|
|
26
|
+
...
|
|
27
|
+
};
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Properties
|
|
31
|
+
|
|
32
|
+
| Property | Modifiers | Type | Description |
|
|
33
|
+
| --- | --- | --- | --- |
|
|
34
|
+
| [error](./foundation-state-machine.machinecontext.error.md) | <code>readonly</code> | any | A general machine error. Maybe equal to <code>errors.lastError</code>. |
|
|
35
|
+
| [errors](./foundation-state-machine.machinecontext.errors.md) | <code>readonly</code> | ErrorMap<ErrorDetailMap> | A <code>ErrorMap</code> of errors that may have occurred during the machine's workflows. |
|
|
36
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [MappingError](./foundation-state-machine.mappingerror.md) > [(constructor)](./foundation-state-machine.mappingerror._constructor_.md)
|
|
4
|
+
|
|
5
|
+
## MappingError.(constructor)
|
|
6
|
+
|
|
7
|
+
Constructs a new instance of the `MappingError` class
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
constructor(dto?: unknown, message?: string);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| dto | unknown | _(Optional)_ |
|
|
20
|
+
| message | string | _(Optional)_ |
|
|
21
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [MappingError](./foundation-state-machine.mappingerror.md) > [dto](./foundation-state-machine.mappingerror.dto.md)
|
|
4
|
+
|
|
5
|
+
## MappingError.dto property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
dto?: unknown;
|
|
11
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [MappingError](./foundation-state-machine.mappingerror.md)
|
|
4
|
+
|
|
5
|
+
## MappingError class
|
|
6
|
+
|
|
7
|
+
MappingError.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare class MappingError extends Error
|
|
13
|
+
```
|
|
14
|
+
**Extends:** Error
|
|
15
|
+
|
|
16
|
+
## Constructors
|
|
17
|
+
|
|
18
|
+
| Constructor | Modifiers | Description |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| [(constructor)(dto, message)](./foundation-state-machine.mappingerror._constructor_.md) | | Constructs a new instance of the <code>MappingError</code> class |
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
| Property | Modifiers | Type | Description |
|
|
25
|
+
| --- | --- | --- | --- |
|
|
26
|
+
| [dto?](./foundation-state-machine.mappingerror.dto.md) | | unknown | _(Optional)_ |
|
|
27
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md)
|
|
4
|
+
|
|
5
|
+
## foundation-state-machine package
|
|
6
|
+
|
|
7
|
+
## Classes
|
|
8
|
+
|
|
9
|
+
| Class | Description |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [APIError](./foundation-state-machine.apierror.md) | APIError. |
|
|
12
|
+
| [DefaultFetchMachine](./foundation-state-machine.defaultfetchmachine.md) | Default FetchMachine. |
|
|
13
|
+
| [GenesisServerError](./foundation-state-machine.genesisservererror.md) | GenesisServerError. |
|
|
14
|
+
| [MappingError](./foundation-state-machine.mappingerror.md) | MappingError. |
|
|
15
|
+
| [NetworkError](./foundation-state-machine.networkerror.md) | NetworkError. |
|
|
16
|
+
|
|
17
|
+
## Abstract Classes
|
|
18
|
+
|
|
19
|
+
| Abstract Class | Description |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| [AbstractMachine](./foundation-state-machine.abstractmachine.md) | AbstractMachine base class. |
|
|
22
|
+
|
|
23
|
+
## Functions
|
|
24
|
+
|
|
25
|
+
| Function | Description |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| [assertEvent(event, type)](./foundation-state-machine.assertevent.md) | assertEvent. |
|
|
28
|
+
|
|
29
|
+
## Interfaces
|
|
30
|
+
|
|
31
|
+
| Interface | Description |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| [FetchConfig](./foundation-state-machine.fetchconfig.md) | FetchConfig interface. |
|
|
34
|
+
| [FetchMachine](./foundation-state-machine.fetchmachine.md) | FetchMachine interface. |
|
|
35
|
+
| [FetchMachineContext](./foundation-state-machine.fetchmachinecontext.md) | FetchMachineContext interface. |
|
|
36
|
+
| [Machine](./foundation-state-machine.machine.md) | Machine interface. |
|
|
37
|
+
| [MachineContext](./foundation-state-machine.machinecontext.md) | MachineContext interface. |
|
|
38
|
+
|
|
39
|
+
## Variables
|
|
40
|
+
|
|
41
|
+
| Variable | Description |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| [createErrorStateNode](./foundation-state-machine.createerrorstatenode.md) | Creates an error state node. |
|
|
44
|
+
| [createFetchPolicy](./foundation-state-machine.createfetchpolicy.md) | A fetch policy factory. |
|
|
45
|
+
| [createResponseDataExtractorWithDeserializer](./foundation-state-machine.createresponsedataextractorwithdeserializer.md) | Creates an extractor that applies a deserializer to the extracted response data. |
|
|
46
|
+
| [defaultFetchConfig](./foundation-state-machine.defaultfetchconfig.md) | The default fetch config. |
|
|
47
|
+
| [defaultFetchMachineContext](./foundation-state-machine.defaultfetchmachinecontext.md) | Default FetchMachineContext. |
|
|
48
|
+
| [defaultFetchPolicy](./foundation-state-machine.defaultfetchpolicy.md) | The default fetch policy. |
|
|
49
|
+
| [defaultResponseDataExtractor](./foundation-state-machine.defaultresponsedataextractor.md) | ResponseDataExtractor type. |
|
|
50
|
+
| [defaultResponseOkChecker](./foundation-state-machine.defaultresponseokchecker.md) | ResponseOkChecker type. |
|
|
51
|
+
| [defaultRetryStatsCodes](./foundation-state-machine.defaultretrystatscodes.md) | Default retry stats codes. |
|
|
52
|
+
| [errorWorkflowInput](./foundation-state-machine.errorworkflowinput.md) | Error workflow input. |
|
|
53
|
+
| [escalateError](./foundation-state-machine.escalateerror.md) | Escalate error action. |
|
|
54
|
+
| [isAbortError](./foundation-state-machine.isaborterror.md) | isAbortError. |
|
|
55
|
+
| [isActorErrorEvent](./foundation-state-machine.isactorerrorevent.md) | isActorErrorEvent. |
|
|
56
|
+
| [isAPIError](./foundation-state-machine.isapierror.md) | |
|
|
57
|
+
| [isDoneInvokeEvent](./foundation-state-machine.isdoneinvokeevent.md) | isDoneInvokeEvent. |
|
|
58
|
+
| [isErrorCustomEvent](./foundation-state-machine.iserrorcustomevent.md) | isErrorCustomEvent. |
|
|
59
|
+
| [isErrorEvent](./foundation-state-machine.iserrorevent.md) | isErrorEvent. |
|
|
60
|
+
| [isErrorType](./foundation-state-machine.iserrortype.md) | isErrorType. |
|
|
61
|
+
| [isGenesisServerError](./foundation-state-machine.isgenesisservererror.md) | |
|
|
62
|
+
| [isMappingError](./foundation-state-machine.ismappingerror.md) | |
|
|
63
|
+
| [isNetworkError](./foundation-state-machine.isnetworkerror.md) | |
|
|
64
|
+
| [isNotFoundError](./foundation-state-machine.isnotfounderror.md) | |
|
|
65
|
+
| [isSyntaxError](./foundation-state-machine.issyntaxerror.md) | isSyntaxError. |
|
|
66
|
+
| [isTypeError](./foundation-state-machine.istypeerror.md) | isTypeError. |
|
|
67
|
+
| [logger](./foundation-state-machine.logger.md) | |
|
|
68
|
+
| [setError](./foundation-state-machine.seterror.md) | Set error action. |
|
|
69
|
+
| [setErrorByKey](./foundation-state-machine.seterrorbykey.md) | Set error by key action. |
|
|
70
|
+
|
|
71
|
+
## Type Aliases
|
|
72
|
+
|
|
73
|
+
| Type Alias | Description |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| [ErrorWorkflowInput](./foundation-state-machine.errorworkflowinput.md) | ErrorWorkflowInput type. |
|
|
76
|
+
| [FetchMachineEvent](./foundation-state-machine.fetchmachineevent.md) | FetchMachineEvent type. |
|
|
77
|
+
| [FetchMachineEventMap](./foundation-state-machine.fetchmachineeventmap.md) | FetchMachineEventMap type. |
|
|
78
|
+
| [FetchMachineOutput](./foundation-state-machine.fetchmachineoutput.md) | FetchMachineOutput type. |
|
|
79
|
+
| [ResponseDataExtractor](./foundation-state-machine.responsedataextractor.md) | ResponseDataExtractor type. |
|
|
80
|
+
| [ResponseOkChecker](./foundation-state-machine.responseokchecker.md) | ResponseOkChecker type. |
|
|
81
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [NetworkError](./foundation-state-machine.networkerror.md) > [(constructor)](./foundation-state-machine.networkerror._constructor_.md)
|
|
4
|
+
|
|
5
|
+
## NetworkError.(constructor)
|
|
6
|
+
|
|
7
|
+
Constructs a new instance of the `NetworkError` class
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
constructor(url: string, message?: string);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| url | string | |
|
|
20
|
+
| message | string | _(Optional)_ |
|
|
21
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [NetworkError](./foundation-state-machine.networkerror.md)
|
|
4
|
+
|
|
5
|
+
## NetworkError class
|
|
6
|
+
|
|
7
|
+
NetworkError.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare class NetworkError extends Error
|
|
13
|
+
```
|
|
14
|
+
**Extends:** Error
|
|
15
|
+
|
|
16
|
+
## Remarks
|
|
17
|
+
|
|
18
|
+
Failed to reach server.
|
|
19
|
+
|
|
20
|
+
## Constructors
|
|
21
|
+
|
|
22
|
+
| Constructor | Modifiers | Description |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| [(constructor)(url, message)](./foundation-state-machine.networkerror._constructor_.md) | | Constructs a new instance of the <code>NetworkError</code> class |
|
|
25
|
+
|
|
26
|
+
## Properties
|
|
27
|
+
|
|
28
|
+
| Property | Modifiers | Type | Description |
|
|
29
|
+
| --- | --- | --- | --- |
|
|
30
|
+
| [url](./foundation-state-machine.networkerror.url.md) | | string | |
|
|
31
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [NetworkError](./foundation-state-machine.networkerror.md) > [url](./foundation-state-machine.networkerror.url.md)
|
|
4
|
+
|
|
5
|
+
## NetworkError.url property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
url: string;
|
|
11
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [ResponseDataExtractor](./foundation-state-machine.responsedataextractor.md)
|
|
4
|
+
|
|
5
|
+
## ResponseDataExtractor type
|
|
6
|
+
|
|
7
|
+
ResponseDataExtractor type.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export type ResponseDataExtractor<TData = any> = (response: Response) => Promise<TData>;
|
|
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) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [ResponseOkChecker](./foundation-state-machine.responseokchecker.md)
|
|
4
|
+
|
|
5
|
+
## ResponseOkChecker type
|
|
6
|
+
|
|
7
|
+
ResponseOkChecker type.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export type ResponseOkChecker = (response: Response) => boolean;
|
|
13
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [setError](./foundation-state-machine.seterror.md)
|
|
4
|
+
|
|
5
|
+
## setError variable
|
|
6
|
+
|
|
7
|
+
Set error action.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
setError: {
|
|
13
|
+
(_: import("xstate").ActionArgs<import("xstate").MachineContext, import("xstate").EventObject, import("xstate").ParameterizedObject>): void;
|
|
14
|
+
type: string;
|
|
15
|
+
assignment: import("xstate").Assigner<import("xstate").MachineContext, import("xstate").EventObject> | import("xstate").PropertyAssigner<import("xstate").MachineContext, import("xstate").EventObject>;
|
|
16
|
+
resolve: (actorContext: import("xstate").AnyActorContext, state: import("xstate").AnyState, actionArgs: import("xstate").ActionArgs<any, any, import("xstate").ParameterizedObject>, { assignment }: {
|
|
17
|
+
assignment: import("xstate").Assigner<any, any> | import("xstate").PropertyAssigner<any, any>;
|
|
18
|
+
}) => import("xstate").AnyState[];
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Remarks
|
|
23
|
+
|
|
24
|
+
Used to set a top level error on the machine. This may equal to `lastError` in the `errors` property.
|
|
25
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [setErrorByKey](./foundation-state-machine.seterrorbykey.md)
|
|
4
|
+
|
|
5
|
+
## setErrorByKey variable
|
|
6
|
+
|
|
7
|
+
Set error by key action.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
setErrorByKey: (key: string) => {
|
|
13
|
+
(_: import("xstate").ActionArgs<import("xstate").MachineContext, import("xstate").EventObject, import("xstate").ParameterizedObject>): void;
|
|
14
|
+
type: string;
|
|
15
|
+
assignment: import("xstate").Assigner<import("xstate").MachineContext, import("xstate").EventObject> | import("xstate").PropertyAssigner<import("xstate").MachineContext, import("xstate").EventObject>;
|
|
16
|
+
resolve: (actorContext: import("xstate").AnyActorContext, state: import("xstate").AnyState, actionArgs: import("xstate").ActionArgs<any, any, import("xstate").ParameterizedObject>, { assignment }: {
|
|
17
|
+
assignment: import("xstate").Assigner<any, any> | import("xstate").PropertyAssigner<any, any>;
|
|
18
|
+
}) => import("xstate").AnyState[];
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Remarks
|
|
23
|
+
|
|
24
|
+
Used to set an error in the by key.
|
|
25
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md)
|
|
4
|
+
|
|
5
|
+
## API Reference
|
|
6
|
+
|
|
7
|
+
## Packages
|
|
8
|
+
|
|
9
|
+
| Package | Description |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [@genesislcap/foundation-state-machine](./foundation-state-machine.md) | |
|
|
12
|
+
|