@crvouga/mockingbird-service-aws 0.2.0 → 0.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-VWCTZQML.js";
7
- import "./chunk-GFJTN44G.js";
6
+ } from "./chunk-PPVNDNY7.js";
7
+ import "./chunk-LQOH4S7Z.js";
8
8
  import "./chunk-6Z2MR3PO.js";
9
9
 
10
10
  // src/cli.ts
package/dist/index.d.ts CHANGED
@@ -1256,6 +1256,8 @@ type SnapshotDocument = {
1256
1256
  faults?: unknown;
1257
1257
  latency?: unknown;
1258
1258
  virtualTime?: boolean;
1259
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
1260
+ webhooks?: unknown;
1259
1261
  };
1260
1262
  /** Controls for one namespace. */
1261
1263
  type NamespaceControls = {
@@ -1485,6 +1487,8 @@ type CredentialRegistry = {
1485
1487
  }[];
1486
1488
  };
1487
1489
 
1490
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
1491
+
1488
1492
  /**
1489
1493
  * A point-in-time copy of everything a service namespace holds.
1490
1494
  *
@@ -1671,8 +1675,16 @@ type PublishInput = {
1671
1675
  id?: string;
1672
1676
  };
1673
1677
  type WebhookHub = {
1678
+ observeDeliveries(listener: (event: {
1679
+ namespace: string;
1680
+ state: string;
1681
+ deliveryId: string;
1682
+ }) => void): () => void;
1683
+ setTransportPolicy(policy: OwnedTransport): void;
1674
1684
  pending(namespace: string): number;
1675
1685
  snapshot(namespace: string): unknown;
1686
+ exportSnapshot(handle: unknown): unknown;
1687
+ importSnapshot(namespace: string, document: unknown): unknown;
1676
1688
  restore(namespace: string, snapshot: unknown): void;
1677
1689
  publish(input: PublishInput): WebhookMessage;
1678
1690
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1685,7 +1697,7 @@ type WebhookHub = {
1685
1697
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1686
1698
  flush(): Promise<void>;
1687
1699
  /** Resolve once nothing is in flight. */
1688
- idle(): Promise<void>;
1700
+ idle(namespace?: string): Promise<void>;
1689
1701
  fault(namespace: string, fault: WebhookFault): void;
1690
1702
  clear(namespace?: string): void;
1691
1703
  };
@@ -1817,6 +1829,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
1817
1829
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1818
1830
  fleetSnapshot(namespace: string): object;
1819
1831
  fleetRestore(snapshot: unknown, namespace: string): void;
1832
+ fleetExport(snapshot: unknown): SnapshotDocument;
1833
+ fleetImport(namespace: string, document: unknown): object;
1820
1834
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1821
1835
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1822
1836
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  document,
6
6
  operationIds,
7
7
  supportedOperationIds
8
- } from "./chunk-GFJTN44G.js";
8
+ } from "./chunk-LQOH4S7Z.js";
9
9
  import "./chunk-6Z2MR3PO.js";
10
10
  export {
11
11
  AWS_NAMESPACE,
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. */
@@ -1557,6 +1572,8 @@ type SnapshotDocument = {
1557
1572
  faults?: unknown;
1558
1573
  latency?: unknown;
1559
1574
  virtualTime?: boolean;
1575
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
1576
+ webhooks?: unknown;
1560
1577
  };
1561
1578
  /** Controls for one namespace. */
1562
1579
  type NamespaceControls = {
@@ -1786,6 +1803,8 @@ type CredentialRegistry = {
1786
1803
  }[];
1787
1804
  };
1788
1805
 
1806
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
1807
+
1789
1808
  /**
1790
1809
  * A point-in-time copy of everything a service namespace holds.
1791
1810
  *
@@ -1972,8 +1991,16 @@ type PublishInput = {
1972
1991
  id?: string;
1973
1992
  };
1974
1993
  type WebhookHub = {
1994
+ observeDeliveries(listener: (event: {
1995
+ namespace: string;
1996
+ state: string;
1997
+ deliveryId: string;
1998
+ }) => void): () => void;
1999
+ setTransportPolicy(policy: OwnedTransport): void;
1975
2000
  pending(namespace: string): number;
1976
2001
  snapshot(namespace: string): unknown;
2002
+ exportSnapshot(handle: unknown): unknown;
2003
+ importSnapshot(namespace: string, document: unknown): unknown;
1977
2004
  restore(namespace: string, snapshot: unknown): void;
1978
2005
  publish(input: PublishInput): WebhookMessage;
1979
2006
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1986,7 +2013,7 @@ type WebhookHub = {
1986
2013
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1987
2014
  flush(): Promise<void>;
1988
2015
  /** Resolve once nothing is in flight. */
1989
- idle(): Promise<void>;
2016
+ idle(namespace?: string): Promise<void>;
1990
2017
  fault(namespace: string, fault: WebhookFault): void;
1991
2018
  clear(namespace?: string): void;
1992
2019
  };
@@ -2118,6 +2145,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
2118
2145
  /** Opaque in-process checkpoint including records, controls and webhook history. */
2119
2146
  fleetSnapshot(namespace: string): object;
2120
2147
  fleetRestore(snapshot: unknown, namespace: string): void;
2148
+ fleetExport(snapshot: unknown): SnapshotDocument;
2149
+ fleetImport(namespace: string, document: unknown): object;
2121
2150
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
2122
2151
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
2123
2152
  /** 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-VWCTZQML.js";
6
- import "./chunk-GFJTN44G.js";
5
+ } from "./chunk-PPVNDNY7.js";
6
+ import "./chunk-LQOH4S7Z.js";
7
7
  import "./chunk-6Z2MR3PO.js";
8
8
  export {
9
9
  DEFAULT_PORT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-aws",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Combined S3, SQS, IAM and STS provider endpoint emulator with native controls.",
5
5
  "license": "MIT",
6
6
  "type": "module",