@crvouga/mockingbird-service-posthog 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-PVGI6M5H.js";
7
- import "./chunk-CJW2IXDE.js";
6
+ } from "./chunk-IODRZUXV.js";
7
+ import "./chunk-YTVQ24KD.js";
8
8
 
9
9
  // src/cli.ts
10
10
  var code = await runCli(
package/dist/index.d.ts CHANGED
@@ -598,6 +598,8 @@ type SnapshotDocument = {
598
598
  faults?: unknown;
599
599
  latency?: unknown;
600
600
  virtualTime?: boolean;
601
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
602
+ webhooks?: unknown;
601
603
  };
602
604
  /** Controls for one namespace. */
603
605
  type NamespaceControls = {
@@ -811,6 +813,8 @@ type CredentialRegistry = {
811
813
  }[];
812
814
  };
813
815
 
816
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
817
+
814
818
  /**
815
819
  * A point-in-time copy of everything a service namespace holds.
816
820
  *
@@ -928,8 +932,16 @@ type PublishInput = {
928
932
  id?: string;
929
933
  };
930
934
  type WebhookHub = {
935
+ observeDeliveries(listener: (event: {
936
+ namespace: string;
937
+ state: string;
938
+ deliveryId: string;
939
+ }) => void): () => void;
940
+ setTransportPolicy(policy: OwnedTransport): void;
931
941
  pending(namespace: string): number;
932
942
  snapshot(namespace: string): unknown;
943
+ exportSnapshot(handle: unknown): unknown;
944
+ importSnapshot(namespace: string, document: unknown): unknown;
933
945
  restore(namespace: string, snapshot: unknown): void;
934
946
  publish(input: PublishInput): WebhookMessage;
935
947
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -942,7 +954,7 @@ type WebhookHub = {
942
954
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
943
955
  flush(): Promise<void>;
944
956
  /** Resolve once nothing is in flight. */
945
- idle(): Promise<void>;
957
+ idle(namespace?: string): Promise<void>;
946
958
  fault(namespace: string, fault: WebhookFault): void;
947
959
  clear(namespace?: string): void;
948
960
  };
@@ -986,6 +998,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
986
998
  /** Opaque in-process checkpoint including records, controls and webhook history. */
987
999
  fleetSnapshot(namespace: string): object;
988
1000
  fleetRestore(snapshot: unknown, namespace: string): void;
1001
+ fleetExport(snapshot: unknown): SnapshotDocument;
1002
+ fleetImport(namespace: string, document: unknown): object;
989
1003
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
990
1004
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
991
1005
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  supportedOperationIds,
16
16
  tokenFromBody,
17
17
  valueForState
18
- } from "./chunk-CJW2IXDE.js";
18
+ } from "./chunk-YTVQ24KD.js";
19
19
  export {
20
20
  ACME_FLAG_STATE,
21
21
  POSTHOG_NAMESPACE,
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. */
@@ -1447,6 +1462,8 @@ type SnapshotDocument = {
1447
1462
  faults?: unknown;
1448
1463
  latency?: unknown;
1449
1464
  virtualTime?: boolean;
1465
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
1466
+ webhooks?: unknown;
1450
1467
  };
1451
1468
  /** Controls for one namespace. */
1452
1469
  type NamespaceControls = {
@@ -1660,6 +1677,8 @@ type CredentialRegistry = {
1660
1677
  }[];
1661
1678
  };
1662
1679
 
1680
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
1681
+
1663
1682
  /**
1664
1683
  * A point-in-time copy of everything a service namespace holds.
1665
1684
  *
@@ -1777,8 +1796,16 @@ type PublishInput = {
1777
1796
  id?: string;
1778
1797
  };
1779
1798
  type WebhookHub = {
1799
+ observeDeliveries(listener: (event: {
1800
+ namespace: string;
1801
+ state: string;
1802
+ deliveryId: string;
1803
+ }) => void): () => void;
1804
+ setTransportPolicy(policy: OwnedTransport): void;
1780
1805
  pending(namespace: string): number;
1781
1806
  snapshot(namespace: string): unknown;
1807
+ exportSnapshot(handle: unknown): unknown;
1808
+ importSnapshot(namespace: string, document: unknown): unknown;
1782
1809
  restore(namespace: string, snapshot: unknown): void;
1783
1810
  publish(input: PublishInput): WebhookMessage;
1784
1811
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1791,7 +1818,7 @@ type WebhookHub = {
1791
1818
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1792
1819
  flush(): Promise<void>;
1793
1820
  /** Resolve once nothing is in flight. */
1794
- idle(): Promise<void>;
1821
+ idle(namespace?: string): Promise<void>;
1795
1822
  fault(namespace: string, fault: WebhookFault): void;
1796
1823
  clear(namespace?: string): void;
1797
1824
  };
@@ -1835,6 +1862,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI$1 & {
1835
1862
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1836
1863
  fleetSnapshot(namespace: string): object;
1837
1864
  fleetRestore(snapshot: unknown, namespace: string): void;
1865
+ fleetExport(snapshot: unknown): SnapshotDocument;
1866
+ fleetImport(namespace: string, document: unknown): object;
1838
1867
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1839
1868
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1840
1869
  /** 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-PVGI6M5H.js";
6
- import "./chunk-CJW2IXDE.js";
5
+ } from "./chunk-IODRZUXV.js";
6
+ import "./chunk-YTVQ24KD.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-posthog",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "description": "Stateful emulator of PostHog: /flags v2 and legacy /decide evaluation with per-test flag, variant and payload control, remote config, gzip/base64 capture (/batch/, /e/, /i/v0/e/), recordings intake, and the feature-flag management and HogQL API slice.",
5
5
  "license": "MIT",
6
6
  "type": "module",