@sailfish-ai/recorder 1.11.5 → 1.12.4

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.
Files changed (75) hide show
  1. package/README.md +19 -1
  2. package/dist/chunkSerializer.js +70 -23
  3. package/dist/chunkSerializer.js.br +0 -0
  4. package/dist/chunkSerializer.js.gz +0 -0
  5. package/dist/chunks/chunkSerializer-DDukZpgl.js +116 -0
  6. package/dist/chunks/chunkSerializer-DDukZpgl.js.br +0 -0
  7. package/dist/chunks/chunkSerializer-DDukZpgl.js.gz +0 -0
  8. package/dist/chunks/chunkSerializer-FQtY90Av.js +115 -0
  9. package/dist/chunks/chunkSerializer-FQtY90Av.js.br +0 -0
  10. package/dist/chunks/chunkSerializer-FQtY90Av.js.gz +0 -0
  11. package/dist/chunks/{index-DiGs9it7.js → index-C-qbsfKe.js} +724 -548
  12. package/dist/chunks/index-C-qbsfKe.js.br +0 -0
  13. package/dist/chunks/index-C-qbsfKe.js.gz +0 -0
  14. package/dist/chunks/{index-CIK1iDN9.js → index-D6axlCRu.js} +757 -577
  15. package/dist/chunks/index-D6axlCRu.js.br +0 -0
  16. package/dist/chunks/index-D6axlCRu.js.gz +0 -0
  17. package/dist/clockSync.js +196 -0
  18. package/dist/clockSync.js.br +0 -0
  19. package/dist/clockSync.js.gz +0 -0
  20. package/dist/errorInterceptor.js +42 -4
  21. package/dist/errorInterceptor.js.br +0 -0
  22. package/dist/errorInterceptor.js.gz +0 -0
  23. package/dist/graphql.js +5 -0
  24. package/dist/graphql.js.br +0 -0
  25. package/dist/graphql.js.gz +0 -0
  26. package/dist/inAppReportIssueModal/index.js +4 -1
  27. package/dist/inAppReportIssueModal/index.js.br +0 -0
  28. package/dist/inAppReportIssueModal/index.js.gz +0 -0
  29. package/dist/inAppReportIssueModal/integrations.js +36 -0
  30. package/dist/inAppReportIssueModal/integrations.js.br +0 -0
  31. package/dist/inAppReportIssueModal/integrations.js.gz +0 -0
  32. package/dist/inAppReportIssueModal/state.js +8 -0
  33. package/dist/inAppReportIssueModal/state.js.br +0 -0
  34. package/dist/inAppReportIssueModal/state.js.gz +0 -0
  35. package/dist/index.js +67 -5
  36. package/dist/index.js.br +0 -0
  37. package/dist/index.js.gz +0 -0
  38. package/dist/privacyMask.js +93 -0
  39. package/dist/privacyMask.js.br +0 -0
  40. package/dist/privacyMask.js.gz +0 -0
  41. package/dist/recorder.cjs +2 -2
  42. package/dist/recorder.cjs.br +0 -0
  43. package/dist/recorder.cjs.gz +0 -0
  44. package/dist/recorder.js +17 -14
  45. package/dist/recorder.js.br +0 -0
  46. package/dist/recorder.js.gz +0 -0
  47. package/dist/recorder.umd.cjs +1338 -1140
  48. package/dist/recorder.umd.cjs.br +0 -0
  49. package/dist/recorder.umd.cjs.gz +0 -0
  50. package/dist/recording.js +84 -13
  51. package/dist/recording.js.br +0 -0
  52. package/dist/recording.js.gz +0 -0
  53. package/dist/types/chunkSerializer.d.ts +14 -0
  54. package/dist/types/clockSync.d.ts +70 -0
  55. package/dist/types/inAppReportIssueModal/integrations.d.ts +1 -0
  56. package/dist/types/inAppReportIssueModal/state.d.ts +2 -0
  57. package/dist/types/index.d.ts +16 -2
  58. package/dist/types/privacyMask.d.ts +46 -0
  59. package/dist/types/recording.d.ts +1 -0
  60. package/dist/types/types.d.ts +23 -0
  61. package/dist/types/websocket.d.ts +1 -0
  62. package/dist/websocket.js +111 -0
  63. package/dist/websocket.js.br +0 -0
  64. package/dist/websocket.js.gz +0 -0
  65. package/package.json +1 -1
  66. package/dist/chunks/chunkSerializer-C8qtomKe.js +0 -95
  67. package/dist/chunks/chunkSerializer-C8qtomKe.js.br +0 -0
  68. package/dist/chunks/chunkSerializer-C8qtomKe.js.gz +0 -0
  69. package/dist/chunks/chunkSerializer-RWnu-UfC.js +0 -94
  70. package/dist/chunks/chunkSerializer-RWnu-UfC.js.br +0 -0
  71. package/dist/chunks/chunkSerializer-RWnu-UfC.js.gz +0 -0
  72. package/dist/chunks/index-CIK1iDN9.js.br +0 -0
  73. package/dist/chunks/index-CIK1iDN9.js.gz +0 -0
  74. package/dist/chunks/index-DiGs9it7.js.br +0 -0
  75. package/dist/chunks/index-DiGs9it7.js.gz +0 -0
