@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/{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 +9 -9
- package/dist/index.d.ts +9 -9
- 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 +6 -6
- 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
|
@@ -196,7 +196,7 @@ interface AnalyticsConfig {
|
|
|
196
196
|
transport?: Transport;
|
|
197
197
|
/** Debug logging. */
|
|
198
198
|
debug?: boolean;
|
|
199
|
-
/** Hanzo-minted Sentry DSN: "https://<version>:<hmac>@<host>/v1/
|
|
199
|
+
/** Hanzo-minted Sentry DSN: "https://<version>:<hmac>@<host>/v1/event/<projectId>".
|
|
200
200
|
* Publishable — the key authorizes writes to ONE project and can read nothing,
|
|
201
201
|
* so it is safe in a browser bundle (same trust class as `ingestKey`). When
|
|
202
202
|
* absent the client reads NEXT_PUBLIC_HANZO_EVENT_DSN; when neither is set the
|
|
@@ -263,6 +263,10 @@ interface Dsn {
|
|
|
263
263
|
origin: string;
|
|
264
264
|
/** Project id segment. */
|
|
265
265
|
projectId: string;
|
|
266
|
+
/** The DSN's own origin + path, e.g. "https://api.hanzo.ai/v1/event/<projectId>".
|
|
267
|
+
* Every URL below is derived from this, so the ingest address is named once —
|
|
268
|
+
* in dsnForProduct — and nowhere else. */
|
|
269
|
+
base: string;
|
|
266
270
|
/** Fully-derived envelope ingest URL incl. ?sentry_key=. */
|
|
267
271
|
ingestUrl: string;
|
|
268
272
|
}
|
|
@@ -196,7 +196,7 @@ interface AnalyticsConfig {
|
|
|
196
196
|
transport?: Transport;
|
|
197
197
|
/** Debug logging. */
|
|
198
198
|
debug?: boolean;
|
|
199
|
-
/** Hanzo-minted Sentry DSN: "https://<version>:<hmac>@<host>/v1/
|
|
199
|
+
/** Hanzo-minted Sentry DSN: "https://<version>:<hmac>@<host>/v1/event/<projectId>".
|
|
200
200
|
* Publishable — the key authorizes writes to ONE project and can read nothing,
|
|
201
201
|
* so it is safe in a browser bundle (same trust class as `ingestKey`). When
|
|
202
202
|
* absent the client reads NEXT_PUBLIC_HANZO_EVENT_DSN; when neither is set the
|
|
@@ -263,6 +263,10 @@ interface Dsn {
|
|
|
263
263
|
origin: string;
|
|
264
264
|
/** Project id segment. */
|
|
265
265
|
projectId: string;
|
|
266
|
+
/** The DSN's own origin + path, e.g. "https://api.hanzo.ai/v1/event/<projectId>".
|
|
267
|
+
* Every URL below is derived from this, so the ingest address is named once —
|
|
268
|
+
* in dsnForProduct — and nowhere else. */
|
|
269
|
+
base: string;
|
|
266
270
|
/** Fully-derived envelope ingest URL incl. ?sentry_key=. */
|
|
267
271
|
ingestUrl: string;
|
|
268
272
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -88,7 +88,7 @@ function dsnForProduct(product, key) {
|
|
|
88
88
|
if (!product || !key) return void 0;
|
|
89
89
|
const projectId = PRODUCT_PROJECT[product];
|
|
90
90
|
if (!projectId) return void 0;
|
|
91
|
-
return `https://${key}@api.hanzo.ai/v1/
|
|
91
|
+
return `https://${key}@api.hanzo.ai/v1/event/${projectId}`;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// src/scrub.ts
|
|
@@ -319,7 +319,7 @@ function uuidv7Time(id) {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
// src/version.ts
|
|
322
|
-
var VERSION = "0.3.
|
|
322
|
+
var VERSION = "0.3.30";
|
|
323
323
|
|
|
324
324
|
// src/sentry.ts
|
|
325
325
|
var MAX_FRAMES = 50;
|
|
@@ -348,8 +348,9 @@ function parseDsn(dsn) {
|
|
|
348
348
|
const projectId = segs.length > 0 ? segs[segs.length - 1] : "";
|
|
349
349
|
if (!projectId) return null;
|
|
350
350
|
const origin = `${scheme}://${host}`;
|
|
351
|
-
const
|
|
352
|
-
|
|
351
|
+
const base = `${origin}/${segs.map(encodeURIComponent).join("/")}`;
|
|
352
|
+
const ingestUrl = `${base}/envelope/?sentry_key=${encodeURIComponent(publicKey)}`;
|
|
353
|
+
return { publicKey, origin, projectId, base, ingestUrl };
|
|
353
354
|
}
|
|
354
355
|
var V8_FRAME = /^\s*at\s+(?:(.+?)\s+\()?(?:(.+?):(\d+):(\d+)|([^)]+))\)?\s*$/;
|
|
355
356
|
var MOZ_FRAME = /^\s*(?:(.*?)@)?(.+?):(\d+):(\d+)\s*$/;
|
|
@@ -498,7 +499,7 @@ function buildEnvelope(event, dsn, sentAt) {
|
|
|
498
499
|
const payload = JSON.stringify(event);
|
|
499
500
|
const header = JSON.stringify({
|
|
500
501
|
event_id: event.event_id,
|
|
501
|
-
dsn:
|
|
502
|
+
dsn: dsn.base,
|
|
502
503
|
sent_at: sentAt ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
503
504
|
});
|
|
504
505
|
const itemHeader = JSON.stringify({
|