@sailfish-ai/recorder 1.10.12 → 1.10.13
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/chunks/{chunkSerializer-Q-GkN7Zg.js → chunkSerializer-CodMnuS3.js} +1 -1
- package/dist/chunks/chunkSerializer-CodMnuS3.js.br +0 -0
- package/dist/chunks/chunkSerializer-CodMnuS3.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-kuVb759b.js → chunkSerializer-Dk1eF3S8.js} +1 -1
- package/dist/chunks/chunkSerializer-Dk1eF3S8.js.br +0 -0
- package/dist/chunks/chunkSerializer-Dk1eF3S8.js.gz +0 -0
- package/dist/chunks/{index-OzfaZiW-.js → index-DW416eVj.js} +122 -122
- package/dist/chunks/index-DW416eVj.js.br +0 -0
- package/dist/chunks/index-DW416eVj.js.gz +0 -0
- package/dist/chunks/{index-DNOCpBMH.js → index-DvLh2k6O.js} +110 -109
- package/dist/chunks/index-DvLh2k6O.js.br +0 -0
- package/dist/chunks/index-DvLh2k6O.js.gz +0 -0
- package/dist/index.js +16 -10
- package/dist/recorder.cjs +2 -2
- package/dist/recorder.js +40 -39
- package/dist/recorder.js.br +0 -0
- package/dist/recorder.js.gz +0 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/chunkSerializer-Q-GkN7Zg.js.br +0 -0
- package/dist/chunks/chunkSerializer-Q-GkN7Zg.js.gz +0 -0
- package/dist/chunks/chunkSerializer-kuVb759b.js.br +0 -0
- package/dist/chunks/chunkSerializer-kuVb759b.js.gz +0 -0
- package/dist/chunks/index-DNOCpBMH.js.br +0 -0
- package/dist/chunks/index-DNOCpBMH.js.gz +0 -0
- package/dist/chunks/index-OzfaZiW-.js.br +0 -0
- package/dist/chunks/index-OzfaZiW-.js.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const e = require("./index-
|
|
3
|
+
const e = require("./index-DW416eVj.js");
|
|
4
4
|
exports.chunkedSnapshot = async function chunkedSnapshot(t, n, o = {}) {
|
|
5
5
|
const s = o.chunkSize ?? 500, r = o.maxChunkMs ?? 16, { blockClass: c, blockSelector: a, maskTextClass: i, maskTextSelector: d } = o;
|
|
6
6
|
let u = 100001, l = 0, N = performance.now();
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { y as e } from "./index-
|
|
1
|
+
import { y as e } from "./index-DvLh2k6O.js";
|
|
2
2
|
async function chunkedSnapshot(t, n, o = {}) {
|
|
3
3
|
const s = o.chunkSize ?? 500, r = o.maxChunkMs ?? 16, { blockClass: c, blockSelector: a, maskTextClass: i, maskTextSelector: d } = o;
|
|
4
4
|
let u = 100001, l = 0, N = performance.now();
|
|
Binary file
|
|
Binary file
|
|
@@ -178,7 +178,7 @@ function withAppUrlMetadata(e2) {
|
|
|
178
178
|
return { ...e2 ?? {}, appUrl: (e2 == null ? void 0 : e2.appUrl) ?? ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.href) };
|
|
179
179
|
}
|
|
180
180
|
exports.nowTimestamp = Date.now, /[1-9][0-9]{12}/.test(Date.now().toString()) || (exports.nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime());
|
|
181
|
-
const
|
|
181
|
+
const S = readDebugFlag(), v = "per_session";
|
|
182
182
|
let w = null, k = null, x = false, I = null, T = null, E = "", C = "", $ = false;
|
|
183
183
|
const F = [];
|
|
184
184
|
function onNavigationChange(e2) {
|
|
@@ -254,21 +254,21 @@ function saveGlobalFuncSpanState(e2, t2) {
|
|
|
254
254
|
try {
|
|
255
255
|
if ("undefined" == typeof localStorage) return;
|
|
256
256
|
const n2 = { enabled: e2, expirationTimestampMs: t2, savedAt: Date.now() };
|
|
257
|
-
localStorage.setItem(P, JSON.stringify(n2)),
|
|
257
|
+
localStorage.setItem(P, JSON.stringify(n2)), S && console.log("[Sailfish] Saved funcSpan state to localStorage:", n2);
|
|
258
258
|
} catch (e3) {
|
|
259
|
-
|
|
259
|
+
S && console.warn("[Sailfish] Failed to save funcSpan state to localStorage:", e3);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
function clearGlobalFuncSpanState() {
|
|
263
263
|
try {
|
|
264
264
|
if ("undefined" == typeof localStorage) return;
|
|
265
|
-
localStorage.removeItem(P),
|
|
265
|
+
localStorage.removeItem(P), S && console.log("[Sailfish] Cleared funcSpan state from localStorage");
|
|
266
266
|
} catch (e2) {
|
|
267
|
-
|
|
267
|
+
S && console.warn("[Sailfish] Failed to clear funcSpan state from localStorage:", e2);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
function clearStaleFuncSpanState() {
|
|
271
|
-
A = false, D = null, _ = false, clearGlobalFuncSpanState(),
|
|
271
|
+
A = false, D = null, _ = false, clearGlobalFuncSpanState(), S && console.log("[Sailfish] Cleared stale function span tracking state (backend validation failed)");
|
|
272
272
|
}
|
|
273
273
|
let B = false;
|
|
274
274
|
function restoreFuncSpanState() {
|
|
@@ -280,14 +280,14 @@ function restoreFuncSpanState() {
|
|
|
280
280
|
const e3 = localStorage.getItem(P);
|
|
281
281
|
if (!e3) return null;
|
|
282
282
|
const t2 = JSON.parse(e3);
|
|
283
|
-
return
|
|
283
|
+
return S && console.log("[Sailfish] Loaded funcSpan state from localStorage:", t2), t2;
|
|
284
284
|
} catch (e3) {
|
|
285
|
-
return
|
|
285
|
+
return S && console.warn("[Sailfish] Failed to load funcSpan state from localStorage:", e3), null;
|
|
286
286
|
}
|
|
287
287
|
})();
|
|
288
|
-
if (e2 && e2.enabled) if (A = true, D = e2.expirationTimestampMs, _ = false,
|
|
289
|
-
Date.now() >= D ? (A = false, D = null, clearGlobalFuncSpanState(),
|
|
290
|
-
} else
|
|
288
|
+
if (e2 && e2.enabled) if (A = true, D = e2.expirationTimestampMs, _ = false, S && console.log("[Sailfish] Restored global function span tracking from localStorage:", { enabled: true, expirationTime: D }), null !== D) {
|
|
289
|
+
Date.now() >= D ? (A = false, D = null, clearGlobalFuncSpanState(), S && console.log("[Sailfish] Persisted tracking already expired, cleared state")) : S && console.log("[Sailfish] Function span tracking is active and valid (temporary until WebSocket confirms)");
|
|
290
|
+
} else S && console.log("[Sailfish] Function span tracking is active (no expiration, temporary until WebSocket confirms)");
|
|
291
291
|
}
|
|
292
292
|
function isWebSocketOpen(e2) {
|
|
293
293
|
return (e2 == null ? void 0 : e2.readyState) === WebSocket.OPEN;
|
|
@@ -345,7 +345,7 @@ function sendEvent(e2) {
|
|
|
345
345
|
e2.app_url || (e2.app_url = getCachedHref()), !x && isWebSocketOpen(k) && wsSendPayload({ type: "event", event: e2, mapUuid: window.sfMapUuid }) || queueEventForIDB(e2);
|
|
346
346
|
}
|
|
347
347
|
function handleWsOpen() {
|
|
348
|
-
|
|
348
|
+
S && (console.log("[Sailfish] WebSocket connection opened"), console.log("[Sailfish] Function span tracking state: " + (A ? "ENABLED" : "DISABLED"))), (async () => {
|
|
349
349
|
try {
|
|
350
350
|
x = true, await flushNotifyQueue(), await flushBufferedEvents();
|
|
351
351
|
} finally {
|
|
@@ -357,29 +357,29 @@ function handleWsOpen() {
|
|
|
357
357
|
})();
|
|
358
358
|
}
|
|
359
359
|
function handleWsClose() {
|
|
360
|
-
null != T && (clearInterval(T), T = null),
|
|
360
|
+
null != T && (clearInterval(T), T = null), S && console.log("[Sailfish] WebSocket closed");
|
|
361
361
|
}
|
|
362
362
|
function handleWsMessage(e2) {
|
|
363
363
|
try {
|
|
364
364
|
const t2 = JSON.parse(e2);
|
|
365
|
-
if ("funcSpanTrackingControl" === t2.type) if (
|
|
365
|
+
if ("funcSpanTrackingControl" === t2.type) if (S && console.log("[Sailfish] Received funcSpanTrackingControl message:", { enabled: t2.enabled, timeoutSeconds: t2.timeoutSeconds, expirationTimestampMs: t2.expirationTimestampMs }), null !== R && (window.clearTimeout(R), R = null), A = t2.enabled, _ = false, S && console.log("[Sailfish] Function span tracking " + (t2.enabled ? "ENABLED (GLOBAL)" : "DISABLED (GLOBAL)")), t2.enabled) {
|
|
366
366
|
if (t2.expirationTimestampMs) {
|
|
367
367
|
D = t2.expirationTimestampMs;
|
|
368
368
|
const e3 = Date.now(), n2 = D - e3;
|
|
369
|
-
|
|
370
|
-
_ || (A = false, D = null, clearGlobalFuncSpanState(),
|
|
371
|
-
}, n2)) : (A = false, D = null, clearGlobalFuncSpanState(),
|
|
369
|
+
S && console.log(`[Sailfish] Server expiration timestamp: ${D}, ms until expiration: ${n2}`), n2 > 0 ? (saveGlobalFuncSpanState(true, D), R = window.setTimeout(() => {
|
|
370
|
+
_ || (A = false, D = null, clearGlobalFuncSpanState(), S && console.log("[Sailfish] GLOBAL function span tracking auto-disabled at server expiration time"), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), S && console.log("[Sailfish] Notified backend that function span tracking expired"));
|
|
371
|
+
}, n2)) : (A = false, D = null, clearGlobalFuncSpanState(), S && console.log("[Sailfish] Tracking already expired, not enabling"));
|
|
372
372
|
} else {
|
|
373
373
|
const e3 = t2.timeoutSeconds || 3600;
|
|
374
374
|
e3 > 0 && (D = Date.now() + 1e3 * e3, saveGlobalFuncSpanState(true, D), R = window.setTimeout(() => {
|
|
375
|
-
_ || (A = false, D = null, clearGlobalFuncSpanState(),
|
|
375
|
+
_ || (A = false, D = null, clearGlobalFuncSpanState(), S && console.log(`[Sailfish] GLOBAL function span tracking auto-disabled after ${e3}s (legacy)`), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), S && console.log("[Sailfish] Notified backend that function span tracking expired (legacy timeout)"));
|
|
376
376
|
}, 1e3 * e3));
|
|
377
377
|
}
|
|
378
378
|
try {
|
|
379
379
|
const e3 = getOrSetSessionId();
|
|
380
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: e3, enabled: true, configurationType: "global" }),
|
|
380
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: e3, enabled: true, configurationType: "global" }), S && console.log(`[Sailfish] GLOBAL tracking session report sent for session: ${e3}`);
|
|
381
381
|
} catch (e3) {
|
|
382
|
-
|
|
382
|
+
S && console.warn("[Sailfish] Failed to send GLOBAL tracking session report:", e3);
|
|
383
383
|
}
|
|
384
384
|
} else D = null, clearGlobalFuncSpanState();
|
|
385
385
|
} catch (e3) {
|
|
@@ -391,7 +391,7 @@ function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
|
|
|
391
391
|
const t3 = new URL(e2);
|
|
392
392
|
return `${t3.hostname}${t3.port ? `:${t3.port}` : ""}`;
|
|
393
393
|
})(t2);
|
|
394
|
-
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${r2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.10.
|
|
394
|
+
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${r2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.10.13`;
|
|
395
395
|
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`), w = s2 ? (function tryCreateWsWorker() {
|
|
396
396
|
if ("undefined" == typeof Worker) return null;
|
|
397
397
|
try {
|
|
@@ -408,10 +408,10 @@ function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
|
|
|
408
408
|
const n3 = e3.data;
|
|
409
409
|
"open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED, handleWsClose()) : "message" === n3.type && handleWsMessage(n3.data);
|
|
410
410
|
}, w.onerror = () => {
|
|
411
|
-
|
|
412
|
-
}, w.postMessage({ type: "init", wsUrl: a2 }),
|
|
411
|
+
S && console.warn("[Sailfish] WebSocket worker error");
|
|
412
|
+
}, w.postMessage({ type: "init", wsUrl: a2 }), S && console.log("[Sailfish] WebSocket running in Web Worker (off main thread)"), t3;
|
|
413
413
|
}
|
|
414
|
-
|
|
414
|
+
S && console.log("[Sailfish] WebSocket running on main thread (Worker unavailable)");
|
|
415
415
|
const l2 = new e(a2, [], { connectionTimeout: 3e4 }), c2 = { get readyState() {
|
|
416
416
|
return l2.readyState;
|
|
417
417
|
}, close: () => {
|
|
@@ -423,35 +423,35 @@ function sendMessage(e2) {
|
|
|
423
423
|
"sessionId" in e2 || (e2.sessionId = getOrSetSessionId()), e2.app_url || (e2.app_url = getCachedHref()), x || !isWebSocketOpen(k) ? saveNotifyMessageToIDB(JSON.stringify(e2)) : wsSendPayload(e2) || saveNotifyMessageToIDB(JSON.stringify(e2));
|
|
424
424
|
}
|
|
425
425
|
function enableFunctionSpanTracking() {
|
|
426
|
-
if (
|
|
427
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType:
|
|
428
|
-
} else
|
|
426
|
+
if (S && console.log("[Sailfish] enableFunctionSpanTracking() called - Report Issue recording started (LOCAL MODE)"), A = true, _ = true, D = null, null !== R && (window.clearTimeout(R), R = null), isWebSocketOpen(k)) {
|
|
427
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType: v });
|
|
428
|
+
} else S && console.warn("[Sailfish] WebSocket not open, cannot report LOCAL tracking session");
|
|
429
429
|
}
|
|
430
430
|
function disableFunctionSpanTracking() {
|
|
431
|
-
if (
|
|
432
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType:
|
|
431
|
+
if (S && console.log("[Sailfish] disableFunctionSpanTracking() called - Report Issue recording stopped"), isWebSocketOpen(k)) {
|
|
432
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType: v });
|
|
433
433
|
} else console.warn("[FUNCSPAN STOP] ✗ WebSocket not open, cannot notify tracking end");
|
|
434
|
-
_ && (A = false, _ = false, D = null,
|
|
434
|
+
_ && (A = false, _ = false, D = null, S && console.log("[Sailfish] LOCAL tracking mode disabled")), null !== R && (window.clearTimeout(R), R = null);
|
|
435
435
|
}
|
|
436
436
|
function isFunctionSpanTrackingEnabled() {
|
|
437
437
|
return A;
|
|
438
438
|
}
|
|
439
439
|
function initializeFunctionSpanTrackingFromApi(e2) {
|
|
440
|
-
e2 && !A ? (A = true, _ = false, D = null,
|
|
440
|
+
e2 && !A ? (A = true, _ = false, D = null, S && console.log("[Sailfish] Function span tracking initialized as ENABLED from API check")) : !e2 && A && (A = false, _ = false, D = null, S && console.log("[Sailfish] Function span tracking initialized as DISABLED from API check"));
|
|
441
441
|
}
|
|
442
442
|
function getFuncSpanHeader() {
|
|
443
443
|
if (!A) return null;
|
|
444
444
|
if (null !== D) {
|
|
445
|
-
if (Date.now() >= D) return A = false, D = null, clearGlobalFuncSpanState(),
|
|
445
|
+
if (Date.now() >= D) return A = false, D = null, clearGlobalFuncSpanState(), S && console.log("[Sailfish] Function span tracking expired on header check - disabling now"), null;
|
|
446
446
|
}
|
|
447
447
|
return { name: "X-Sf3-FunctionSpanCaptureOverride", value: "1-1-10-10-1-1.0-1-0-0" };
|
|
448
448
|
}
|
|
449
449
|
const j = Object.freeze(Object.defineProperty({ __proto__: null, clearStaleFuncSpanState, disableFunctionSpanTracking, enableFunctionSpanTracking, ensureHrefCache, flushBufferedEvents, getCachedHref, getCachedHrefNoQuery, getFuncSpanHeader, initializeFunctionSpanTrackingFromApi, initializeWebSocket, isFunctionSpanTrackingEnabled, onNavigationChange, restoreFuncSpanState, sendEvent, sendMessage }, Symbol.toStringTag, { value: "Module" }));
|
|
450
|
-
let O = null,
|
|
451
|
-
let
|
|
450
|
+
let O = null, U = null;
|
|
451
|
+
let z = null;
|
|
452
452
|
const H = ["https://api.ipify.org?format=json", "https://api.ip.sb/jsonip", "https://api4.my-ip.io/ip.json"];
|
|
453
453
|
function fetchAndSendIp(e2) {
|
|
454
|
-
|
|
454
|
+
z !== e2 && (z = e2, (async () => {
|
|
455
455
|
for (const e3 of H) try {
|
|
456
456
|
const t2 = new AbortController(), n2 = setTimeout(() => t2.abort(), 5e3), i2 = await fetch(e3, { signal: t2.signal });
|
|
457
457
|
if (clearTimeout(n2), !i2.ok) continue;
|
|
@@ -459,9 +459,9 @@ function fetchAndSendIp(e2) {
|
|
|
459
459
|
if (s2 && "string" == typeof s2 && s2.length <= 45) return void sendMessage({ type: "visitorIp", ip: s2, timestamp: exports.nowTimestamp() });
|
|
460
460
|
} catch {
|
|
461
461
|
}
|
|
462
|
-
|
|
462
|
+
z = null;
|
|
463
463
|
})().catch(() => {
|
|
464
|
-
|
|
464
|
+
z = null;
|
|
465
465
|
}));
|
|
466
466
|
}
|
|
467
467
|
let N = null;
|
|
@@ -711,7 +711,7 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
|
|
|
711
711
|
}
|
|
712
712
|
const { record: n4 } = await import("@sailfish-rrweb/rrweb-record-only");
|
|
713
713
|
if (Q = n4, await yieldToMain(), l2) {
|
|
714
|
-
const { chunkedSnapshot: i3 } = await Promise.resolve().then(() => require("./chunkSerializer-
|
|
714
|
+
const { chunkedSnapshot: i3 } = await Promise.resolve().then(() => require("./chunkSerializer-CodMnuS3.js")), o3 = n4.mirror;
|
|
715
715
|
let s3 = true;
|
|
716
716
|
const r3 = [];
|
|
717
717
|
n4({ emit(e3) {
|
|
@@ -1027,7 +1027,7 @@ function renderCustomMultiSelect(e2, t2, n2, i2, o2 = false) {
|
|
|
1027
1027
|
}
|
|
1028
1028
|
const he = { enabled: false, openModalExistingMode: { key: "e", requireCmdCtrl: false }, openModalCaptureNewMode: { key: "n", requireCmdCtrl: false }, closeModal: { key: "escape", requireCmdCtrl: false }, submitReport: { key: "enter", requireCmdCtrl: true }, startRecording: { key: "r", requireCmdCtrl: false }, stopRecording: { key: "escape", requireCmdCtrl: true } }, ye = { shortcuts: { ...he }, resolveSessionId: null, apiKey: null, backendApi: null, triageBaseUrl: "https://app.sailfishqa.com", deactivateIsolation: () => {
|
|
1029
1029
|
}, integrationData: null, showEngTicketFieldsDefault: false };
|
|
1030
|
-
let be = null,
|
|
1030
|
+
let be = null, Se = false;
|
|
1031
1031
|
function setupCustomMultiSelectListeners(e2, t2) {
|
|
1032
1032
|
const n2 = document.getElementById(`${e2}-container`), i2 = document.getElementById(`${e2}-dropdown`);
|
|
1033
1033
|
if (!n2 || !i2) return;
|
|
@@ -1276,7 +1276,7 @@ function getSessionIdSafely() {
|
|
|
1276
1276
|
return ye.resolveSessionId();
|
|
1277
1277
|
}
|
|
1278
1278
|
function openReportIssueModal(e2) {
|
|
1279
|
-
me ? stopRecording() : (
|
|
1279
|
+
me ? stopRecording() : (Se = (e2 == null ? void 0 : e2.showEngTicketFields) ?? ye.showEngTicketFieldsDefault, injectModalHTML(), be && document.body.appendChild(be));
|
|
1280
1280
|
}
|
|
1281
1281
|
function closeModal() {
|
|
1282
1282
|
ye.deactivateIsolation(), document.activeElement instanceof HTMLElement && document.activeElement.blur(), (be == null ? void 0 : be.parentNode) && be.parentNode.removeChild(be), be = null, me || (function resetState() {
|
|
@@ -1468,7 +1468,7 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1468
1468
|
Create an Issue
|
|
1469
1469
|
</label>
|
|
1470
1470
|
|
|
1471
|
-
<label id="sf-create-eng-ticket-label" style="display:${ye.integrationData &&
|
|
1471
|
+
<label id="sf-create-eng-ticket-label" style="display:${ye.integrationData && Se ? "flex" : "none"}; align-items:center; gap:8px; font-size:14px; font-weight:500; cursor:pointer;">
|
|
1472
1472
|
<input type="checkbox" id="sf-create-eng-ticket-checkbox" ${ue.createEngTicket ? "checked" : ""}
|
|
1473
1473
|
style="width:16px; height:16px; accent-color:#295DBF; cursor:pointer;">
|
|
1474
1474
|
Create an Eng Ticket
|
|
@@ -1693,7 +1693,7 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1693
1693
|
const e4 = generateEngTicketFieldsHTML();
|
|
1694
1694
|
e4 && (t3.innerHTML = e4, initializeEngTicketForm(), bindEngTicketListeners(), updateFormWithIntegrationData(ue), renderDynamicFields(ue.engTicketProject, ue.engTicketIssueType));
|
|
1695
1695
|
}
|
|
1696
|
-
if (
|
|
1696
|
+
if (Se) {
|
|
1697
1697
|
const e4 = document.getElementById("sf-create-eng-ticket-label");
|
|
1698
1698
|
e4 && (e4.style.display = "flex");
|
|
1699
1699
|
}
|
|
@@ -1884,7 +1884,7 @@ function showStatusModal(e2, t2, n2) {
|
|
|
1884
1884
|
function fadeCardAndRemove(e2, t2, n2 = 300) {
|
|
1885
1885
|
t2.style.opacity = "0", t2.addEventListener("transitionend", () => e2.remove(), { once: true }), setTimeout(() => e2.remove(), n2 + 100);
|
|
1886
1886
|
}
|
|
1887
|
-
const
|
|
1887
|
+
const ve = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueContext: ye, openReportIssueModal, setupIssueReporting: function setupIssueReporting(e2) {
|
|
1888
1888
|
ye.apiKey = e2.apiKey, ye.backendApi = e2.backendApi, ye.resolveSessionId = e2.getSessionId, ye.integrationData = e2.integrationData || null, ye.showEngTicketFieldsDefault = e2.showEngTicketFieldsInReportIssueModalDefault ?? false, e2.customBaseUrl && (ye.triageBaseUrl = e2.customBaseUrl), ye.shortcuts = (function mergeShortcutsConfig(e3) {
|
|
1889
1889
|
const t3 = { ...he };
|
|
1890
1890
|
if (!e3) return t3;
|
|
@@ -2012,7 +2012,7 @@ function matchUrlWithWildcard(e2, t2) {
|
|
|
2012
2012
|
let [n3, i3] = t3.split("/", 2), o3 = "";
|
|
2013
2013
|
n3.includes(":") && ([n3, o3] = n3.split(":"));
|
|
2014
2014
|
const a3 = getCachedRegex(`^${n3.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`, "i"), c2 = l2.startsWith("www.") ? l2.slice(4) : l2;
|
|
2015
|
-
if (o3 && r2 !== o3) return false;
|
|
2015
|
+
if (o3 && "*" !== o3 && r2 !== o3) return false;
|
|
2016
2016
|
if (n3.startsWith("*.")) {
|
|
2017
2017
|
const e4 = n3.slice(2).toLowerCase();
|
|
2018
2018
|
if (!(l2 === e4 || c2 === e4 || l2.endsWith("." + e4))) return false;
|
|
@@ -2028,34 +2028,34 @@ function matchUrlWithWildcard(e2, t2) {
|
|
|
2028
2028
|
return true;
|
|
2029
2029
|
});
|
|
2030
2030
|
}
|
|
2031
|
-
function createSkipHeadersPropagationChecker(e2 = []) {
|
|
2032
|
-
const
|
|
2031
|
+
function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
2032
|
+
const n2 = [...Ie, ...e2], i2 = t2.length > 0;
|
|
2033
2033
|
return function shouldSkipHeadersPropagation(e3) {
|
|
2034
|
-
let
|
|
2034
|
+
let o2;
|
|
2035
2035
|
try {
|
|
2036
|
-
|
|
2036
|
+
o2 = new URL("string" == typeof e3 ? e3 : String((e3 == null ? void 0 : e3.url) ?? e3), window.location.href);
|
|
2037
2037
|
} catch {
|
|
2038
2038
|
return true;
|
|
2039
2039
|
}
|
|
2040
|
-
const
|
|
2041
|
-
return !(-1 ===
|
|
2040
|
+
const s2 = o2.pathname.toLowerCase(), r2 = s2.lastIndexOf(".");
|
|
2041
|
+
return !(-1 === r2 || !xe.has(s2.slice(r2))) || (!(!i2 || matchUrlWithWildcard(e3, t2)) || !!matchUrlWithWildcard(e3, n2));
|
|
2042
2042
|
};
|
|
2043
2043
|
}
|
|
2044
|
-
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }) {
|
|
2045
|
-
const
|
|
2046
|
-
window.fetch = new Proxy(
|
|
2047
|
-
let c2, d2 =
|
|
2044
|
+
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i2 = []) {
|
|
2045
|
+
const o2 = window.fetch, s2 = getOrSetSessionId(), r2 = createSkipHeadersPropagationChecker(e2, i2), a2 = ["text/event-stream", "application/x-ndjson", "application/stream+json", "application/grpc", "application/grpc-web"], l2 = ["application/octet-stream"];
|
|
2046
|
+
window.fetch = new Proxy(o2, { apply: async (e3, i3, o3) => {
|
|
2047
|
+
let c2, d2 = o3[0], u2 = o3[1] || {};
|
|
2048
2048
|
if ("string" == typeof d2) c2 = d2;
|
|
2049
2049
|
else if (d2 instanceof Request) c2 = d2.url;
|
|
2050
2050
|
else {
|
|
2051
|
-
if (!(d2 instanceof URL)) return e3.apply(i3,
|
|
2051
|
+
if (!(d2 instanceof URL)) return e3.apply(i3, o3);
|
|
2052
2052
|
c2 = d2.href;
|
|
2053
2053
|
}
|
|
2054
|
-
return
|
|
2054
|
+
return r2(c2) ? e3.apply(i3, o3) : (async function injectHeaderWrapper(e4, i4, o4, s3, r3, c3, d3) {
|
|
2055
2055
|
var _a, _b;
|
|
2056
|
-
if (!c3) return e4.apply(i4,
|
|
2056
|
+
if (!c3) return e4.apply(i4, o4);
|
|
2057
2057
|
let u3 = uuidv4();
|
|
2058
|
-
const p2 = getUrlAndStoredUuids(), f2 =
|
|
2058
|
+
const p2 = getUrlAndStoredUuids(), f2 = r3.method || "GET", g2 = Date.now();
|
|
2059
2059
|
let m2, h2 = {}, y2 = null;
|
|
2060
2060
|
try {
|
|
2061
2061
|
if (s3 instanceof Request) {
|
|
@@ -2067,54 +2067,54 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2067
2067
|
} catch (e5) {
|
|
2068
2068
|
y2 = null;
|
|
2069
2069
|
}
|
|
2070
|
-
} else
|
|
2070
|
+
} else r3.headers && (r3.headers instanceof Headers ? r3.headers.forEach((e5, t3) => {
|
|
2071
2071
|
h2[t3] = e5;
|
|
2072
|
-
}) : Array.isArray(
|
|
2072
|
+
}) : Array.isArray(r3.headers) ? r3.headers.forEach(([e5, t3]) => {
|
|
2073
2073
|
h2[e5] = t3;
|
|
2074
|
-
}) : h2 = { ...
|
|
2074
|
+
}) : h2 = { ...r3.headers }), m2 = r3.body;
|
|
2075
2075
|
} catch (e5) {
|
|
2076
2076
|
we && console.warn("[Sailfish] Failed to capture request data:", e5);
|
|
2077
2077
|
}
|
|
2078
2078
|
delete h2[n];
|
|
2079
2079
|
const b2 = getFuncSpanHeader();
|
|
2080
2080
|
b2 && delete h2[b2.name];
|
|
2081
|
-
const
|
|
2082
|
-
h2[n] =
|
|
2081
|
+
const S2 = `${c3}/${p2.page_visit_uuid}/${u3}`;
|
|
2082
|
+
h2[n] = S2, b2 && (h2[b2.name] = b2.value);
|
|
2083
2083
|
maskAuthorizationHeader(h2);
|
|
2084
2084
|
try {
|
|
2085
|
-
let b3 = await (async function injectHeader(e5, t3, i5,
|
|
2086
|
-
const
|
|
2085
|
+
let b3 = await (async function injectHeader(e5, t3, i5, o5, s4, r4, a3) {
|
|
2086
|
+
const l3 = getFuncSpanHeader();
|
|
2087
2087
|
if (i5 instanceof Request) {
|
|
2088
2088
|
const c4 = i5.clone(), d4 = new Headers(c4.headers);
|
|
2089
|
-
d4.set(n, `${s4}/${
|
|
2089
|
+
d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value), we && console.log("[Sailfish] Added funcspan header to HTTP Request:", { url: i5.url, header: l3.name }));
|
|
2090
2090
|
const u4 = new Request(c4, { headers: d4 });
|
|
2091
|
-
return await e5.call(t3, u4,
|
|
2091
|
+
return await e5.call(t3, u4, o5);
|
|
2092
2092
|
}
|
|
2093
2093
|
{
|
|
2094
|
-
const c4 = { ...
|
|
2095
|
-
return d4.set(n, `${s4}/${
|
|
2094
|
+
const c4 = { ...o5 }, d4 = new Headers(o5.headers || {});
|
|
2095
|
+
return d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value), we && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof i5 ? i5 : i5.href, header: l3.name })), c4.headers = d4, await e5.call(t3, i5, c4);
|
|
2096
2096
|
}
|
|
2097
|
-
})(e4, i4, s3,
|
|
2098
|
-
Te.includes(b3.status) && (we && console.log("Perform retry as status was fail:", b3), delete h2[n], b3 = await (async function retryWithoutPropagateHeaders(e5, t3, i5,
|
|
2097
|
+
})(e4, i4, s3, r3, c3, p2.page_visit_uuid, u3), S3 = false;
|
|
2098
|
+
Te.includes(b3.status) && (we && console.log("Perform retry as status was fail:", b3), delete h2[n], b3 = await (async function retryWithoutPropagateHeaders(e5, t3, i5, o5) {
|
|
2099
2099
|
try {
|
|
2100
|
-
let
|
|
2101
|
-
if ("string" == typeof
|
|
2102
|
-
const i6 = { ...s4 },
|
|
2103
|
-
|
|
2104
|
-
return await e5.call(t3,
|
|
2100
|
+
let o6 = i5[0], s4 = i5[1] || {};
|
|
2101
|
+
if ("string" == typeof o6 || o6 instanceof URL) {
|
|
2102
|
+
const i6 = { ...s4 }, r4 = new Headers(s4.headers || {});
|
|
2103
|
+
r4.delete(n), i6.headers = r4;
|
|
2104
|
+
return await e5.call(t3, o6, i6);
|
|
2105
2105
|
}
|
|
2106
|
-
if (
|
|
2107
|
-
const i6 =
|
|
2108
|
-
|
|
2109
|
-
const a3 = new Request(i6, { headers:
|
|
2106
|
+
if (o6 instanceof Request) {
|
|
2107
|
+
const i6 = o6.clone(), r4 = new Headers(i6.headers);
|
|
2108
|
+
r4.delete(n);
|
|
2109
|
+
const a3 = new Request(i6, { headers: r4 });
|
|
2110
2110
|
return await e5.call(t3, a3, s4);
|
|
2111
2111
|
}
|
|
2112
2112
|
return e5.apply(t3, i5);
|
|
2113
2113
|
} catch (e6) {
|
|
2114
|
-
throw we && console.log(`Retry without ${n} for ${
|
|
2114
|
+
throw we && console.log(`Retry without ${n} for ${o5} also failed:`, e6), e6;
|
|
2115
2115
|
}
|
|
2116
|
-
})(e4, i4,
|
|
2117
|
-
const
|
|
2116
|
+
})(e4, i4, o4, d3), S3 = true);
|
|
2117
|
+
const v2 = Date.now(), w2 = b3.status, k2 = b3.ok, x2 = k2 ? "" : `Request Error: ${b3.statusText}`;
|
|
2118
2118
|
let I2 = null;
|
|
2119
2119
|
try {
|
|
2120
2120
|
I2 = {}, b3.headers.forEach((e5, t3) => {
|
|
@@ -2123,7 +2123,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2123
2123
|
} catch (e5) {
|
|
2124
2124
|
we && console.warn("[Sailfish] Failed to capture response headers:", e5), I2 = null;
|
|
2125
2125
|
}
|
|
2126
|
-
const T2 = { type: 27, timestamp:
|
|
2126
|
+
const T2 = { type: 27, timestamp: v2, sessionId: c3, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: v2, response_code: w2, success: k2, error: x2, method: f2, url: d3, retry_without_trace_id: S3, request_headers: h2, request_body: m2, response_headers: I2, response_body: null }, ...p2 }, sendEventWithBody = (e5) => {
|
|
2127
2127
|
T2.data.response_body = e5, y2 ? y2.text().then((e6) => {
|
|
2128
2128
|
T2.data.request_body = e6, sendEvent(T2);
|
|
2129
2129
|
}, () => {
|
|
@@ -2135,32 +2135,32 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2135
2135
|
const t3 = e5.headers.get("content-type");
|
|
2136
2136
|
if (!t3) return false;
|
|
2137
2137
|
const n2 = t3.toLowerCase();
|
|
2138
|
-
return
|
|
2138
|
+
return l2.some((e6) => n2.includes(e6));
|
|
2139
2139
|
})(b3)) sendEventWithBody(null);
|
|
2140
2140
|
else if ((function isStreamingResponse(e5) {
|
|
2141
2141
|
const t3 = e5.headers.get("content-type");
|
|
2142
2142
|
if (!t3) return false;
|
|
2143
2143
|
const n2 = t3.toLowerCase();
|
|
2144
|
-
return
|
|
2144
|
+
return a2.some((e6) => n2.includes(e6));
|
|
2145
2145
|
})(b3)) if (t2.captureStreamingResponseBody) try {
|
|
2146
2146
|
(async function readStreamPrefix(e5, t3, n2) {
|
|
2147
2147
|
const i5 = e5.body;
|
|
2148
2148
|
if (!i5) return null;
|
|
2149
|
-
const
|
|
2149
|
+
const o5 = i5.getReader(), s4 = new TextDecoder(), r4 = [];
|
|
2150
2150
|
let a3 = 0;
|
|
2151
2151
|
const readWithLimit = async () => {
|
|
2152
2152
|
try {
|
|
2153
2153
|
for (; a3 < t3; ) {
|
|
2154
|
-
const { done: e6, value: t4 } = await
|
|
2154
|
+
const { done: e6, value: t4 } = await o5.read();
|
|
2155
2155
|
if (e6) break;
|
|
2156
|
-
a3 += t4.byteLength,
|
|
2156
|
+
a3 += t4.byteLength, r4.push(s4.decode(t4, { stream: true }));
|
|
2157
2157
|
}
|
|
2158
|
-
return
|
|
2158
|
+
return r4.push(s4.decode()), r4.join("");
|
|
2159
2159
|
} catch {
|
|
2160
|
-
return
|
|
2160
|
+
return r4.length > 0 ? r4.join("") : null;
|
|
2161
2161
|
} finally {
|
|
2162
2162
|
try {
|
|
2163
|
-
|
|
2163
|
+
o5.cancel();
|
|
2164
2164
|
} catch {
|
|
2165
2165
|
}
|
|
2166
2166
|
}
|
|
@@ -2168,14 +2168,14 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2168
2168
|
try {
|
|
2169
2169
|
return await Promise.race([readWithLimit(), new Promise((e6) => setTimeout(() => {
|
|
2170
2170
|
try {
|
|
2171
|
-
|
|
2171
|
+
o5.cancel();
|
|
2172
2172
|
} catch {
|
|
2173
2173
|
}
|
|
2174
|
-
e6(
|
|
2174
|
+
e6(r4.length > 0 ? r4.join("") : null);
|
|
2175
2175
|
}, n2))]);
|
|
2176
2176
|
} catch {
|
|
2177
2177
|
try {
|
|
2178
|
-
|
|
2178
|
+
o5.cancel();
|
|
2179
2179
|
} catch {
|
|
2180
2180
|
}
|
|
2181
2181
|
return null;
|
|
@@ -2198,20 +2198,20 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2198
2198
|
}
|
|
2199
2199
|
return b3;
|
|
2200
2200
|
} catch (t3) {
|
|
2201
|
-
const n2 = Date.now(), s4 = false,
|
|
2202
|
-
if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(Ee.toLowerCase()))) return e4.apply(i4,
|
|
2203
|
-
let
|
|
2201
|
+
const n2 = Date.now(), s4 = false, r4 = ((_a = t3.response) == null ? void 0 : _a.status) || 500, a3 = t3.message || "Fetch request failed";
|
|
2202
|
+
if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(Ee.toLowerCase()))) return e4.apply(i4, o4);
|
|
2203
|
+
let l3 = m2;
|
|
2204
2204
|
if (y2) try {
|
|
2205
|
-
|
|
2205
|
+
l3 = await y2.text();
|
|
2206
2206
|
} catch {
|
|
2207
|
-
|
|
2207
|
+
l3 = null;
|
|
2208
2208
|
}
|
|
2209
|
-
throw sendEvent({ type: 27, timestamp: n2, sessionId: c3, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: n2, response_code:
|
|
2209
|
+
throw sendEvent({ type: 27, timestamp: n2, sessionId: c3, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: n2, response_code: r4, success: s4, error: a3, method: f2, url: d3, request_headers: h2, request_body: l3, response_body: null }, ...p2 }), t3;
|
|
2210
2210
|
}
|
|
2211
|
-
})(e3, i3,
|
|
2211
|
+
})(e3, i3, o3, d2, u2, s2, c2);
|
|
2212
2212
|
} });
|
|
2213
2213
|
}
|
|
2214
|
-
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = [], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: s2, serviceIdentifier: r2, gitSha: a2, serviceAdditionalMetadata: l2, enableIpTracking: c2, captureStreamingResponseBody: d2 = true, captureResponseBodyMaxMb: u2 = 10, captureStreamPrefixKb: p2 = 64, captureStreamTimeoutMs: f2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: b2, useWsWorker:
|
|
2214
|
+
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = [], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: s2, serviceIdentifier: r2, gitSha: a2, serviceAdditionalMetadata: l2, enableIpTracking: c2, captureStreamingResponseBody: d2 = true, captureResponseBodyMaxMb: u2 = 10, captureStreamPrefixKb: p2 = 64, captureStreamTimeoutMs: f2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: b2, useWsWorker: S2 = true }) {
|
|
2215
2215
|
var _a, _b;
|
|
2216
2216
|
if ((function isHeadlessOrLighthouse() {
|
|
2217
2217
|
try {
|
|
@@ -2224,20 +2224,20 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2224
2224
|
return false;
|
|
2225
2225
|
}
|
|
2226
2226
|
})()) return;
|
|
2227
|
-
const
|
|
2227
|
+
const v2 = h2 ?? y2 ?? true, w2 = getOrSetSessionId(), k2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
2228
2228
|
if (k2.sessionId = w2, k2.apiKey = e2, k2.backendApi = t2, k2.serviceAdditionalMetadata = l2, k2.initialized && k2.sessionId === w2 && k2.ws && 1 === k2.ws.readyState) return void trackDomainChangesOnce();
|
|
2229
2229
|
const x2 = { captureStreamingResponseBody: d2, captureResponseBodyMaxMb: u2, captureStreamPrefixKb: p2, captureStreamTimeoutMs: f2 };
|
|
2230
|
-
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()), k2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }) {
|
|
2231
|
-
const
|
|
2230
|
+
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()), k2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i3 = []) {
|
|
2231
|
+
const o3 = XMLHttpRequest.prototype.open, s3 = XMLHttpRequest.prototype.send, r3 = XMLHttpRequest.prototype.setRequestHeader, a3 = getOrSetSessionId(), l3 = createSkipHeadersPropagationChecker(e3, i3);
|
|
2232
2232
|
XMLHttpRequest.prototype.setRequestHeader = function(e4, t4) {
|
|
2233
|
-
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4,
|
|
2233
|
+
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4, r3.call(this, e4, t4);
|
|
2234
2234
|
}, XMLHttpRequest.prototype.open = function(e4, t4, ...n2) {
|
|
2235
|
-
return this._requestUrl = "string" == typeof t4 && t4.length > 0 ? t4 : null, this._requestMethod = e4, this._capturedRequestHeaders = {},
|
|
2235
|
+
return this._requestUrl = "string" == typeof t4 && t4.length > 0 ? t4 : null, this._requestMethod = e4, this._capturedRequestHeaders = {}, o3.apply(this, [e4, t4, ...n2]);
|
|
2236
2236
|
}, XMLHttpRequest.prototype.send = function(...e4) {
|
|
2237
2237
|
const i4 = this._requestUrl;
|
|
2238
|
-
if (!i4) return
|
|
2239
|
-
if (
|
|
2240
|
-
const
|
|
2238
|
+
if (!i4) return s3.apply(this, e4);
|
|
2239
|
+
if (l3(i4)) return s3.apply(this, e4);
|
|
2240
|
+
const o4 = sessionStorage.getItem("pageVisitUUID"), r4 = uuidv4(), c3 = `${a3}/${o4}/${r4}`;
|
|
2241
2241
|
try {
|
|
2242
2242
|
this.setRequestHeader(n, c3);
|
|
2243
2243
|
} catch (e5) {
|
|
@@ -2253,21 +2253,21 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2253
2253
|
let p3 = false;
|
|
2254
2254
|
const f3 = e4[0], g2 = { ...this._capturedRequestHeaders };
|
|
2255
2255
|
maskAuthorizationHeader(g2);
|
|
2256
|
-
const emitFinished = (e5, t4, n2,
|
|
2256
|
+
const emitFinished = (e5, t4, n2, o5, s4) => {
|
|
2257
2257
|
if (p3) return;
|
|
2258
2258
|
p3 = true;
|
|
2259
|
-
const
|
|
2260
|
-
sendEvent({ type: 27, timestamp:
|
|
2259
|
+
const l4 = Date.now();
|
|
2260
|
+
sendEvent({ type: 27, timestamp: l4, sessionId: a3, data: { request_id: r4, session_id: a3, timestamp_start: u3, timestamp_end: l4, response_code: t4, success: e5, error: n2, method: this._requestMethod, url: i4, request_headers: g2, request_body: f3, response_headers: s4, response_body: o5 }, ...getUrlAndStoredUuids() });
|
|
2261
2261
|
};
|
|
2262
2262
|
return this.addEventListener("load", () => {
|
|
2263
2263
|
const e5 = this.status || 0;
|
|
2264
2264
|
let n2, i5 = null;
|
|
2265
|
-
const
|
|
2265
|
+
const o5 = 1024 * t3.captureResponseBodyMaxMb * 1024;
|
|
2266
2266
|
try {
|
|
2267
2267
|
if (0 === t3.captureResponseBodyMaxMb) n2 = null;
|
|
2268
2268
|
else {
|
|
2269
2269
|
const e6 = this.responseText || this.response;
|
|
2270
|
-
n2 = "string" == typeof e6 && e6.length >
|
|
2270
|
+
n2 = "string" == typeof e6 && e6.length > o5 ? null : e6;
|
|
2271
2271
|
}
|
|
2272
2272
|
} catch (e6) {
|
|
2273
2273
|
n2 = null;
|
|
@@ -2290,9 +2290,9 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2290
2290
|
}, { once: true }), this.addEventListener("error", () => {
|
|
2291
2291
|
const e5 = this.status || 0, t4 = 0 === e5 ? "Network or CORS failure" : this.statusText || `Error ${e5}`;
|
|
2292
2292
|
emitFinished(false, e5, t4);
|
|
2293
|
-
}, { once: true }),
|
|
2293
|
+
}, { once: true }), s3.apply(this, e4);
|
|
2294
2294
|
};
|
|
2295
|
-
})(o2, x2), k2.xhrPatched = true), k2.fetchPatched || (setupFetchInterceptor(o2, x2), k2.fetchPatched = true), await yieldToMain(), k2.domEventsInit || (initializeDomContentEvents(w2), k2.domEventsInit = true), await yieldToMain(), k2.consoleInit || (initializeConsolePlugin(Le, w2), k2.consoleInit = true), await yieldToMain(), k2.errorInit || (!(function initializeErrorInterceptor() {
|
|
2295
|
+
})(o2, x2, i2), k2.xhrPatched = true), k2.fetchPatched || (setupFetchInterceptor(o2, x2, i2), k2.fetchPatched = true), await yieldToMain(), k2.domEventsInit || (initializeDomContentEvents(w2), k2.domEventsInit = true), await yieldToMain(), k2.consoleInit || (initializeConsolePlugin(Le, w2), k2.consoleInit = true), await yieldToMain(), k2.errorInit || (!(function initializeErrorInterceptor() {
|
|
2296
2296
|
window.addEventListener("error", (e3) => {
|
|
2297
2297
|
captureError(e3.error || e3.message);
|
|
2298
2298
|
}), window.addEventListener("unhandledrejection", (e3) => {
|
|
@@ -2351,7 +2351,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2351
2351
|
if ((_b = h3.data) == null ? void 0 : _b.startRecordingSession) {
|
|
2352
2352
|
const n3 = (l2 == null ? void 0 : l2.env) || (l2 == null ? void 0 : l2.environment);
|
|
2353
2353
|
await yieldToMain();
|
|
2354
|
-
const i4 = await initializeRecording(y3, t2, e2, w2, n3,
|
|
2354
|
+
const i4 = await initializeRecording(y3, t2, e2, w2, n3, v2, S2, b2 ?? false);
|
|
2355
2355
|
k2.ws = i4, k2.initialized = true, trackDomainChangesOnce(), k2.sentMapUuidOnce || (!(function sendMapUuidIfAvailable(e3 = "", t3 = "") {
|
|
2356
2356
|
window.sfMapUuid && sendMessage({ type: "mapUuid", data: { mapUuid: window.sfMapUuid, serviceIdentifier: e3, serviceVersion: t3 } });
|
|
2357
2357
|
})(r2, s2), k2.sentMapUuidOnce = true);
|
|
@@ -2362,8 +2362,8 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2362
2362
|
}
|
|
2363
2363
|
exports.DEFAULT_CAPTURE_SETTINGS = Fe, exports.DEFAULT_CONSOLE_RECORDING_SETTINGS = Le, exports.STORAGE_VERSION = 1, exports.addOrUpdateMetadata = function addOrUpdateMetadata(e2) {
|
|
2364
2364
|
const t2 = { type: "addOrUpdateMetadata", metadata: e2 };
|
|
2365
|
-
|
|
2366
|
-
}, exports.buildBatches = buildBatches, exports.clearStaleFuncSpanState = clearStaleFuncSpanState, exports.createTriageAndIssueFromRecorder = createTriageAndIssueFromRecorder, exports.createTriageFromRecorder = createTriageFromRecorder, exports.disableFunctionSpanTracking = disableFunctionSpanTracking, exports.enableFunctionSpanTracking = enableFunctionSpanTracking, exports.ensureHrefCache = ensureHrefCache, exports.eventSize = eventSize, exports.fetchAndSendIp = fetchAndSendIp, exports.fetchCaptureSettings = fetchCaptureSettings, exports.fetchEngineeringTicketPlatformIntegrations = fetchEngineeringTicketPlatformIntegrations, exports.fetchFunctionSpanTrackingEnabled = fetchFunctionSpanTrackingEnabled, exports.flushBufferedEvents = flushBufferedEvents, exports.getCachedHref = getCachedHref, exports.getCachedHrefNoQuery = getCachedHrefNoQuery, exports.getFuncSpanHeader = getFuncSpanHeader, exports.getOrSetSessionId = getOrSetSessionId, exports.getUrlAndStoredUuids = getUrlAndStoredUuids, exports.identify = function identify(e2, t2 = {}, n2 = false) {
|
|
2365
|
+
U && JSON.stringify(U) === JSON.stringify(e2) || (U = e2, sendMessage(t2));
|
|
2366
|
+
}, exports.buildBatches = buildBatches, exports.clearStaleFuncSpanState = clearStaleFuncSpanState, exports.createSkipHeadersPropagationChecker = createSkipHeadersPropagationChecker, exports.createTriageAndIssueFromRecorder = createTriageAndIssueFromRecorder, exports.createTriageFromRecorder = createTriageFromRecorder, exports.disableFunctionSpanTracking = disableFunctionSpanTracking, exports.enableFunctionSpanTracking = enableFunctionSpanTracking, exports.ensureHrefCache = ensureHrefCache, exports.eventSize = eventSize, exports.fetchAndSendIp = fetchAndSendIp, exports.fetchCaptureSettings = fetchCaptureSettings, exports.fetchEngineeringTicketPlatformIntegrations = fetchEngineeringTicketPlatformIntegrations, exports.fetchFunctionSpanTrackingEnabled = fetchFunctionSpanTrackingEnabled, exports.flushBufferedEvents = flushBufferedEvents, exports.getCachedHref = getCachedHref, exports.getCachedHrefNoQuery = getCachedHrefNoQuery, exports.getFuncSpanHeader = getFuncSpanHeader, exports.getOrSetSessionId = getOrSetSessionId, exports.getUrlAndStoredUuids = getUrlAndStoredUuids, exports.identify = function identify(e2, t2 = {}, n2 = false) {
|
|
2367
2367
|
const i2 = { type: "identify", userId: e2, traits: t2 };
|
|
2368
2368
|
O && O.userId === e2 && JSON.stringify(O.traits) === JSON.stringify(t2) || (O = { userId: e2, traits: t2, overwrite: n2 }, sendMessage(i2));
|
|
2369
2369
|
}, exports.initRecorder = async (e2) => {
|
|
@@ -2371,7 +2371,7 @@ exports.DEFAULT_CAPTURE_SETTINGS = Fe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
|
|
|
2371
2371
|
const t2 = window.__sailfish_recorder || (window.__sailfish_recorder = {}), n2 = getOrSetSessionId();
|
|
2372
2372
|
return clearPageVisitDataFromSessionStorage(), t2.initialized && t2.sessionId === n2 && t2.ws && 1 === t2.ws.readyState ? void 0 : (t2.initPromise || (t2.initPromise = (async () => {
|
|
2373
2373
|
if (t2.hasLoggedInitOnce || (console.log("Initializing Sailfish Recorder (first run) …"), t2.hasLoggedInitOnce = true), await startRecording(e2), !t2.issueReportingInit) {
|
|
2374
|
-
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: s2 }] = await Promise.all([Promise.resolve().then(() =>
|
|
2374
|
+
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: s2 }] = await Promise.all([Promise.resolve().then(() => ve), Promise.resolve().then(() => le)]);
|
|
2375
2375
|
let r2 = null;
|
|
2376
2376
|
try {
|
|
2377
2377
|
await o2(e2.apiKey, n3), r2 = s2();
|
|
Binary file
|
|
Binary file
|