@sailfish-ai/recorder 1.5.4 → 1.5.5

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/index.js CHANGED
@@ -3,6 +3,7 @@ import { v4 as uuidv4 } from "uuid";
3
3
  import { gatherAndCacheDeviceInfo } from "./deviceInfo";
4
4
  import { sendRecordingEvents } from "./eventCache";
5
5
  import { fetchCaptureSettings, sendDomainsToNotPropagateHeaderTo, startRecordingSession, } from "./graphql";
6
+ import { sendMapUuidIfAvailable } from "./mapUuid";
6
7
  import { initializeRecording } from "./recording";
7
8
  import { sendMessage } from "./websocket";
8
9
  // Default list of domains to ignore
@@ -350,7 +351,7 @@ function setupFetchInterceptor(domainsToNotPropagateHeadersTo, domainsToPropagat
350
351
  }
351
352
  }
352
353
  // Main Recording Function
353
- export async function startRecording({ apiKey, backendApi = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo = [], domainsToNotPropagateHeaderTo = [], }) {
354
+ export async function startRecording({ apiKey, backendApi = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo = [], domainsToNotPropagateHeaderTo = [], serviceVersion = "", }) {
354
355
  let sessionId = getOrSetSessionId();
355
356
  storeCredentialsAndConnection({ apiKey, backendApi });
356
357
  trackDomainChanges();
@@ -371,6 +372,8 @@ export async function startRecording({ apiKey, backendApi = "https://api-service
371
372
  const websocket = await initializeRecording(captureSettings, DEFAULT_CONSOLE_RECORDING_SETTINGS,
372
373
  // DEFAULT_NETWORK_CAPTURE_SETTINGS,
373
374
  backendApi, apiKey, sessionId);
375
+ // Send parameters once before starting interval
376
+ sendMapUuidIfAvailable(serviceVersion);
374
377
  setInterval(() => {
375
378
  if (websocket && websocket.readyState === WebSocket.OPEN) {
376
379
  sendRecordingEvents(websocket);
package/dist/mapUuid.js CHANGED
@@ -1,16 +1,13 @@
1
- // mapUuid.tsx
2
1
  import { sendMessage } from "./websocket";
3
- export function sendMapUuidIfAvailable() {
2
+ export function sendMapUuidIfAvailable(serviceVersion) {
4
3
  if (window.sfMapUuid) {
5
4
  const mapUuidMessage = {
6
5
  type: "mapUuid",
7
6
  data: {
8
7
  mapUuid: window.sfMapUuid,
8
+ serviceVersion: serviceVersion,
9
9
  },
10
10
  };
11
11
  sendMessage(mapUuidMessage);
12
12
  }
13
- else {
14
- console.log("window.sfMapUuid is not set. Please install @sailfish/sf-map-utils as a dev dependency and include it in your build process.");
15
- }
16
13
  }