@sailfish-ai/recorder 1.11.3 → 1.11.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 (37) hide show
  1. package/dist/chunks/{chunkSerializer-jzbHv2wf.js → chunkSerializer-CFHDS9Vi.js} +1 -1
  2. package/dist/chunks/chunkSerializer-CFHDS9Vi.js.br +0 -0
  3. package/dist/chunks/chunkSerializer-CFHDS9Vi.js.gz +0 -0
  4. package/dist/chunks/{chunkSerializer-CV4nkb5-.js → chunkSerializer-DOaGGlCg.js} +1 -1
  5. package/dist/chunks/chunkSerializer-DOaGGlCg.js.br +0 -0
  6. package/dist/chunks/chunkSerializer-DOaGGlCg.js.gz +0 -0
  7. package/dist/chunks/{index-BynFTRFv.js → index-B8IAZfT7.js} +220 -192
  8. package/dist/chunks/index-B8IAZfT7.js.br +0 -0
  9. package/dist/chunks/index-B8IAZfT7.js.gz +0 -0
  10. package/dist/chunks/{index-BP-kNUGS.js → index-DbcegHRc.js} +313 -285
  11. package/dist/chunks/index-DbcegHRc.js.br +0 -0
  12. package/dist/chunks/index-DbcegHRc.js.gz +0 -0
  13. package/dist/inAppReportIssueModal/index.js +10 -4
  14. package/dist/inAppReportIssueModal/index.js.br +0 -0
  15. package/dist/inAppReportIssueModal/index.js.gz +0 -0
  16. package/dist/inAppReportIssueModal/integrations.js +50 -0
  17. package/dist/inAppReportIssueModal/integrations.js.br +0 -0
  18. package/dist/inAppReportIssueModal/integrations.js.gz +0 -0
  19. package/dist/recorder.cjs +1 -1
  20. package/dist/recorder.cjs.br +0 -0
  21. package/dist/recorder.cjs.gz +0 -0
  22. package/dist/recorder.js +1 -1
  23. package/dist/recorder.js.br +0 -0
  24. package/dist/recorder.js.gz +0 -0
  25. package/dist/recorder.umd.cjs +34 -6
  26. package/dist/recorder.umd.cjs.br +0 -0
  27. package/dist/recorder.umd.cjs.gz +0 -0
  28. package/dist/types/inAppReportIssueModal/integrations.d.ts +3 -0
  29. package/package.json +1 -1
  30. package/dist/chunks/chunkSerializer-CV4nkb5-.js.br +0 -0
  31. package/dist/chunks/chunkSerializer-CV4nkb5-.js.gz +0 -0
  32. package/dist/chunks/chunkSerializer-jzbHv2wf.js.br +0 -0
  33. package/dist/chunks/chunkSerializer-jzbHv2wf.js.gz +0 -0
  34. package/dist/chunks/index-BP-kNUGS.js.br +0 -0
  35. package/dist/chunks/index-BP-kNUGS.js.gz +0 -0
  36. package/dist/chunks/index-BynFTRFv.js.br +0 -0
  37. package/dist/chunks/index-BynFTRFv.js.gz +0 -0
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  import { createTriageAndIssueFromRecorder, createTriageFromRecorder, } from "../graphql";
2
- import { getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSprintFieldId, getUsers, hasValidIntegration, refreshIntegrationData, updateFormWithIntegrationData, updateIssueTypeOptions, } from "./integrations";
2
+ import { getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSprintFieldId, getUsers, getValidSavedReporterAccountId, hasValidIntegration, refreshIntegrationData, saveLastReporterAccountId, updateFormWithIntegrationData, updateIssueTypeOptions, } from "./integrations";
3
3
  import { currentState, isRecording, recordingEndTime, recordingStartTime, resetState, setIsRecording, setRecordingEndTime, setRecordingStartTime, setTimerInterval, timerInterval, } from "./state";
4
4
  import { STORAGE_KEYS } from "./types";
5
5
  import { getChevronSVG, renderCustomMultiSelect, renderDynamicField, } from "./ui";
