@crvouga/mockingbird-service-rxvortex 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-DAE44LUH.js";
7
- import "./chunk-U2SZUONL.js";
6
+ } from "./chunk-5NISHHYG.js";
7
+ import "./chunk-IGSGSEGS.js";
8
8
 
9
9
  // src/cli.ts
10
10
  var code = await runCli(
package/dist/index.d.ts CHANGED
@@ -534,6 +534,8 @@ type SnapshotDocument = {
534
534
  faults?: unknown;
535
535
  latency?: unknown;
536
536
  virtualTime?: boolean;
537
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
538
+ webhooks?: unknown;
537
539
  };
538
540
  /** Controls for one namespace. */
539
541
  type NamespaceControls = {
@@ -747,6 +749,8 @@ type CredentialRegistry = {
747
749
  }[];
748
750
  };
749
751
 
752
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
753
+
750
754
  /**
751
755
  * A point-in-time copy of everything a service namespace holds.
752
756
  *
@@ -864,8 +868,16 @@ type PublishInput = {
864
868
  id?: string;
865
869
  };
866
870
  type WebhookHub = {
871
+ observeDeliveries(listener: (event: {
872
+ namespace: string;
873
+ state: string;
874
+ deliveryId: string;
875
+ }) => void): () => void;
876
+ setTransportPolicy(policy: OwnedTransport): void;
867
877
  pending(namespace: string): number;
868
878
  snapshot(namespace: string): unknown;
879
+ exportSnapshot(handle: unknown): unknown;
880
+ importSnapshot(namespace: string, document: unknown): unknown;
869
881
  restore(namespace: string, snapshot: unknown): void;
870
882
  publish(input: PublishInput): WebhookMessage;
871
883
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -878,7 +890,7 @@ type WebhookHub = {
878
890
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
879
891
  flush(): Promise<void>;
880
892
  /** Resolve once nothing is in flight. */
881
- idle(): Promise<void>;
893
+ idle(namespace?: string): Promise<void>;
882
894
  fault(namespace: string, fault: WebhookFault): void;
883
895
  clear(namespace?: string): void;
884
896
  };
@@ -922,6 +934,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
922
934
  /** Opaque in-process checkpoint including records, controls and webhook history. */
923
935
  fleetSnapshot(namespace: string): object;
924
936
  fleetRestore(snapshot: unknown, namespace: string): void;
937
+ fleetExport(snapshot: unknown): SnapshotDocument;
938
+ fleetImport(namespace: string, document: unknown): object;
925
939
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
926
940
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
927
941
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  parseCatalogItem,
12
12
  supportedOperationIds,
13
13
  tokenCredential
14
- } from "./chunk-U2SZUONL.js";
14
+ } from "./chunk-IGSGSEGS.js";
15
15
  export {
16
16
  CUSTOM_CREAM_ANCHOR_PRESET_ID,
17
17
  DEFAULT_CATALOG,
package/dist/server.d.ts CHANGED
@@ -445,6 +445,8 @@ type SnapshotDocument$1 = {
445
445
  faults?: unknown;
446
446
  latency?: unknown;
447
447
  virtualTime?: boolean;
448
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
449
+ webhooks?: unknown;
448
450
  };
449
451
  /** Controls for one namespace. */
450
452
  type NamespaceControls$1 = {
@@ -658,6 +660,8 @@ type CredentialRegistry$1 = {
658
660
  }[];
659
661
  };
660
662
 
663
+ type OwnedTransport$1 = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
664
+
661
665
  /**
662
666
  * A point-in-time copy of everything a service namespace holds.
663
667
  *
@@ -775,8 +779,16 @@ type PublishInput$1 = {
775
779
  id?: string;
776
780
  };
777
781
  type WebhookHub$1 = {
782
+ observeDeliveries(listener: (event: {
783
+ namespace: string;
784
+ state: string;
785
+ deliveryId: string;
786
+ }) => void): () => void;
787
+ setTransportPolicy(policy: OwnedTransport$1): void;
778
788
  pending(namespace: string): number;
779
789
  snapshot(namespace: string): unknown;
790
+ exportSnapshot(handle: unknown): unknown;
791
+ importSnapshot(namespace: string, document: unknown): unknown;
780
792
  restore(namespace: string, snapshot: unknown): void;
781
793
  publish(input: PublishInput$1): WebhookMessage$1;
782
794
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -789,7 +801,7 @@ type WebhookHub$1 = {
789
801
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
790
802
  flush(): Promise<void>;
791
803
  /** Resolve once nothing is in flight. */
792
- idle(): Promise<void>;
804
+ idle(namespace?: string): Promise<void>;
793
805
  fault(namespace: string, fault: WebhookFault$1): void;
794
806
  clear(namespace?: string): void;
795
807
  };
