@genesislcap/foundation-state-machine 14.303.0 → 14.303.2

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 (2) hide show
  1. package/package.json +12 -12
  2. package/docs/api-report.md +0 -410
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-state-machine",
3
3
  "description": "Genesis Foundation State Machine",
4
- "version": "14.303.0",
4
+ "version": "14.303.2",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -52,18 +52,18 @@
52
52
  }
53
53
  },
54
54
  "devDependencies": {
55
- "@genesislcap/foundation-testing": "14.303.0",
56
- "@genesislcap/genx": "14.303.0",
57
- "@genesislcap/rollup-builder": "14.303.0",
58
- "@genesislcap/ts-builder": "14.303.0",
59
- "@genesislcap/uvu-playwright-builder": "14.303.0",
60
- "@genesislcap/vite-builder": "14.303.0",
61
- "@genesislcap/webpack-builder": "14.303.0"
55
+ "@genesislcap/foundation-testing": "14.303.2",
56
+ "@genesislcap/genx": "14.303.2",
57
+ "@genesislcap/rollup-builder": "14.303.2",
58
+ "@genesislcap/ts-builder": "14.303.2",
59
+ "@genesislcap/uvu-playwright-builder": "14.303.2",
60
+ "@genesislcap/vite-builder": "14.303.2",
61
+ "@genesislcap/webpack-builder": "14.303.2"
62
62
  },
63
63
  "dependencies": {
64
- "@genesislcap/foundation-comms": "14.303.0",
65
- "@genesislcap/foundation-logger": "14.303.0",
66
- "@genesislcap/foundation-utils": "14.303.0",
64
+ "@genesislcap/foundation-comms": "14.303.2",
65
+ "@genesislcap/foundation-logger": "14.303.2",
66
+ "@genesislcap/foundation-utils": "14.303.2",
67
67
  "@microsoft/fast-element": "1.14.0",
68
68
  "@microsoft/fast-foundation": "2.49.6",
69
69
  "cockatiel": "^3.1.1",
@@ -78,5 +78,5 @@
78
78
  "publishConfig": {
79
79
  "access": "public"
80
80
  },
81
- "gitHead": "1495670cf431019b7a29589f6ab7b80c0ec31945"
81
+ "gitHead": "f556f123bafe956a7ba9328bb3f78f4d7d2495ba"
82
82
  }
@@ -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 } 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<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<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
- ```