@hanzo/event 0.3.28 → 0.3.29

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.29";
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
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.29";
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
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.29";
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({