@edraj/sauron-browser 1.6.0 → 1.7.0
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/CHANGELOG.md +8 -0
- package/COPYING +674 -0
- package/LICENSE +160 -656
- package/README.md +15 -9
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
|
@@ -277,7 +277,8 @@ interface TransportOptions {
|
|
|
277
277
|
interface InitOptions {
|
|
278
278
|
/** `https://<public_key>@<host>/<project_id>` */
|
|
279
279
|
dsn: string;
|
|
280
|
-
|
|
280
|
+
/** Required. The app version every event is attributed to. */
|
|
281
|
+
release: string;
|
|
281
282
|
/** Error sample rate in [0, 1]. Default 1 (send everything). */
|
|
282
283
|
sampleRate?: number;
|
|
283
284
|
/** Ring-buffer size for breadcrumbs. Default 50. */
|
|
@@ -309,7 +310,7 @@ interface InitOptions {
|
|
|
309
310
|
/** Fully-resolved options with all defaults applied. */
|
|
310
311
|
interface ResolvedOptions {
|
|
311
312
|
dsn: string;
|
|
312
|
-
release: string
|
|
313
|
+
release: string;
|
|
313
314
|
sampleRate: number;
|
|
314
315
|
maxBreadcrumbs: number;
|
|
315
316
|
beforeSend?: BeforeSend;
|
|
@@ -597,7 +598,7 @@ declare function parseError(err: unknown): Frame[];
|
|
|
597
598
|
/** Small dependency-free helpers shared across the SDK. */
|
|
598
599
|
/** SDK identity, embedded in every envelope header. */
|
|
599
600
|
declare const SDK_NAME = "sauron.javascript";
|
|
600
|
-
declare const SDK_VERSION = "1.
|
|
601
|
+
declare const SDK_VERSION = "1.7.0";
|
|
601
602
|
/**
|
|
602
603
|
* Largest serialized `extra` a single transaction may carry, in bytes.
|
|
603
604
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -277,7 +277,8 @@ interface TransportOptions {
|
|
|
277
277
|
interface InitOptions {
|
|
278
278
|
/** `https://<public_key>@<host>/<project_id>` */
|
|
279
279
|
dsn: string;
|
|
280
|
-
|
|
280
|
+
/** Required. The app version every event is attributed to. */
|
|
281
|
+
release: string;
|
|
281
282
|
/** Error sample rate in [0, 1]. Default 1 (send everything). */
|
|
282
283
|
sampleRate?: number;
|
|
283
284
|
/** Ring-buffer size for breadcrumbs. Default 50. */
|
|
@@ -309,7 +310,7 @@ interface InitOptions {
|
|
|
309
310
|
/** Fully-resolved options with all defaults applied. */
|
|
310
311
|
interface ResolvedOptions {
|
|
311
312
|
dsn: string;
|
|
312
|
-
release: string
|
|
313
|
+
release: string;
|
|
313
314
|
sampleRate: number;
|
|
314
315
|
maxBreadcrumbs: number;
|
|
315
316
|
beforeSend?: BeforeSend;
|
|
@@ -597,7 +598,7 @@ declare function parseError(err: unknown): Frame[];
|
|
|
597
598
|
/** Small dependency-free helpers shared across the SDK. */
|
|
598
599
|
/** SDK identity, embedded in every envelope header. */
|
|
599
600
|
declare const SDK_NAME = "sauron.javascript";
|
|
600
|
-
declare const SDK_VERSION = "1.
|
|
601
|
+
declare const SDK_VERSION = "1.7.0";
|
|
601
602
|
/**
|
|
602
603
|
* Largest serialized `extra` a single transaction may carry, in bytes.
|
|
603
604
|
*
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4
4
|
|
|
5
5
|
// src/utils.ts
|
|
6
6
|
var SDK_NAME = "sauron.javascript";
|
|
7
|
-
var SDK_VERSION = "1.
|
|
7
|
+
var SDK_VERSION = "1.7.0";
|
|
8
8
|
function getGlobal() {
|
|
9
9
|
return globalThis;
|
|
10
10
|
}
|
|
@@ -2171,10 +2171,13 @@ function resolveOptions(options) {
|
|
|
2171
2171
|
if (!options || typeof options.dsn !== "string" || options.dsn.length === 0) {
|
|
2172
2172
|
throw new Error("[sauron] init() requires a `dsn`");
|
|
2173
2173
|
}
|
|
2174
|
+
if (typeof options.release !== "string" || options.release.trim().length === 0) {
|
|
2175
|
+
throw new Error("[sauron] init() requires a `release` (the app version this build reports as)");
|
|
2176
|
+
}
|
|
2174
2177
|
const t = options.transport ?? {};
|
|
2175
2178
|
return {
|
|
2176
2179
|
dsn: options.dsn,
|
|
2177
|
-
release: options.release
|
|
2180
|
+
release: options.release.trim(),
|
|
2178
2181
|
sampleRate: clamp(options.sampleRate ?? 1, 0, 1),
|
|
2179
2182
|
maxBreadcrumbs: options.maxBreadcrumbs ?? 50,
|
|
2180
2183
|
tags: options.tags ?? {},
|