@crvouga/mockingbird-service-mongoatlas 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-P52TRCEH.js";
7
- import "./chunk-2M4V3TBY.js";
6
+ } from "./chunk-OW5SEVWV.js";
7
+ import "./chunk-YPJETTFK.js";
8
8
  import "./chunk-6Z2MR3PO.js";
9
9
 
10
10
  // src/cli.ts
package/dist/index.d.ts CHANGED
@@ -1254,6 +1254,8 @@ type SnapshotDocument = {
1254
1254
  faults?: unknown;
1255
1255
  latency?: unknown;
1256
1256
  virtualTime?: boolean;
1257
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
1258
+ webhooks?: unknown;
1257
1259
  };
1258
1260
  /** Controls for one namespace. */
1259
1261
  type NamespaceControls = {
@@ -1483,6 +1485,8 @@ type CredentialRegistry = {
1483
1485
  }[];
1484
1486
  };
1485
1487
 
1488
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
1489
+
1486
1490
  /**
1487
1491
  * A point-in-time copy of everything a service namespace holds.
1488
1492
  *
@@ -1669,8 +1673,16 @@ type PublishInput = {
1669
1673
  id?: string;
1670
1674
  };
1671
1675
  type WebhookHub = {
1676
+ observeDeliveries(listener: (event: {
1677
+ namespace: string;
1678
+ state: string;
1679
+ deliveryId: string;
1680
+ }) => void): () => void;
1681
+ setTransportPolicy(policy: OwnedTransport): void;
1672
1682
  pending(namespace: string): number;
1673
1683
  snapshot(namespace: string): unknown;
1684
+ exportSnapshot(handle: unknown): unknown;
1685
+ importSnapshot(namespace: string, document: unknown): unknown;
1674
1686
  restore(namespace: string, snapshot: unknown): void;
1675
1687
  publish(input: PublishInput): WebhookMessage;
1676
1688
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1683,7 +1695,7 @@ type WebhookHub = {
1683
1695
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1684
1696
  flush(): Promise<void>;
1685
1697
  /** Resolve once nothing is in flight. */
1686
- idle(): Promise<void>;
1698
+ idle(namespace?: string): Promise<void>;
1687
1699
  fault(namespace: string, fault: WebhookFault): void;
1688
1700
  clear(namespace?: string): void;
1689
1701
  };
@@ -1815,6 +1827,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
1815
1827
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1816
1828
  fleetSnapshot(namespace: string): object;
1817
1829
  fleetRestore(snapshot: unknown, namespace: string): void;
1830
+ fleetExport(snapshot: unknown): SnapshotDocument;
1831
+ fleetImport(namespace: string, document: unknown): object;
1818
1832
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1819
1833
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1820
1834
  /** 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-2M4V3TBY.js";
8
+ } from "./chunk-YPJETTFK.js";
9
9
  import "./chunk-6Z2MR3PO.js";
10
10
  export {
11
11
  MONGOATLAS_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-P52TRCEH.js";
6
- import "./chunk-2M4V3TBY.js";
5
+ } from "./chunk-OW5SEVWV.js";
6
+ import "./chunk-YPJETTFK.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-mongoatlas",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Stateful MongoDB Atlas public vendor API emulator with native namespaces, checkpoints and test controls.",
5
5
  "license": "MIT",
6
6
  "type": "module",