@hanzo/event 0.3.18 → 0.3.19
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.cjs +12 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -8
- package/dist/index.d.ts +15 -8
- package/dist/index.mjs +12 -10
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +11 -9
- package/dist/react.cjs.map +1 -1
- package/dist/react.mjs +11 -9
- package/dist/react.mjs.map +1 -1
- package/hz.js +1 -1
- package/package.json +1 -1
- package/src/dsn.test.ts +14 -11
- package/src/dsn.ts +19 -14
- package/src/index.ts +1 -1
- package/src/version.ts +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -6,7 +6,7 @@ declare function getFirstTouch(): Attribution | undefined;
|
|
|
6
6
|
/** Read persisted cohort dimensions. */
|
|
7
7
|
declare function getCohort(): Cohort | undefined;
|
|
8
8
|
|
|
9
|
-
declare const VERSION = "0.3.
|
|
9
|
+
declare const VERSION = "0.3.19";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* parseDsn parses "https://<version>:<hmac>@<host>/v1/sentry/<projectId>" into its
|
|
@@ -102,12 +102,19 @@ declare function uuidv7Time(id: string): number;
|
|
|
102
102
|
* (POST /v1/sentry/projects with X-Org-Id), then add its `dsn` here keyed by the
|
|
103
103
|
* product name the app passes to `createAnalytics`.
|
|
104
104
|
*/
|
|
105
|
-
/**
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* project
|
|
105
|
+
/** PRODUCT_PROJECT maps a `product` to its Sentry project id. The DSN's KEY is no
|
|
106
|
+
* longer a per-project secret — it is the ONE org publishable key (below), so a
|
|
107
|
+
* surface's errors ride the SAME key its events do. The id only names WHICH
|
|
108
|
+
* project the errors group under, and cloud auto-provisions that project on first
|
|
109
|
+
* keyed ingest, so a new id needs nothing minted. `site` lives in the `hanzo-ai`
|
|
110
|
+
* project — an explicit map, because the projects predate this and do not derive
|
|
111
|
+
* cleanly from the product name. */
|
|
112
|
+
declare const PRODUCT_PROJECT: Readonly<Record<string, string>>;
|
|
113
|
+
/** dsnForProduct builds the product's Sentry DSN — the ONE org publishable key at
|
|
114
|
+
* its project's envelope endpoint — or undefined when the product has no project
|
|
115
|
+
* yet, which leaves the error plane inert rather than posting into the wrong one.
|
|
116
|
+
* Same key as the event stream: cloud resolves it to the org and attributes the
|
|
117
|
+
* errors there. */
|
|
111
118
|
declare function dsnForProduct(product: string | undefined): string | undefined;
|
|
112
119
|
|
|
113
120
|
/** redactSecrets removes known secret shapes. Always applied. */
|
|
@@ -290,4 +297,4 @@ declare function hasAttribution(a: Attribution): boolean;
|
|
|
290
297
|
/** isoWeek returns the ISO-8601 week label, e.g. "2026-W28". */
|
|
291
298
|
declare function isoWeek(d: Date): string;
|
|
292
299
|
|
|
293
|
-
export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, EVENTS, type ErrorIdentity, type EventName, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PAGEVIEW, PRODUCTS,
|
|
300
|
+
export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, EVENTS, type ErrorIdentity, type EventName, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PAGEVIEW, PRODUCTS, PRODUCT_PROJECT, type ProductId, SentryEvent, SentryFrame, VERSION, buildEnvelope, buildSentryEvent, deriveChannel, dsnForProduct, eventsOf, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare function getFirstTouch(): Attribution | undefined;
|
|
|
6
6
|
/** Read persisted cohort dimensions. */
|
|
7
7
|
declare function getCohort(): Cohort | undefined;
|
|
8
8
|
|
|
9
|
-
declare const VERSION = "0.3.
|
|
9
|
+
declare const VERSION = "0.3.19";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* parseDsn parses "https://<version>:<hmac>@<host>/v1/sentry/<projectId>" into its
|
|
@@ -102,12 +102,19 @@ declare function uuidv7Time(id: string): number;
|
|
|
102
102
|
* (POST /v1/sentry/projects with X-Org-Id), then add its `dsn` here keyed by the
|
|
103
103
|
* product name the app passes to `createAnalytics`.
|
|
104
104
|
*/
|
|
105
|
-
/**
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* project
|
|
105
|
+
/** PRODUCT_PROJECT maps a `product` to its Sentry project id. The DSN's KEY is no
|
|
106
|
+
* longer a per-project secret — it is the ONE org publishable key (below), so a
|
|
107
|
+
* surface's errors ride the SAME key its events do. The id only names WHICH
|
|
108
|
+
* project the errors group under, and cloud auto-provisions that project on first
|
|
109
|
+
* keyed ingest, so a new id needs nothing minted. `site` lives in the `hanzo-ai`
|
|
110
|
+
* project — an explicit map, because the projects predate this and do not derive
|
|
111
|
+
* cleanly from the product name. */
|
|
112
|
+
declare const PRODUCT_PROJECT: Readonly<Record<string, string>>;
|
|
113
|
+
/** dsnForProduct builds the product's Sentry DSN — the ONE org publishable key at
|
|
114
|
+
* its project's envelope endpoint — or undefined when the product has no project
|
|
115
|
+
* yet, which leaves the error plane inert rather than posting into the wrong one.
|
|
116
|
+
* Same key as the event stream: cloud resolves it to the org and attributes the
|
|
117
|
+
* errors there. */
|
|
111
118
|
declare function dsnForProduct(product: string | undefined): string | undefined;
|
|
112
119
|
|
|
113
120
|
/** redactSecrets removes known secret shapes. Always applied. */
|
|
@@ -290,4 +297,4 @@ declare function hasAttribution(a: Attribution): boolean;
|
|
|
290
297
|
/** isoWeek returns the ISO-8601 week label, e.g. "2026-W28". */
|
|
291
298
|
declare function isoWeek(d: Date): string;
|
|
292
299
|
|
|
293
|
-
export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, EVENTS, type ErrorIdentity, type EventName, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PAGEVIEW, PRODUCTS,
|
|
300
|
+
export { Attribution, COHORTS, CaptureErrorOptions, Cohort, type CohortDef, Dsn, EVENTS, type ErrorIdentity, type EventName, FUNNELS, type FunnelDef, type FunnelId, type FunnelStep, GOALS, type GoalDef, PAGEVIEW, PRODUCTS, PRODUCT_PROJECT, type ProductId, SentryEvent, SentryFrame, VERSION, buildEnvelope, buildSentryEvent, deriveChannel, dsnForProduct, eventsOf, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
|
package/dist/index.mjs
CHANGED
|
@@ -72,17 +72,19 @@ function isoWeek(d) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// src/dsn.ts
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
console
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
var PRODUCT_PROJECT = Object.freeze({
|
|
76
|
+
console: "019fa40b-94ae-7f1d-8f7b-e92f123fad42",
|
|
77
|
+
// console.hanzo.ai
|
|
78
|
+
app: "019f9b1e-57eb-7171-9d92-72c0b85e4b4b",
|
|
79
|
+
// hanzo.app
|
|
80
|
+
site: "019f9b1e-5785-7359-ad0b-f75db8e58c99"
|
|
81
|
+
// hanzo.ai (marketing; product `site`)
|
|
82
82
|
});
|
|
83
83
|
function dsnForProduct(product) {
|
|
84
84
|
if (!product) return void 0;
|
|
85
|
-
|
|
85
|
+
const projectId = PRODUCT_PROJECT[product];
|
|
86
|
+
if (!projectId) return void 0;
|
|
87
|
+
return `https://${HANZO_PUBLISHABLE_KEY}@api.hanzo.ai/v1/sentry/${projectId}`;
|
|
86
88
|
}
|
|
87
89
|
var HANZO_PUBLISHABLE_KEY = "pk-live-c88649f1085fb6ad441d8a0072933a9b";
|
|
88
90
|
function defaultPublishableKey(host) {
|
|
@@ -369,7 +371,7 @@ function uuidv7Time(id) {
|
|
|
369
371
|
}
|
|
370
372
|
|
|
371
373
|
// src/version.ts
|
|
372
|
-
var VERSION = "0.3.
|
|
374
|
+
var VERSION = "0.3.19";
|
|
373
375
|
|
|
374
376
|
// src/sentry.ts
|
|
375
377
|
var MAX_FRAMES = 50;
|
|
@@ -1146,6 +1148,6 @@ var COHORTS = {
|
|
|
1146
1148
|
* reformat of one copy is a diff against the other.
|
|
1147
1149
|
*/
|
|
1148
1150
|
|
|
1149
|
-
export { Analytics, COHORTS, EVENTS, FUNNELS, GOALS, PAGEVIEW, PRODUCTS,
|
|
1151
|
+
export { Analytics, COHORTS, EVENTS, FUNNELS, GOALS, PAGEVIEW, PRODUCTS, PRODUCT_PROJECT, VERSION, buildEnvelope, buildSentryEvent, createAnalytics, deriveChannel, dsnForProduct, eventsOf, framesFromStack, getCohort, getFirstTouch, hasAttribution, hostOf, isoWeek, parseAttribution, parseDsn, redactSecrets, scrubPII, scrubText, hzUuidv7 as uuidv7, uuidv7Time };
|
|
1150
1152
|
//# sourceMappingURL=index.mjs.map
|
|
1151
1153
|
//# sourceMappingURL=index.mjs.map
|