@crvouga/mockingbird-service-microsoft 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-54NQJFIT.js";
7
- import "./chunk-JDVH3EVJ.js";
6
+ } from "./chunk-YZERYNS7.js";
7
+ import "./chunk-2S244VQQ.js";
8
8
  import "./chunk-6Z2MR3PO.js";
9
9
 
10
10
  // src/cli.ts
package/dist/index.d.ts CHANGED
@@ -1241,6 +1241,8 @@ type SnapshotDocument = {
1241
1241
  faults?: unknown;
1242
1242
  latency?: unknown;
1243
1243
  virtualTime?: boolean;
1244
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
1245
+ webhooks?: unknown;
1244
1246
  };
1245
1247
  /** Controls for one namespace. */
1246
1248
  type NamespaceControls = {
@@ -1470,6 +1472,8 @@ type CredentialRegistry = {
1470
1472
  }[];
1471
1473
  };
1472
1474
 
1475
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
1476
+
1473
1477
  /**
1474
1478
  * A point-in-time copy of everything a service namespace holds.
1475
1479
  *
@@ -1656,8 +1660,16 @@ type PublishInput = {
1656
1660
  id?: string;
1657
1661
  };
1658
1662
  type WebhookHub = {
1663
+ observeDeliveries(listener: (event: {
1664
+ namespace: string;
1665
+ state: string;
1666
+ deliveryId: string;
1667
+ }) => void): () => void;
1668
+ setTransportPolicy(policy: OwnedTransport): void;
1659
1669
  pending(namespace: string): number;
1660
1670
  snapshot(namespace: string): unknown;
1671
+ exportSnapshot(handle: unknown): unknown;
1672
+ importSnapshot(namespace: string, document: unknown): unknown;
1661
1673
  restore(namespace: string, snapshot: unknown): void;
1662
1674
  publish(input: PublishInput): WebhookMessage;
1663
1675
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1670,7 +1682,7 @@ type WebhookHub = {
1670
1682
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1671
1683
  flush(): Promise<void>;
1672
1684
  /** Resolve once nothing is in flight. */
1673
- idle(): Promise<void>;
1685
+ idle(namespace?: string): Promise<void>;
1674
1686
  fault(namespace: string, fault: WebhookFault): void;
1675
1687
  clear(namespace?: string): void;
1676
1688
  };
@@ -1802,6 +1814,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
1802
1814
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1803
1815
  fleetSnapshot(namespace: string): object;
1804
1816
  fleetRestore(snapshot: unknown, namespace: string): void;
1817
+ fleetExport(snapshot: unknown): SnapshotDocument;
1818
+ fleetImport(namespace: string, document: unknown): object;
1805
1819
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1806
1820
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1807
1821
  /** 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-JDVH3EVJ.js";
8
+ } from "./chunk-2S244VQQ.js";
9
9
  import "./chunk-6Z2MR3PO.js";
10
10
  export {
11
11
  MICROSOFT_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-54NQJFIT.js";
6
- import "./chunk-JDVH3EVJ.js";
5
+ } from "./chunk-YZERYNS7.js";
6
+ import "./chunk-2S244VQQ.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-microsoft",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Stateful Microsoft public vendor API emulator with native namespaces, checkpoints and test controls.",
5
5
  "license": "MIT",
6
6
  "type": "module",