@genesislcap/foundation-state-machine 14.408.0 → 14.409.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 +6 -26
- package/package.json +12 -12
- package/docs/api/foundation-state-machine.abstractmachine.actor.md +0 -18
- package/docs/api/foundation-state-machine.abstractmachine.binding.md +0 -102
- package/docs/api/foundation-state-machine.abstractmachine.complete.md +0 -13
- package/docs/api/foundation-state-machine.abstractmachine.context.md +0 -13
- package/docs/api/foundation-state-machine.abstractmachine.error.md +0 -13
- package/docs/api/foundation-state-machine.abstractmachine.errors.md +0 -13
- package/docs/api/foundation-state-machine.abstractmachine.getfromcontainer.md +0 -23
- package/docs/api/foundation-state-machine.abstractmachine.getmetavaluesbykey.md +0 -58
- package/docs/api/foundation-state-machine.abstractmachine.hastag.md +0 -58
- package/docs/api/foundation-state-machine.abstractmachine.machine.md +0 -18
- package/docs/api/foundation-state-machine.abstractmachine.matches.md +0 -58
- package/docs/api/foundation-state-machine.abstractmachine.md +0 -435
- package/docs/api/foundation-state-machine.abstractmachine.meta.md +0 -13
- package/docs/api/foundation-state-machine.abstractmachine.onsendevent.md +0 -13
- package/docs/api/foundation-state-machine.abstractmachine.output.md +0 -13
- package/docs/api/foundation-state-machine.abstractmachine.provide.md +0 -54
- package/docs/api/foundation-state-machine.abstractmachine.send.md +0 -54
- package/docs/api/foundation-state-machine.abstractmachine.snapshot.md +0 -13
- package/docs/api/foundation-state-machine.abstractmachine.start.md +0 -58
- package/docs/api/foundation-state-machine.abstractmachine.startingcontext.md +0 -13
- package/docs/api/foundation-state-machine.abstractmachine.startingstate.md +0 -13
- package/docs/api/foundation-state-machine.abstractmachine.state.md +0 -13
- package/docs/api/foundation-state-machine.abstractmachine.stop.md +0 -17
- package/docs/api/foundation-state-machine.apierror._constructor_.md +0 -80
- package/docs/api/foundation-state-machine.apierror.data.md +0 -11
- package/docs/api/foundation-state-machine.apierror.isunauthorized.md +0 -16
- package/docs/api/foundation-state-machine.apierror.md +0 -147
- package/docs/api/foundation-state-machine.apierror.status.md +0 -11
- package/docs/api/foundation-state-machine.assertevent.md +0 -72
- package/docs/api/foundation-state-machine.createerrorstatenode.md +0 -86
- package/docs/api/foundation-state-machine.createfetchpolicy.md +0 -122
- package/docs/api/foundation-state-machine.createresponsedataextractorwithdeserializer.md +0 -70
- package/docs/api/foundation-state-machine.defaultfetchconfig.md +0 -13
- package/docs/api/foundation-state-machine.defaultfetchmachine._constructor_.md +0 -50
- package/docs/api/foundation-state-machine.defaultfetchmachine.getfromcontainer.md +0 -23
- package/docs/api/foundation-state-machine.defaultfetchmachine.md +0 -99
- package/docs/api/foundation-state-machine.defaultfetchmachine.start.md +0 -58
- package/docs/api/foundation-state-machine.defaultfetchmachinecontext.md +0 -13
- package/docs/api/foundation-state-machine.defaultfetchpolicy.md +0 -13
- package/docs/api/foundation-state-machine.defaultresponsedataextractor.md +0 -18
- package/docs/api/foundation-state-machine.defaultresponseokchecker.md +0 -13
- package/docs/api/foundation-state-machine.defaultretrystatscodes.md +0 -13
- package/docs/api/foundation-state-machine.errorworkflowinput.md +0 -17
- package/docs/api/foundation-state-machine.escalateerror.md +0 -42
- package/docs/api/foundation-state-machine.fetchconfig.fetcher.md +0 -13
- package/docs/api/foundation-state-machine.fetchconfig.fetchpolicy.md +0 -13
- package/docs/api/foundation-state-machine.fetchconfig.md +0 -115
- package/docs/api/foundation-state-machine.fetchconfig.responsedataextractor.md +0 -13
- package/docs/api/foundation-state-machine.fetchconfig.responseokchecker.md +0 -13
- package/docs/api/foundation-state-machine.fetchmachine.md +0 -15
- package/docs/api/foundation-state-machine.fetchmachinecontext.controller.md +0 -13
- package/docs/api/foundation-state-machine.fetchmachinecontext.data.md +0 -13
- package/docs/api/foundation-state-machine.fetchmachinecontext.md +0 -120
- package/docs/api/foundation-state-machine.fetchmachinecontext.params.md +0 -17
- package/docs/api/foundation-state-machine.fetchmachinecontext.response.md +0 -13
- package/docs/api/foundation-state-machine.fetchmachineevent.md +0 -24
- package/docs/api/foundation-state-machine.fetchmachineeventmap.md +0 -21
- package/docs/api/foundation-state-machine.fetchmachineoutput.md +0 -21
- package/docs/api/foundation-state-machine.genesisservererror._constructor_.md +0 -82
- package/docs/api/foundation-state-machine.genesisservererror.getdetailserror.md +0 -15
- package/docs/api/foundation-state-machine.genesisservererror.getmessageerror.md +0 -15
- package/docs/api/foundation-state-machine.genesisservererror.haserrorcode.md +0 -50
- package/docs/api/foundation-state-machine.genesisservererror.isignorableerror.md +0 -17
- package/docs/api/foundation-state-machine.genesisservererror.md +0 -186
- package/docs/api/foundation-state-machine.genesisservererror.received.md +0 -11
- package/docs/api/foundation-state-machine.genesisservererror.sent.md +0 -11
- package/docs/api/foundation-state-machine.isaborterror.md +0 -54
- package/docs/api/foundation-state-machine.isactorerrorevent.md +0 -70
- package/docs/api/foundation-state-machine.isapierror.md +0 -52
- package/docs/api/foundation-state-machine.isdoneinvokeevent.md +0 -54
- package/docs/api/foundation-state-machine.iserrorcustomevent.md +0 -58
- package/docs/api/foundation-state-machine.iserrorevent.md +0 -54
- package/docs/api/foundation-state-machine.iserrortype.md +0 -54
- package/docs/api/foundation-state-machine.iseventwithparams.md +0 -54
- package/docs/api/foundation-state-machine.isgenesisservererror.md +0 -52
- package/docs/api/foundation-state-machine.ismappingerror.md +0 -52
- package/docs/api/foundation-state-machine.isnetworkerror.md +0 -52
- package/docs/api/foundation-state-machine.isnotfounderror.md +0 -54
- package/docs/api/foundation-state-machine.issyntaxerror.md +0 -54
- package/docs/api/foundation-state-machine.istypeerror.md +0 -54
- package/docs/api/foundation-state-machine.isunauthorizederror.md +0 -54
- package/docs/api/foundation-state-machine.logger.md +0 -12
- package/docs/api/foundation-state-machine.machine.actor.md +0 -18
- package/docs/api/foundation-state-machine.machine.binding.md +0 -122
- package/docs/api/foundation-state-machine.machine.complete.md +0 -13
- package/docs/api/foundation-state-machine.machine.context.md +0 -13
- package/docs/api/foundation-state-machine.machine.error.md +0 -13
- package/docs/api/foundation-state-machine.machine.errors.md +0 -13
- package/docs/api/foundation-state-machine.machine.getfromcontainer.md +0 -35
- package/docs/api/foundation-state-machine.machine.getmetavaluesbykey.md +0 -58
- package/docs/api/foundation-state-machine.machine.hastag.md +0 -65
- package/docs/api/foundation-state-machine.machine.machine.md +0 -18
- package/docs/api/foundation-state-machine.machine.matches.md +0 -65
- package/docs/api/foundation-state-machine.machine.md +0 -474
- package/docs/api/foundation-state-machine.machine.meta.md +0 -13
- package/docs/api/foundation-state-machine.machine.onsendevent.md +0 -54
- package/docs/api/foundation-state-machine.machine.output.md +0 -13
- package/docs/api/foundation-state-machine.machine.provide.md +0 -74
- package/docs/api/foundation-state-machine.machine.send.md +0 -54
- package/docs/api/foundation-state-machine.machine.snapshot.md +0 -13
- package/docs/api/foundation-state-machine.machine.start.md +0 -58
- package/docs/api/foundation-state-machine.machine.startingcontext.md +0 -13
- package/docs/api/foundation-state-machine.machine.startingstate.md +0 -13
- package/docs/api/foundation-state-machine.machine.state.md +0 -13
- package/docs/api/foundation-state-machine.machine.stop.md +0 -17
- package/docs/api/foundation-state-machine.machinecontext.error.md +0 -13
- package/docs/api/foundation-state-machine.machinecontext.errors.md +0 -13
- package/docs/api/foundation-state-machine.machinecontext.md +0 -96
- package/docs/api/foundation-state-machine.mappingerror._constructor_.md +0 -66
- package/docs/api/foundation-state-machine.mappingerror.dto.md +0 -11
- package/docs/api/foundation-state-machine.mappingerror.md +0 -93
- package/docs/api/foundation-state-machine.md +0 -600
- package/docs/api/foundation-state-machine.networkerror._constructor_.md +0 -64
- package/docs/api/foundation-state-machine.networkerror.md +0 -95
- package/docs/api/foundation-state-machine.networkerror.url.md +0 -11
- package/docs/api/foundation-state-machine.responsedataextractor.md +0 -18
- package/docs/api/foundation-state-machine.responseokchecker.md +0 -13
- package/docs/api/foundation-state-machine.seterror.md +0 -25
- package/docs/api/foundation-state-machine.seterrorbykey.md +0 -65
- package/docs/api/index.md +0 -30
- package/docs/api-report.md.api.md +0 -410
|
@@ -1,95 +0,0 @@
|
|
|
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
|
-
<table><thead><tr><th>
|
|
23
|
-
|
|
24
|
-
Constructor
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Modifiers
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th><th>
|
|
33
|
-
|
|
34
|
-
Description
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</th></tr></thead>
|
|
38
|
-
<tbody><tr><td>
|
|
39
|
-
|
|
40
|
-
[(constructor)(url, message)](./foundation-state-machine.networkerror._constructor_.md)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</td><td>
|
|
47
|
-
|
|
48
|
-
Constructs a new instance of the `NetworkError` class
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
</td></tr>
|
|
52
|
-
</tbody></table>
|
|
53
|
-
|
|
54
|
-
## Properties
|
|
55
|
-
|
|
56
|
-
<table><thead><tr><th>
|
|
57
|
-
|
|
58
|
-
Property
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
</th><th>
|
|
62
|
-
|
|
63
|
-
Modifiers
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
</th><th>
|
|
67
|
-
|
|
68
|
-
Type
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
</th><th>
|
|
72
|
-
|
|
73
|
-
Description
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
</th></tr></thead>
|
|
77
|
-
<tbody><tr><td>
|
|
78
|
-
|
|
79
|
-
[url](./foundation-state-machine.networkerror.url.md)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</td><td>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</td><td>
|
|
86
|
-
|
|
87
|
-
string
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
</td><td>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</td></tr>
|
|
94
|
-
</tbody></table>
|
|
95
|
-
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
```
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
```
|
|
@@ -1,25 +0,0 @@
|
|
|
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>, { 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
|
-
|
|
@@ -1,65 +0,0 @@
|
|
|
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() function
|
|
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>, { assignment }: {
|
|
17
|
-
assignment: import("xstate").Assigner<any, any> | import("xstate").PropertyAssigner<any, any>;
|
|
18
|
-
}) => import("xstate").AnyState[];
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Parameters
|
|
23
|
-
|
|
24
|
-
<table><thead><tr><th>
|
|
25
|
-
|
|
26
|
-
Parameter
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</th><th>
|
|
30
|
-
|
|
31
|
-
Type
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</th><th>
|
|
35
|
-
|
|
36
|
-
Description
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</th></tr></thead>
|
|
40
|
-
<tbody><tr><td>
|
|
41
|
-
|
|
42
|
-
key
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</td><td>
|
|
46
|
-
|
|
47
|
-
string
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</td><td>
|
|
51
|
-
|
|
52
|
-
The error key.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</td></tr>
|
|
56
|
-
</tbody></table>
|
|
57
|
-
|
|
58
|
-
**Returns:**
|
|
59
|
-
|
|
60
|
-
{ (\_: import("xstate").ActionArgs<import("xstate").MachineContext, import("xstate").EventObject, import("xstate").ParameterizedObject>): void; type: string; assignment: import("xstate").Assigner<import("xstate").MachineContext, import("xstate").EventObject> \| import("xstate").PropertyAssigner<import("xstate").MachineContext, import("xstate").EventObject>; resolve: (actorContext: import("xstate").AnyActorContext, state: import("xstate").AnyState, actionArgs: import("xstate").ActionArgs<any, any>, { assignment }: { assignment: import("xstate").Assigner<any, any> \| import("xstate").PropertyAssigner<any, any>; }) => import("xstate").AnyState\[\]; }
|
|
61
|
-
|
|
62
|
-
## Remarks
|
|
63
|
-
|
|
64
|
-
Used to set an error in the by key.
|
|
65
|
-
|
package/docs/api/index.md
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
<table><thead><tr><th>
|
|
10
|
-
|
|
11
|
-
Package
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</th><th>
|
|
15
|
-
|
|
16
|
-
Description
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</th></tr></thead>
|
|
20
|
-
<tbody><tr><td>
|
|
21
|
-
|
|
22
|
-
[@genesislcap/foundation-state-machine](./foundation-state-machine.md)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</td><td>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</td></tr>
|
|
29
|
-
</tbody></table>
|
|
30
|
-
|
|
@@ -1,410 +0,0 @@
|
|
|
1
|
-
## API Report File for "@genesislcap/foundation-state-machine"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import { ActionArgs } from 'xstate';
|
|
8
|
-
import { AnyActorContext } from 'xstate';
|
|
9
|
-
import { AnyActorRef } from 'xstate';
|
|
10
|
-
import { AnyEventObject } from 'xstate';
|
|
11
|
-
import { AnyState } from 'xstate';
|
|
12
|
-
import { Assigner } from 'xstate';
|
|
13
|
-
import { BindingObserver } from '@microsoft/fast-element';
|
|
14
|
-
import { Container } from '@microsoft/fast-foundation';
|
|
15
|
-
import { DelayExpr } from 'xstate';
|
|
16
|
-
import { DoneInvokeEvent } from 'xstate';
|
|
17
|
-
import { ErrorDetailMap } from '@genesislcap/foundation-utils';
|
|
18
|
-
import { ErrorEvent as ErrorEvent_2 } from 'xstate';
|
|
19
|
-
import { ErrorMap } from '@genesislcap/foundation-utils';
|
|
20
|
-
import { EventObject } from 'xstate';
|
|
21
|
-
import { ExecutionContext } from '@microsoft/fast-element';
|
|
22
|
-
import type { IBackoffFactory } from 'cockatiel';
|
|
23
|
-
import { ICancellationContext } from 'cockatiel';
|
|
24
|
-
import { IMergedPolicy } from 'cockatiel';
|
|
25
|
-
import { InterfaceSymbol } from '@microsoft/fast-foundation';
|
|
26
|
-
import type { InternalMachineImplementations } from 'xstate';
|
|
27
|
-
import type { InterpreterFrom } from 'xstate';
|
|
28
|
-
import type { InterpreterOptions } from 'xstate';
|
|
29
|
-
import type { IRetryBackoffContext } from 'cockatiel';
|
|
30
|
-
import { IRetryContext } from 'cockatiel';
|
|
31
|
-
import { Logger } from '@genesislcap/foundation-logger';
|
|
32
|
-
import { MachineContext as MachineContext_2 } from 'xstate';
|
|
33
|
-
import { Message } from '@genesislcap/foundation-comms';
|
|
34
|
-
import type { NoInfer as NoInfer_2 } from 'xstate';
|
|
35
|
-
import { ParameterizedObject } from 'xstate';
|
|
36
|
-
import { PropertyAssigner } from 'xstate';
|
|
37
|
-
import type { ProvidedActor } from 'xstate';
|
|
38
|
-
import type { ResolveTypegenMeta } from 'xstate';
|
|
39
|
-
import { RetryPolicy } from 'cockatiel';
|
|
40
|
-
import { SendExpr } from 'xstate';
|
|
41
|
-
import type { State } from 'xstate';
|
|
42
|
-
import type { StateMachine } from 'xstate';
|
|
43
|
-
import type { StateNodeConfig } from 'xstate';
|
|
44
|
-
import type { StateValue } from 'xstate';
|
|
45
|
-
import type { StateValueFrom } from 'xstate';
|
|
46
|
-
import { StatusCodes } from 'http-status-codes';
|
|
47
|
-
import { TimeoutPolicy } from 'cockatiel';
|
|
48
|
-
import type { TypegenDisabled } from 'xstate';
|
|
49
|
-
import { UnifiedArg } from 'xstate';
|
|
50
|
-
|
|
51
|
-
// @public
|
|
52
|
-
export abstract class AbstractMachine<TContext extends MachineContext, TEvent extends EventObject = AnyEventObject, TAction extends ParameterizedObject = ParameterizedObject, TActor extends ProvidedActor = ProvidedActor, TInput = any, TResolvedTypesMeta = ResolveTypegenMeta<TypegenDisabled, NoInfer_2<TEvent>, TAction, TActor>> implements Machine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta> {
|
|
53
|
-
actor: InterpreterFrom<StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>>;
|
|
54
|
-
// @internal (undocumented)
|
|
55
|
-
protected applySnapshot(snapshot?: typeof AbstractMachine.snapshot): void;
|
|
56
|
-
// Warning: (ae-incompatible-release-tags) The symbol "binding" is marked as @public, but its signature references "SubscriberChangeCallback" which is marked as @internal
|
|
57
|
-
binding<TReturn = any, TParent = any>(token: ((target: this) => TReturn) | keyof this, subscriberChangeCallback?: SubscriberChangeCallback<TReturn> | undefined, isVolatileBinding?: boolean, context?: ExecutionContext): BindingObserver<this, TReturn, TParent>;
|
|
58
|
-
complete: boolean;
|
|
59
|
-
// @internal (undocumented)
|
|
60
|
-
protected container: Container;
|
|
61
|
-
context: Partial<TContext>;
|
|
62
|
-
error: any;
|
|
63
|
-
errors: ErrorMap<ErrorDetailMap>;
|
|
64
|
-
abstract getFromContainer(): this;
|
|
65
|
-
getMetaValuesByKey<T = string>(key?: string): T[];
|
|
66
|
-
hasTag(tag: string): boolean;
|
|
67
|
-
// @internal (undocumented)
|
|
68
|
-
protected interpret(options?: InterpreterOptions<typeof AbstractMachine.machine>): void;
|
|
69
|
-
machine: StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>;
|
|
70
|
-
matches(value: StateValueFrom<typeof AbstractMachine.machine>): boolean;
|
|
71
|
-
meta: Record<string, any>;
|
|
72
|
-
onSendEvent: (event: CustomEvent<TEvent>) => void;
|
|
73
|
-
output: any;
|
|
74
|
-
provide(implementations: InternalMachineImplementations<TContext, TEvent, TAction, TActor, TResolvedTypesMeta, true>): void;
|
|
75
|
-
send(event: TEvent): void;
|
|
76
|
-
snapshot: State<TContext, TEvent, TActor, TResolvedTypesMeta>;
|
|
77
|
-
start(options?: InterpreterOptions<typeof AbstractMachine.machine>): void;
|
|
78
|
-
// @internal (undocumented)
|
|
79
|
-
protected startActor(): void;
|
|
80
|
-
startingContext: Partial<TContext>;
|
|
81
|
-
startingState: StateValue;
|
|
82
|
-
state: StateValue;
|
|
83
|
-
stop(): void;
|
|
84
|
-
// @internal (undocumented)
|
|
85
|
-
protected stopActor(): void;
|
|
86
|
-
// @internal (undocumented)
|
|
87
|
-
protected subscribe(): void;
|
|
88
|
-
// @internal (undocumented)
|
|
89
|
-
protected unsubscribe(): void;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// @public
|
|
93
|
-
export class APIError extends Error {
|
|
94
|
-
constructor(status: number, data?: unknown, message?: string);
|
|
95
|
-
// (undocumented)
|
|
96
|
-
data?: unknown;
|
|
97
|
-
// (undocumented)
|
|
98
|
-
isUnauthorized(): boolean;
|
|
99
|
-
// (undocumented)
|
|
100
|
-
status: number;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// @public
|
|
104
|
-
export function assertEvent<TEvent extends EventObject = EventObject>(event: TEvent, type: TEvent['type']): asserts event is Extract<TEvent, {
|
|
105
|
-
type: TEvent['type'];
|
|
106
|
-
}>;
|
|
107
|
-
|
|
108
|
-
// @public
|
|
109
|
-
export const createErrorStateNode: (key: string, metaContent?: string, final?: boolean) => StateNodeConfig<any, any, any, any>;
|
|
110
|
-
|
|
111
|
-
// @public
|
|
112
|
-
export const createFetchPolicy: (maxAttempts?: number, retryCodes?: StatusCodes[] | number[], backoff?: IBackoffFactory<IRetryBackoffContext<unknown>>, timeoutDuration?: number, logEvents?: boolean) => IMergedPolicy<IRetryContext & ICancellationContext, never, [RetryPolicy, TimeoutPolicy]>;
|
|
113
|
-
|
|
114
|
-
// @public
|
|
115
|
-
export const createResponseDataExtractorWithDeserializer: <TInput = any, TOutput = any>(deserializer: (data: TInput) => Promise<TOutput>, extractor?: ResponseDataExtractor) => ResponseDataExtractor;
|
|
116
|
-
|
|
117
|
-
// @public
|
|
118
|
-
export const defaultFetchConfig: FetchConfig;
|
|
119
|
-
|
|
120
|
-
// @public
|
|
121
|
-
export class DefaultFetchMachine extends AbstractMachine<FetchMachineContext, FetchMachineEvent> implements FetchMachine {
|
|
122
|
-
constructor(config?: FetchConfig);
|
|
123
|
-
getFromContainer(): this;
|
|
124
|
-
start(options?: InterpreterOptions<typeof DefaultFetchMachine.machine>): void;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// @public
|
|
128
|
-
export const defaultFetchMachineContext: Partial<FetchMachineContext>;
|
|
129
|
-
|
|
130
|
-
// @public
|
|
131
|
-
export const defaultFetchPolicy: IMergedPolicy<IRetryContext & ICancellationContext, never, [RetryPolicy, TimeoutPolicy]>;
|
|
132
|
-
|
|
133
|
-
// @public
|
|
134
|
-
export const defaultResponseDataExtractor: ResponseDataExtractor;
|
|
135
|
-
|
|
136
|
-
// @public
|
|
137
|
-
export const defaultResponseOkChecker: ResponseOkChecker;
|
|
138
|
-
|
|
139
|
-
// @public
|
|
140
|
-
export const defaultRetryStatsCodes: StatusCodes[];
|
|
141
|
-
|
|
142
|
-
// @public
|
|
143
|
-
export type ErrorWorkflowInput = {
|
|
144
|
-
errorKey: string;
|
|
145
|
-
errorValue: any;
|
|
146
|
-
errorMap: ErrorMap<ErrorDetailMap>;
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
// @public
|
|
150
|
-
export const errorWorkflowInput: (key: string) => ({ context }: {
|
|
151
|
-
context: any;
|
|
152
|
-
}) => ErrorWorkflowInput;
|
|
153
|
-
|
|
154
|
-
// @public
|
|
155
|
-
export const escalateError: {
|
|
156
|
-
(_: ActionArgs<MachineContext_2, EventObject, ParameterizedObject>): void;
|
|
157
|
-
type: string;
|
|
158
|
-
to: string | AnyActorRef | ((args: UnifiedArg<MachineContext_2, EventObject>) => string | AnyActorRef);
|
|
159
|
-
event: any;
|
|
160
|
-
id: string | undefined;
|
|
161
|
-
delay: string | number | DelayExpr<MachineContext_2, EventObject>;
|
|
162
|
-
resolve: (actorContext: AnyActorContext, state: AnyState, args: ActionArgs<any, any>, { to, event: eventOrExpr, id, delay }: {
|
|
163
|
-
to: AnyActorRef | string | ((args: UnifiedArg<MachineContext_2, EventObject>) => AnyActorRef | string);
|
|
164
|
-
event: EventObject | SendExpr<MachineContext_2, EventObject, EventObject>;
|
|
165
|
-
id: string | undefined;
|
|
166
|
-
delay: string | number | DelayExpr<MachineContext_2, EventObject> | undefined;
|
|
167
|
-
}) => (AnyState | {
|
|
168
|
-
to: AnyActorRef;
|
|
169
|
-
event: EventObject;
|
|
170
|
-
id: string | undefined;
|
|
171
|
-
delay: number | undefined;
|
|
172
|
-
})[];
|
|
173
|
-
execute: (actorContext: AnyActorContext, params: {
|
|
174
|
-
to: AnyActorRef;
|
|
175
|
-
event: EventObject;
|
|
176
|
-
id: string | undefined;
|
|
177
|
-
delay: number | undefined;
|
|
178
|
-
}) => void;
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
// Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "FetchConfig" because one of its declarations is marked as @internal
|
|
182
|
-
//
|
|
183
|
-
// @public
|
|
184
|
-
export interface FetchConfig {
|
|
185
|
-
fetcher: typeof fetch;
|
|
186
|
-
fetchPolicy?: IMergedPolicy<any, any, any>;
|
|
187
|
-
responseDataExtractor?: ResponseDataExtractor;
|
|
188
|
-
responseOkChecker?: ResponseOkChecker;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// @internal
|
|
192
|
-
export const FetchConfig: InterfaceSymbol<FetchConfig>;
|
|
193
|
-
|
|
194
|
-
// Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "FetchMachine" because one of its declarations is marked as @internal
|
|
195
|
-
//
|
|
196
|
-
// @public
|
|
197
|
-
export interface FetchMachine extends Machine<FetchMachineContext, FetchMachineEvent> {
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// @internal
|
|
201
|
-
export const FetchMachine: InterfaceSymbol<FetchMachine>;
|
|
202
|
-
|
|
203
|
-
// @public
|
|
204
|
-
export interface FetchMachineContext extends MachineContext {
|
|
205
|
-
controller: AbortController;
|
|
206
|
-
data: any;
|
|
207
|
-
params: {
|
|
208
|
-
url: string;
|
|
209
|
-
requestInit?: RequestInit | CMRequestInit;
|
|
210
|
-
fetchConfig?: FetchConfig;
|
|
211
|
-
};
|
|
212
|
-
response: Response | undefined;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// @public
|
|
216
|
-
export type FetchMachineEvent = {
|
|
217
|
-
type: 'fetch';
|
|
218
|
-
params: FetchMachineContext['params'];
|
|
219
|
-
} | {
|
|
220
|
-
type: 'cancel';
|
|
221
|
-
} | DoneInvokeEvent<unknown> | ErrorEvent_2<unknown>;
|
|
222
|
-
|
|
223
|
-
// @public
|
|
224
|
-
export type FetchMachineEventMap = {
|
|
225
|
-
'fetch-machine-event': FetchMachineEvent;
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
// @public
|
|
229
|
-
export type FetchMachineOutput<TData = any> = Partial<Pick<FetchMachineContext, 'response' | 'error'>> & {
|
|
230
|
-
data: TData;
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
// @public
|
|
234
|
-
export class GenesisServerError extends Error {
|
|
235
|
-
constructor(sent?: Message, received?: Message, message?: string);
|
|
236
|
-
// (undocumented)
|
|
237
|
-
getDetailsError(): string;
|
|
238
|
-
// (undocumented)
|
|
239
|
-
getMessageError(): string;
|
|
240
|
-
// (undocumented)
|
|
241
|
-
hasErrorCode(code: string): boolean;
|
|
242
|
-
isIgnorableError(): boolean;
|
|
243
|
-
// (undocumented)
|
|
244
|
-
received?: Message;
|
|
245
|
-
// (undocumented)
|
|
246
|
-
sent?: Message;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
// Warning: (ae-internal-missing-underscore) The name "getBindArgs" should be prefixed with an underscore because the declaration is marked as @internal
|
|
250
|
-
//
|
|
251
|
-
// @internal (undocumented)
|
|
252
|
-
export const getBindArgs: <TTarget = any>(...args: unknown[]) => TargetBinding<TTarget>;
|
|
253
|
-
|
|
254
|
-
// @public
|
|
255
|
-
export const isAbortError: ({ event }: {
|
|
256
|
-
event: any;
|
|
257
|
-
}) => boolean;
|
|
258
|
-
|
|
259
|
-
// @public
|
|
260
|
-
export const isActorErrorEvent: <TData = any>(actorId: string, event: EventObject | ErrorEvent_2<TData>) => event is ErrorEvent_2<TData>;
|
|
261
|
-
|
|
262
|
-
// @public (undocumented)
|
|
263
|
-
export const isAPIError: (error: unknown) => error is APIError;
|
|
264
|
-
|
|
265
|
-
// @public
|
|
266
|
-
export const isDoneInvokeEvent: <TData = any>(event: EventObject | DoneInvokeEvent<TData>) => event is DoneInvokeEvent<TData>;
|
|
267
|
-
|
|
268
|
-
// @public
|
|
269
|
-
export const isErrorCustomEvent: <TData = any>(event: EventObject | ErrorEvent_2<TData>) => event is ErrorEvent_2<TData>;
|
|
270
|
-
|
|
271
|
-
// @public
|
|
272
|
-
export const isErrorEvent: <TData = any>(event: EventObject | ErrorEvent_2<TData>) => event is ErrorEvent_2<TData>;
|
|
273
|
-
|
|
274
|
-
// @public
|
|
275
|
-
export const isErrorType: <TType extends ErrorConstructor>(type: TType) => (event: any) => boolean;
|
|
276
|
-
|
|
277
|
-
// @public
|
|
278
|
-
export const isEventWithParams: (event: AnyEventObject) => event is ParameterizedObject;
|
|
279
|
-
|
|
280
|
-
// @public (undocumented)
|
|
281
|
-
export const isGenesisServerError: (error: unknown) => error is GenesisServerError;
|
|
282
|
-
|
|
283
|
-
// @public (undocumented)
|
|
284
|
-
export const isMappingError: (error: unknown) => error is MappingError;
|
|
285
|
-
|
|
286
|
-
// @public (undocumented)
|
|
287
|
-
export const isNetworkError: (error: unknown) => error is NetworkError;
|
|
288
|
-
|
|
289
|
-
// @public (undocumented)
|
|
290
|
-
export const isNotFoundError: (error: {
|
|
291
|
-
status?: number;
|
|
292
|
-
}) => error is APIError;
|
|
293
|
-
|
|
294
|
-
// @public
|
|
295
|
-
export const isSyntaxError: ({ event }: {
|
|
296
|
-
event: any;
|
|
297
|
-
}) => boolean;
|
|
298
|
-
|
|
299
|
-
// @public
|
|
300
|
-
export const isTypeError: ({ event }: {
|
|
301
|
-
event: any;
|
|
302
|
-
}) => boolean;
|
|
303
|
-
|
|
304
|
-
// @public (undocumented)
|
|
305
|
-
export const isUnauthorizedError: (error: {
|
|
306
|
-
status?: number;
|
|
307
|
-
}) => error is APIError;
|
|
308
|
-
|
|
309
|
-
// @public (undocumented)
|
|
310
|
-
export const logger: Logger;
|
|
311
|
-
|
|
312
|
-
// @public
|
|
313
|
-
export interface Machine<TContext extends MachineContext, TEvent extends EventObject = AnyEventObject, TAction extends ParameterizedObject = ParameterizedObject, TActor extends ProvidedActor = ProvidedActor, TInput = any, TResolvedTypesMeta = ResolveTypegenMeta<TypegenDisabled, NoInfer_2<TEvent>, TAction, TActor>> {
|
|
314
|
-
readonly actor?: InterpreterFrom<StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>>;
|
|
315
|
-
// Warning: (ae-incompatible-release-tags) The symbol "binding" is marked as @public, but its signature references "SubscriberChangeCallback" which is marked as @internal
|
|
316
|
-
binding<TReturn = any, TParent = any>(token: ((target: this) => TReturn) | keyof this, subscriberChangeCallback?: SubscriberChangeCallback<TReturn> | undefined, isVolatileBinding?: boolean, context?: ExecutionContext): BindingObserver<this, TReturn, TParent>;
|
|
317
|
-
readonly complete: boolean;
|
|
318
|
-
readonly context: Partial<TContext>;
|
|
319
|
-
readonly error: any;
|
|
320
|
-
readonly errors: ErrorMap<ErrorDetailMap>;
|
|
321
|
-
getFromContainer(): this;
|
|
322
|
-
getMetaValuesByKey<T = string>(key?: string): T[];
|
|
323
|
-
hasTag(tag: string): boolean;
|
|
324
|
-
readonly machine: StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>;
|
|
325
|
-
matches(value: StateValueFrom<StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>>): boolean;
|
|
326
|
-
readonly meta: Record<string, any>;
|
|
327
|
-
onSendEvent(event: CustomEvent<TEvent>): void;
|
|
328
|
-
readonly output: any;
|
|
329
|
-
provide(implementations: InternalMachineImplementations<TContext, TEvent, TAction, TActor, TResolvedTypesMeta, true>): void;
|
|
330
|
-
send(event: TEvent): void;
|
|
331
|
-
readonly snapshot: State<TContext, TEvent, TActor, TResolvedTypesMeta>;
|
|
332
|
-
start(options?: InterpreterOptions<StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>>): any;
|
|
333
|
-
readonly startingContext: Partial<TContext>;
|
|
334
|
-
readonly startingState: StateValue;
|
|
335
|
-
readonly state: StateValue;
|
|
336
|
-
stop(): void;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// @public
|
|
340
|
-
export interface MachineContext extends MachineContext_2 {
|
|
341
|
-
readonly error: any;
|
|
342
|
-
readonly errors: ErrorMap<ErrorDetailMap>;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
// @public
|
|
346
|
-
export class MappingError extends Error {
|
|
347
|
-
constructor(dto?: unknown, message?: string);
|
|
348
|
-
// (undocumented)
|
|
349
|
-
dto?: unknown;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// @public
|
|
353
|
-
export class NetworkError extends Error {
|
|
354
|
-
constructor(url: string, message?: string);
|
|
355
|
-
// (undocumented)
|
|
356
|
-
url: string;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
// @public
|
|
360
|
-
export type ResponseDataExtractor<TData = any> = (response: Response) => Promise<TData>;
|
|
361
|
-
|
|
362
|
-
// @public
|
|
363
|
-
export type ResponseOkChecker = (response: Response) => boolean;
|
|
364
|
-
|
|
365
|
-
// @public
|
|
366
|
-
export const setError: {
|
|
367
|
-
(_: ActionArgs<MachineContext_2, EventObject, ParameterizedObject>): void;
|
|
368
|
-
type: string;
|
|
369
|
-
assignment: Assigner<MachineContext_2, EventObject> | PropertyAssigner<MachineContext_2, EventObject>;
|
|
370
|
-
resolve: (actorContext: AnyActorContext, state: AnyState, actionArgs: ActionArgs<any, any>, { assignment }: {
|
|
371
|
-
assignment: Assigner<any, any> | PropertyAssigner<any, any>;
|
|
372
|
-
}) => AnyState[];
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
// @public
|
|
376
|
-
export const setErrorByKey: (key: string) => {
|
|
377
|
-
(_: ActionArgs<MachineContext_2, EventObject, ParameterizedObject>): void;
|
|
378
|
-
type: string;
|
|
379
|
-
assignment: Assigner<MachineContext_2, EventObject> | PropertyAssigner<MachineContext_2, EventObject>;
|
|
380
|
-
resolve: (actorContext: AnyActorContext, state: AnyState, actionArgs: ActionArgs<any, any>, { assignment }: {
|
|
381
|
-
assignment: Assigner<any, any> | PropertyAssigner<any, any>;
|
|
382
|
-
}) => AnyState[];
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
// Warning: (ae-internal-missing-underscore) The name "SubscriberChangeCallback" should be prefixed with an underscore because the declaration is marked as @internal
|
|
386
|
-
//
|
|
387
|
-
// @internal (undocumented)
|
|
388
|
-
export type SubscriberChangeCallback<TReturn = any> = (value: TReturn, args: BindingObserver) => void;
|
|
389
|
-
|
|
390
|
-
// Warning: (ae-internal-missing-underscore) The name "SubscriberChangeHandler" should be prefixed with an underscore because the declaration is marked as @internal
|
|
391
|
-
//
|
|
392
|
-
// @internal (undocumented)
|
|
393
|
-
export type SubscriberChangeHandler<TTarget = any, TReturn = any> = (binding: (x?: TTarget, context?: ExecutionContext) => TReturn, args: BindingObserver) => void;
|
|
394
|
-
|
|
395
|
-
// Warning: (ae-internal-missing-underscore) The name "TargetBinding" should be prefixed with an underscore because the declaration is marked as @internal
|
|
396
|
-
//
|
|
397
|
-
// @internal (undocumented)
|
|
398
|
-
export type TargetBinding<TTarget = any> = (target: TTarget) => any;
|
|
399
|
-
|
|
400
|
-
// Warning: (ae-internal-missing-underscore) The name "TargetSubscriber" should be prefixed with an underscore because the declaration is marked as @internal
|
|
401
|
-
//
|
|
402
|
-
// @internal (undocumented)
|
|
403
|
-
export interface TargetSubscriber<TTarget = any, TReturn = any> {
|
|
404
|
-
// (undocumented)
|
|
405
|
-
handleChange: SubscriberChangeHandler<TTarget, TReturn>;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
// (No @packageDocumentation comment for this package)
|
|
409
|
-
|
|
410
|
-
```
|