@hanzo/event 0.3.28 → 0.3.30

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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as Cohort, A as Attribution, S as SentryEvent, D as Dsn, a as CaptureErrorOptions, b as SentryFrame, E as ExceptionEntry, c as SentryLevel, d as ExceptionProperties } from './core-usULsfUB.cjs';
2
- export { e as Analytics, f as AnalyticsConfig, g as EventKind, h as Exception, i as ExceptionFrame, T as Transport, W as WireEvent, j as createAnalytics } from './core-usULsfUB.cjs';
1
+ import { C as Cohort, A as Attribution, S as SentryEvent, D as Dsn, a as CaptureErrorOptions, b as SentryFrame, E as ExceptionEntry, c as SentryLevel, d as ExceptionProperties } from './core-ZXDaPEyY.cjs';
2
+ export { e as Analytics, f as AnalyticsConfig, g as EventKind, h as Exception, i as ExceptionFrame, T as Transport, W as WireEvent, j as createAnalytics } from './core-ZXDaPEyY.cjs';
3
3
  import { FunnelId } from '@hanzo/events';
4
4
  export { EVENTS, EXCEPTION, EventName, FUNNELS, FunnelDef, FunnelId, FunnelStep, PAGEVIEW, PRODUCTS, ProductId, eventsOf } from '@hanzo/events';
5
5
 
@@ -8,10 +8,10 @@ declare function getFirstTouch(): Attribution | undefined;
8
8
  /** Read persisted cohort dimensions. */
9
9
  declare function getCohort(): Cohort | undefined;
10
10
 
11
- declare const VERSION = "0.3.28";
11
+ declare const VERSION = "0.3.30";
12
12
 
13
13
  /**
14
- * parseDsn parses "https://<version>:<hmac>@<host>/v1/sentry/<projectId>" into its
14
+ * parseDsn parses "https://<version>:<hmac>@<host>/v1/event/<projectId>" into its
15
15
  * public key + the derived envelope ingest URL. The key (which itself contains a
16
16
  * ':') is taken verbatim as the userinfo — we do NOT split it as user:pass. The
17
17
  * key rides ?sentry_key= (not the DSN in the body) because that is the credential
@@ -80,14 +80,14 @@ declare function hzUuidv7(now?: number): string
80
80
  declare function uuidv7Time(id: string): number;
81
81
 
82
82
  /**
83
- * The product → Sentry DSN registry.
83
+ * The product → Sentinel DSN registry.
84
84
  *
85
85
  * An app declares WHAT it is (`product: 'console'`); this module knows WHERE its
86
86
  * errors go. That split is the whole point: no surface has to learn a DSN, carry
87
87
  * a build argument, or grow a config file to report errors — declaring the
88
88
  * product it already declares is enough.
89
89
  *
90
- * A Sentry DSN is PUBLIC by construction. It ships inside the client bundle and
90
+ * A Sentinel DSN is PUBLIC by construction. It ships inside the client bundle and
91
91
  * is readable in devtools on any deployed page, and it grants exactly one
92
92
  * capability: submitting new events. It cannot read issues, projects, or any
93
93
  * other data. So committing it is not leaking a secret — it is recording a public
@@ -101,10 +101,10 @@ declare function uuidv7Time(id: string): number;
101
101
  * exception table is the same data with a trap in it.
102
102
  *
103
103
  * Projects are org-scoped and named `<org>-<app>`. To add one: create the project
104
- * (POST /v1/sentry/projects with X-Org-Id), then add its `dsn` here keyed by the
104
+ * (POST /v1/sentinel/projects with X-Org-Id), then add its `dsn` here keyed by the
105
105
  * product name the app passes to `createAnalytics`.
106
106
  */
107
- /** PRODUCT_PROJECT maps a `product` to its Sentry project id. The DSN's KEY is no
107
+ /** PRODUCT_PROJECT maps a `product` to its Sentinel project id. The DSN's KEY is no
108
108
  * longer a per-project secret — it is the ONE org publishable key (below), so a
109
109
  * surface's errors ride the SAME key its events do. The id only names WHICH
110
110
  * project the errors group under, and cloud auto-provisions that project on first
@@ -112,7 +112,7 @@ declare function uuidv7Time(id: string): number;
112
112
  * project — an explicit map, because the projects predate this and do not derive
113
113
  * cleanly from the product name. */
