@crvouga/mockingbird-service-resend 3.3.0 → 3.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/cli.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  runCli,
4
4
  serveCommand,
5
5
  serveTarget
6
- } from "./chunk-YE2BKTX6.js";
7
- import "./chunk-YJDLINUI.js";
6
+ } from "./chunk-ZB42MLNS.js";
7
+ import "./chunk-KPX5JPKL.js";
8
8
  import "./chunk-6Z2MR3PO.js";
9
9
 
10
10
  // src/cli.ts
package/dist/index.d.ts CHANGED
@@ -612,6 +612,8 @@ type SnapshotDocument = {
612
612
  faults?: unknown;
613
613
  latency?: unknown;
614
614
  virtualTime?: boolean;
615
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
616
+ webhooks?: unknown;
615
617
  };
616
618
  /** Controls for one namespace. */
617
619
  type NamespaceControls = {
@@ -843,6 +845,8 @@ declare class IdempotencyStore {
843
845
  run(key: string, fingerprint: string, errors: IdempotencyErrors, handler: () => Promise<Response> | Response, replayable?: (status: number) => boolean): Promise<Response>;
844
846
  }
845
847
 
848
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
849
+
846
850
  /**
847
851
  * A point-in-time copy of everything a service namespace holds.
848
852
  *
@@ -960,8 +964,16 @@ type PublishInput = {
960
964
  id?: string;
961
965
  };
962
966
  type WebhookHub = {
967
+ observeDeliveries(listener: (event: {
968
+ namespace: string;
969
+ state: string;
970
+ deliveryId: string;
971
+ }) => void): () => void;
972
+ setTransportPolicy(policy: OwnedTransport): void;
963
973
  pending(namespace: string): number;
964
974
  snapshot(namespace: string): unknown;
975
+ exportSnapshot(handle: unknown): unknown;
976
+ importSnapshot(namespace: string, document: unknown): unknown;
965
977
  restore(namespace: string, snapshot: unknown): void;
966
978
  publish(input: PublishInput): WebhookMessage;
967
979
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -974,7 +986,7 @@ type WebhookHub = {
974
986
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
975
987
  flush(): Promise<void>;
976
988
  /** Resolve once nothing is in flight. */
977
- idle(): Promise<void>;
989
+ idle(namespace?: string): Promise<void>;
978
990
  fault(namespace: string, fault: WebhookFault): void;
979
991
  clear(namespace?: string): void;
980
992
  };
@@ -1018,6 +1030,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
1018
1030
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1019
1031
  fleetSnapshot(namespace: string): object;
1020
1032
  fleetRestore(snapshot: unknown, namespace: string): void;
1033
+ fleetExport(snapshot: unknown): SnapshotDocument;
1034
+ fleetImport(namespace: string, document: unknown): object;
1021
1035
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1022
1036
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1023
1037
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  forwardToInbox,
10
10
  operationIds,
11
11
  supportedOperationIds
12
- } from "./chunk-YJDLINUI.js";
12
+ } from "./chunk-KPX5JPKL.js";
13
13
  import "./chunk-6Z2MR3PO.js";
14
14
  export {
15
15
  DOWNLOAD_URL_TTL_MS,
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. */
@@ -1435,6 +1450,8 @@ type SnapshotDocument = {
1435
1450
  faults?: unknown;
1436
1451
  latency?: unknown;
1437
1452
  virtualTime?: boolean;
1453
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
1454
+ webhooks?: unknown;
1438
1455
  };
1439
1456
  /** Controls for one namespace. */
1440
1457
  type NamespaceControls = {
@@ -1666,6 +1683,8 @@ declare class IdempotencyStore {
1666
1683
  run(key: string, fingerprint: string, errors: IdempotencyErrors, handler: () => Promise<Response> | Response, replayable?: (status: number) => boolean): Promise<Response>;
1667
1684
  }
1668
1685
 
1686
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
1687
+
1669
1688
  /**
1670
1689
  * A point-in-time copy of everything a service namespace holds.
1671
1690
  *
@@ -1783,8 +1802,16 @@ type PublishInput = {
1783
1802
  id?: string;
1784
1803
  };
1785
1804
  type WebhookHub = {
1805
+ observeDeliveries(listener: (event: {
1806
+ namespace: string;
1807
+ state: string;
1808
+ deliveryId: string;
1809
+ }) => void): () => void;
1810
+ setTransportPolicy(policy: OwnedTransport): void;
1786
1811
  pending(namespace: string): number;
1787
1812
  snapshot(namespace: string): unknown;
1813
+ exportSnapshot(handle: unknown): unknown;
1814
+ importSnapshot(namespace: string, document: unknown): unknown;
1788
1815
  restore(namespace: string, snapshot: unknown): void;
1789
1816
  publish(input: PublishInput): WebhookMessage;
1790
1817
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1797,7 +1824,7 @@ type WebhookHub = {
1797
1824
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1798
1825
  flush(): Promise<void>;
1799
1826
  /** Resolve once nothing is in flight. */
1800
- idle(): Promise<void>;
1827
+ idle(namespace?: string): Promise<void>;
1801
1828
  fault(namespace: string, fault: WebhookFault): void;
1802
1829
  clear(namespace?: string): void;
1803
1830
  };
@@ -1841,6 +1868,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI$1 & {
1841
1868
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1842
1869
  fleetSnapshot(namespace: string): object;
1843
1870
  fleetRestore(snapshot: unknown, namespace: string): void;
1871
+ fleetExport(snapshot: unknown): SnapshotDocument;
1872
+ fleetImport(namespace: string, document: unknown): object;
1844
1873
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1845
1874
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1846
1875
  /** 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-YE2BKTX6.js";
6
- import "./chunk-YJDLINUI.js";
5
+ } from "./chunk-ZB42MLNS.js";
6
+ import "./chunk-KPX5JPKL.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-resend",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "description": "Stateful emulator of the Resend email API (send with idempotency, received emails, attachments) with an outbox and Svix-signed inbound webhooks (Mockingbird service contract).",
5
5
  "license": "MIT",
6
6
  "type": "module",