@@ -0,0 +1,93 @@
1
+ // Helpers that apply account-level Form Privacy Rules to rrweb's masking
2
+ // hooks. Kept in their own module so they can be unit-tested without
3
+ // pulling in the rest of recording.tsx (which imports rrweb dynamically).
4
+ /**
5
+ * Safe ancestor-match check. A malformed selector — typo'd by an admin in
6
+ * the Form Privacy Rules UI — would otherwise throw from `closest()` and
7
+ * crash rrweb's serializer mid-walk. Under-masking is better than dropping
8
+ * the session.
9
+ */
10
+ export function closestSafe(el, selector) {
11
+ if (!el || !selector)
12
+ return false;
13
+ try {
14
+ return !!el.closest(selector);
15
+ }
16
+ catch {
17
+ return false;
18
+ }
19
+ }
20
+ /** Element.matches with try/catch for malformed selectors. */
21
+ export function matchesSelectorSafe(el, selector) {
22
+ if (!selector)
23
+ return false;
24
+ try {
25
+ return el.matches(selector);
26
+ }
27
+ catch {
28
+ return false;
29
+ }
30
+ }
31
+ /**
32
+ * Build the maskInputFn we hand to rrweb. rrweb only calls maskInputFn after
33
+ * its own check on `maskInputOptions[tagName] || maskInputOptions[type]` —
34
+ * it has NO `maskInputSelector` concept. To honor admin-set
35
+ * `maskInputSelector` in normal record() mode, callers expand the
36
+ * rrweb-facing `maskInputOptions` to all-true so rrweb routes EVERY input
37
+ * through this fn. This function then enforces the real per-element decision:
38
+ *
39
+ * 1. unmaskSelector match → raw (admin opted this subtree out)
40
+ * 2. type in admin-intent maskInputOptions OR maskInputSelector match → mask
41
+ * 3. otherwise → raw (admin didn't configure this field for masking)
42
+ *
43
+ * `baseFn` produces the masked string (PII-specific last-4 CC/SSN/DOB, or
44
+ * a full-asterisk fallback).
45
+ */
46
+ export function buildMaskInputFn(opts) {
47
+ const { baseFn, unmaskSelector, maskInputSelector, adminMaskInputOptions } = opts;
48
+ // Without any per-element rule there's nothing to decide; rrweb's own
49
+ // maskInputOptions check already gates the call and baseFn does the rest.
50
+ if (!unmaskSelector && !maskInputSelector)
51
+ return baseFn;
52
+ return (text, node) => {
53
+ if (node.type === "hidden")
54
+ return "";
55
+ if (closestSafe(node, unmaskSelector))
56
+ return text;
57
+ const type = (node.type || "").toLowerCase();
58
+ const tag = (node.tagName || "").toLowerCase();
59
+ const typeMatches = adminMaskInputOptions[type] === true ||
60
+ adminMaskInputOptions[tag] === true;
61
+ const selectorMatches = matchesSelectorSafe(node, maskInputSelector);
62
+ if (!typeMatches && !selectorMatches) {
63
+ // Admin didn't configure this field; pass raw through.
64
+ return text;
65
+ }
66
+ return baseFn(text, node);
67
+ };
68
+ }
69
+ /**
70
+ * @deprecated Use buildMaskInputFn. Kept so older test imports keep working
71
+ * during the transition.
72
+ */
73
+ export function wrapMaskInputFn(baseFn, unmaskSelector) {
74
+ if (!unmaskSelector)
75
+ return baseFn;
76
+ return (text, node) => {
77
+ if (closestSafe(node, unmaskSelector))
78
+ return text;
79
+ return baseFn(text, node);
80
+ };
81
+ }
82
+ /**
83
+ * Default maskTextFn — replaces every non-whitespace char with "*",
84
+ * matching rrweb's built-in behavior. Wrapped so that nodes under
85
+ * `unmaskSelector` skip masking.
86
+ */
87
+ export function makeMaskTextFn(unmaskSelector) {
88
+ return (text, element) => {
89
+ if (closestSafe(element, unmaskSelector))
90
+ return text;
91
+ return text.replace(/\S/g, "*");
92
+ };
93
+ }
Binary file
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-DiGs9it7.js");
4
- 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.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.matchUrlWithWildcard = e.matchUrlWithWildcard, Object.defineProperty(exports, "nowTimestamp", { enumerable: true, get: () => e.nowTimestamp }), exports.onNavigationChange = e.onNavigationChange, exports.openReportIssueModal = e.openReportIssueModal, 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.trackingEvent = e.trackingEvent, exports.withAppUrlMetadata = e.withAppUrlMetadata;
3
+ const e = require("./chunks/index-C-qbsfKe.js");
4
+ 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.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.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.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;
Binary file
Binary file
package/dist/recorder.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D, a, S, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, z, A, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V } from "./chunks/index-CIK1iDN9.js";
1
+ import { D, a, S, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, 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 } from "./chunks/index-D6axlCRu.js";
2
2
  export {
3
3
  D as DEFAULT_CAPTURE_SETTINGS,
4
4
  a as DEFAULT_CONSOLE_RECORDING_SETTINGS,
@@ -34,17 +34,20 @@ export {
34
34
  F as initializeWebSocket,
35
35
  G as invalidateUrlCache,
36
36
  H as isFunctionSpanTrackingEnabled,
37
- I as matchUrlWithWildcard,
38
- J as nowTimestamp,
39
- K as onNavigationChange,
40
- L as openReportIssueModal,
41
- M as restoreFuncSpanState,
42
- N as sendDomainsToNotPropagateHeaderTo,
43
- O as sendEvent,
44
- P as sendGraphQLRequest,
45
- Q as sendMessage,
46
- R as startRecording,
47
- T as startRecordingSession,
48
- U as trackingEvent,
49
- V as withAppUrlMetadata
37
+ I as maskInputFn,
38
+ J as matchUrlWithWildcard,
39
+ K as nowTimestamp,
40
+ L as onNavigationChange,
41
+ M as openReportIssueModal,
42
+ N as requestTimeSync,
43
+ O as restoreFuncSpanState,
44
+ P as sendDomainsToNotPropagateHeaderTo,
45
+ Q as sendEvent,
46
+ R as sendGraphQLRequest,
47
+ T as sendMessage,
48
+ U as startRecording,
49
+ V as startRecordingSession,
50
+ W as toAbsoluteUrl,
51
+ X as trackingEvent,
52
+ Y as withAppUrlMetadata
50
53
  };
Binary file
Binary file