@mushi-mushi/web 1.27.0 → 1.28.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/README.md +24 -2
- package/dist/headless.cjs +9 -8
- package/dist/headless.cjs.map +1 -1
- package/dist/headless.js +10 -9
- package/dist/headless.js.map +1 -1
- package/dist/i18n/index.cjs +44 -4
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +18 -0
- package/dist/i18n/index.d.ts +18 -0
- package/dist/i18n/index.js +44 -4
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.cjs +95 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +96 -18
- package/dist/index.js.map +1 -1
- package/dist/mushi.loader.global.js +432 -432
- package/dist/mushi.loader.global.js.map +1 -1
- package/dist/otel.cjs +7 -6
- package/dist/otel.cjs.map +1 -1
- package/dist/otel.js +7 -6
- package/dist/otel.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MushiConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiAssistantReply, MushiWidgetConfig, MushiLeaderboardEntry, MushiCrossAppReport, MushiTesterReputation, MushiApiCascadeConfig } from '@mushi-mushi/core';
|
|
1
|
+
import { MushiConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiAssistantReply, MushiWidgetConfig, MushiLeaderboardEntry, MushiCrossAppReport, MushiTesterReputation, MushiApiCascadeConfig, MushiErrorFilter } from '@mushi-mushi/core';
|
|
2
2
|
export { MushiApiCascadeConfig, MushiConfig, MushiConsoleEntry, MushiDiagnosticsResult, MushiEnvironment, MushiEventHandler, MushiEventType, MushiNetworkEntry, MushiPerformanceMetrics, MushiReport, MushiReportCategory, MushiSDKInstance, MushiTimelineEntry, MushiTimelineKind, MushiUrlMatcher, MushiWidgetConfig } from '@mushi-mushi/core';
|
|
3
3
|
export { C as ConsoleCapture, E as ElementSelector, N as NetworkCapture, P as PerformanceCapture, S as ScreenshotCapture, T as TimelineCapture, c as createConsoleCapture, a as createElementSelector, b as createNetworkCapture, d as createPerformanceCapture, e as createScreenshotCapture, f as createTimelineCapture } from './timeline-BuqAn2FH.cjs';
|
|
4
4
|
export { MushiLocale, getAvailableLocales, getLocale } from './i18n/index.cjs';
|
|
@@ -678,6 +678,9 @@ interface ProactiveTriggerConfig {
|
|
|
678
678
|
* projects. Sourced from `MushiConfig.projectId` by the SDK.
|
|
679
679
|
*/
|
|
680
680
|
projectId?: string;
|
|
681
|
+
ignoreErrors?: readonly MushiErrorFilter[];
|
|
682
|
+
denyUrls?: readonly MushiErrorFilter[];
|
|
683
|
+
allowUrls?: readonly MushiErrorFilter[];
|
|
681
684
|
}
|
|
682
685
|
interface ProactiveTriggerCallbacks {
|
|
683
686
|
onTrigger: (type: string, context: Record<string, unknown>) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MushiConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiAssistantReply, MushiWidgetConfig, MushiLeaderboardEntry, MushiCrossAppReport, MushiTesterReputation, MushiApiCascadeConfig } from '@mushi-mushi/core';
|
|
1
|
+
import { MushiConfig, MushiSDKInstance, MushiDiagnosticsResult, MushiReportCategory, MushiReporterReport, MushiReporterComment, MushiAssistantReply, MushiWidgetConfig, MushiLeaderboardEntry, MushiCrossAppReport, MushiTesterReputation, MushiApiCascadeConfig, MushiErrorFilter } from '@mushi-mushi/core';
|
|
2
2
|
export { MushiApiCascadeConfig, MushiConfig, MushiConsoleEntry, MushiDiagnosticsResult, MushiEnvironment, MushiEventHandler, MushiEventType, MushiNetworkEntry, MushiPerformanceMetrics, MushiReport, MushiReportCategory, MushiSDKInstance, MushiTimelineEntry, MushiTimelineKind, MushiUrlMatcher, MushiWidgetConfig } from '@mushi-mushi/core';
|
|
3
3
|
export { C as ConsoleCapture, E as ElementSelector, N as NetworkCapture, P as PerformanceCapture, S as ScreenshotCapture, T as TimelineCapture, c as createConsoleCapture, a as createElementSelector, b as createNetworkCapture, d as createPerformanceCapture, e as createScreenshotCapture, f as createTimelineCapture } from './timeline-BuqAn2FH.js';
|
|
4
4
|
export { MushiLocale, getAvailableLocales, getLocale } from './i18n/index.js';
|
|
@@ -678,6 +678,9 @@ interface ProactiveTriggerConfig {
|
|
|
678
678
|
* projects. Sourced from `MushiConfig.projectId` by the SDK.
|
|
679
679
|
*/
|
|
680
680
|
projectId?: string;
|
|
681
|
+
ignoreErrors?: readonly MushiErrorFilter[];
|
|
682
|
+
denyUrls?: readonly MushiErrorFilter[];
|
|
683
|
+
allowUrls?: readonly MushiErrorFilter[];
|
|
681
684
|
}
|
|
682
685
|
interface ProactiveTriggerCallbacks {
|
|
683
686
|
onTrigger: (type: string, context: Record<string, unknown>) => void;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mushiPalette, resolveWidgetAccent, MUSHI_REPORTER_STATUS, MUSHI_GEOMETRY, MUSHI_Z, MUSHI_MOTION, MUSHI_TYPE, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_INVERSE, MUSHI_ON_ACCENT, MUSHI_ACCENT_SHADOW, MUSHI_TIER_COLORS, readPageFaviconHref, scrubUrl, resolveEnvConfig, diagnoseEnvConfig, validateConfig, expandPreset, createLogger, noopLogger, createApiClient, initSessionTracker, getReporterToken, createPreFilter, createOfflineQueue, createRateLimiter, createPiiScrubber, createBreadcrumbBuffer, getDeviceFingerprintHash, MAX_SCREENSHOT_DATA_URL_BYTES, captureEnvironment, getSessionId, newUuid, DEFAULT_API_ENDPOINT, MUSHI_DURATION, MUSHI_SPACING, MUSHI_RADIUS, isLikelyGenericFavicon, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INTERNAL_HEADER, MUSHI_COLORS_LIGHT, parseIdentityToken, updateSessionIdentity, normaliseThrown, destroySessionTracker, resolveProjectDomain, projectInitials, projectFaviconUrlCandidates, sha256Hex } from '@mushi-mushi/core';
|
|
1
|
+
import { mushiPalette, resolveWidgetAccent, MUSHI_REPORTER_STATUS, MUSHI_GEOMETRY, MUSHI_Z, MUSHI_MOTION, MUSHI_TYPE, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_INVERSE, MUSHI_ON_ACCENT, MUSHI_ACCENT_SHADOW, MUSHI_TIER_COLORS, readPageFaviconHref, scrubUrl, resolveEnvConfig, diagnoseEnvConfig, validateConfig, expandPreset, createLogger, noopLogger, createApiClient, initSessionTracker, getReporterToken, createPreFilter, createOfflineQueue, createRateLimiter, createPiiScrubber, createBreadcrumbBuffer, getDeviceFingerprintHash, MAX_SCREENSHOT_DATA_URL_BYTES, captureEnvironment, getSessionId, newUuid, markPageUnloading, flushLastOutboundOnUnload, DEFAULT_API_ENDPOINT, shouldDropCapturedError, MUSHI_DURATION, MUSHI_SPACING, MUSHI_RADIUS, isLikelyGenericFavicon, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INTERNAL_HEADER, MUSHI_COLORS_LIGHT, parseIdentityToken, updateSessionIdentity, normaliseThrown, destroySessionTracker, resolveProjectDomain, projectInitials, projectFaviconUrlCandidates, sha256Hex } from '@mushi-mushi/core';
|
|
2
2
|
|
|
3
3
|
// src/capture/compress-screenshot.ts
|
|
4
4
|
async function compressScreenshotDataUrl(dataUrl, maxBytes = MAX_SCREENSHOT_DATA_URL_BYTES) {
|
|
@@ -75,7 +75,9 @@ var en = {
|
|
|
75
75
|
visual: "Layout, styling, or display problem",
|
|
76
76
|
confusing: "Hard to understand or navigate",
|
|
77
77
|
other: "Something else"
|
|
78
|
-
}
|
|
78
|
+
},
|
|
79
|
+
moreCategoriesLabel: "More issue types",
|
|
80
|
+
moreCategoriesCount: "{n} more"
|
|
79
81
|
},
|
|
80
82
|
step2: {
|
|
81
83
|
heading: "What happened?",
|
|
@@ -212,6 +214,14 @@ var en = {
|
|
|
212
214
|
label: "Feature request",
|
|
213
215
|
description: "Suggest a change"
|
|
214
216
|
},
|
|
217
|
+
betaStrip: {
|
|
218
|
+
defaultMessage: "{appName} is in early development",
|
|
219
|
+
contactHint: "Reports go to {email} \xB7 reviewed by the team",
|
|
220
|
+
ariaLabel: "Beta status"
|
|
221
|
+
},
|
|
222
|
+
changelog: {
|
|
223
|
+
whatsNew: "What's new in {version}"
|
|
224
|
+
},
|
|
215
225
|
poweredBy: "Powered by Mushi v{version}"
|
|
216
226
|
}
|
|
217
227
|
};
|
|
@@ -255,7 +265,9 @@ var ja = {
|
|
|
255
265
|
visual: "\u30EC\u30A4\u30A2\u30A6\u30C8\u3001\u30C7\u30B6\u30A4\u30F3\u3001\u8868\u793A\u306E\u554F\u984C",
|
|
256
266
|
confusing: "\u7406\u89E3\u3057\u306B\u304F\u3044\u3001\u64CD\u4F5C\u304C\u308F\u304B\u308A\u306B\u304F\u3044",
|
|
257
267
|
other: "\u305D\u306E\u4ED6\u306E\u554F\u984C"
|
|
258
|
-
}
|
|
268
|
+
},
|
|
269
|
+
moreCategoriesLabel: "\u305D\u306E\u4ED6\u306E\u554F\u984C\u306E\u7A2E\u985E",
|
|
270
|
+
moreCategoriesCount: "\u4ED6{n}\u4EF6"
|
|
259
271
|
},
|
|
260
272
|
step2: {
|
|
261
273
|
heading: "\u4F55\u304C\u8D77\u304D\u307E\u3057\u305F\u304B\uFF1F",
|
|
@@ -392,6 +404,14 @@ var ja = {
|
|
|
392
404
|
label: "\u6A5F\u80FD\u30EA\u30AF\u30A8\u30B9\u30C8",
|
|
393
405
|
description: "\u5909\u66F4\u3092\u63D0\u6848"
|
|
394
406
|
},
|
|
407
|
+
betaStrip: {
|
|
408
|
+
defaultMessage: "{appName}\u306F\u958B\u767A\u521D\u671F\u6BB5\u968E\u3067\u3059",
|
|
409
|
+
contactHint: "\u30EC\u30DD\u30FC\u30C8\u306F {email} \u306B\u5C4A\u304D\u3001\u30C1\u30FC\u30E0\u304C\u78BA\u8A8D\u3057\u307E\u3059",
|
|
410
|
+
ariaLabel: "\u30D9\u30FC\u30BF\u7248\u306E\u304A\u77E5\u3089\u305B"
|
|
411
|
+
},
|
|
412
|
+
changelog: {
|
|
413
|
+
whatsNew: "{version} \u306E\u65B0\u6A5F\u80FD"
|
|
414
|
+
},
|
|
395
415
|
poweredBy: "Mushi v{version}"
|
|
396
416
|
}
|
|
397
417
|
};
|
|
@@ -435,7 +455,9 @@ var th = {
|
|
|
435
455
|
visual: "\u0E1B\u0E31\u0E0D\u0E2B\u0E32\u0E40\u0E25\u0E22\u0E4C\u0E40\u0E2D\u0E32\u0E15\u0E4C \u0E2A\u0E44\u0E15\u0E25\u0E4C \u0E2B\u0E23\u0E37\u0E2D\u0E01\u0E32\u0E23\u0E41\u0E2A\u0E14\u0E07\u0E1C\u0E25",
|
|
436
456
|
confusing: "\u0E40\u0E02\u0E49\u0E32\u0E43\u0E08\u0E22\u0E32\u0E01\u0E2B\u0E23\u0E37\u0E2D\u0E19\u0E33\u0E17\u0E32\u0E07\u0E22\u0E32\u0E01",
|
|
437
457
|
other: "\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E2D\u0E37\u0E48\u0E19"
|
|
438
|
-
}
|
|
458
|
+
},
|
|
459
|
+
moreCategoriesLabel: "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E1B\u0E31\u0E0D\u0E2B\u0E32\u0E2D\u0E37\u0E48\u0E19 \u0E46",
|
|
460
|
+
moreCategoriesCount: "\u0E2D\u0E35\u0E01 {n} \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"
|
|
439
461
|
},
|
|
440
462
|
step2: {
|
|
441
463
|
heading: "\u0E40\u0E01\u0E34\u0E14\u0E2D\u0E30\u0E44\u0E23\u0E02\u0E36\u0E49\u0E19?",
|
|
@@ -572,6 +594,14 @@ var th = {
|
|
|
572
594
|
label: "\u0E02\u0E2D\u0E1F\u0E35\u0E40\u0E08\u0E2D\u0E23\u0E4C",
|
|
573
595
|
description: "\u0E40\u0E2A\u0E19\u0E2D\u0E01\u0E32\u0E23\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E41\u0E1B\u0E25\u0E07"
|
|
574
596
|
},
|
|
597
|
+
betaStrip: {
|
|
598
|
+
defaultMessage: "{appName} \u0E2D\u0E22\u0E39\u0E48\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E01\u0E32\u0E23\u0E1E\u0E31\u0E12\u0E19\u0E32\u0E0A\u0E48\u0E27\u0E07\u0E15\u0E49\u0E19",
|
|
599
|
+
contactHint: "\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E08\u0E30\u0E2A\u0E48\u0E07\u0E44\u0E1B\u0E17\u0E35\u0E48 {email} \xB7 \u0E17\u0E35\u0E21\u0E07\u0E32\u0E19\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E17\u0E38\u0E01\u0E09\u0E1A\u0E31\u0E1A",
|
|
600
|
+
ariaLabel: "\u0E2A\u0E16\u0E32\u0E19\u0E30\u0E40\u0E1A\u0E15\u0E49\u0E32"
|
|
601
|
+
},
|
|
602
|
+
changelog: {
|
|
603
|
+
whatsNew: "\u0E21\u0E35\u0E2D\u0E30\u0E44\u0E23\u0E43\u0E2B\u0E21\u0E48\u0E43\u0E19 {version}"
|
|
604
|
+
},
|
|
575
605
|
poweredBy: "Powered by Mushi v{version}"
|
|
576
606
|
}
|
|
577
607
|
};
|
|
@@ -615,7 +645,9 @@ var es = {
|
|
|
615
645
|
visual: "Problema de dise\xF1o, estilo o visualizaci\xF3n",
|
|
616
646
|
confusing: "Dif\xEDcil de entender o navegar",
|
|
617
647
|
other: "Otro problema"
|
|
618
|
-
}
|
|
648
|
+
},
|
|
649
|
+
moreCategoriesLabel: "M\xE1s tipos de problemas",
|
|
650
|
+
moreCategoriesCount: "{n} m\xE1s"
|
|
619
651
|
},
|
|
620
652
|
step2: {
|
|
621
653
|
heading: "\xBFQu\xE9 pas\xF3?",
|
|
@@ -752,6 +784,14 @@ var es = {
|
|
|
752
784
|
label: "Solicitud de funci\xF3n",
|
|
753
785
|
description: "Sugerir un cambio"
|
|
754
786
|
},
|
|
787
|
+
betaStrip: {
|
|
788
|
+
defaultMessage: "{appName} est\xE1 en desarrollo temprano",
|
|
789
|
+
contactHint: "Los reportes van a {email} \xB7 revisados por el equipo",
|
|
790
|
+
ariaLabel: "Estado beta"
|
|
791
|
+
},
|
|
792
|
+
changelog: {
|
|
793
|
+
whatsNew: "Novedades de {version}"
|
|
794
|
+
},
|
|
755
795
|
poweredBy: "Con tecnolog\xEDa de Mushi v{version}"
|
|
756
796
|
}
|
|
757
797
|
};
|
|
@@ -2673,7 +2713,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2673
2713
|
|
|
2674
2714
|
// src/version.ts
|
|
2675
2715
|
var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
|
|
2676
|
-
var MUSHI_SDK_VERSION = "1.
|
|
2716
|
+
var MUSHI_SDK_VERSION = "1.28.0" ;
|
|
2677
2717
|
var ASSISTANT_SESSION_STORAGE_KEY = "mushi-assistant-session-v1";
|
|
2678
2718
|
function loadAssistantSession() {
|
|
2679
2719
|
try {
|
|
@@ -3101,8 +3141,8 @@ function renderCategoryStep(ctx) {
|
|
|
3101
3141
|
const primaryCategories = primaryEntries.map(renderEntry).join("");
|
|
3102
3142
|
const secondaryCategories = secondaryEntries.map(renderEntry).join("");
|
|
3103
3143
|
const secondaryHtml = hasMore ? ctx.showAllCategories ? `<div class="mushi-categories-expanded">${secondaryCategories}</div>` : `<button type="button" class="mushi-more-toggle" data-action="show-all-categories">
|
|
3104
|
-
<span class="mushi-more-toggle-text"
|
|
3105
|
-
<span class="mushi-more-toggle-count">${secondaryEntries.length}
|
|
3144
|
+
<span class="mushi-more-toggle-text">${escapeHtml(t.step1.moreCategoriesLabel)}</span>
|
|
3145
|
+
<span class="mushi-more-toggle-count">${escapeHtml(t.step1.moreCategoriesCount.replace("{n}", String(secondaryEntries.length)))}</span>
|
|
3106
3146
|
<span class="mushi-more-toggle-arrow" aria-hidden="true">\u2192</span>
|
|
3107
3147
|
</button>` : "";
|
|
3108
3148
|
return `
|
|
@@ -3145,7 +3185,10 @@ function renderBetaChangelog(ctx) {
|
|
|
3145
3185
|
if (!entries?.length) return "";
|
|
3146
3186
|
const latest = entries[0];
|
|
3147
3187
|
const items = latest.items.map((item) => `<li>\u2022 ${escapeHtml(item)}</li>`).join("");
|
|
3148
|
-
const
|
|
3188
|
+
const whatsNew = escapeHtml(
|
|
3189
|
+
ctx.locale.flows.changelog.whatsNew.replace("{version}", latest.version)
|
|
3190
|
+
);
|
|
3191
|
+
const label = latest.date ? `${whatsNew} \xB7 ${escapeHtml(latest.date)}` : whatsNew;
|
|
3149
3192
|
return `
|
|
3150
3193
|
<details class="mushi-changelog">
|
|
3151
3194
|
<summary class="mushi-changelog-summary">${label}</summary>
|
|
@@ -3155,17 +3198,18 @@ function renderBetaChangelog(ctx) {
|
|
|
3155
3198
|
}
|
|
3156
3199
|
function renderBetaStrip(ctx) {
|
|
3157
3200
|
const beta = ctx.config.betaMode;
|
|
3201
|
+
const strip = ctx.locale.flows.betaStrip;
|
|
3158
3202
|
const appName = escapeHtml(beta.appName ?? "This app");
|
|
3159
|
-
const message = beta.message ? escapeHtml(beta.message) :
|
|
3203
|
+
const message = beta.message ? escapeHtml(beta.message) : escapeHtml(strip.defaultMessage).replace("{appName}", appName);
|
|
3160
3204
|
const email = beta.contactEmail ? escapeHtml(beta.contactEmail) : null;
|
|
3161
3205
|
const perks = beta.perks ?? [];
|
|
3162
3206
|
return `
|
|
3163
|
-
<div class="mushi-beta-strip" role="note" aria-label="
|
|
3207
|
+
<div class="mushi-beta-strip" role="note" aria-label="${escapeHtml(strip.ariaLabel)}">
|
|
3164
3208
|
<div class="mushi-beta-strip-row">
|
|
3165
3209
|
<span class="mushi-beta-tag" aria-hidden="true">BETA</span>
|
|
3166
3210
|
<span class="mushi-beta-msg">${message}</span>
|
|
3167
3211
|
</div>
|
|
3168
|
-
${email ? `<div class="mushi-beta-contact-hint"
|
|
3212
|
+
${email ? `<div class="mushi-beta-contact-hint">${escapeHtml(strip.contactHint).replace("{email}", email)}</div>` : ""}
|
|
3169
3213
|
${perks.length > 0 ? `
|
|
3170
3214
|
<ul class="mushi-beta-perks" aria-label="Beta tester perks">
|
|
3171
3215
|
${perks.map((p) => `<li>\u2713 ${escapeHtml(p)}</li>`).join("")}
|
|
@@ -6436,8 +6480,7 @@ function createNetworkCapture(options = {}) {
|
|
|
6436
6480
|
const originalXhrSend = OriginalXHR ? XMLHttpRequest.prototype.send : null;
|
|
6437
6481
|
const originalXhrSetRequestHeader = OriginalXHR ? XMLHttpRequest.prototype.setRequestHeader : null;
|
|
6438
6482
|
let activeOptions = options;
|
|
6439
|
-
|
|
6440
|
-
globalThis.fetch = fetchWrapper = async function mushiFetchInterceptor(input, init) {
|
|
6483
|
+
const fetchWrapper = async function mushiFetchInterceptor(input, init) {
|
|
6441
6484
|
const startTime = Date.now();
|
|
6442
6485
|
const method = init?.method?.toUpperCase() ?? "GET";
|
|
6443
6486
|
const url = getRequestUrl(input);
|
|
@@ -6495,6 +6538,7 @@ function createNetworkCapture(options = {}) {
|
|
|
6495
6538
|
}
|
|
6496
6539
|
}
|
|
6497
6540
|
};
|
|
6541
|
+
globalThis.fetch = fetchWrapper;
|
|
6498
6542
|
const xhrStateMap = typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : null;
|
|
6499
6543
|
if (OriginalXHR && originalXhrOpen && originalXhrSend && originalXhrSetRequestHeader && xhrStateMap) {
|
|
6500
6544
|
const _originalOpen = originalXhrOpen;
|
|
@@ -7953,8 +7997,6 @@ function tagSentryScope(reportId, options = {}) {
|
|
|
7953
7997
|
} catch {
|
|
7954
7998
|
}
|
|
7955
7999
|
}
|
|
7956
|
-
|
|
7957
|
-
// src/proactive-triggers.ts
|
|
7958
8000
|
var DEFAULT_EXCLUDE_ROUTES = [
|
|
7959
8001
|
"/login",
|
|
7960
8002
|
"/logout",
|
|
@@ -8097,6 +8139,15 @@ function setupProactiveTriggers(callbacks, config = {}) {
|
|
|
8097
8139
|
}
|
|
8098
8140
|
if (config.errorBoundary) {
|
|
8099
8141
|
let handleError2 = function(event) {
|
|
8142
|
+
if (shouldDropCapturedError({
|
|
8143
|
+
message: event.message,
|
|
8144
|
+
filename: event.filename,
|
|
8145
|
+
ignoreErrors: config.ignoreErrors,
|
|
8146
|
+
denyUrls: config.denyUrls,
|
|
8147
|
+
allowUrls: config.allowUrls
|
|
8148
|
+
})) {
|
|
8149
|
+
return;
|
|
8150
|
+
}
|
|
8100
8151
|
callbacks.onTrigger("error_boundary", {
|
|
8101
8152
|
message: event.message,
|
|
8102
8153
|
filename: event.filename,
|
|
@@ -8104,8 +8155,17 @@ function setupProactiveTriggers(callbacks, config = {}) {
|
|
|
8104
8155
|
colno: event.colno
|
|
8105
8156
|
});
|
|
8106
8157
|
}, handleUnhandledRejection2 = function(event) {
|
|
8158
|
+
const message = event.reason instanceof Error ? event.reason.message : String(event.reason);
|
|
8159
|
+
if (shouldDropCapturedError({
|
|
8160
|
+
message,
|
|
8161
|
+
ignoreErrors: config.ignoreErrors,
|
|
8162
|
+
denyUrls: config.denyUrls,
|
|
8163
|
+
allowUrls: config.allowUrls
|
|
8164
|
+
})) {
|
|
8165
|
+
return;
|
|
8166
|
+
}
|
|
8107
8167
|
callbacks.onTrigger("error_boundary", {
|
|
8108
|
-
message
|
|
8168
|
+
message,
|
|
8109
8169
|
type: "unhandled_rejection"
|
|
8110
8170
|
});
|
|
8111
8171
|
};
|
|
@@ -8268,6 +8328,7 @@ function createInstance(config) {
|
|
|
8268
8328
|
...typeof bootstrapConfig.timeout === "number" ? { timeout: bootstrapConfig.timeout } : {},
|
|
8269
8329
|
...typeof bootstrapConfig.maxRetries === "number" ? { maxRetries: bootstrapConfig.maxRetries } : {},
|
|
8270
8330
|
...bootstrapConfig.circuitBreaker ? { circuitBreaker: bootstrapConfig.circuitBreaker } : {},
|
|
8331
|
+
...bootstrapConfig.tunnel ? { tunnel: bootstrapConfig.tunnel } : {},
|
|
8271
8332
|
getUserToken: () => userToken,
|
|
8272
8333
|
sdkPackage: MUSHI_SDK_PACKAGE,
|
|
8273
8334
|
sdkVersion: MUSHI_SDK_VERSION
|
|
@@ -8457,7 +8518,9 @@ function createInstance(config) {
|
|
|
8457
8518
|
const replayMode = activeConfig.capture?.replay ?? "off";
|
|
8458
8519
|
const replaySampleRate = activeConfig.replaySampleRate ?? 1;
|
|
8459
8520
|
const replaySampled = replaySampleRate >= 1 || Math.random() < replaySampleRate;
|
|
8460
|
-
|
|
8521
|
+
const onErrorReplayRate = activeConfig.replaysOnErrorSampleRate ?? 0;
|
|
8522
|
+
const replayOnErrorSampled = !replaySampled && onErrorReplayRate > 0 && Math.random() < onErrorReplayRate;
|
|
8523
|
+
if ((replayMode === "rrweb" || replayMode === "lite") && (replaySampled || replayOnErrorSampled)) {
|
|
8461
8524
|
const generation = ++replayGeneration;
|
|
8462
8525
|
void createReplayCapture({
|
|
8463
8526
|
redactSelectors: activeConfig.privacy?.redactSelectors
|
|
@@ -8876,6 +8939,9 @@ function createInstance(config) {
|
|
|
8876
8939
|
apiCascade: proactiveCfg?.apiCascade,
|
|
8877
8940
|
apiEndpoint: resolveApiEndpoint(activeConfig),
|
|
8878
8941
|
errorBoundary: proactiveCfg?.errorBoundary,
|
|
8942
|
+
ignoreErrors: activeConfig.ignoreErrors,
|
|
8943
|
+
denyUrls: activeConfig.denyUrls,
|
|
8944
|
+
allowUrls: activeConfig.allowUrls,
|
|
8879
8945
|
pageDwell: proactiveCfg?.pageDwell,
|
|
8880
8946
|
firstSession: proactiveCfg?.firstSession,
|
|
8881
8947
|
projectId: bootstrapConfig.projectId
|
|
@@ -9383,6 +9449,16 @@ function createInstance(config) {
|
|
|
9383
9449
|
},
|
|
9384
9450
|
async captureException(error, options) {
|
|
9385
9451
|
const normalised = normaliseThrown(error);
|
|
9452
|
+
const filename = typeof options?.metadata?.filename === "string" ? options.metadata.filename : void 0;
|
|
9453
|
+
if (shouldDropCapturedError({
|
|
9454
|
+
message: normalised.message,
|
|
9455
|
+
filename,
|
|
9456
|
+
ignoreErrors: activeConfig.ignoreErrors,
|
|
9457
|
+
denyUrls: activeConfig.denyUrls,
|
|
9458
|
+
allowUrls: activeConfig.allowUrls
|
|
9459
|
+
})) {
|
|
9460
|
+
return null;
|
|
9461
|
+
}
|
|
9386
9462
|
breadcrumbs.add({
|
|
9387
9463
|
category: "lifecycle",
|
|
9388
9464
|
level: "error",
|
|
@@ -9576,6 +9652,8 @@ function createInstance(config) {
|
|
|
9576
9652
|
localStorage.setItem(SENTINEL_KEY, "clean");
|
|
9577
9653
|
} catch {
|
|
9578
9654
|
}
|
|
9655
|
+
markPageUnloading();
|
|
9656
|
+
flushLastOutboundOnUnload();
|
|
9579
9657
|
});
|
|
9580
9658
|
} catch {
|
|
9581
9659
|
}
|