@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/{core-usULsfUB.d.cts → core-ZXDaPEyY.d.cts} +5 -1
- package/dist/{core-usULsfUB.d.ts → core-ZXDaPEyY.d.ts} +5 -1
- package/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +6 -5
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +6 -5
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.mjs +6 -5
- package/dist/react.mjs.map +1 -1
- package/hz.js +1 -1
- package/package.json +1 -1
- package/src/core.test.ts +3 -3
- package/src/core.ts +1 -1
- package/src/dsn.test.ts +4 -4
- package/src/dsn.ts +1 -1
- package/src/sentry.test.ts +3 -3
- package/src/sentry.ts +11 -7
- package/src/types.ts +5 -1
- package/src/version.ts +1 -1
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-
|
|
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-
|
|
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.
|
|
11
|
+
declare const VERSION = "0.3.29";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* parseDsn parses "https://<version>:<hmac>@<host>/v1/
|
|
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-
|
|
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-
|
|
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.
|
|
11
|
+
declare const VERSION = "0.3.29";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* parseDsn parses "https://<version>:<hmac>@<host>/v1/
|
|
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/
|
|
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.
|
|
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
|
|
351
|
-
|
|
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:
|
|
501
|
+
dsn: dsn.base,
|
|
501
502
|
sent_at: sentAt ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
502
503
|
});
|
|
503
504
|
const itemHeader = JSON.stringify({
|