@@ -833,6 +845,8 @@ type ServiceRuntime$1<T extends ServiceInstance$1> = FetchAPI$2 & {
833
845
  /** Opaque in-process checkpoint including records, controls and webhook history. */
834
846
  fleetSnapshot(namespace: string): object;
835
847
  fleetRestore(snapshot: unknown, namespace: string): void;
848
+ fleetExport(snapshot: unknown): SnapshotDocument$1;
849
+ fleetImport(namespace: string, document: unknown): object;
836
850
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
837
851
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule$1>): FaultRule$1[];
838
852
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
@@ -925,6 +939,7 @@ type CommonServeOptions = {
925
939
  * `serveTarget`, which is also how `serve --config` finds services by name.
926
940
  */
927
941
  type ServeTarget = {
942
+ packageVersion?: string;
928
943
  name: string;
929
944
  defaultPort: number;
930
945
  /** Serve flags beyond the common ones. */
@@ -1461,6 +1476,8 @@ type SnapshotDocument = {
1461
1476
  faults?: unknown;
1462
1477
  latency?: unknown;
1463
1478
  virtualTime?: boolean;
1479
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
1480
+ webhooks?: unknown;
1464
1481
  };
1465
1482
  /** Controls for one namespace. */
1466
1483
  type NamespaceControls = {
@@ -1674,6 +1691,8 @@ type CredentialRegistry = {
1674
1691
  }[];
1675
1692
  };
1676
1693
 
1694
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
1695
+
1677
1696
  /**
1678
1697
  * A point-in-time copy of everything a service namespace holds.
1679
1698
  *
@@ -1791,8 +1810,16 @@ type PublishInput = {
1791
1810
  id?: string;
1792
1811
  };
1793
1812
  type WebhookHub = {
1813
+ observeDeliveries(listener: (event: {
1814
+ namespace: string;
1815
+ state: string;
1816
+ deliveryId: string;
1817
+ }) => void): () => void;
1818
+ setTransportPolicy(policy: OwnedTransport): void;
1794
1819
  pending(namespace: string): number;
1795
1820
  snapshot(namespace: string): unknown;
1821
+ exportSnapshot(handle: unknown): unknown;
1822
+ importSnapshot(namespace: string, document: unknown): unknown;
1796
1823
  restore(namespace: string, snapshot: unknown): void;
1797
1824
  publish(input: PublishInput): WebhookMessage;
1798
1825
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1805,7 +1832,7 @@ type WebhookHub = {
1805
1832
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1806
1833
  flush(): Promise<void>;
1807
1834
  /** Resolve once nothing is in flight. */
1808
- idle(): Promise<void>;
1835
+ idle(namespace?: string): Promise<void>;
1809
1836
  fault(namespace: string, fault: WebhookFault): void;
1810
1837
  clear(namespace?: string): void;
1811
1838
  };
@@ -1849,6 +1876,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI$1 & {
1849
1876
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1850
1877
  fleetSnapshot(namespace: string): object;
1851
1878
  fleetRestore(snapshot: unknown, namespace: string): void;
1879
+ fleetExport(snapshot: unknown): SnapshotDocument;
1880
+ fleetImport(namespace: string, document: unknown): object;
1852
1881
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1853
1882
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1854
1883
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
package/dist/server.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  createServer,
4
4
  loadCatalogFile,
5
5
  serveTarget
6
- } from "./chunk-DAE44LUH.js";
7
- import "./chunk-U2SZUONL.js";
6
+ } from "./chunk-5NISHHYG.js";
7
+ import "./chunk-IGSGSEGS.js";
8
8
  export {
9
9
  DEFAULT_PORT,
10
10
  createServer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-rxvortex",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "Stateful emulator of the RxVortex (Strive) pharmacy API: OAuth token, order submit, status, cancel, recovery by sender order id, preset catalog, and signed status webhooks.",
5
5
  "license": "MIT",
6
6
  "type": "module",