@crvouga/mockingbird-service-docker 1.3.0 → 1.5.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/index.d.ts CHANGED
@@ -687,6 +687,8 @@ type SnapshotDocument = {
687
687
  faults?: unknown;
688
688
  latency?: unknown;
689
689
  virtualTime?: boolean;
690
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
691
+ webhooks?: unknown;
690
692
  };
691
693
  /** Controls for one namespace. */
692
694
  type NamespaceControls = {
@@ -916,6 +918,8 @@ type CredentialRegistry = {
916
918
  }[];
917
919
  };
918
920
 
921
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
922
+
919
923
  /**
920
924
  * A point-in-time copy of everything a service namespace holds.
921
925
  *
@@ -1102,8 +1106,16 @@ type PublishInput = {
1102
1106
  id?: string;
1103
1107
  };
1104
1108
  type WebhookHub = {
1109
+ observeDeliveries(listener: (event: {
1110
+ namespace: string;
1111
+ state: string;
1112
+ deliveryId: string;
1113
+ }) => void): () => void;
1114
+ setTransportPolicy(policy: OwnedTransport): void;
1105
1115
  pending(namespace: string): number;
1106
1116
  snapshot(namespace: string): unknown;
1117
+ exportSnapshot(handle: unknown): unknown;
1118
+ importSnapshot(namespace: string, document: unknown): unknown;
1107
1119
  restore(namespace: string, snapshot: unknown): void;
1108
1120
  publish(input: PublishInput): WebhookMessage;
1109
1121
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1116,7 +1128,7 @@ type WebhookHub = {
1116
1128
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1117
1129
  flush(): Promise<void>;
1118
1130
  /** Resolve once nothing is in flight. */
1119
- idle(): Promise<void>;
1131
+ idle(namespace?: string): Promise<void>;
1120
1132
  fault(namespace: string, fault: WebhookFault): void;
1121
1133
  clear(namespace?: string): void;
1122
1134
  };
@@ -1248,6 +1260,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
1248
1260
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1249
1261
  fleetSnapshot(namespace: string): object;
1250
1262
  fleetRestore(snapshot: unknown, namespace: string): void;
1263
+ fleetExport(snapshot: unknown): SnapshotDocument;
1264
+ fleetImport(namespace: string, document: unknown): object;
1251
1265
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1252
1266
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1253
1267
  /** 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-NSZYARVW.js";
8
+ } from "./chunk-PEU54Q4H.js";
9
9
  export {
10
10
  DOCKER_NAMESPACE,
11
11
  DockerAPI,
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. */
@@ -1623,6 +1638,8 @@ type SnapshotDocument = {
1623
1638
  faults?: unknown;
1624
1639
  latency?: unknown;
1625
1640
  virtualTime?: boolean;
1641
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
1642
+ webhooks?: unknown;
1626
1643
  };
1627
1644
  /** Controls for one namespace. */
1628
1645
  type NamespaceControls = {
@@ -1852,6 +1869,8 @@ type CredentialRegistry = {
1852
1869
  }[];
1853
1870
  };
1854
1871
 
1872
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
1873
+
1855
1874
  /**
1856
1875
  * A point-in-time copy of everything a service namespace holds.
1857
1876
  *
@@ -2038,8 +2057,16 @@ type PublishInput = {
2038
2057
  id?: string;
2039
2058
  };
2040
2059
  type WebhookHub = {
2060
+ observeDeliveries(listener: (event: {
2061
+ namespace: string;
2062
+ state: string;
2063
+ deliveryId: string;
2064
+ }) => void): () => void;
2065
+ setTransportPolicy(policy: OwnedTransport): void;
2041
2066
  pending(namespace: string): number;
2042
2067
  snapshot(namespace: string): unknown;
2068
+ exportSnapshot(handle: unknown): unknown;
2069
+ importSnapshot(namespace: string, document: unknown): unknown;
2043
2070
  restore(namespace: string, snapshot: unknown): void;
2044
2071
  publish(input: PublishInput): WebhookMessage;
2045
2072
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -2052,7 +2079,7 @@ type WebhookHub = {
2052
2079
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
2053
2080
  flush(): Promise<void>;
2054
2081
  /** Resolve once nothing is in flight. */
2055
- idle(): Promise<void>;
2082
+ idle(namespace?: string): Promise<void>;
2056
2083
  fault(namespace: string, fault: WebhookFault): void;
2057
2084
  clear(namespace?: string): void;
2058
2085
  };
@@ -2184,6 +2211,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
2184
2211
  /** Opaque in-process checkpoint including records, controls and webhook history. */
2185
2212
  fleetSnapshot(namespace: string): object;
2186
2213
  fleetRestore(snapshot: unknown, namespace: string): void;
2214
+ fleetExport(snapshot: unknown): SnapshotDocument;
2215
+ fleetImport(namespace: string, document: unknown): object;
2187
2216
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
2188
2217
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
2189
2218
  /** 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-Y4JH3Q6Z.js";
6
- import "./chunk-NSZYARVW.js";
5
+ } from "./chunk-DG4KWFV5.js";
6
+ import "./chunk-PEU54Q4H.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-docker",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Stateful Docker Engine API v1.52 emulator with portable controls and Node transport.",
5
5
  "license": "MIT",
6
6
  "type": "module",