@crvouga/mockingbird-service-step-functions 3.3.0 → 3.4.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/dist/cli.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  runCli,
4
4
  serveCommand,
5
5
  serveTarget
6
- } from "./chunk-5M7DLGOU.js";
7
- import "./chunk-SHMO7XCX.js";
6
+ } from "./chunk-LSHC7AAT.js";
7
+ import "./chunk-WM6TYPGJ.js";
8
8
 
9
9
  // src/cli.ts
10
10
  var code = await runCli(
package/dist/index.d.ts CHANGED
@@ -522,6 +522,8 @@ type SnapshotDocument = {
522
522
  faults?: unknown;
523
523
  latency?: unknown;
524
524
  virtualTime?: boolean;
525
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
526
+ webhooks?: unknown;
525
527
  };
526
528
  /** Controls for one namespace. */
527
529
  type NamespaceControls = {
@@ -735,6 +737,8 @@ type CredentialRegistry = {
735
737
  }[];
736
738
  };
737
739
 
740
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
741
+
738
742
  /**
739
743
  * A point-in-time copy of everything a service namespace holds.
740
744
  *
@@ -852,8 +856,16 @@ type PublishInput = {
852
856
  id?: string;
853
857
  };
854
858
  type WebhookHub = {
859
+ observeDeliveries(listener: (event: {
860
+ namespace: string;
861
+ state: string;
862
+ deliveryId: string;
863
+ }) => void): () => void;
864
+ setTransportPolicy(policy: OwnedTransport): void;
855
865
  pending(namespace: string): number;
856
866
  snapshot(namespace: string): unknown;
867
+ exportSnapshot(handle: unknown): unknown;
868
+ importSnapshot(namespace: string, document: unknown): unknown;
857
869
  restore(namespace: string, snapshot: unknown): void;
858
870
  publish(input: PublishInput): WebhookMessage;
859
871
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -866,7 +878,7 @@ type WebhookHub = {
866
878
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
867
879
  flush(): Promise<void>;
868
880
  /** Resolve once nothing is in flight. */
869
- idle(): Promise<void>;
881
+ idle(namespace?: string): Promise<void>;
870
882
  fault(namespace: string, fault: WebhookFault): void;
871
883
  clear(namespace?: string): void;
872
884
  };
@@ -910,6 +922,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
910
922
  /** Opaque in-process checkpoint including records, controls and webhook history. */
911
923
  fleetSnapshot(namespace: string): object;
912
924
  fleetRestore(snapshot: unknown, namespace: string): void;
925
+ fleetExport(snapshot: unknown): SnapshotDocument;
926
+ fleetImport(namespace: string, document: unknown): object;
913
927
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
914
928
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
915
929
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  document,
8
8
  operationIds,
9
9
  supportedOperationIds
10
- } from "./chunk-SHMO7XCX.js";
10
+ } from "./chunk-WM6TYPGJ.js";
11
11
  export {
12
12
  STEP_FUNCTIONS_NAMESPACE,
13
13
  STEP_FUNCTIONS_PRESETS,
package/dist/server.d.ts CHANGED
@@ -444,6 +444,8 @@ type SnapshotDocument$1 = {
444
444
  faults?: unknown;
445
445
  latency?: unknown;
446
446
  virtualTime?: boolean;
447
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
448
+ webhooks?: unknown;
447
449
  };
448
450
  /** Controls for one namespace. */
449
451
  type NamespaceControls$1 = {
@@ -657,6 +659,8 @@ type CredentialRegistry$1 = {
657
659
  }[];
658
660
  };
659
661
 
662
+ type OwnedTransport$1 = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
663
+
660
664
  /**
661
665
  * A point-in-time copy of everything a service namespace holds.
662
666
  *
@@ -774,8 +778,16 @@ type PublishInput$1 = {
774
778
  id?: string;
775
779
  };
776
780
  type WebhookHub$1 = {
781
+ observeDeliveries(listener: (event: {
782
+ namespace: string;
783
+ state: string;
784
+ deliveryId: string;
785
+ }) => void): () => void;
786
+ setTransportPolicy(policy: OwnedTransport$1): void;
777
787
  pending(namespace: string): number;
778
788
  snapshot(namespace: string): unknown;
789
+ exportSnapshot(handle: unknown): unknown;
790
+ importSnapshot(namespace: string, document: unknown): unknown;
779
791
  restore(namespace: string, snapshot: unknown): void;
780
792
  publish(input: PublishInput$1): WebhookMessage$1;
781
793
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -788,7 +800,7 @@ type WebhookHub$1 = {
788
800
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
789
801
  flush(): Promise<void>;
790
802
  /** Resolve once nothing is in flight. */
791
- idle(): Promise<void>;
803
+ idle(namespace?: string): Promise<void>;
792
804
  fault(namespace: string, fault: WebhookFault$1): void;
793
805
  clear(namespace?: string): void;
794
806
  };
