@crvouga/mockingbird-service-oauth 3.4.0 → 3.6.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-7NQ4E3LE.js";
7
- import "./chunk-PTZMPBV7.js";
6
+ } from "./chunk-OYEO5VHR.js";
7
+ import "./chunk-ANDSQ2HK.js";
8
8
 
9
9
  // src/cli.ts
10
10
  var code = await runCli(
package/dist/index.d.ts CHANGED
@@ -510,6 +510,8 @@ type SnapshotDocument = {
510
510
  faults?: unknown;
511
511
  latency?: unknown;
512
512
  virtualTime?: boolean;
513
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
514
+ webhooks?: unknown;
513
515
  };
514
516
  /** Controls for one namespace. */
515
517
  type NamespaceControls = {
@@ -723,6 +725,8 @@ type CredentialRegistry = {
723
725
  }[];
724
726
  };
725
727
 
728
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
729
+
726
730
  /**
727
731
  * A point-in-time copy of everything a service namespace holds.
728
732
  *
@@ -840,8 +844,16 @@ type PublishInput = {
840
844
  id?: string;
841
845
  };
842
846
  type WebhookHub = {
847
+ observeDeliveries(listener: (event: {
848
+ namespace: string;
849
+ state: string;
850
+ deliveryId: string;
851
+ }) => void): () => void;
852
+ setTransportPolicy(policy: OwnedTransport): void;
843
853
  pending(namespace: string): number;
844
854
  snapshot(namespace: string): unknown;
855
+ exportSnapshot(handle: unknown): unknown;
856
+ importSnapshot(namespace: string, document: unknown): unknown;
845
857
  restore(namespace: string, snapshot: unknown): void;
846
858
  publish(input: PublishInput): WebhookMessage;
847
859
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -854,7 +866,7 @@ type WebhookHub = {
854
866
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
855
867
  flush(): Promise<void>;
856
868
  /** Resolve once nothing is in flight. */
857
- idle(): Promise<void>;
869
+ idle(namespace?: string): Promise<void>;
858
870
  fault(namespace: string, fault: WebhookFault): void;
859
871
  clear(namespace?: string): void;
860
872
  };
@@ -898,6 +910,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
898
910
  /** Opaque in-process checkpoint including records, controls and webhook history. */
899
911
  fleetSnapshot(namespace: string): object;
900
912
  fleetRestore(snapshot: unknown, namespace: string): void;
913
+ fleetExport(snapshot: unknown): SnapshotDocument;
914
+ fleetImport(namespace: string, document: unknown): object;
901
915
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
902
916
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
903
917
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  document,
8
8
  operationIds,
9
9
  supportedOperationIds
10
- } from "./chunk-PTZMPBV7.js";
10
+ } from "./chunk-ANDSQ2HK.js";
11
11
  export {
12
12
  OAUTH_PRESETS,
13
13
  OAUTH_SCENARIOS,
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. */
@@ -1434,6 +1449,8 @@ type SnapshotDocument = {
1434
1449
  faults?: unknown;
1435
1450
  latency?: unknown;
1436
1451
  virtualTime?: boolean;
1452
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
1453
+ webhooks?: unknown;
1437
1454
  };
1438
1455
  /** Controls for one namespace. */
1439
1456
  type NamespaceControls = {
@@ -1647,6 +1664,8 @@ type CredentialRegistry = {
1647
1664
  }[];
1648
1665
  };
1649
1666
 
1667
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
1668
+
1650
1669
  /**
1651
1670
  * A point-in-time copy of everything a service namespace holds.
1652
1671
  *
@@ -1764,8 +1783,16 @@ type PublishInput = {
1764
1783
  id?: string;
1765
1784
  };
1766
1785
  type WebhookHub = {
1786
+ observeDeliveries(listener: (event: {
1787
+ namespace: string;
1788
+ state: string;
1789
+ deliveryId: string;
1790
+ }) => void): () => void;
1791
+ setTransportPolicy(policy: OwnedTransport): void;
1767
1792
  pending(namespace: string): number;
1768
1793
  snapshot(namespace: string): unknown;
1794
+ exportSnapshot(handle: unknown): unknown;
1795
+ importSnapshot(namespace: string, document: unknown): unknown;
1769
1796
  restore(namespace: string, snapshot: unknown): void;
1770
1797
  publish(input: PublishInput): WebhookMessage;
1771
1798
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1778,7 +1805,7 @@ type WebhookHub = {
1778
1805
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1779
1806
  flush(): Promise<void>;
1780
1807
  /** Resolve once nothing is in flight. */
1781
- idle(): Promise<void>;
1808
+ idle(namespace?: string): Promise<void>;
1782
1809
  fault(namespace: string, fault: WebhookFault): void;
1783
1810
  clear(namespace?: string): void;
1784
1811
  };
@@ -1822,6 +1849,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
1822
1849
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1823
1850
  fleetSnapshot(namespace: string): object;
1824
1851
  fleetRestore(snapshot: unknown, namespace: string): void;
1852
+ fleetExport(snapshot: unknown): SnapshotDocument;
1853
+ fleetImport(namespace: string, document: unknown): object;
1825
1854
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1826
1855
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1827
1856
  /** 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
  createMultiServer,
4
4
  createServer,
5
5
  serveTarget
6
- } from "./chunk-7NQ4E3LE.js";
7
- import "./chunk-PTZMPBV7.js";
6
+ } from "./chunk-OYEO5VHR.js";
7
+ import "./chunk-ANDSQ2HK.js";
8
8
  export {
9
9
  DEFAULT_PORT,
10
10
  createMultiServer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-oauth",
3
- "version": "3.4.0",
3
+ "version": "3.6.0",
4
4
  "description": "Social-login emulator with Google, Apple, Microsoft, GitHub and generic OIDC profiles, private relay identities, reproducible edge cases, signed tokens and an accessible UI.",
5
5
  "license": "MIT",
6
6
  "type": "module",