@crvouga/mockingbird-service-aws-iot 0.2.0 → 0.3.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-3R2TXJ3A.js";
7
- import "./chunk-KMHCBHR2.js";
6
+ } from "./chunk-5BBI5I2N.js";
7
+ import "./chunk-CKRKJW6D.js";
8
8
 
9
9
  // src/cli.ts
10
10
  var code = await runCli(
package/dist/index.d.ts CHANGED
@@ -1132,6 +1132,8 @@ type SnapshotDocument = {
1132
1132
  faults?: unknown;
1133
1133
  latency?: unknown;
1134
1134
  virtualTime?: boolean;
1135
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
1136
+ webhooks?: unknown;
1135
1137
  };
1136
1138
  /** Controls for one namespace. */
1137
1139
  type NamespaceControls = {
@@ -1345,6 +1347,8 @@ type CredentialRegistry = {
1345
1347
  }[];
1346
1348
  };
1347
1349
 
1350
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
1351
+
1348
1352
  /**
1349
1353
  * A point-in-time copy of everything a service namespace holds.
1350
1354
  *
@@ -1462,8 +1466,16 @@ type PublishInput = {
1462
1466
  id?: string;
1463
1467
  };
1464
1468
  type WebhookHub = {
1469
+ observeDeliveries(listener: (event: {
1470
+ namespace: string;
1471
+ state: string;
1472
+ deliveryId: string;
1473
+ }) => void): () => void;
1474
+ setTransportPolicy(policy: OwnedTransport): void;
1465
1475
  pending(namespace: string): number;
1466
1476
  snapshot(namespace: string): unknown;
1477
+ exportSnapshot(handle: unknown): unknown;
1478
+ importSnapshot(namespace: string, document: unknown): unknown;
1467
1479
  restore(namespace: string, snapshot: unknown): void;
1468
1480
  publish(input: PublishInput): WebhookMessage;
1469
1481
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1476,7 +1488,7 @@ type WebhookHub = {
1476
1488
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1477
1489
  flush(): Promise<void>;
1478
1490
  /** Resolve once nothing is in flight. */
1479
- idle(): Promise<void>;
1491
+ idle(namespace?: string): Promise<void>;
1480
1492
  fault(namespace: string, fault: WebhookFault): void;
1481
1493
  clear(namespace?: string): void;
1482
1494
  };
@@ -1520,6 +1532,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
1520
1532
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1521
1533
  fleetSnapshot(namespace: string): object;
1522
1534
  fleetRestore(snapshot: unknown, namespace: string): void;
1535
+ fleetExport(snapshot: unknown): SnapshotDocument;
1536
+ fleetImport(namespace: string, document: unknown): object;
1523
1537
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1524
1538
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1525
1539
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  resourceArn,
27
27
  splitUsername,
28
28
  supportedOperationIds
29
- } from "./chunk-KMHCBHR2.js";
29
+ } from "./chunk-CKRKJW6D.js";
30
30
  export {
31
31
  AWS_IOT_NAMESPACE,
32
32
  AWS_IOT_PRESETS,
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$2 = {
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$2): 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. */
@@ -1985,6 +2000,8 @@ type SnapshotDocument = {
1985
2000
  faults?: unknown;
1986
2001
  latency?: unknown;
1987
2002
  virtualTime?: boolean;
2003
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
2004
+ webhooks?: unknown;
1988
2005
  };
1989
2006
  /** Controls for one namespace. */
1990
2007
  type NamespaceControls = {
@@ -2198,6 +2215,8 @@ type CredentialRegistry = {
2198
2215
  }[];
2199
2216
  };
2200
2217
 
2218
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
2219
+
2201
2220
  /**
2202
2221
  * A point-in-time copy of everything a service namespace holds.
2203
2222
  *
@@ -2315,8 +2334,16 @@ type PublishInput = {
2315
2334
  id?: string;
2316
2335
  };
2317
2336
  type WebhookHub = {
2337
+ observeDeliveries(listener: (event: {
2338
+ namespace: string;
2339
+ state: string;
2340
+ deliveryId: string;
2341
+ }) => void): () => void;
2342
+ setTransportPolicy(policy: OwnedTransport): void;
2318
2343
  pending(namespace: string): number;
2319
2344
  snapshot(namespace: string): unknown;
2345
+ exportSnapshot(handle: unknown): unknown;
2346
+ importSnapshot(namespace: string, document: unknown): unknown;
2320
2347
  restore(namespace: string, snapshot: unknown): void;
2321
2348
  publish(input: PublishInput): WebhookMessage;
2322
2349
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -2329,7 +2356,7 @@ type WebhookHub = {
2329
2356
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
2330
2357
  flush(): Promise<void>;
2331
2358
  /** Resolve once nothing is in flight. */
2332
- idle(): Promise<void>;
2359
+ idle(namespace?: string): Promise<void>;
2333
2360
  fault(namespace: string, fault: WebhookFault): void;
2334
2361
  clear(namespace?: string): void;
2335
2362
  };
@@ -2373,6 +2400,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI$1 & {
2373
2400
  /** Opaque in-process checkpoint including records, controls and webhook history. */
2374
2401
  fleetSnapshot(namespace: string): object;
2375
2402
  fleetRestore(snapshot: unknown, namespace: string): void;
2403
+ fleetExport(snapshot: unknown): SnapshotDocument;
2404
+ fleetImport(namespace: string, document: unknown): object;
2376
2405
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
2377
2406
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
2378
2407
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
package/dist/server.js CHANGED
@@ -5,8 +5,8 @@ import {
5
5
  createServer,
6
6
  loadSettingsFile,
7
7
  serveTarget
8
- } from "./chunk-3R2TXJ3A.js";
9
- import "./chunk-KMHCBHR2.js";
8
+ } from "./chunk-5BBI5I2N.js";
9
+ import "./chunk-CKRKJW6D.js";
10
10
  export {
11
11
  DEFAULT_MQTT_PORT,
12
12
  DEFAULT_PORT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-aws-iot",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Stateful emulator of the AWS IoT Core data plane: SigV4-signed HTTP Publish and the MQTT 5 message broker over TCP and WebSocket, with custom-authorizer policies and persistent sessions.",
5
5
  "license": "MIT",
6
6
  "type": "module",