@@ -844,7 +844,8 @@ function initializeEngTicketForm() {
844
844
  const fields = getFieldsForProject(currentState.engTicketProject, currentState.engTicketIssueType);
845
845
  const reporterField = fields.find((f) => f.fieldId === "reporter");
846
846
  if (reporterField) {
847
- const matchedReporter = getDefaultReporterAccountId();
847
+ const savedReporter = getValidSavedReporterAccountId();
848
+ const matchedReporter = savedReporter || getDefaultReporterAccountId();
848
849
  currentState.engTicketCustomFields["reporter"] =
849
850
  matchedReporter || integrationData.jiraReporterAccountId || "";
850
851
  }
@@ -966,7 +967,8 @@ function bindEngTicketListeners() {
966
967
  const fields = getFieldsForProject(engProjectSelect.value, currentState.engTicketIssueType);
967
968
  const reporterField = fields.find((f) => f.fieldId === "reporter");
968
969
  if (reporterField) {
969
- const matchedReporter = getDefaultReporterAccountId();
970
+ const savedReporter = getValidSavedReporterAccountId();
971
+ const matchedReporter = savedReporter || getDefaultReporterAccountId();
970
972
  currentState.engTicketCustomFields["reporter"] =
971
973
  matchedReporter || integrationData.jiraReporterAccountId || "";
972
974
  }
@@ -1031,6 +1033,9 @@ function bindEngTicketListeners() {
1031
1033
  const fieldId = target.dataset.fieldId;
1032
1034
  if (fieldId) {
1033
1035
  currentState.engTicketCustomFields[fieldId] = target.value;
1036
+ if (fieldId === "reporter" && target.value) {
1037
+ saveLastReporterAccountId(target.value);
1038
+ }
1034
1039
  }
1035
1040
  if (target.tagName === "SELECT") {
1036
1041
  const selectElement = target;
@@ -1168,7 +1173,8 @@ function bindListeners() {
1168
1173
  const fields = getFieldsForProject(currentState.engTicketProject, currentState.engTicketIssueType);
1169
1174
  const reporterField = fields.find((f) => f.fieldId === "reporter");
1170
1175
  if (reporterField) {
1171
- const matchedReporter = getDefaultReporterAccountId();
1176
+ const savedReporter = getValidSavedReporterAccountId();
1177
+ const matchedReporter = savedReporter || getDefaultReporterAccountId();
1172
1178
  currentState.engTicketCustomFields["reporter"] =
1173
1179
  matchedReporter || integrationData.jiraReporterAccountId || "";
1174
1180
  }
@@ -289,6 +289,56 @@ export function getDefaultReporterAccountId() {
289
289
  }
290
290
  return matched ? (matched.id || matched.accountId || null) : null;
291
291
  }
292
+ // localStorage-backed "last reporter" persistence. SSR-safe — accessing
293
+ // `localStorage` on the server throws, so we guard with a window check.
294
+ // Keyed per Jira cloud (primaryCloudId) since accountIds aren't portable
295
+ // across Jira sites; falls back to provider when no cloud id is present.
296
+ function lastReporterStorageKey() {
297
+ if (!integrationData)
298
+ return null;
299
+ const scope = integrationData.primaryCloudId || integrationData.provider || "";
300
+ if (!scope)
301
+ return null;
302
+ return `sf-veritas:lastReporter:${scope}`;
303
+ }
304
+ export function getSavedLastReporterAccountId() {
305
+ if (typeof window === "undefined" || typeof localStorage === "undefined") {
306
+ return null;
307
+ }
308
+ const key = lastReporterStorageKey();
309
+ if (!key)
310
+ return null;
311
+ try {
312
+ return localStorage.getItem(key);
313
+ }
314
+ catch {
315
+ return null;
316
+ }
317
+ }
318
+ export function saveLastReporterAccountId(accountId) {
319
+ if (typeof window === "undefined" || typeof localStorage === "undefined") {
320
+ return;
321
+ }
322
+ const key = lastReporterStorageKey();
323
+ if (!key || !accountId)
324
+ return;
325
+ try {
326
+ localStorage.setItem(key, accountId);
327
+ }
328
+ catch {
329
+ // best-effort persistence — ignore quota / privacy-mode failures
330
+ }
331
+ }
332
+ // Returns the saved last reporter only when it still resolves to an active
333
+ // user on this integration. Stale ids fall through silently.
334
+ export function getValidSavedReporterAccountId() {
335
+ const saved = getSavedLastReporterAccountId();
336
+ if (!saved)
337
+ return null;
338
+ const users = getUsers();
339
+ const stillValid = users.some((u) => (u.accountId || u.id) === saved && u.active !== false);
340
+ return stillValid ? saved : null;
341
+ }
292
342
  // Get projects based on team selection (for Linear) or directly from integration (for Jira)
293
343
  export function getProjectsForTeam(teamId) {
294
344
  if (!integrationData)
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-BP-kNUGS.js");
3
+ const e = require("./chunks/index-DbcegHRc.js");
4
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;
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-BynFTRFv.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 } from "./chunks/index-B8IAZfT7.js";
2
2
  export {
3
3
  D as DEFAULT_CAPTURE_SETTINGS,
4
4
  a as DEFAULT_CONSOLE_RECORDING_SETTINGS,
Binary file
Binary file
@@ -593,7 +593,7 @@
593
593
  const w3 = new URL(e3);
594
594
  return `${w3.hostname}${w3.port ? `:${w3.port}` : ""}`;
595
595
  })(e2);
596
- let _2 = `${"https:" === new URL(e2).protocol ? "wss" : "ws"}://${M2}/ws/notify/?apiKey=${w2}&sessionId=${C2}&sender=JS%2FTS&version=1.11.3`;
596
+ let _2 = `${"https:" === new URL(e2).protocol ? "wss" : "ws"}://${M2}/ws/notify/?apiKey=${w2}&sessionId=${C2}&sender=JS%2FTS&version=1.11.4`;
597
597
  if (x2 && (_2 += `&envValue=${encodeURIComponent(x2)}`), le = I2 ? (function tryCreateWsWorker() {
598
598
  if ("undefined" == typeof Worker) return null;
599
599
  try {
@@ -1180,6 +1180,34 @@
1180
1180
  }
1181
1181
  return M2 && (M2.id || M2.accountId) || null;
1182
1182
  }
1183
+ function lastReporterStorageKey() {
1184
+ if (!ut) return null;
1185
+ const e2 = ut.primaryCloudId || ut.provider || "";
1186
+ return e2 ? `sf-veritas:lastReporter:${e2}` : null;
1187
+ }
1188
+ function getSavedLastReporterAccountId() {
1189
+ if ("undefined" == typeof window || "undefined" == typeof localStorage) return null;
1190
+ const e2 = lastReporterStorageKey();
1191
+ if (!e2) return null;
1192
+ try {
1193
+ return localStorage.getItem(e2);
1194
+ } catch {
1195
+ return null;
1196
+ }
1197
+ }
1198
+ function saveLastReporterAccountId(e2) {
1199
+ if ("undefined" == typeof window || "undefined" == typeof localStorage) return;
1200
+ const w2 = lastReporterStorageKey();
1201
+ if (w2 && e2) try {
1202
+ localStorage.setItem(w2, e2);
1203
+ } catch {
1204
+ }
1205
+ }
1206
+ function getValidSavedReporterAccountId() {
1207
+ const e2 = getSavedLastReporterAccountId();
1208
+ if (!e2) return null;
1209
+ return getUsers().some((w2) => (w2.accountId || w2.id) === e2 && false !== w2.active) ? e2 : null;
1210
+ }
1183
1211
  function getProjectsForTeam(e2) {
1184
1212
  if (!ut) return [];
1185
1213
  const w2 = ut.teams && Array.isArray(ut.teams) && ut.teams.length > 0;
@@ -1212,7 +1240,7 @@
1212
1240
  } catch (e3) {
1213
1241
  console.error("Error fetching integration data:", e3), ut = null;
1214
1242
  }
1215
- }, getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSprintFieldId, getUsers, hasValidIntegration, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" })), ht = "sf-create-issue-preference", ft = "sf-create-eng-ticket-preference";
1243
+ }, getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSavedLastReporterAccountId, getSprintFieldId, getUsers, getValidSavedReporterAccountId, hasValidIntegration, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, saveLastReporterAccountId, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" })), ht = "sf-create-issue-preference", ft = "sf-create-eng-ticket-preference";
1216
1244
  function getInitialState() {
1217
1245
  const e2 = (function loadUserPreferences() {
1218
1246
  return { createIssue: J && "true" === localStorage.getItem(ht), createEngTicket: J && "true" === localStorage.getItem(ft) };
@@ -1805,7 +1833,7 @@
1805
1833
  if (!wt.engTicketTeam && e5.defaultTeam && (wt.engTicketTeam = e5.defaultTeam), !wt.engTicketProject && e5.defaultProject && (wt.engTicketProject = e5.defaultProject), !wt.engTicketPriority && e5.defaultPriority && (wt.engTicketPriority = e5.defaultPriority), updateFormWithIntegrationData(wt), "jira" === ((_a2 = e5.provider) == null ? void 0 : _a2.toLowerCase()) && wt.engTicketProject && !wt.engTicketCustomFields.reporter) {
1806
1834
  const w5 = getFieldsForProject(wt.engTicketProject, wt.engTicketIssueType).find((e6) => "reporter" === e6.fieldId);
1807
1835
  if (w5) {
1808
- const w6 = getDefaultReporterAccountId();
1836
+ const w6 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
1809
1837
  wt.engTicketCustomFields.reporter = w6 || e5.jiraReporterAccountId || "";
1810
1838
  }
1811
1839
  }
@@ -1944,7 +1972,7 @@
1944
1972
  if (!wt.engTicketTeam && e2.defaultTeam && (wt.engTicketTeam = e2.defaultTeam), !wt.engTicketProject && e2.defaultProject && (wt.engTicketProject = e2.defaultProject), !wt.engTicketPriority && e2.defaultPriority && (wt.engTicketPriority = e2.defaultPriority), updateFormWithIntegrationData(wt), "jira" === ((_a2 = e2.provider) == null ? void 0 : _a2.toLowerCase()) && wt.engTicketProject && !wt.engTicketCustomFields.reporter) {
1945
1973
  const w2 = getFieldsForProject(wt.engTicketProject, wt.engTicketIssueType).find((e3) => "reporter" === e3.fieldId);
1946
1974
  if (w2) {
1947
- const w3 = getDefaultReporterAccountId();
1975
+ const w3 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
1948
1976
  wt.engTicketCustomFields.reporter = w3 || e2.jiraReporterAccountId || "";
1949
1977
  }
1950
1978
  }
@@ -1987,7 +2015,7 @@
1987
2015
  if (e3 && I2 && (updateIssueTypeOptions(I2, w2.value), wt.engTicketIssueType = I2.value), e3 && "jira" === ((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase()) && w2.value) {
1988
2016
  const C3 = getFieldsForProject(w2.value, wt.engTicketIssueType).find((e4) => "reporter" === e4.fieldId);
1989
2017
  if (C3) {
1990
- const w3 = getDefaultReporterAccountId();
2018
+ const w3 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
1991
2019
  wt.engTicketCustomFields.reporter = w3 || e3.jiraReporterAccountId || "";
1992
2020
  }
1993
2021
  }
@@ -2017,7 +2045,7 @@
2017
2045
  const w3 = e3.target;
2018
2046
  if (w3.classList.contains("sf-dynamic-field")) {
2019
2047
  const e4 = w3.dataset.fieldId;
2020
- if (e4 && (wt.engTicketCustomFields[e4] = w3.value), "SELECT" === w3.tagName) {
2048
+ if (e4 && (wt.engTicketCustomFields[e4] = w3.value, "reporter" === e4 && w3.value && saveLastReporterAccountId(w3.value)), "SELECT" === w3.tagName) {
2021
2049
  const e5 = w3;
2022
2050
  e5.style.color = e5.value ? "" : "#9ca3af";
2023
2051
  }
Binary file
Binary file
@@ -23,5 +23,8 @@ export declare function getUsers(): any[];
23
23
  * user matches to avoid ambiguity.
24
24
  */
25
25
  export declare function getDefaultReporterAccountId(): string | null;
26
+ export declare function getSavedLastReporterAccountId(): string | null;
27
+ export declare function saveLastReporterAccountId(accountId: string): void;
28
+ export declare function getValidSavedReporterAccountId(): string | null;
26
29
  export declare function getProjectsForTeam(teamId?: string): any[];
27
30
  export declare function updateFormWithIntegrationData(currentState: IssueReportState): IssueReportState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sailfish-ai/recorder",
3
- "version": "1.11.3",
3
+ "version": "1.11.4",
4
4
  "publishPublicly": true,
5
5
  "publishToCdn": {
6
6
  "jsdelivr": true,
Binary file
Binary file
Binary file
Binary file