@@ -832,6 +844,8 @@ type ServiceRuntime$1<T extends ServiceInstance$1> = FetchAPI$1 & {
832
844
  /** Opaque in-process checkpoint including records, controls and webhook history. */
833
845
  fleetSnapshot(namespace: string): object;
834
846
  fleetRestore(snapshot: unknown, namespace: string): void;
847
+ fleetExport(snapshot: unknown): SnapshotDocument$1;
848
+ fleetImport(namespace: string, document: unknown): object;
835
849
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
836
850
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule$1>): FaultRule$1[];
837
851
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
@@ -924,6 +938,7 @@ type CommonServeOptions = {
924
938
  * `serveTarget`, which is also how `serve --config` finds services by name.
925
939
  */
926
940
  type ServeTarget = {
941
+ packageVersion?: string;
927
942
  name: string;
928
943
  defaultPort: number;
929
944
  /** Serve flags beyond the common ones. */
@@ -1446,6 +1461,8 @@ type SnapshotDocument = {
1446
1461
  faults?: unknown;
1447
1462
  latency?: unknown;
1448
1463
  virtualTime?: boolean;
1464
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
1465
+ webhooks?: unknown;
1449
1466
  };
1450
1467
  /** Controls for one namespace. */
1451
1468
  type NamespaceControls = {
@@ -1659,6 +1676,8 @@ type CredentialRegistry = {
1659
1676
  }[];
1660
1677
  };
1661
1678
 
1679
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
1680
+
1662
1681
  /**
1663
1682
  * A point-in-time copy of everything a service namespace holds.
1664
1683
  *
@@ -1776,8 +1795,16 @@ type PublishInput = {
1776
1795
  id?: string;
1777
1796
  };
1778
1797
  type WebhookHub = {
1798
+ observeDeliveries(listener: (event: {
1799
+ namespace: string;
1800
+ state: string;
1801
+ deliveryId: string;
1802
+ }) => void): () => void;
1803
+ setTransportPolicy(policy: OwnedTransport): void;
1779
1804
  pending(namespace: string): number;
1780
1805
  snapshot(namespace: string): unknown;
1806
+ exportSnapshot(handle: unknown): unknown;
1807
+ importSnapshot(namespace: string, document: unknown): unknown;
1781
1808
  restore(namespace: string, snapshot: unknown): void;
1782
1809
  publish(input: PublishInput): WebhookMessage;
1783
1810
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1790,7 +1817,7 @@ type WebhookHub = {
1790
1817
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1791
1818
  flush(): Promise<void>;
1792
1819
  /** Resolve once nothing is in flight. */
1793
- idle(): Promise<void>;
1820
+ idle(namespace?: string): Promise<void>;
1794
1821
  fault(namespace: string, fault: WebhookFault): void;
1795
1822
  clear(namespace?: string): void;
1796
1823
  };
@@ -1834,6 +1861,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
1834
1861
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1835
1862
  fleetSnapshot(namespace: string): object;
1836
1863
  fleetRestore(snapshot: unknown, namespace: string): void;
1864
+ fleetExport(snapshot: unknown): SnapshotDocument;
1865
+ fleetImport(namespace: string, document: unknown): object;
1837
1866
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1838
1867
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1839
1868
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
package/dist/server.js CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  DEFAULT_PORT,
3
3
  createServer,
4
4
  serveTarget
5
- } from "./chunk-5M7DLGOU.js";
6
- import "./chunk-SHMO7XCX.js";
5
+ } from "./chunk-LSHC7AAT.js";
6
+ import "./chunk-WM6TYPGJ.js";
7
7
  export {
8
8
  DEFAULT_PORT,
9
9
  createServer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-step-functions",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "Stateful AWS Step Functions emulator with idempotent executions, callbacks, deterministic transitions, and history.",
5
5
  "license": "MIT",
6
6
  "type": "module",