@sailfish-ai/recorder 1.12.8 → 1.12.9
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/{canvasManager-CDEhVz_J.js → canvasManager-CLCtW5BZ.js} +1 -1
- package/dist/chunks/canvasManager-CLCtW5BZ.js.br +0 -0
- package/dist/chunks/canvasManager-CLCtW5BZ.js.gz +0 -0
- package/dist/chunks/{canvasManager-3AzRUaNq.js → canvasManager-Dtum5H28.js} +1 -1
- package/dist/chunks/canvasManager-Dtum5H28.js.br +0 -0
- package/dist/chunks/canvasManager-Dtum5H28.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-Cz0TPV-B.js → chunkSerializer-9QANwItv.js} +1 -1
- package/dist/chunks/chunkSerializer-9QANwItv.js.br +0 -0
- package/dist/chunks/chunkSerializer-9QANwItv.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-B3loCr3q.js → chunkSerializer-Ds0Flu_e.js} +1 -1
- package/dist/chunks/chunkSerializer-Ds0Flu_e.js.br +0 -0
- package/dist/chunks/chunkSerializer-Ds0Flu_e.js.gz +0 -0
- package/dist/chunks/{index-BUAmLDnY.js → index-BRybWPUS.js} +41 -33
- package/dist/chunks/index-BRybWPUS.js.br +0 -0
- package/dist/chunks/index-BRybWPUS.js.gz +0 -0
- package/dist/chunks/{index-CPZwt1ko.js → index-Cp1vLB5Q.js} +71 -64
- package/dist/chunks/index-Cp1vLB5Q.js.br +0 -0
- package/dist/chunks/index-Cp1vLB5Q.js.gz +0 -0
- package/dist/index.js +15 -1
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/recorder.cjs +2 -2
- package/dist/recorder.cjs.br +0 -0
- package/dist/recorder.cjs.gz +0 -0
- package/dist/recorder.js +13 -12
- package/dist/recorder.js.br +0 -0
- package/dist/recorder.js.gz +0 -0
- package/dist/recorder.umd.cjs +28 -21
- package/dist/recorder.umd.cjs.br +0 -0
- package/dist/recorder.umd.cjs.gz +0 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/canvasManager-3AzRUaNq.js.br +0 -0
- package/dist/chunks/canvasManager-3AzRUaNq.js.gz +0 -0
- package/dist/chunks/canvasManager-CDEhVz_J.js.br +0 -0
- package/dist/chunks/canvasManager-CDEhVz_J.js.gz +0 -0
- package/dist/chunks/chunkSerializer-B3loCr3q.js.br +0 -0
- package/dist/chunks/chunkSerializer-B3loCr3q.js.gz +0 -0
- package/dist/chunks/chunkSerializer-Cz0TPV-B.js.br +0 -0
- package/dist/chunks/chunkSerializer-Cz0TPV-B.js.gz +0 -0
- package/dist/chunks/index-BUAmLDnY.js.br +0 -0
- package/dist/chunks/index-BUAmLDnY.js.gz +0 -0
- package/dist/chunks/index-CPZwt1ko.js.br +0 -0
- package/dist/chunks/index-CPZwt1ko.js.gz +0 -0
|
@@ -3,7 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
|
-
const e = require("./index-
|
|
6
|
+
const e = require("./index-Cp1vLB5Q.js"), t = require("./patch2d-9voowhJ_.js");
|
|
7
7
|
function createBlobWorker(e2) {
|
|
8
8
|
const t2 = new Blob([e2], { type: "application/javascript" }), n2 = URL.createObjectURL(t2), r2 = new Worker(n2);
|
|
9
9
|
return URL.revokeObjectURL(n2), r2;
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { i as e, u as t } from "./index-
|
|
4
|
+
import { i as e, u as t } from "./index-BRybWPUS.js";
|
|
5
5
|
import { k as n, R as r, B as o, o as s, d as a, D as i, q as c, s as d, T as l, i as u, t as f, u as h, v as p, w as m, x as v, y, C as g, z as w, A as k, E as b, F as C, G as x, H as S, I as R, J as L, K as M, L as I, M as T, a as E } from "./patch2d-PQxcaE6r.js";
|
|
6
6
|
function createBlobWorker(e2) {
|
|
7
7
|
const t2 = new Blob([e2], { type: "application/javascript" }), n2 = URL.createObjectURL(t2), r2 = new Worker(n2);
|
|
Binary file
|
|
Binary file
|
|
@@ -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-Cp1vLB5Q.js");
|
|
4
4
|
exports.chunkedSnapshot = async function chunkedSnapshot(t, n, s = {}) {
|
|
5
5
|
const o = s.chunkSize ?? 500, r = s.maxChunkMs ?? 16, { blockClass: a, blockSelector: c, maskTextClass: i, maskTextSelector: u, maskInputSelector: d, maskInputOptions: l, maskInputFn: f, maskTextFn: N, unmaskSelector: h } = s;
|
|
6
6
|
function matchesSelectorSafe(e2, t2) {
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { y as e } from "./index-
|
|
1
|
+
import { y as e } from "./index-BRybWPUS.js";
|
|
2
2
|
async function chunkedSnapshot(t, n, s = {}) {
|
|
3
3
|
const o = s.chunkSize ?? 500, r = s.maxChunkMs ?? 16, { blockClass: a, blockSelector: c, maskTextClass: i, maskTextSelector: u, maskInputSelector: d, maskInputOptions: l, maskInputFn: f, maskTextFn: N, unmaskSelector: m } = s;
|
|
4
4
|
function matchesSelectorSafe(e2, t2) {
|
|
Binary file
|
|
Binary file
|
|
@@ -605,7 +605,7 @@ function initializeWebSocket(t2, n2, i2, o2, r2 = false) {
|
|
|
605
605
|
const t3 = new URL(e2);
|
|
606
606
|
return `${t3.hostname}${t3.port ? `:${t3.port}` : ""}`;
|
|
607
607
|
})(t2);
|
|
608
|
-
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${s2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.12.
|
|
608
|
+
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${s2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.12.9`;
|
|
609
609
|
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`), U = null, N = null, q = 0, O = r2 ? (function tryCreateWsWorker() {
|
|
610
610
|
if ("undefined" == typeof Worker) return null;
|
|
611
611
|
try {
|
|
@@ -971,7 +971,7 @@ async function initializeRecording(e2, o2, r2, s2, a2, c2 = true, l2 = false, d2
|
|
|
971
971
|
ke = o4, await yieldToMain();
|
|
972
972
|
const r3 = e2.unmaskSelector || void 0, a3 = e2.blockSelector || void 0, c3 = e2.maskTextSelector || void 0, l3 = e2.maskInputSelector || void 0, u3 = { ...e2.maskInputOptions ?? {} }, p2 = l3 ? { ...we } : u3, f2 = n({ baseFn: maskInputFn, unmaskSelector: r3, maskInputSelector: l3, adminMaskInputOptions: u3 }), g2 = i(r3);
|
|
973
973
|
if (d2) {
|
|
974
|
-
const { chunkedSnapshot: n2 } = await import("./chunkSerializer-
|
|
974
|
+
const { chunkedSnapshot: n2 } = await import("./chunkSerializer-Ds0Flu_e.js"), i2 = o4.mirror;
|
|
975
975
|
let s3 = true;
|
|
976
976
|
const d3 = [];
|
|
977
977
|
o4({ emit(e3) {
|
|
@@ -993,7 +993,7 @@ async function initializeRecording(e2, o2, r2, s2, a2, c2 = true, l2 = false, d2
|
|
|
993
993
|
console.warn("[Sailfish] Failed to enable hover detection:", e3);
|
|
994
994
|
}
|
|
995
995
|
if (e2.recordCanvas) try {
|
|
996
|
-
const { startCanvasRecording: n2, stopCanvasRecording: i2, flushAllCanvas: r4, isCanvasRecordingActive: a4 } = await import("./canvasManager-
|
|
996
|
+
const { startCanvasRecording: n2, stopCanvasRecording: i2, flushAllCanvas: r4, isCanvasRecordingActive: a4 } = await import("./canvasManager-Dtum5H28.js"), c4 = { settings: { maskCanvasClass: e2.maskCanvasClass, maskTextClass: e2.maskTextClass, maskTextSelector: e2.maskTextSelector, blockSelector: e2.blockSelector, unmaskSelector: e2.unmaskSelector, maskCanvasText: e2.maskCanvasText ?? void 0, canvasRedactStyle: e2.canvasRedactStyle, recordSsn: e2.recordSsn, recordCreditCardInfo: e2.recordCreditCardInfo, recordDob: e2.recordDob, recordRealName: e2.recordRealName, recordPassword: e2.recordPassword }, mirror: o4.mirror, addSailfishEvent: (e3) => {
|
|
997
997
|
ke == null ? void 0 : ke.addSailfishEvent(t.SailfishCustom, { ...e3, tag: "sf-canvas" });
|
|
998
998
|
}, sendBinary: wsSendBinary, getContextIds: () => ({ session_id: s2, page_visit_uuid: getUrlAndStoredUuids().page_visit_uuid }), isTransportSaturated };
|
|
999
999
|
n2(c4);
|
|
@@ -2631,6 +2631,10 @@ function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
|
2631
2631
|
return !(-1 === s2 || !tt.has(r2.slice(s2))) || (!(!i2 || matchParsedUrlAgainstPatterns(o2, t2)) || !!matchParsedUrlAgainstPatterns(o2, n2));
|
|
2632
2632
|
};
|
|
2633
2633
|
}
|
|
2634
|
+
function resolveFailedFetchStatus(e2, t2) {
|
|
2635
|
+
var _a;
|
|
2636
|
+
return ((_a = e2 == null ? void 0 : e2.response) == null ? void 0 : _a.status) ?? t2 ?? 0;
|
|
2637
|
+
}
|
|
2634
2638
|
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, n2 = []) {
|
|
2635
2639
|
const i2 = window.fetch, o2 = getOrSetSessionId(), r2 = createSkipHeadersPropagationChecker(e2, n2), s2 = ["text/event-stream", "application/x-ndjson", "application/stream+json", "application/grpc", "application/grpc-web"], a2 = ["application/octet-stream"];
|
|
2636
2640
|
window.fetch = new Proxy(i2, { apply: async (e3, n3, i3) => {
|
|
@@ -2642,7 +2646,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2642
2646
|
c2 = l2.href;
|
|
2643
2647
|
}
|
|
2644
2648
|
return r2(c2) ? e3.apply(n3, i3) : (async function injectHeaderWrapper(e4, n4, i4, o3, r3, c3, l3) {
|
|
2645
|
-
var _a
|
|
2649
|
+
var _a;
|
|
2646
2650
|
if (!c3) return e4.apply(n4, i4);
|
|
2647
2651
|
let d3 = uuidv4();
|
|
2648
2652
|
const u2 = getUrlAndStoredUuids(), p2 = r3.method || "GET", g2 = Date.now();
|
|
@@ -2670,6 +2674,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2670
2674
|
v2 && delete h2[v2.name];
|
|
2671
2675
|
const b2 = `${c3}/${u2.page_visit_uuid}/${d3}`;
|
|
2672
2676
|
h2[f] = b2, v2 && (h2[v2.name] = v2.value);
|
|
2677
|
+
let S2;
|
|
2673
2678
|
maskAuthorizationHeader(h2);
|
|
2674
2679
|
try {
|
|
2675
2680
|
let v3 = await (async function injectHeader(e5, t3, n5, i5, o4, r4, s3) {
|
|
@@ -2684,7 +2689,9 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2684
2689
|
const c4 = { ...i5 }, l4 = new Headers(i5.headers || {});
|
|
2685
2690
|
return l4.set(f, `${o4}/${r4}/${s3}`), a3 && (l4.set(a3.name, a3.value), Ze && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof n5 ? n5 : n5.href, header: a3.name })), c4.headers = l4, await e5.call(t3, n5, c4);
|
|
2686
2691
|
}
|
|
2687
|
-
})(e4, n4, o3, r3, c3, u2.page_visit_uuid, d3)
|
|
2692
|
+
})(e4, n4, o3, r3, c3, u2.page_visit_uuid, d3);
|
|
2693
|
+
S2 = v3.status;
|
|
2694
|
+
let b3 = false;
|
|
2688
2695
|
it.includes(v3.status) && (Ze && console.log("Perform retry as status was fail:", v3), delete h2[f], v3 = await (async function retryWithoutPropagateHeaders(e5, t3, n5, i5) {
|
|
2689
2696
|
try {
|
|
2690
2697
|
let i6 = n5[0], o4 = n5[1] || {};
|
|
@@ -2703,25 +2710,25 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2703
2710
|
} catch (e6) {
|
|
2704
2711
|
throw Ze && console.log(`Retry without ${f} for ${i5} also failed:`, e6), e6;
|
|
2705
2712
|
}
|
|
2706
|
-
})(e4, n4, i4, l3), b3 = true);
|
|
2707
|
-
const
|
|
2713
|
+
})(e4, n4, i4, l3), S2 = v3.status, b3 = true);
|
|
2714
|
+
const w2 = Date.now(), k2 = (function captureClientTime() {
|
|
2708
2715
|
return { wallTimeMs: Date.now(), monotonicMs: monotonicNow(), timeOriginMs: timeOriginMs() };
|
|
2709
|
-
})(),
|
|
2710
|
-
let
|
|
2716
|
+
})(), x2 = v3.status, I2 = v3.ok, T2 = I2 ? "" : `Request Error: ${v3.statusText}`;
|
|
2717
|
+
let E2 = null;
|
|
2711
2718
|
try {
|
|
2712
|
-
|
|
2713
|
-
|
|
2719
|
+
E2 = {}, v3.headers.forEach((e5, t3) => {
|
|
2720
|
+
E2[t3] = e5;
|
|
2714
2721
|
});
|
|
2715
2722
|
} catch (e5) {
|
|
2716
|
-
Ze && console.warn("[Sailfish] Failed to capture response headers:", e5),
|
|
2723
|
+
Ze && console.warn("[Sailfish] Failed to capture response headers:", e5), E2 = null;
|
|
2717
2724
|
}
|
|
2718
|
-
const
|
|
2719
|
-
|
|
2720
|
-
|
|
2725
|
+
const C2 = { type: 27, timestamp: w2, sessionId: c3, client: k2, data: { request_id: d3, session_id: c3, timestamp_start: g2, timestamp_end: w2, response_code: x2, success: I2, error: T2, method: p2, url: toAbsoluteUrl(l3), retry_without_trace_id: b3, request_headers: h2, request_body: m2, response_headers: E2, response_body: null }, ...u2 }, sendEventWithBody = (e5) => {
|
|
2726
|
+
C2.data.response_body = e5, y2 ? y2.text().then((e6) => {
|
|
2727
|
+
C2.data.request_body = e6, sendEvent(C2);
|
|
2721
2728
|
}, () => {
|
|
2722
|
-
sendEvent(
|
|
2723
|
-
}) : sendEvent(
|
|
2724
|
-
},
|
|
2729
|
+
sendEvent(C2);
|
|
2730
|
+
}) : sendEvent(C2);
|
|
2731
|
+
}, M2 = 1024 * t2.captureResponseBodyMaxMb * 1024;
|
|
2725
2732
|
if (0 === t2.captureResponseBodyMaxMb) sendEventWithBody(null);
|
|
2726
2733
|
else if ((function shouldSkipBodyCapture(e5) {
|
|
2727
2734
|
const t3 = e5.headers.get("content-type");
|
|
@@ -2779,10 +2786,10 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2779
2786
|
else sendEventWithBody(null);
|
|
2780
2787
|
else {
|
|
2781
2788
|
const e5 = v3.headers.get("content-length"), t3 = e5 ? parseInt(e5, 10) : NaN;
|
|
2782
|
-
if (!isNaN(t3) && t3 >
|
|
2789
|
+
if (!isNaN(t3) && t3 > M2) sendEventWithBody(null);
|
|
2783
2790
|
else try {
|
|
2784
2791
|
v3.clone().text().then((e6) => {
|
|
2785
|
-
e6.length >
|
|
2792
|
+
e6.length > M2 ? sendEventWithBody(null) : sendEventWithBody(e6);
|
|
2786
2793
|
}, () => sendEventWithBody(null));
|
|
2787
2794
|
} catch {
|
|
2788
2795
|
sendEventWithBody(null);
|
|
@@ -2790,8 +2797,8 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2790
2797
|
}
|
|
2791
2798
|
return v3;
|
|
2792
2799
|
} catch (t3) {
|
|
2793
|
-
const o4 = Date.now(), r4 = false, s3 = (
|
|
2794
|
-
if (t3 instanceof TypeError && ((
|
|
2800
|
+
const o4 = Date.now(), r4 = false, s3 = resolveFailedFetchStatus(t3, S2), a3 = t3.message || "Fetch request failed";
|
|
2801
|
+
if (t3 instanceof TypeError && ((_a = t3 == null ? void 0 : t3.message) == null ? void 0 : _a.toLowerCase().includes(ot.toLowerCase()))) return e4.apply(n4, i4);
|
|
2795
2802
|
let f2 = m2;
|
|
2796
2803
|
if (y2) try {
|
|
2797
2804
|
f2 = await y2.text();
|
|
@@ -3015,7 +3022,7 @@ function maskCanvasDraws(e2, t2, n2) {
|
|
|
3015
3022
|
}
|
|
3016
3023
|
}
|
|
3017
3024
|
export {
|
|
3018
|
-
|
|
3025
|
+
restoreFuncSpanState as $,
|
|
3019
3026
|
getUrlAndStoredUuids as A,
|
|
3020
3027
|
identify as B,
|
|
3021
3028
|
initRecorder as C,
|
|
@@ -3042,17 +3049,18 @@ export {
|
|
|
3042
3049
|
registerPixiApp as X,
|
|
3043
3050
|
registerThreeScene as Y,
|
|
3044
3051
|
requestTimeSync as Z,
|
|
3045
|
-
|
|
3052
|
+
resolveFailedFetchStatus as _,
|
|
3046
3053
|
lt as a,
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3054
|
+
sendDomainsToNotPropagateHeaderTo as a0,
|
|
3055
|
+
sendEvent as a1,
|
|
3056
|
+
sendGraphQLRequest as a2,
|
|
3057
|
+
sendMessage as a3,
|
|
3058
|
+
startRecording as a4,
|
|
3059
|
+
startRecordingSession as a5,
|
|
3060
|
+
toAbsoluteUrl as a6,
|
|
3061
|
+
trackingEvent as a7,
|
|
3062
|
+
withAppUrlMetadata as a8,
|
|
3063
|
+
wsSendBinary as a9,
|
|
3056
3064
|
addOrUpdateMetadata as b,
|
|
3057
3065
|
buildBatches as c,
|
|
3058
3066
|
clearStaleFuncSpanState as d,
|
|
Binary file
|
|
Binary file
|
|
@@ -305,7 +305,7 @@ function withAppUrlMetadata(e2) {
|
|
|
305
305
|
}
|
|
306
306
|
exports.nowTimestamp = Date.now, /[1-9][0-9]{12}/.test(Date.now().toString()) || (exports.nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime());
|
|
307
307
|
const I = readDebugFlag(), E = "per_session";
|
|
308
|
-
let C = null, M = null, $ = null,
|
|
308
|
+
let C = null, M = null, $ = null, F = null, A = 0, L = false, R = null, D = null;
|
|
309
309
|
const P = [];
|
|
310
310
|
let B = 0, _ = 0, O = false;
|
|
311
311
|
function pushBinaryRing(e2) {
|
|
@@ -350,9 +350,9 @@ function getBinaryDropCount() {
|
|
|
350
350
|
return _;
|
|
351
351
|
}
|
|
352
352
|
function getBufferedAmount() {
|
|
353
|
-
if (C) return
|
|
354
|
-
if (
|
|
355
|
-
return
|
|
353
|
+
if (C) return A;
|
|
354
|
+
if (F && isWebSocketOpen(M)) try {
|
|
355
|
+
return F();
|
|
356
356
|
} catch {
|
|
357
357
|
return 0;
|
|
358
358
|
}
|
|
@@ -624,8 +624,8 @@ function initializeWebSocket(t2, n2, i2, o2, r2 = false) {
|
|
|
624
624
|
const t3 = new URL(e2);
|
|
625
625
|
return `${t3.hostname}${t3.port ? `:${t3.port}` : ""}`;
|
|
626
626
|
})(t2);
|
|
627
|
-
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${s2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.12.
|
|
628
|
-
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`), $ = null,
|
|
627
|
+
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${s2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.12.9`;
|
|
628
|
+
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`), $ = null, F = null, A = 0, C = r2 ? (function tryCreateWsWorker() {
|
|
629
629
|
if ("undefined" == typeof Worker) return null;
|
|
630
630
|
try {
|
|
631
631
|
const e2 = new Blob(['\nvar ws = null;\nvar wsUrl = "";\nvar reconnectTimer = null;\nvar reconnectDelay = 1000;\nvar MAX_RECONNECT_DELAY = 30000;\nvar CONNECTION_TIMEOUT = 30000;\nvar queue = [];\nvar MAX_QUEUE = 500;\n\nfunction enqueue(str) {\n if (queue.length >= MAX_QUEUE) queue.shift();\n queue.push(str);\n}\n\nfunction drain() {\n while (queue.length > 0) {\n if (!ws || ws.readyState !== 1) break;\n try { ws.send(queue.shift()); } catch (e) { break; }\n }\n}\n\n// Backpressure (A11): report the live socket buffer depth to the main thread on\n// a light interval so canvas video capture can throttle frame production when a\n// slow-but-open socket falls behind. Cheap (one number) and off the main thread.\nvar bufferedReportTimer = null;\nfunction startBufferedReporting() {\n if (bufferedReportTimer) return;\n bufferedReportTimer = setInterval(function() {\n var amt = (ws && ws.readyState === 1) ? (ws.bufferedAmount || 0) : 0;\n postMessage({ type: "buffered", bufferedAmount: amt });\n }, 250);\n}\n\nfunction connect() {\n if (ws && (ws.readyState === 0 || ws.readyState === 1)) return;\n try { ws = new WebSocket(wsUrl); } catch (e) { scheduleReconnect(); return; }\n var tid = setTimeout(function() { if (ws && ws.readyState === 0) ws.close(); }, CONNECTION_TIMEOUT);\n ws.onopen = function() {\n clearTimeout(tid);\n reconnectDelay = 1000;\n drain();\n startBufferedReporting();\n postMessage({ type: "open" });\n };\n ws.onclose = function() {\n clearTimeout(tid);\n ws = null;\n if (bufferedReportTimer) { clearInterval(bufferedReportTimer); bufferedReportTimer = null; }\n postMessage({ type: "buffered", bufferedAmount: 0 });\n postMessage({ type: "close" });\n scheduleReconnect();\n };\n ws.onerror = function() {};\n ws.onmessage = function(e) {\n postMessage({ type: "message", data: e.data });\n };\n}\n\nfunction scheduleReconnect() {\n if (reconnectTimer) return;\n reconnectTimer = setTimeout(function() {\n reconnectTimer = null;\n reconnectDelay = Math.min(reconnectDelay * 1.5, MAX_RECONNECT_DELAY);\n connect();\n }, reconnectDelay);\n}\n\nself.onmessage = function(e) {\n var msg = e.data;\n if (msg.type === "init") {\n wsUrl = msg.wsUrl;\n connect();\n } else if (msg.type === "send") {\n try {\n var s = JSON.stringify(msg.payload);\n if (ws && ws.readyState === 1) { ws.send(s); }\n else { enqueue(s); }\n } catch (e) {}\n } else if (msg.type === "sendRaw") {\n if (ws && ws.readyState === 1) {\n try { ws.send(msg.payload); } catch (e) { enqueue(msg.payload); }\n } else { enqueue(msg.payload); }\n } else if (msg.type === "sendBinary") {\n // Binary frames (canvas SFCV). The main thread only posts these while the\n // socket is open; if it closed in the meantime the frame is dropped (the\n // main-thread ring buffer covers the not-open case).\n if (ws && ws.readyState === 1) {\n try { ws.send(msg.payload); } catch (e) {}\n }\n } else if (msg.type === "close") {\n if (reconnectTimer) { clearTimeout(reconnectTimer); reconnectTimer = null; }\n if (ws) { ws.close(); ws = null; }\n }\n};\n'], { type: "application/javascript" }), t3 = URL.createObjectURL(e2), n3 = new Worker(t3);
|
|
@@ -639,14 +639,14 @@ function initializeWebSocket(t2, n2, i2, o2, r2 = false) {
|
|
|
639
639
|
} };
|
|
640
640
|
return M = t3, C.onmessage = (e3) => {
|
|
641
641
|
const n3 = e3.data;
|
|
642
|
-
"open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED,
|
|
642
|
+
"open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED, A = 0, handleWsClose()) : "message" === n3.type ? handleWsMessage(n3.data) : "buffered" === n3.type && (A = "number" == typeof n3.bufferedAmount ? n3.bufferedAmount : 0);
|
|
643
643
|
}, C.onerror = () => {
|
|
644
644
|
I && console.warn("[Sailfish] WebSocket worker error");
|
|
645
645
|
}, C.postMessage({ type: "init", wsUrl: a2 }), I && console.log("[Sailfish] WebSocket running in Web Worker (off main thread)"), t3;
|
|
646
646
|
}
|
|
647
647
|
I && console.log("[Sailfish] WebSocket running on main thread (Worker unavailable)");
|
|
648
648
|
const c2 = new e(a2, [], { connectionTimeout: 3e4 });
|
|
649
|
-
c2.binaryType = "arraybuffer", $ = (e2) => c2.send(e2),
|
|
649
|
+
c2.binaryType = "arraybuffer", $ = (e2) => c2.send(e2), F = () => c2.bufferedAmount || 0;
|
|
650
650
|
const l2 = { get readyState() {
|
|
651
651
|
return c2.readyState;
|
|
652
652
|
}, close: () => {
|
|
@@ -979,7 +979,7 @@ async function initializeRecording(e2, i2, o2, r2, s2, a2 = true, c2 = false, l2
|
|
|
979
979
|
ue = i4, await yieldToMain();
|
|
980
980
|
const o3 = e2.unmaskSelector || void 0, s3 = e2.blockSelector || void 0, a3 = e2.maskTextSelector || void 0, c3 = e2.maskInputSelector || void 0, d3 = { ...e2.maskInputOptions ?? {} }, u2 = c3 ? { ...de } : d3, p2 = n.buildMaskInputFn({ baseFn: maskInputFn, unmaskSelector: o3, maskInputSelector: c3, adminMaskInputOptions: d3 }), f2 = n.makeMaskTextFn(o3);
|
|
981
981
|
if (l2) {
|
|
982
|
-
const { chunkedSnapshot: n2 } = await Promise.resolve().then(() => require("./chunkSerializer-
|
|
982
|
+
const { chunkedSnapshot: n2 } = await Promise.resolve().then(() => require("./chunkSerializer-9QANwItv.js")), r3 = i4.mirror;
|
|
983
983
|
let l3 = true;
|
|
984
984
|
const d4 = [];
|
|
985
985
|
i4({ emit(e3) {
|
|
@@ -1001,7 +1001,7 @@ async function initializeRecording(e2, i2, o2, r2, s2, a2 = true, c2 = false, l2
|
|
|
1001
1001
|
console.warn("[Sailfish] Failed to enable hover detection:", e3);
|
|
1002
1002
|
}
|
|
1003
1003
|
if (e2.recordCanvas) try {
|
|
1004
|
-
const { startCanvasRecording: n2, stopCanvasRecording: o4, flushAllCanvas: s4, isCanvasRecordingActive: a4 } = await Promise.resolve().then(() => require("./canvasManager-
|
|
1004
|
+
const { startCanvasRecording: n2, stopCanvasRecording: o4, flushAllCanvas: s4, isCanvasRecordingActive: a4 } = await Promise.resolve().then(() => require("./canvasManager-CLCtW5BZ.js")), c4 = { settings: { maskCanvasClass: e2.maskCanvasClass, maskTextClass: e2.maskTextClass, maskTextSelector: e2.maskTextSelector, blockSelector: e2.blockSelector, unmaskSelector: e2.unmaskSelector, maskCanvasText: e2.maskCanvasText ?? void 0, canvasRedactStyle: e2.canvasRedactStyle, recordSsn: e2.recordSsn, recordCreditCardInfo: e2.recordCreditCardInfo, recordDob: e2.recordDob, recordRealName: e2.recordRealName, recordPassword: e2.recordPassword }, mirror: i4.mirror, addSailfishEvent: (e3) => {
|
|
1005
1005
|
ue == null ? void 0 : ue.addSailfishEvent(t.EventType.SailfishCustom, { ...e3, tag: "sf-canvas" });
|
|
1006
1006
|
}, sendBinary: wsSendBinary, getContextIds: () => ({ session_id: r2, page_visit_uuid: getUrlAndStoredUuids().page_visit_uuid }), isTransportSaturated };
|
|
1007
1007
|
n2(c4);
|
|
@@ -1149,13 +1149,13 @@ function setIsRecording(e2) {
|
|
|
1149
1149
|
Ce = e2;
|
|
1150
1150
|
}
|
|
1151
1151
|
const $e = ["jira", "linear", "zendesk"];
|
|
1152
|
-
let
|
|
1153
|
-
const
|
|
1152
|
+
let Fe = null;
|
|
1153
|
+
const Ae = /* @__PURE__ */ new Map();
|
|
1154
1154
|
function getIntegrationData() {
|
|
1155
|
-
return
|
|
1155
|
+
return Fe;
|
|
1156
1156
|
}
|
|
1157
1157
|
function hasValidIntegration() {
|
|
1158
|
-
return null !==
|
|
1158
|
+
return null !== Fe && true === Fe.installed;
|
|
1159
1159
|
}
|
|
1160
1160
|
function resolveIntegration(e2) {
|
|
1161
1161
|
var _a;
|
|
@@ -1169,14 +1169,14 @@ function resolveIntegration(e2) {
|
|
|
1169
1169
|
var _a2;
|
|
1170
1170
|
return "jira" === ((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase());
|
|
1171
1171
|
}) || n2[0];
|
|
1172
|
-
return (i2 == null ? void 0 : i2.primaryCloudId) &&
|
|
1172
|
+
return (i2 == null ? void 0 : i2.primaryCloudId) && Ae.set(i2.primaryCloudId, i2), i2;
|
|
1173
1173
|
}
|
|
1174
1174
|
async function refreshIntegrationData(e2, t2) {
|
|
1175
1175
|
try {
|
|
1176
1176
|
const n2 = resolveIntegration(await fetchEngineeringTicketPlatformIntegrations(e2, t2));
|
|
1177
|
-
return
|
|
1177
|
+
return Fe = n2, n2;
|
|
1178
1178
|
} catch (e3) {
|
|
1179
|
-
return console.error("Error refreshing integration data:", e3),
|
|
1179
|
+
return console.error("Error refreshing integration data:", e3), Fe;
|
|
1180
1180
|
}
|
|
1181
1181
|
}
|
|
1182
1182
|
function populateSelectOptions(e2, t2, n2) {
|
|
@@ -1221,8 +1221,8 @@ function populateSprintOptions(e2, t2, n2) {
|
|
|
1221
1221
|
}), n2 && (e2.value = n2);
|
|
1222
1222
|
}
|
|
1223
1223
|
function getSprintFieldId() {
|
|
1224
|
-
if (!(
|
|
1225
|
-
const e2 = Array.isArray(
|
|
1224
|
+
if (!(Fe == null ? void 0 : Fe.fieldConfigurations)) return "customfield_10020";
|
|
1225
|
+
const e2 = Array.isArray(Fe.fieldConfigurations) ? Fe.fieldConfigurations : [];
|
|
1226
1226
|
for (const t2 of e2) {
|
|
1227
1227
|
const e3 = (t2.fields || []).find((e4) => {
|
|
1228
1228
|
var _a;
|
|
@@ -1234,12 +1234,12 @@ function getSprintFieldId() {
|
|
|
1234
1234
|
}
|
|
1235
1235
|
function updateIssueTypeOptions(e2, t2) {
|
|
1236
1236
|
var _a;
|
|
1237
|
-
if (!(
|
|
1237
|
+
if (!(Fe == null ? void 0 : Fe.projects) || !t2) {
|
|
1238
1238
|
e2.innerHTML = "";
|
|
1239
1239
|
const t3 = document.createElement("option");
|
|
1240
1240
|
return t3.value = "", t3.disabled = true, t3.selected = true, t3.textContent = "Select project first...", t3.style.color = "#9ca3af", e2.appendChild(t3), void (e2.style.color = "#9ca3af");
|
|
1241
1241
|
}
|
|
1242
|
-
const n2 =
|
|
1242
|
+
const n2 = Fe.projects.find((e3) => e3.id === t2);
|
|
1243
1243
|
if (!n2 || !n2.issue_types) {
|
|
1244
1244
|
e2.innerHTML = "";
|
|
1245
1245
|
const t3 = document.createElement("option");
|
|
@@ -1263,12 +1263,12 @@ function updateIssueTypeOptions(e2, t2) {
|
|
|
1263
1263
|
}
|
|
1264
1264
|
}
|
|
1265
1265
|
function getFieldsForProject(e2, t2) {
|
|
1266
|
-
if (!(
|
|
1267
|
-
const n2 = Array.isArray(
|
|
1266
|
+
if (!(Fe == null ? void 0 : Fe.fieldConfigurations) || !e2) return [];
|
|
1267
|
+
const n2 = Array.isArray(Fe.fieldConfigurations) ? Fe.fieldConfigurations.find((n3) => !(n3.project_key !== e2 && String(n3.project_id) !== String(e2) || t2 && String(n3.issue_type_id) !== String(t2))) : Fe.fieldConfigurations[e2];
|
|
1268
1268
|
return n2 && n2.fields ? n2.fields : [];
|
|
1269
1269
|
}
|
|
1270
1270
|
function getUsers() {
|
|
1271
|
-
return (
|
|
1271
|
+
return (Fe == null ? void 0 : Fe.users) ? Fe.users : [];
|
|
1272
1272
|
}
|
|
1273
1273
|
function getDefaultReporterAccountId() {
|
|
1274
1274
|
const e2 = getUsers(), t2 = getIdentifiedUser();
|
|
@@ -1285,8 +1285,8 @@ function getDefaultReporterAccountId() {
|
|
|
1285
1285
|
return r2 && (r2.id || r2.accountId) || null;
|
|
1286
1286
|
}
|
|
1287
1287
|
function lastReporterStorageKey() {
|
|
1288
|
-
if (!
|
|
1289
|
-
const e2 =
|
|
1288
|
+
if (!Fe) return null;
|
|
1289
|
+
const e2 = Fe.primaryCloudId || Fe.provider || "";
|
|
1290
1290
|
return e2 ? `sf-veritas:lastReporter:${e2}` : null;
|
|
1291
1291
|
}
|
|
1292
1292
|
function getSavedLastReporterAccountId() {
|
|
@@ -1313,42 +1313,42 @@ function getValidSavedReporterAccountId() {
|
|
|
1313
1313
|
return getUsers().some((t2) => (t2.accountId || t2.id) === e2 && false !== t2.active) ? e2 : null;
|
|
1314
1314
|
}
|
|
1315
1315
|
function getProjectsForTeam(e2) {
|
|
1316
|
-
if (!
|
|
1317
|
-
const t2 =
|
|
1316
|
+
if (!Fe) return [];
|
|
1317
|
+
const t2 = Fe.teams && Array.isArray(Fe.teams) && Fe.teams.length > 0;
|
|
1318
1318
|
if (t2 && e2) {
|
|
1319
|
-
const t3 =
|
|
1319
|
+
const t3 = Fe.teams.find((t4) => t4.id === e2);
|
|
1320
1320
|
return (t3 == null ? void 0 : t3.projects) || [];
|
|
1321
1321
|
}
|
|
1322
|
-
return !t2 &&
|
|
1322
|
+
return !t2 && Fe.projects ? Fe.projects : [];
|
|
1323
1323
|
}
|
|
1324
1324
|
function updateFormWithIntegrationData(e2) {
|
|
1325
1325
|
var _a;
|
|
1326
|
-
if (!
|
|
1327
|
-
const t2 =
|
|
1328
|
-
n2 && t2 && (populateSelectOptions(n2,
|
|
1326
|
+
if (!Fe) return e2;
|
|
1327
|
+
const t2 = Fe.teams && Array.isArray(Fe.teams) && Fe.teams.length > 0, n2 = document.getElementById("sf-eng-ticket-team");
|
|
1328
|
+
n2 && t2 && (populateSelectOptions(n2, Fe.teams, Fe.defaultTeam), e2.engTicketTeam ? n2.value = e2.engTicketTeam : e2.engTicketTeam = n2.value);
|
|
1329
1329
|
const i2 = document.getElementById("sf-eng-ticket-project");
|
|
1330
1330
|
if (i2) {
|
|
1331
|
-
populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) :
|
|
1331
|
+
populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) : Fe.projects || [], Fe.defaultProject), e2.engTicketProject ? i2.value = e2.engTicketProject : e2.engTicketProject = i2.value;
|
|
1332
1332
|
}
|
|
1333
1333
|
const o2 = document.getElementById("sf-eng-ticket-priority");
|
|
1334
|
-
o2 && (populatePriorityOptions(o2,
|
|
1335
|
-
const r2 = document.getElementById("sf-eng-ticket-sprint"), s2 = "jira" === ((_a =
|
|
1336
|
-
if (r2 && s2 &&
|
|
1334
|
+
o2 && (populatePriorityOptions(o2, Fe.provider || "", Fe.defaultPriority), e2.engTicketPriority ? o2.value = String(e2.engTicketPriority) : e2.engTicketPriority = Number(o2.value));
|
|
1335
|
+
const r2 = document.getElementById("sf-eng-ticket-sprint"), s2 = "jira" === ((_a = Fe.provider) == null ? void 0 : _a.toLowerCase());
|
|
1336
|
+
if (r2 && s2 && Fe.sprints) {
|
|
1337
1337
|
if (!e2.engTicketSprint && !Me) {
|
|
1338
|
-
const t3 = pickDefaultActiveSprint(
|
|
1338
|
+
const t3 = pickDefaultActiveSprint(Fe.sprints, e2.engTicketProject, Fe.projects || []);
|
|
1339
1339
|
(t3 == null ? void 0 : t3.id) && (e2.engTicketSprint = String(t3.id), setSprintDefaulted(true));
|
|
1340
1340
|
}
|
|
1341
|
-
populateSprintOptions(r2,
|
|
1341
|
+
populateSprintOptions(r2, Fe.sprints, e2.engTicketSprint || void 0), e2.engTicketSprint && (r2.style.color = "");
|
|
1342
1342
|
}
|
|
1343
1343
|
const a2 = document.getElementById("sf-eng-ticket-type");
|
|
1344
1344
|
return a2 && s2 && e2.engTicketProject && (updateIssueTypeOptions(a2, e2.engTicketProject), e2.engTicketIssueType ? (a2.value = e2.engTicketIssueType, a2.style.color = "#000") : a2.value && (e2.engTicketIssueType = a2.value)), e2;
|
|
1345
1345
|
}
|
|
1346
1346
|
const Le = Object.freeze(Object.defineProperty({ __proto__: null, fetchIntegrationData: async function fetchIntegrationData(e2, t2) {
|
|
1347
|
-
if (!
|
|
1347
|
+
if (!Fe) try {
|
|
1348
1348
|
const n2 = await fetchEngineeringTicketPlatformIntegrations(e2, t2);
|
|
1349
|
-
|
|
1349
|
+
Fe = resolveIntegration(n2);
|
|
1350
1350
|
} catch (e3) {
|
|
1351
|
-
console.error("Error fetching integration data:", e3),
|
|
1351
|
+
console.error("Error fetching integration data:", e3), Fe = null;
|
|
1352
1352
|
}
|
|
1353
1353
|
}, getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSavedLastReporterAccountId, getSprintFieldId, getUsers, getValidSavedReporterAccountId, hasValidIntegration, pickDefaultActiveSprint, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, saveLastReporterAccountId, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" }));
|
|
1354
1354
|
function renderCustomMultiSelect(e2, t2, n2, i2, o2 = false) {
|
|
@@ -2503,6 +2503,10 @@ function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
|
2503
2503
|
return !(-1 === s2 || !ze.has(r2.slice(s2))) || (!(!i2 || matchParsedUrlAgainstPatterns(o2, t2)) || !!matchParsedUrlAgainstPatterns(o2, n2));
|
|
2504
2504
|
};
|
|
2505
2505
|
}
|
|
2506
|
+
function resolveFailedFetchStatus(e2, t2) {
|
|
2507
|
+
var _a;
|
|
2508
|
+
return ((_a = e2 == null ? void 0 : e2.response) == null ? void 0 : _a.status) ?? t2 ?? 0;
|
|
2509
|
+
}
|
|
2506
2510
|
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, n2 = []) {
|
|
2507
2511
|
const o2 = window.fetch, r2 = getOrSetSessionId(), s2 = createSkipHeadersPropagationChecker(e2, n2), a2 = ["text/event-stream", "application/x-ndjson", "application/stream+json", "application/grpc", "application/grpc-web"], c2 = ["application/octet-stream"];
|
|
2508
2512
|
window.fetch = new Proxy(o2, { apply: async (e3, n3, o3) => {
|
|
@@ -2514,7 +2518,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2514
2518
|
l2 = d2.href;
|
|
2515
2519
|
}
|
|
2516
2520
|
return s2(l2) ? e3.apply(n3, o3) : (async function injectHeaderWrapper(e4, n4, o4, r3, s3, l3, d3) {
|
|
2517
|
-
var _a
|
|
2521
|
+
var _a;
|
|
2518
2522
|
if (!l3) return e4.apply(n4, o4);
|
|
2519
2523
|
let u3 = uuidv4();
|
|
2520
2524
|
const p2 = getUrlAndStoredUuids(), f2 = s3.method || "GET", g2 = Date.now();
|
|
@@ -2542,6 +2546,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2542
2546
|
v2 && delete h2[v2.name];
|
|
2543
2547
|
const S2 = `${l3}/${p2.page_visit_uuid}/${u3}`;
|
|
2544
2548
|
h2[i] = S2, v2 && (h2[v2.name] = v2.value);
|
|
2549
|
+
let b2;
|
|
2545
2550
|
maskAuthorizationHeader(h2);
|
|
2546
2551
|
try {
|
|
2547
2552
|
let v3 = await (async function injectHeader(e5, t3, n5, o5, r4, s4, a3) {
|
|
@@ -2556,7 +2561,9 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2556
2561
|
const l4 = { ...o5 }, d4 = new Headers(o5.headers || {});
|
|
2557
2562
|
return d4.set(i, `${r4}/${s4}/${a3}`), c3 && (d4.set(c3.name, c3.value), qe && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof n5 ? n5 : n5.href, header: c3.name })), l4.headers = d4, await e5.call(t3, n5, l4);
|
|
2558
2563
|
}
|
|
2559
|
-
})(e4, n4, r3, s3, l3, p2.page_visit_uuid, u3)
|
|
2564
|
+
})(e4, n4, r3, s3, l3, p2.page_visit_uuid, u3);
|
|
2565
|
+
b2 = v3.status;
|
|
2566
|
+
let S3 = false;
|
|
2560
2567
|
Ke.includes(v3.status) && (qe && console.log("Perform retry as status was fail:", v3), delete h2[i], v3 = await (async function retryWithoutPropagateHeaders(e5, t3, n5, o5) {
|
|
2561
2568
|
try {
|
|
2562
2569
|
let o6 = n5[0], r4 = n5[1] || {};
|
|
@@ -2575,25 +2582,25 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2575
2582
|
} catch (e6) {
|
|
2576
2583
|
throw qe && console.log(`Retry without ${i} for ${o5} also failed:`, e6), e6;
|
|
2577
2584
|
}
|
|
2578
|
-
})(e4, n4, o4, d3), S3 = true);
|
|
2579
|
-
const
|
|
2585
|
+
})(e4, n4, o4, d3), b2 = v3.status, S3 = true);
|
|
2586
|
+
const w2 = Date.now(), k2 = (function captureClientTime() {
|
|
2580
2587
|
return { wallTimeMs: Date.now(), monotonicMs: monotonicNow(), timeOriginMs: timeOriginMs() };
|
|
2581
|
-
})(),
|
|
2582
|
-
let
|
|
2588
|
+
})(), x2 = v3.status, T2 = v3.ok, I2 = T2 ? "" : `Request Error: ${v3.statusText}`;
|
|
2589
|
+
let E2 = null;
|
|
2583
2590
|
try {
|
|
2584
|
-
|
|
2585
|
-
|
|
2591
|
+
E2 = {}, v3.headers.forEach((e5, t3) => {
|
|
2592
|
+
E2[t3] = e5;
|
|
2586
2593
|
});
|
|
2587
2594
|
} catch (e5) {
|
|
2588
|
-
qe && console.warn("[Sailfish] Failed to capture response headers:", e5),
|
|
2595
|
+
qe && console.warn("[Sailfish] Failed to capture response headers:", e5), E2 = null;
|
|
2589
2596
|
}
|
|
2590
|
-
const
|
|
2591
|
-
|
|
2592
|
-
|
|
2597
|
+
const C2 = { type: 27, timestamp: w2, sessionId: l3, client: k2, data: { request_id: u3, session_id: l3, timestamp_start: g2, timestamp_end: w2, response_code: x2, success: T2, error: I2, method: f2, url: toAbsoluteUrl(d3), retry_without_trace_id: S3, request_headers: h2, request_body: m2, response_headers: E2, response_body: null }, ...p2 }, sendEventWithBody = (e5) => {
|
|
2598
|
+
C2.data.response_body = e5, y2 ? y2.text().then((e6) => {
|
|
2599
|
+
C2.data.request_body = e6, sendEvent(C2);
|
|
2593
2600
|
}, () => {
|
|
2594
|
-
sendEvent(
|
|
2595
|
-
}) : sendEvent(
|
|
2596
|
-
},
|
|
2601
|
+
sendEvent(C2);
|
|
2602
|
+
}) : sendEvent(C2);
|
|
2603
|
+
}, M2 = 1024 * t2.captureResponseBodyMaxMb * 1024;
|
|
2597
2604
|
if (0 === t2.captureResponseBodyMaxMb) sendEventWithBody(null);
|
|
2598
2605
|
else if ((function shouldSkipBodyCapture(e5) {
|
|
2599
2606
|
const t3 = e5.headers.get("content-type");
|
|
@@ -2651,10 +2658,10 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2651
2658
|
else sendEventWithBody(null);
|
|
2652
2659
|
else {
|
|
2653
2660
|
const e5 = v3.headers.get("content-length"), t3 = e5 ? parseInt(e5, 10) : NaN;
|
|
2654
|
-
if (!isNaN(t3) && t3 >
|
|
2661
|
+
if (!isNaN(t3) && t3 > M2) sendEventWithBody(null);
|
|
2655
2662
|
else try {
|
|
2656
2663
|
v3.clone().text().then((e6) => {
|
|
2657
|
-
e6.length >
|
|
2664
|
+
e6.length > M2 ? sendEventWithBody(null) : sendEventWithBody(e6);
|
|
2658
2665
|
}, () => sendEventWithBody(null));
|
|
2659
2666
|
} catch {
|
|
2660
2667
|
sendEventWithBody(null);
|
|
@@ -2662,8 +2669,8 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2662
2669
|
}
|
|
2663
2670
|
return v3;
|
|
2664
2671
|
} catch (t3) {
|
|
2665
|
-
const i2 = Date.now(), r4 = false, s4 = (
|
|
2666
|
-
if (t3 instanceof TypeError && ((
|
|
2672
|
+
const i2 = Date.now(), r4 = false, s4 = resolveFailedFetchStatus(t3, b2), a3 = t3.message || "Fetch request failed";
|
|
2673
|
+
if (t3 instanceof TypeError && ((_a = t3 == null ? void 0 : t3.message) == null ? void 0 : _a.toLowerCase().includes(Ge.toLowerCase()))) return e4.apply(n4, o4);
|
|
2667
2674
|
let c3 = m2;
|
|
2668
2675
|
if (y2) try {
|
|
2669
2676
|
c3 = await y2.text();
|
|
@@ -2675,7 +2682,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2675
2682
|
})(e3, n3, o3, d2, u2, r2, l2);
|
|
2676
2683
|
} });
|
|
2677
2684
|
}
|
|
2678
|
-
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: o2 = ["*"], domainsToNotPropagateHeaderTo: r2 = [], serviceVersion: s2, serviceIdentifier: a2, gitSha: c2, serviceAdditionalMetadata: l2, enableIpTracking: d2, captureStreamingResponseBody: u2 = true, captureResponseBodyMaxMb: p2 = 10, captureStreamPrefixKb: f2 = 64, captureStreamTimeoutMs: g2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: v2, useWsWorker: S2 = true, capturePerformanceMetrics: w2 = true, maskTextClass: k2, maskInputSelector: x2, maskTextSelector: T2, blockSelector: I2, unmaskSelector: E2, maskInputOptions: C2, recordCanvas: M2, maskCanvasClass: $2, gitOrg:
|
|
2685
|
+
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: o2 = ["*"], domainsToNotPropagateHeaderTo: r2 = [], serviceVersion: s2, serviceIdentifier: a2, gitSha: c2, serviceAdditionalMetadata: l2, enableIpTracking: d2, captureStreamingResponseBody: u2 = true, captureResponseBodyMaxMb: p2 = 10, captureStreamPrefixKb: f2 = 64, captureStreamTimeoutMs: g2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: v2, useWsWorker: S2 = true, capturePerformanceMetrics: w2 = true, maskTextClass: k2, maskInputSelector: x2, maskTextSelector: T2, blockSelector: I2, unmaskSelector: E2, maskInputOptions: C2, recordCanvas: M2, maskCanvasClass: $2, gitOrg: F2, gitRepo: A2, gitProvider: L2, library: R2, headlessRecording: D2 = false }) {
|
|
2679
2686
|
var _a, _b, _c, _d;
|
|
2680
2687
|
if (!D2 && (function isHeadlessOrLighthouse() {
|
|
2681
2688
|
try {
|
|
@@ -2819,7 +2826,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2819
2826
|
return { framework: i3[0] ?? null, additionalFrameworks: i3.slice(1), serviceRole: "frontend" };
|
|
2820
2827
|
})(), f3 = { ...u3, serviceRole: p3.serviceRole, ...null !== p3.framework && { framework: p3.framework }, ...p3.additionalFrameworks.length > 0 && { additionalFrameworks: p3.additionalFrameworks } };
|
|
2821
2828
|
await yieldToMain();
|
|
2822
|
-
const [g3, h3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2, B2, t2, i2, o3, d3, n2, r3, f3,
|
|
2829
|
+
const [g3, h3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2, B2, t2, i2, o3, d3, n2, r3, f3, F2, A2, L2)]), y3 = { ...Xe, ...(_a = g3.data) == null ? void 0 : _a.captureSettingsFromApiKey, enableFiberTracking: m2, ...void 0 !== k2 ? { maskTextClass: k2 } : {}, ...void 0 !== x2 ? { maskInputSelector: x2 } : {}, ...void 0 !== T2 ? { maskTextSelector: T2 } : {}, ...void 0 !== I2 ? { blockSelector: I2 } : {}, ...void 0 !== E2 ? { unmaskSelector: E2 } : {}, ...void 0 !== C2 ? { maskInputOptions: C2 } : {}, recordCanvas: M2 ?? ((_c = (_b = g3.data) == null ? void 0 : _b.captureSettingsFromApiKey) == null ? void 0 : _c.recordCanvasSf) ?? Xe.recordCanvas, ...void 0 !== $2 ? { maskCanvasClass: $2 } : {} };
|
|
2823
2830
|
if (_2.ws && 1 === _2.ws.readyState) return;
|
|
2824
2831
|
if ((_d = h3.data) == null ? void 0 : _d.startRecordingSession) {
|
|
2825
2832
|
const n3 = (l2 == null ? void 0 : l2.env) || (l2 == null ? void 0 : l2.environment);
|
|
@@ -3011,7 +3018,7 @@ exports.DEFAULT_CAPTURE_SETTINGS = Xe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
|
|
|
3011
3018
|
return () => {
|
|
3012
3019
|
};
|
|
3013
3020
|
}
|
|
3014
|
-
}, exports.requestTimeSync = requestTimeSync, exports.restoreFuncSpanState = restoreFuncSpanState, exports.sendDomainsToNotPropagateHeaderTo = sendDomainsToNotPropagateHeaderTo, exports.sendEvent = sendEvent, exports.sendGraphQLRequest = sendGraphQLRequest, exports.sendMessage = sendMessage, exports.startRecording = startRecording, exports.startRecordingSession = startRecordingSession, exports.toAbsoluteUrl = toAbsoluteUrl, exports.trackingEvent = function trackingEvent(e2) {
|
|
3021
|
+
}, exports.requestTimeSync = requestTimeSync, exports.resolveFailedFetchStatus = resolveFailedFetchStatus, exports.restoreFuncSpanState = restoreFuncSpanState, exports.sendDomainsToNotPropagateHeaderTo = sendDomainsToNotPropagateHeaderTo, exports.sendEvent = sendEvent, exports.sendGraphQLRequest = sendGraphQLRequest, exports.sendMessage = sendMessage, exports.startRecording = startRecording, exports.startRecordingSession = startRecordingSession, exports.toAbsoluteUrl = toAbsoluteUrl, exports.trackingEvent = function trackingEvent(e2) {
|
|
3015
3022
|
sendMessage({ type: "trackingEvent", trackingData: e2, timestamp: exports.nowTimestamp() });
|
|
3016
3023
|
}, exports.uninstallAdapters = function uninstallAdapters() {
|
|
3017
3024
|
Ue = null, Ne && "undefined" != typeof window && window.removeEventListener("pointerdown", onPointerDown, { capture: true }), Ne = false, je.clear();
|
|
Binary file
|
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -652,6 +652,15 @@ function setupXMLHttpRequestInterceptor(domainsToNotPropagateHeaderTo = [], body
|
|
|
652
652
|
return originalSend.apply(this, args);
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
|
+
// A rejected fetch carries no HTTP status — the browser hides it for CORS and
|
|
656
|
+
// network failures — so never fabricate one (DIAGPLAT-1699: a CORS-blocked 401
|
|
657
|
+
// was reported as 500). Prefer a status attached by an HTTP-lib wrapper
|
|
658
|
+
// (axios-style error.response.status), then the last status actually observed
|
|
659
|
+
// on the wire (e.g. the 400/403 that triggered the header-less retry which
|
|
660
|
+
// then threw), else 0 = "no response received", matching the XHR error path.
|
|
661
|
+
export function resolveFailedFetchStatus(error, observedStatus) {
|
|
662
|
+
return error?.response?.status ?? observedStatus ?? 0;
|
|
663
|
+
}
|
|
655
664
|
// Updated fetch interceptor with exclusion handling
|
|
656
665
|
function setupFetchInterceptor(domainsToNotPropagateHeadersTo = [], bodyCaptureConfig = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 10000 }, domainsToPropagateHeaderTo = []) {
|
|
657
666
|
const originalFetch = window.fetch;
|
|
@@ -838,8 +847,12 @@ function setupFetchInterceptor(domainsToNotPropagateHeadersTo = [], bodyCaptureC
|
|
|
838
847
|
}
|
|
839
848
|
// Mask authorization header for privacy (preserve scheme like "Bearer", mask the token)
|
|
840
849
|
maskAuthorizationHeader(requestHeaders);
|
|
850
|
+
// Last HTTP status actually received, so the catch block can report it if
|
|
851
|
+
// a later step (e.g. the header-less retry) throws.
|
|
852
|
+
let observedStatus;
|
|
841
853
|
try {
|
|
842
854
|
let response = await injectHeader(target, thisArg, input, init, sessionId, urlAndStoredUuids.page_visit_uuid, networkUUID);
|
|
855
|
+
observedStatus = response.status;
|
|
843
856
|
let isRetry = false;
|
|
844
857
|
// Retry logic for 400/403 before logging finished event
|
|
845
858
|
if (BAD_HTTP_STATUS.includes(response.status)) {
|
|
@@ -847,6 +860,7 @@ function setupFetchInterceptor(domainsToNotPropagateHeadersTo = [], bodyCaptureC
|
|
|
847
860
|
// Remove x-sf3-rid from captured headers since retry doesn't include it
|
|
848
861
|
delete requestHeaders[xSf3RidHeader];
|
|
849
862
|
response = await retryWithoutPropagateHeaders(target, thisArg, args, url);
|
|
863
|
+
observedStatus = response.status;
|
|
850
864
|
isRetry = true;
|
|
851
865
|
}
|
|
852
866
|
const endTime = Date.now();
|
|
@@ -964,7 +978,7 @@ function setupFetchInterceptor(domainsToNotPropagateHeadersTo = [], bodyCaptureC
|
|
|
964
978
|
catch (error) {
|
|
965
979
|
const endTime = Date.now();
|
|
966
980
|
const success = false;
|
|
967
|
-
const responseCode = error
|
|
981
|
+
const responseCode = resolveFailedFetchStatus(error, observedStatus);
|
|
968
982
|
const errorMessage = error.message || "Fetch request failed";
|
|
969
983
|
if (error instanceof TypeError &&
|
|
970
984
|
error?.message?.toLowerCase().includes(CORS_KEYWORD.toLowerCase())) {
|
package/dist/index.js.br
CHANGED
|
Binary file
|
package/dist/index.js.gz
CHANGED
|
Binary file
|
package/dist/recorder.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const e = require("./chunks/index-
|
|
4
|
-
require("./chunks/patch2d-9voowhJ_.js"), exports.DEFAULT_CAPTURE_SETTINGS = e.DEFAULT_CAPTURE_SETTINGS, exports.DEFAULT_CONSOLE_RECORDING_SETTINGS = e.DEFAULT_CONSOLE_RECORDING_SETTINGS, exports.STORAGE_VERSION = e.STORAGE_VERSION, exports.addOrUpdateMetadata = e.addOrUpdateMetadata, exports.buildBatches = e.buildBatches, exports.clearStaleFuncSpanState = e.clearStaleFuncSpanState, exports.createSkipHeadersPropagationChecker = e.createSkipHeadersPropagationChecker, exports.createTriageAndIssueFromRecorder = e.createTriageAndIssueFromRecorder, exports.createTriageFromRecorder = e.createTriageFromRecorder, exports.disableFunctionSpanTracking = e.disableFunctionSpanTracking, exports.enableFunctionSpanTracking = e.enableFunctionSpanTracking, exports.ensureHrefCache = e.ensureHrefCache, exports.eventSize = e.eventSize, exports.fetchAndSendIp = e.fetchAndSendIp, exports.fetchCaptureSettings = e.fetchCaptureSettings, exports.fetchEngineeringTicketPlatformIntegrations = e.fetchEngineeringTicketPlatformIntegrations, exports.fetchFunctionSpanTrackingEnabled = e.fetchFunctionSpanTrackingEnabled, exports.flushBufferedEvents = e.flushBufferedEvents, exports.getBinaryDropCount = e.getBinaryDropCount, exports.getBufferedAmount = e.getBufferedAmount, exports.getCachedHref = e.getCachedHref, exports.getCachedHrefNoQuery = e.getCachedHrefNoQuery, exports.getFuncSpanHeader = e.getFuncSpanHeader, exports.getIdentifiedUser = e.getIdentifiedUser, exports.getOrSetSessionId = e.getOrSetSessionId, exports.getUrlAndStoredUuids = e.getUrlAndStoredUuids, exports.identify = e.identify, exports.initRecorder = e.initRecorder, exports.initializeConsolePlugin = e.initializeConsolePlugin, exports.initializeDomContentEvents = e.initializeDomContentEvents, exports.initializeFunctionSpanTrackingFromApi = e.initializeFunctionSpanTrackingFromApi, exports.initializePerformancePlugin = e.initializePerformancePlugin, exports.initializeRecording = e.initializeRecording, exports.initializeWebSocket = e.initializeWebSocket, exports.invalidateUrlCache = e.invalidateUrlCache, exports.isFunctionSpanTrackingEnabled = e.isFunctionSpanTrackingEnabled, exports.isTransportSaturated = e.isTransportSaturated, exports.maskCanvasDraws = e.maskCanvasDraws, exports.maskInputFn = e.maskInputFn, exports.matchUrlWithWildcard = e.matchUrlWithWildcard, Object.defineProperty(exports, "nowTimestamp", { enumerable: true, get: () => e.nowTimestamp }), exports.onNavigationChange = e.onNavigationChange, exports.openReportIssueModal = e.openReportIssueModal, exports.registerChart = e.registerChart, exports.registerFabricCanvas = e.registerFabricCanvas, exports.registerKonvaStage = e.registerKonvaStage, exports.registerPixiApp = e.registerPixiApp, exports.registerThreeScene = e.registerThreeScene, exports.requestTimeSync = e.requestTimeSync, exports.restoreFuncSpanState = e.restoreFuncSpanState, exports.sendDomainsToNotPropagateHeaderTo = e.sendDomainsToNotPropagateHeaderTo, exports.sendEvent = e.sendEvent, exports.sendGraphQLRequest = e.sendGraphQLRequest, exports.sendMessage = e.sendMessage, exports.startRecording = e.startRecording, exports.startRecordingSession = e.startRecordingSession, exports.toAbsoluteUrl = e.toAbsoluteUrl, exports.trackingEvent = e.trackingEvent, exports.withAppUrlMetadata = e.withAppUrlMetadata, exports.wsSendBinary = e.wsSendBinary;
|
|
3
|
+
const e = require("./chunks/index-Cp1vLB5Q.js");
|
|
4
|
+
require("./chunks/patch2d-9voowhJ_.js"), exports.DEFAULT_CAPTURE_SETTINGS = e.DEFAULT_CAPTURE_SETTINGS, exports.DEFAULT_CONSOLE_RECORDING_SETTINGS = e.DEFAULT_CONSOLE_RECORDING_SETTINGS, exports.STORAGE_VERSION = e.STORAGE_VERSION, exports.addOrUpdateMetadata = e.addOrUpdateMetadata, exports.buildBatches = e.buildBatches, exports.clearStaleFuncSpanState = e.clearStaleFuncSpanState, exports.createSkipHeadersPropagationChecker = e.createSkipHeadersPropagationChecker, exports.createTriageAndIssueFromRecorder = e.createTriageAndIssueFromRecorder, exports.createTriageFromRecorder = e.createTriageFromRecorder, exports.disableFunctionSpanTracking = e.disableFunctionSpanTracking, exports.enableFunctionSpanTracking = e.enableFunctionSpanTracking, exports.ensureHrefCache = e.ensureHrefCache, exports.eventSize = e.eventSize, exports.fetchAndSendIp = e.fetchAndSendIp, exports.fetchCaptureSettings = e.fetchCaptureSettings, exports.fetchEngineeringTicketPlatformIntegrations = e.fetchEngineeringTicketPlatformIntegrations, exports.fetchFunctionSpanTrackingEnabled = e.fetchFunctionSpanTrackingEnabled, exports.flushBufferedEvents = e.flushBufferedEvents, exports.getBinaryDropCount = e.getBinaryDropCount, exports.getBufferedAmount = e.getBufferedAmount, exports.getCachedHref = e.getCachedHref, exports.getCachedHrefNoQuery = e.getCachedHrefNoQuery, exports.getFuncSpanHeader = e.getFuncSpanHeader, exports.getIdentifiedUser = e.getIdentifiedUser, exports.getOrSetSessionId = e.getOrSetSessionId, exports.getUrlAndStoredUuids = e.getUrlAndStoredUuids, exports.identify = e.identify, exports.initRecorder = e.initRecorder, exports.initializeConsolePlugin = e.initializeConsolePlugin, exports.initializeDomContentEvents = e.initializeDomContentEvents, exports.initializeFunctionSpanTrackingFromApi = e.initializeFunctionSpanTrackingFromApi, exports.initializePerformancePlugin = e.initializePerformancePlugin, exports.initializeRecording = e.initializeRecording, exports.initializeWebSocket = e.initializeWebSocket, exports.invalidateUrlCache = e.invalidateUrlCache, exports.isFunctionSpanTrackingEnabled = e.isFunctionSpanTrackingEnabled, exports.isTransportSaturated = e.isTransportSaturated, exports.maskCanvasDraws = e.maskCanvasDraws, exports.maskInputFn = e.maskInputFn, exports.matchUrlWithWildcard = e.matchUrlWithWildcard, Object.defineProperty(exports, "nowTimestamp", { enumerable: true, get: () => e.nowTimestamp }), exports.onNavigationChange = e.onNavigationChange, exports.openReportIssueModal = e.openReportIssueModal, exports.registerChart = e.registerChart, exports.registerFabricCanvas = e.registerFabricCanvas, exports.registerKonvaStage = e.registerKonvaStage, exports.registerPixiApp = e.registerPixiApp, exports.registerThreeScene = e.registerThreeScene, exports.requestTimeSync = e.requestTimeSync, exports.resolveFailedFetchStatus = e.resolveFailedFetchStatus, exports.restoreFuncSpanState = e.restoreFuncSpanState, exports.sendDomainsToNotPropagateHeaderTo = e.sendDomainsToNotPropagateHeaderTo, exports.sendEvent = e.sendEvent, exports.sendGraphQLRequest = e.sendGraphQLRequest, exports.sendMessage = e.sendMessage, exports.startRecording = e.startRecording, exports.startRecordingSession = e.startRecordingSession, exports.toAbsoluteUrl = e.toAbsoluteUrl, exports.trackingEvent = e.trackingEvent, exports.withAppUrlMetadata = e.withAppUrlMetadata, exports.wsSendBinary = e.wsSendBinary;
|
package/dist/recorder.cjs.br
CHANGED
|
Binary file
|
package/dist/recorder.cjs.gz
CHANGED
|
Binary file
|
package/dist/recorder.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D, a, S, b, c, d, e, f, g, h, j, k, l, m, n, o, p, q, r, s, t, v, w, x, z, A, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8 } from "./chunks/index-
|
|
1
|
+
import { D, a, S, b, c, d, e, f, g, h, j, k, l, m, n, o, p, q, r, s, t, v, w, x, z, A, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 } from "./chunks/index-BRybWPUS.js";
|
|
2
2
|
import "./chunks/patch2d-PQxcaE6r.js";
|
|
3
3
|
export {
|
|
4
4
|
D as DEFAULT_CAPTURE_SETTINGS,
|
|
@@ -50,15 +50,16 @@ export {
|
|
|
50
50
|
X as registerPixiApp,
|
|
51
51
|
Y as registerThreeScene,
|
|
52
52
|
Z as requestTimeSync,
|
|
53
|
-
_ as
|
|
54
|
-
$ as
|
|
55
|
-
a0 as
|
|
56
|
-
a1 as
|
|
57
|
-
a2 as
|
|
58
|
-
a3 as
|
|
59
|
-
a4 as
|
|
60
|
-
a5 as
|
|
61
|
-
a6 as
|
|
62
|
-
a7 as
|
|
63
|
-
a8 as
|
|
53
|
+
_ as resolveFailedFetchStatus,
|
|
54
|
+
$ as restoreFuncSpanState,
|
|
55
|
+
a0 as sendDomainsToNotPropagateHeaderTo,
|
|
56
|
+
a1 as sendEvent,
|
|
57
|
+
a2 as sendGraphQLRequest,
|
|
58
|
+
a3 as sendMessage,
|
|
59
|
+
a4 as startRecording,
|
|
60
|
+
a5 as startRecordingSession,
|
|
61
|
+
a6 as toAbsoluteUrl,
|
|
62
|
+
a7 as trackingEvent,
|
|
63
|
+
a8 as withAppUrlMetadata,
|
|
64
|
+
a9 as wsSendBinary
|
|
64
65
|
};
|
package/dist/recorder.js.br
CHANGED
|
Binary file
|
package/dist/recorder.js.gz
CHANGED
|
Binary file
|
package/dist/recorder.umd.cjs
CHANGED
|
@@ -827,7 +827,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
827
827
|
const w3 = new URL(e3);
|
|
828
828
|
return `${w3.hostname}${w3.port ? `:${w3.port}` : ""}`;
|
|
829
829
|
})(e2);
|
|
830
|
-
let _2 = `${"https:" === new URL(e2).protocol ? "wss" : "ws"}://${I2}/ws/notify/?apiKey=${w2}&sessionId=${C2}&sender=JS%2FTS&version=1.12.
|
|
830
|
+
let _2 = `${"https:" === new URL(e2).protocol ? "wss" : "ws"}://${I2}/ws/notify/?apiKey=${w2}&sessionId=${C2}&sender=JS%2FTS&version=1.12.9`;
|
|
831
831
|
if (x2 && (_2 += `&envValue=${encodeURIComponent(x2)}`), we = null, be = null, Se = 0, ge = M2 ? (function tryCreateWsWorker() {
|
|
832
832
|
if ("undefined" == typeof Worker) return null;
|
|
833
833
|
try {
|
|
@@ -3522,6 +3522,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3522
3522
|
return !(-1 === _2 || !ir.has(I2.slice(_2))) || (!(!x2 || matchParsedUrlAgainstPatterns(M2, w2)) || !!matchParsedUrlAgainstPatterns(M2, C2));
|
|
3523
3523
|
};
|
|
3524
3524
|
}
|
|
3525
|
+
function resolveFailedFetchStatus(e2, w2) {
|
|
3526
|
+
var _a2;
|
|
3527
|
+
return ((_a2 = e2 == null ? void 0 : e2.response) == null ? void 0 : _a2.status) ?? w2 ?? 0;
|
|
3528
|
+
}
|
|
3525
3529
|
function setupFetchInterceptor(e2 = [], C2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, x2 = []) {
|
|
3526
3530
|
const M2 = window.fetch, I2 = getOrSetSessionId(), _2 = createSkipHeadersPropagationChecker(e2, x2), U2 = ["text/event-stream", "application/x-ndjson", "application/stream+json", "application/grpc", "application/grpc-web"], j2 = ["application/octet-stream"];
|
|
3527
3531
|
window.fetch = new Proxy(M2, { apply: async (e3, x3, M3) => {
|
|
@@ -3533,7 +3537,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3533
3537
|
W2 = z2.href;
|
|
3534
3538
|
}
|
|
3535
3539
|
return _2(W2) ? e3.apply(x3, M3) : (async function injectHeaderWrapper(e4, x4, M4, I3, _3, W3, z3) {
|
|
3536
|
-
var _a2
|
|
3540
|
+
var _a2;
|
|
3537
3541
|
if (!W3) return e4.apply(x4, M4);
|
|
3538
3542
|
let H3 = uuidv4();
|
|
3539
3543
|
const K2 = getUrlAndStoredUuids(), X2 = _3.method || "GET", Y2 = Date.now();
|
|
@@ -3561,6 +3565,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3561
3565
|
ee2 && delete J2[ee2.name];
|
|
3562
3566
|
const te2 = `${W3}/${K2.page_visit_uuid}/${H3}`;
|
|
3563
3567
|
J2[w] = te2, ee2 && (J2[ee2.name] = ee2.value);
|
|
3568
|
+
let ne2;
|
|
3564
3569
|
maskAuthorizationHeader(J2);
|
|
3565
3570
|
try {
|
|
3566
3571
|
let ee3 = await (async function injectHeader(e5, C3, x5, M5, I4, _4, U3) {
|
|
@@ -3575,7 +3580,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3575
3580
|
const W4 = { ...M5 }, z4 = new Headers(M5.headers || {});
|
|
3576
3581
|
return z4.set(w, `${I4}/${_4}/${U3}`), j3 && (z4.set(j3.name, j3.value), or && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof x5 ? x5 : x5.href, header: j3.name })), W4.headers = z4, await e5.call(C3, x5, W4);
|
|
3577
3582
|
}
|
|
3578
|
-
})(e4, x4, I3, _3, W3, K2.page_visit_uuid, H3)
|
|
3583
|
+
})(e4, x4, I3, _3, W3, K2.page_visit_uuid, H3);
|
|
3584
|
+
ne2 = ee3.status;
|
|
3585
|
+
let te3 = false;
|
|
3579
3586
|
cr.includes(ee3.status) && (or && console.log("Perform retry as status was fail:", ee3), delete J2[w], ee3 = await (async function retryWithoutPropagateHeaders(e5, C3, x5, M5) {
|
|
3580
3587
|
try {
|
|
3581
3588
|
let M6 = x5[0], I4 = x5[1] || {};
|
|
@@ -3594,25 +3601,25 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3594
3601
|
} catch (e6) {
|
|
3595
3602
|
throw or && console.log(`Retry without ${w} for ${M5} also failed:`, e6), e6;
|
|
3596
3603
|
}
|
|
3597
|
-
})(e4, x4, M4, z3), te3 = true);
|
|
3598
|
-
const
|
|
3604
|
+
})(e4, x4, M4, z3), ne2 = ee3.status, te3 = true);
|
|
3605
|
+
const re2 = Date.now(), se2 = (function captureClientTime() {
|
|
3599
3606
|
return { wallTimeMs: Date.now(), monotonicMs: monotonicNow(), timeOriginMs: timeOriginMs() };
|
|
3600
|
-
})(),
|
|
3601
|
-
let
|
|
3607
|
+
})(), ie2 = ee3.status, ae2 = ee3.ok, ce2 = ae2 ? "" : `Request Error: ${ee3.statusText}`;
|
|
3608
|
+
let le2 = null;
|
|
3602
3609
|
try {
|
|
3603
|
-
|
|
3604
|
-
|
|
3610
|
+
le2 = {}, ee3.headers.forEach((e5, w2) => {
|
|
3611
|
+
le2[w2] = e5;
|
|
3605
3612
|
});
|
|
3606
3613
|
} catch (e5) {
|
|
3607
|
-
or && console.warn("[Sailfish] Failed to capture response headers:", e5),
|
|
3614
|
+
or && console.warn("[Sailfish] Failed to capture response headers:", e5), le2 = null;
|
|
3608
3615
|
}
|
|
3609
|
-
const
|
|
3610
|
-
|
|
3611
|
-
|
|
3616
|
+
const de2 = { type: 27, timestamp: re2, sessionId: W3, client: se2, data: { request_id: H3, session_id: W3, timestamp_start: Y2, timestamp_end: re2, response_code: ie2, success: ae2, error: ce2, method: X2, url: toAbsoluteUrl(z3), retry_without_trace_id: te3, request_headers: J2, request_body: Z2, response_headers: le2, response_body: null }, ...K2 }, sendEventWithBody = (e5) => {
|
|
3617
|
+
de2.data.response_body = e5, Q2 ? Q2.text().then((e6) => {
|
|
3618
|
+
de2.data.request_body = e6, sendEvent(de2);
|
|
3612
3619
|
}, () => {
|
|
3613
|
-
sendEvent(
|
|
3614
|
-
}) : sendEvent(
|
|
3615
|
-
},
|
|
3620
|
+
sendEvent(de2);
|
|
3621
|
+
}) : sendEvent(de2);
|
|
3622
|
+
}, pe2 = 1024 * C2.captureResponseBodyMaxMb * 1024;
|
|
3616
3623
|
if (0 === C2.captureResponseBodyMaxMb) sendEventWithBody(null);
|
|
3617
3624
|
else if ((function shouldSkipBodyCapture(e5) {
|
|
3618
3625
|
const w2 = e5.headers.get("content-type");
|
|
@@ -3670,10 +3677,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3670
3677
|
else sendEventWithBody(null);
|
|
3671
3678
|
else {
|
|
3672
3679
|
const e5 = ee3.headers.get("content-length"), w2 = e5 ? parseInt(e5, 10) : NaN;
|
|
3673
|
-
if (!isNaN(w2) && w2 >
|
|
3680
|
+
if (!isNaN(w2) && w2 > pe2) sendEventWithBody(null);
|
|
3674
3681
|
else try {
|
|
3675
3682
|
ee3.clone().text().then((e6) => {
|
|
3676
|
-
e6.length >
|
|
3683
|
+
e6.length > pe2 ? sendEventWithBody(null) : sendEventWithBody(e6);
|
|
3677
3684
|
}, () => sendEventWithBody(null));
|
|
3678
3685
|
} catch {
|
|
3679
3686
|
sendEventWithBody(null);
|
|
@@ -3681,8 +3688,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3681
3688
|
}
|
|
3682
3689
|
return ee3;
|
|
3683
3690
|
} catch (w2) {
|
|
3684
|
-
const C3 = Date.now(), I4 = false, _4 = (
|
|
3685
|
-
if (w2 instanceof TypeError && ((
|
|
3691
|
+
const C3 = Date.now(), I4 = false, _4 = resolveFailedFetchStatus(w2, ne2), U3 = w2.message || "Fetch request failed";
|
|
3692
|
+
if (w2 instanceof TypeError && ((_a2 = w2 == null ? void 0 : w2.message) == null ? void 0 : _a2.toLowerCase().includes(lr.toLowerCase()))) return e4.apply(x4, M4);
|
|
3686
3693
|
let j3 = Z2;
|
|
3687
3694
|
if (Q2) try {
|
|
3688
3695
|
j3 = await Q2.text();
|
|
@@ -12097,7 +12104,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
12097
12104
|
return () => {
|
|
12098
12105
|
};
|
|
12099
12106
|
}
|
|
12100
|
-
}, e.requestTimeSync = requestTimeSync, e.restoreFuncSpanState = restoreFuncSpanState, e.sendDomainsToNotPropagateHeaderTo = sendDomainsToNotPropagateHeaderTo, e.sendEvent = sendEvent, e.sendGraphQLRequest = sendGraphQLRequest, e.sendMessage = sendMessage, e.startRecording = startRecording, e.startRecordingSession = startRecordingSession, e.toAbsoluteUrl = toAbsoluteUrl, e.trackingEvent = function trackingEvent(w2) {
|
|
12107
|
+
}, e.requestTimeSync = requestTimeSync, e.resolveFailedFetchStatus = resolveFailedFetchStatus, e.restoreFuncSpanState = restoreFuncSpanState, e.sendDomainsToNotPropagateHeaderTo = sendDomainsToNotPropagateHeaderTo, e.sendEvent = sendEvent, e.sendGraphQLRequest = sendGraphQLRequest, e.sendMessage = sendMessage, e.startRecording = startRecording, e.startRecordingSession = startRecordingSession, e.toAbsoluteUrl = toAbsoluteUrl, e.trackingEvent = function trackingEvent(w2) {
|
|
12101
12108
|
sendMessage({ type: "trackingEvent", trackingData: w2, timestamp: e.nowTimestamp() });
|
|
12102
12109
|
}, e.withAppUrlMetadata = withAppUrlMetadata, e.wsSendBinary = wsSendBinary, Object.defineProperty(e, Symbol.toStringTag, { value: "Module" });
|
|
12103
12110
|
});
|
package/dist/recorder.umd.cjs.br
CHANGED
|
Binary file
|
package/dist/recorder.umd.cjs.gz
CHANGED
|
Binary file
|
package/dist/types/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const DEFAULT_CONSOLE_RECORDING_SETTINGS: LogRecordOptions;
|
|
|
8
8
|
export declare function toAbsoluteUrl(url: string): string;
|
|
9
9
|
export declare function matchUrlWithWildcard(input: unknown, patterns: string[]): boolean;
|
|
10
10
|
export declare function createSkipHeadersPropagationChecker(domainsToNotPropagateHeaderTo?: string[], domainsToPropagateHeaderTo?: string[]): (url: string) => boolean;
|
|
11
|
+
export declare function resolveFailedFetchStatus(error: any, observedStatus?: number): number;
|
|
11
12
|
export declare function startRecording({ apiKey, backendApi, domainsToPropagateHeaderTo, domainsToNotPropagateHeaderTo, serviceVersion, serviceIdentifier, gitSha, serviceAdditionalMetadata, enableIpTracking, captureStreamingResponseBody, captureResponseBodyMaxMb, captureStreamPrefixKb, captureStreamTimeoutMs, enableFiberTracking, deferRecording, deferRecordingStart, chunkSnapshot, useWsWorker, capturePerformanceMetrics, maskTextClass, maskInputSelector, maskTextSelector, blockSelector, unmaskSelector, maskInputOptions, recordCanvas, maskCanvasClass, gitOrg, gitRepo, gitProvider, library, headlessRecording, }: {
|
|
12
13
|
apiKey: string;
|
|
13
14
|
backendApi?: string;
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|