@hanzo/event 0.3.36 → 0.3.37

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 (60) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +8 -8
  3. package/TAXONOMY.md +1 -1
  4. package/dist/attribution.d.ts +14 -0
  5. package/dist/attribution.d.ts.map +1 -0
  6. package/dist/core.d.ts +102 -0
  7. package/dist/core.d.ts.map +1 -0
  8. package/dist/dsn.d.ts +43 -0
  9. package/dist/dsn.d.ts.map +1 -0
  10. package/dist/events.d.ts +21 -0
  11. package/dist/events.d.ts.map +1 -0
  12. package/dist/exception.d.ts +50 -0
  13. package/dist/exception.d.ts.map +1 -0
  14. package/dist/funnels.d.ts +14 -0
  15. package/dist/funnels.d.ts.map +1 -0
  16. package/dist/goals.d.ts +24 -0
  17. package/dist/goals.d.ts.map +1 -0
  18. package/dist/index.cjs +7 -7
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +22 -292
  21. package/dist/index.d.ts +22 -292
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.mjs +7 -7
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/org.d.ts +74 -0
  26. package/dist/org.d.ts.map +1 -0
  27. package/dist/react.cjs +7 -7
  28. package/dist/react.cjs.map +1 -1
  29. package/dist/react.d.cts +13 -14
  30. package/dist/react.d.ts +13 -14
  31. package/dist/react.d.ts.map +1 -0
  32. package/dist/react.mjs +7 -7
  33. package/dist/react.mjs.map +1 -1
  34. package/dist/scrub.d.ts +20 -0
  35. package/dist/scrub.d.ts.map +1 -0
  36. package/dist/sentry.d.ts +62 -0
  37. package/dist/sentry.d.ts.map +1 -0
  38. package/dist/stack.d.ts +25 -0
  39. package/dist/stack.d.ts.map +1 -0
  40. package/dist/storage.d.ts +32 -0
  41. package/dist/storage.d.ts.map +1 -0
  42. package/dist/{core-CIhI2R7S.d.cts → types.d.ts} +21 -119
  43. package/dist/types.d.ts.map +1 -0
  44. package/dist/uid.d.ts +10 -0
  45. package/dist/uid.d.ts.map +1 -0
  46. package/dist/version.d.ts +2 -0
  47. package/dist/version.d.ts.map +1 -0
  48. package/package.json +11 -11
  49. package/src/anon.d.ts +1 -1
  50. package/src/anon.js +3 -3
  51. package/src/anon.test.ts +3 -3
  52. package/src/core.test.ts +6 -6
  53. package/src/core.ts +11 -11
  54. package/src/events.ts +1 -1
  55. package/src/exception.ts +1 -1
  56. package/src/stack.ts +1 -1
  57. package/src/types.ts +3 -3
  58. package/src/uid.ts +2 -2
  59. package/src/version.ts +1 -1
  60. package/dist/core-CIhI2R7S.d.ts +0 -380