114
114
  declare const PRODUCT_PROJECT: Readonly<Record<string, string>>;
115
- /** dsnForProduct builds the product's Sentry DSN from the caller's resolved
115
+ /** dsnForProduct builds the product's Sentinel DSN from the caller's resolved
116
116
  * publishable `key` and the product's project — the SAME key the event stream
117
117
  * carries, at the product's envelope endpoint. Returns undefined when there is no
118
118
  * key or no project for the product, leaving the error plane inert rather than
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as Cohort, A as Attribution, S as SentryEvent, D as Dsn, a as CaptureErrorOptions, b as SentryFrame, E as ExceptionEntry, c as SentryLevel, d as ExceptionProperties } from './core-usULsfUB.js';
2
- export { e as Analytics, f as AnalyticsConfig, g as EventKind, h as Exception, i as ExceptionFrame, T as Transport, W as WireEvent, j as createAnalytics } from './core-usULsfUB.js';
1
+ import { C as Cohort, A as Attribution, S as SentryEvent, D as Dsn, a as CaptureErrorOptions, b as SentryFrame, E as ExceptionEntry, c as SentryLevel, d as ExceptionProperties } from './core-ZXDaPEyY.js';
2
+ export { e as Analytics, f as AnalyticsConfig, g as EventKind, h as Exception, i as ExceptionFrame, T as Transport, W as WireEvent, j as createAnalytics } from './core-ZXDaPEyY.js';
3
3
  import { FunnelId } from '@hanzo/events';
4
4
  export { EVENTS, EXCEPTION, EventName, FUNNELS, FunnelDef, FunnelId, FunnelStep, PAGEVIEW, PRODUCTS, ProductId, eventsOf } from '@hanzo/events';
5
5
 
@@ -8,10 +8,10 @@ declare function getFirstTouch(): Attribution | undefined;
8
8
  /** Read persisted cohort dimensions. */
9
9
  declare function getCohort(): Cohort | undefined;
10
10
 
11
- declare const VERSION = "0.3.28";
11
+ declare const VERSION = "0.3.30";
12
12
 
13
13
  /**
14
- * parseDsn parses "https://<version>:<hmac>@<host>/v1/sentry/<projectId>" into its
14
+ * parseDsn parses "https://<version>:<hmac>@<host>/v1/event/<projectId>" into its
15
15
  * public key + the derived envelope ingest URL. The key (which itself contains a
16
16
  * ':') is taken verbatim as the userinfo — we do NOT split it as user:pass. The
17
17
  * key rides ?sentry_key= (not the DSN in the body) because that is the credential
@@ -80,14 +80,14 @@ declare function hzUuidv7(now?: number): string
80
80
  declare function uuidv7Time(id: string): number;
81
81
 
82
82
  /**
83
- * The product → Sentry DSN registry.
83
+ * The product → Sentinel DSN registry.
84
84
  *
85
85
  * An app declares WHAT it is (`product: 'console'`); this module knows WHERE its
86
86
  * errors go. That split is the whole point: no surface has to learn a DSN, carry
87
87
  * a build argument, or grow a config file to report errors — declaring the
88
88
  * product it already declares is enough.
89
89
  *
90
- * A Sentry DSN is PUBLIC by construction. It ships inside the client bundle and
90
+ * A Sentinel DSN is PUBLIC by construction. It ships inside the client bundle and
91
91
  * is readable in devtools on any deployed page, and it grants exactly one
92
92
  * capability: submitting new events. It cannot read issues, projects, or any
93
93
  * other data. So committing it is not leaking a secret — it is recording a public
@@ -101,10 +101,10 @@ declare function uuidv7Time(id: string): number;
101
101
  * exception table is the same data with a trap in it.
102
102
  *
103
103
  * Projects are org-scoped and named `<org>-<app>`. To add one: create the project
104
- * (POST /v1/sentry/projects with X-Org-Id), then add its `dsn` here keyed by the
104
+ * (POST /v1/sentinel/projects with X-Org-Id), then add its `dsn` here keyed by the
105
105
  * product name the app passes to `createAnalytics`.
106
106
  */
