@capxul/observability 2.5.1 → 2.5.2

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.
Files changed (2) hide show
  1. package/dist/index.d.mts +9 -6
  2. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -1573,7 +1573,7 @@ interface PostHogProductAppOptions {
1573
1573
  };
1574
1574
  readonly recordHeaders: true;
1575
1575
  readonly recordBody: true; /** Drops credential headers and masks secrets and OTP codes in bodies. */
1576
- readonly maskCapturedNetworkRequestFn: (request: CapturedNetworkRequestLike) => CapturedNetworkRequestLike;
1576
+ readonly maskCapturedNetworkRequestFn: <T extends CapturedNetworkRequestLike>(request: T) => T;
1577
1577
  };
1578
1578
  readonly before_send: PostHogBeforeSend;
1579
1579
  }
@@ -1586,13 +1586,16 @@ interface CapxulBrowserAnalyticsInput {
1586
1586
  /** Back-compat alias for the pre-ADR-0020 name. */
1587
1587
  type InitializePostHogBrowserAnalyticsInput = CapxulBrowserAnalyticsInput;
1588
1588
  declare function utilityAppAnalytics(input: CapxulBrowserAnalyticsInput): PostHogUtilityAppOptions;
1589
- /** The posthog-js `CapturedNetworkRequest` fields this profile touches. */
1589
+ /**
1590
+ * The posthog-js `CapturedNetworkRequest` fields this profile touches. Kept
1591
+ * structural and optional so posthog-js's own type satisfies it: the masker is
1592
+ * generic over the real request type and returns the same type it was given.
1593
+ */
1590
1594
  interface CapturedNetworkRequestLike {
1591
1595
  readonly requestHeaders?: Record<string, string> | undefined;
1592
1596
  readonly responseHeaders?: Record<string, string> | undefined;
1593
- readonly requestBody?: string | null | undefined;
1594
- readonly responseBody?: string | null | undefined;
1595
- readonly [key: string]: unknown;
1597
+ readonly requestBody?: unknown;
1598
+ readonly responseBody?: unknown;
1596
1599
  }
1597
1600
  /**
1598
1601
  * Replay keeps the request line, status, timing, headers, and bodies, so a
@@ -1600,7 +1603,7 @@ interface CapturedNetworkRequestLike {
1600
1603
  * never leave the browser: bearer tokens, cookies, API keys, and the OTP a
1601
1604
  * user just typed are masked before the recording is sent.
1602
1605
  */
1603
- declare function maskCapturedNetworkRequest(request: CapturedNetworkRequestLike): CapturedNetworkRequestLike;
1606
+ declare function maskCapturedNetworkRequest<T extends CapturedNetworkRequestLike>(request: T): T;
1604
1607
  declare function productAppAnalytics(input: CapxulBrowserAnalyticsInput): PostHogProductAppOptions;
1605
1608
  type PostHogBrowserInitialize<Options, T> = (key: string, options: Options) => T;
1606
1609
  interface PostHogBrowserPageviewClient {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/observability",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",