package/dist/react.d.cts CHANGED
@@ -1,9 +1,8 @@
1
- import * as react from 'react';
2
- import { ReactNode, Component, ErrorInfo } from 'react';
3
- import { e as Analytics, f as AnalyticsConfig } from './core-CIhI2R7S.cjs';
4
-
5
- declare const Ctx: react.Context<Analytics | null>;
6
- interface AnalyticsProviderProps {
1
+ import { Component, type ErrorInfo, type ReactNode } from 'react';
2
+ import { Analytics } from './core';
3
+ import type { AnalyticsConfig } from './types';
4
+ declare const Ctx: import("react").Context<Analytics | null>;
5
+ export interface AnalyticsProviderProps {
7
6
  /** Provide a pre-built client, or a config to build one. */
8
7
  client?: Analytics;
9
8
  config?: AnalyticsConfig;
@@ -11,14 +10,14 @@ interface AnalyticsProviderProps {
11
10
  autoPageview?: boolean;
12
11
  children: ReactNode;
13
12
  }
14
- declare function AnalyticsProvider(props: AnalyticsProviderProps): react.FunctionComponentElement<react.ProviderProps<Analytics | null>>;
13
+ export declare function AnalyticsProvider(props: AnalyticsProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<Analytics | null>>;
15
14
  /** useAnalytics returns the client. Outside a provider it returns a no-op-safe
16
15
  * null-guarded proxy so calls never throw during SSR/tests. */
17
- declare function useAnalytics(): Analytics;
16
+ export declare function useAnalytics(): Analytics;
18
17
  /** usePageview fires a pageview on every route CHANGE (not the initial mount —
19
18
  * the provider's autoPageview covers that, so pages are counted exactly once). */
20
- declare function usePageview(path: string | null | undefined): void;
21
- interface ErrorBoundaryProps {
19
+ export declare function usePageview(path: string | null | undefined): void;
20
+ export interface ErrorBoundaryProps {
22
21
  children: ReactNode;
23
22
  /** Rendered when a child throws. A function receives the error + a reset. */
24
23
  fallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode);
@@ -33,8 +32,8 @@ interface ErrorBoundaryState {
33
32
  * ONLY way to capture them. This is the React half of the @sentry replacement.
34
33
  * Pair it with AnalyticsProvider (it reads the client from context), or pass an
35
34
  * explicit `client`. */
36
- declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
37
- static contextType: react.Context<Analytics | null>;
35
+ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
36
+ static contextType: import("react").Context<Analytics | null>;
38
37
  context: React.ContextType<typeof Ctx>;
39
38
  state: ErrorBoundaryState;
40
39
  static getDerivedStateFromError(error: Error): ErrorBoundaryState;
@@ -42,5 +41,5 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
42
41
  private reset;
43
42
  render(): ReactNode;
44
43
  }
45
-
46
- export { AnalyticsProvider, type AnalyticsProviderProps, ErrorBoundary, type ErrorBoundaryProps, useAnalytics, usePageview };
44
+ export {};
45
+ //# sourceMappingURL=react.d.ts.map
package/dist/react.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import * as react from 'react';
2
- import { ReactNode, Component, ErrorInfo } from 'react';
3
- import { e as Analytics, f as AnalyticsConfig } from './core-CIhI2R7S.js';
4
-
5
- declare const Ctx: react.Context<Analytics | null>;
6
- interface AnalyticsProviderProps {
1
+ import { Component, type ErrorInfo, type ReactNode } from 'react';
2
+ import { Analytics } from './core';
3
+ import type { AnalyticsConfig } from './types';
4
+ declare const Ctx: import("react").Context<Analytics | null>;
5
+ export interface AnalyticsProviderProps {
7
6
  /** Provide a pre-built client, or a config to build one. */
8
7
  client?: Analytics;
9
8
  config?: AnalyticsConfig;
@@ -11,14 +10,14 @@ interface AnalyticsProviderProps {
11
10
  autoPageview?: boolean;
12
11
  children: ReactNode;
13
12
  }
14
- declare function AnalyticsProvider(props: AnalyticsProviderProps): react.FunctionComponentElement<react.ProviderProps<Analytics | null>>;
13
+ export declare function AnalyticsProvider(props: AnalyticsProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<Analytics | null>>;
15
14
  /** useAnalytics returns the client. Outside a provider it returns a no-op-safe
16
15
  * null-guarded proxy so calls never throw during SSR/tests. */
17
- declare function useAnalytics(): Analytics;
16
+ export declare function useAnalytics(): Analytics;
18
17
  /** usePageview fires a pageview on every route CHANGE (not the initial mount —
19
18
  * the provider's autoPageview covers that, so pages are counted exactly once). */
20
- declare function usePageview(path: string | null | undefined): void;
21
- interface ErrorBoundaryProps {
19
+ export declare function usePageview(path: string | null | undefined): void;
20
+ export interface ErrorBoundaryProps {
22
21
  children: ReactNode;
23
22
  /** Rendered when a child throws. A function receives the error + a reset. */
24
23
  fallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode);
@@ -33,8 +32,8 @@ interface ErrorBoundaryState {
33
32
  * ONLY way to capture them. This is the React half of the @sentry replacement.
34
33
  * Pair it with AnalyticsProvider (it reads the client from context), or pass an
35
34
  * explicit `client`. */
36
- declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
37
- static contextType: react.Context<Analytics | null>;
35
+ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
36
+ static contextType: import("react").Context<Analytics | null>;
38
37
  context: React.ContextType<typeof Ctx>;
39
38
  state: ErrorBoundaryState;
40
39
  static getDerivedStateFromError(error: Error): ErrorBoundaryState;
@@ -42,5 +41,5 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
42
41
  private reset;
43
42
  render(): ReactNode;
44
43
  }
45
-
46
- export { AnalyticsProvider, type AnalyticsProviderProps, ErrorBoundary, type ErrorBoundaryProps, useAnalytics, usePageview };
44
+ export {};
45
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAWA,OAAO,EACL,SAAS,EAMT,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,SAAS,EAAmB,MAAM,QAAQ,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,QAAA,MAAM,GAAG,2CAAwC,CAAA;AAEjD,MAAM,WAAW,sBAAsB;IACrC,4DAA4D;IAC5D,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,6FAgB9D;AAED;gEACgE;AAChE,wBAAgB,YAAY,IAAI,SAAS,CAIxC;AAED;mFACmF;AACnF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAUjE;AAKD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAA;IACnB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC,CAAA;IACvE,mEAAmE;IACnE,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB;AAED,UAAU,kBAAkB;IAC1B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CACpB;AAED;;;;yBAIyB;AACzB,qBAAa,aAAc,SAAQ,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAClF,MAAM,CAAC,WAAW,4CAAM;IAChB,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,GAAG,CAAC,CAAA;IAC9C,KAAK,EAAE,kBAAkB,CAAkB;IAE3C,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,kBAAkB,CAEhE;IAED,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,CAMrD;IAED,OAAO,CAAC,KAAK,CAAuC;IAEpD,MAAM,IAAI,SAAS,CAMlB;CACF"}
package/dist/react.mjs CHANGED
@@ -380,7 +380,7 @@ function hzAnonId() {
380
380
  }
381
381
 
382
382
  // src/version.ts
383
- var VERSION = "0.3.36";
383
+ var VERSION = "0.3.37";
384
384
 
385
385
  // src/sentry.ts
386
386
  var MAX_FRAMES = 50;
@@ -850,10 +850,10 @@ var Analytics = class {
850
850
  // so before this the only way to report was to commit a key literal, and the
851
851
  // fleet grew one copy per site of a value with a single source.
852
852
  //
853
- // A surface no brand claims still has no key, and the door REFUSES an
853
+ // A surface no brand claims still has no key, and the edge REFUSES an
854
854
  // unattributed event (401 `ingest_key_required`) — the reserved `$public`
855
855
  // tenant that once caught keyless beacons is retired, and anonymous ingest is
856
- // refused at every door on every brand host. So there is no quiet fallback to
856
+ // refused at every edge on every brand host. So there is no quiet fallback to
857
857
  // rely on: an event lands in the org a credential names, or it does not land.
858
858
  ingestKey: config.ingestKey ?? readEnv("NEXT_PUBLIC_PUBLISHABLE_KEY") ?? keyForPage()
859
859
  };
@@ -991,7 +991,7 @@ var Analytics = class {
991
991
  this.cohort = mergeCohort(patch);
992
992
  }
993
993
  /** flush drains the buffer to the server as ONE batch through the ONE ingest
994
- * front door POST /v1/event, body { batch: [Event…] }. beacon=true selects the
994
+ * endpoint POST /v1/event, body { batch: [Event…] }. beacon=true selects the
995
995
  * unload-safe transport. Auth is orthogonal to the wire:
996
996
  *
997
997
  * • publishable key set → rides ?ingest_key=pk-… on both sends, keeping each
@@ -1204,15 +1204,15 @@ ErrorBoundary.contextType = Ctx;
1204
1204
  *
1205
1205
  * The two call sites:
1206
1206
  * 1. src/storage.ts — the bundled npm client; IMPORTS this file.
1207
- * 2. hanzoai/cloud apps/analytics/tag.js — the tag the door hosts at
1207
+ * 2. hanzoai/cloud apps/analytics/tag.js — the tag served at
1208
1208
  * /v1/event.js; vendors this file and its tag.go serves the marked region
1209
- * with the tag as one asset, so the door holds no second copy either.
1209
+ * with the tag as one asset, so cloud holds no second copy either.
1210
1210
  *
1211
1211
  * (2) has no bundler and cannot import anything, which is why the chain lives in a
1212
1212
  * file that is plain ES5 rather than in a .ts: the region between the BEGIN and END
1213
1213
  * markers is COPIED VERBATIM. Keep it ES5, dependency-free, `hz`-prefixed (it is
1214
1214
  * spliced into other people's scopes) and unformatted — a reformat here is a diff
1215
- * against the vendored copy. After editing, resync the door:
1215
+ * against the vendored copy. After editing, resync that copy:
1216
1216
  *
1217
1217
  * curl -fsSL https://unpkg.com/@hanzo/event/src/anon.js -o apps/analytics/anon.js
1218
1218
  */