107
- /** PRODUCT_PROJECT maps a `product` to its Sentry project id. The DSN's KEY is no
107
+ /** PRODUCT_PROJECT maps a `product` to its Sentinel project id. The DSN's KEY is no
108
108
  * longer a per-project secret — it is the ONE org publishable key (below), so a
109
109
  * surface's errors ride the SAME key its events do. The id only names WHICH
110
110
  * project the errors group under, and cloud auto-provisions that project on first
@@ -112,7 +112,7 @@ declare function uuidv7Time(id: string): number;
112
112
  * project — an explicit map, because the projects predate this and do not derive
113
113
  * cleanly from the product name. */
114
114
  declare const PRODUCT_PROJECT: Readonly<Record<string, string>>;
115
- /** dsnForProduct builds the product's Sentry DSN from the caller's resolved
115
+ /** dsnForProduct builds the product's Sentinel DSN from the caller's resolved
116
116
  * publishable `key` and the product's project — the SAME key the event stream
117
117
  * carries, at the product's envelope endpoint. Returns undefined when there is no
118
118
  * key or no project for the product, leaving the error plane inert rather than
package/dist/index.mjs CHANGED
@@ -87,7 +87,7 @@ function dsnForProduct(product, key) {
87
87
  if (!product || !key) return void 0;
88
88
  const projectId = PRODUCT_PROJECT[product];
89
89
  if (!projectId) return void 0;
90
- return `https://${key}@api.hanzo.ai/v1/sentry/${projectId}`;
90
+ return `https://${key}@api.hanzo.ai/v1/event/${projectId}`;
91
91
  }
92
92
 
93
93
  // src/scrub.ts
@@ -318,7 +318,7 @@ function uuidv7Time(id) {
318
318
  }
319
319
 
320
320
  // src/version.ts
321
- var VERSION = "0.3.28";
321
+ var VERSION = "0.3.30";
322
322
 
323
323
  // src/sentry.ts
324
324
  var MAX_FRAMES = 50;
@@ -347,8 +347,9 @@ function parseDsn(dsn) {
347
347
  const projectId = segs.length > 0 ? segs[segs.length - 1] : "";
348
348
  if (!projectId) return null;
349
349
  const origin = `${scheme}://${host}`;
350
- const ingestUrl = `${origin}/v1/sentry/${encodeURIComponent(projectId)}/envelope/?sentry_key=${encodeURIComponent(publicKey)}`;
351
- return { publicKey, origin, projectId, ingestUrl };
350
+ const base = `${origin}/${segs.map(encodeURIComponent).join("/")}`;
351
+ const ingestUrl = `${base}/envelope/?sentry_key=${encodeURIComponent(publicKey)}`;
352
+ return { publicKey, origin, projectId, base, ingestUrl };
352
353
  }
353
354
  var V8_FRAME = /^\s*at\s+(?:(.+?)\s+\()?(?:(.+?):(\d+):(\d+)|([^)]+))\)?\s*$/;
354
355
  var MOZ_FRAME = /^\s*(?:(.*?)@)?(.+?):(\d+):(\d+)\s*$/;
@@ -497,7 +498,7 @@ function buildEnvelope(event, dsn, sentAt) {
497
498
  const payload = JSON.stringify(event);
498
499
  const header = JSON.stringify({
499
500
  event_id: event.event_id,
500
- dsn: `${dsn.origin}/v1/sentry/${dsn.projectId}`,
501
+ dsn: dsn.base,
501
502
  sent_at: sentAt ?? (/* @__PURE__ */ new Date()).toISOString()
502
503
  });
503
504
  const itemHeader = JSON.stringify({