tsv2-library 1.0.65 → 1.0.66

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.
@@ -37502,8 +37502,14 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
37502
37502
  group: toastScanGroup.value
37503
37503
  });
37504
37504
  };
37505
+ const { company: companyId } = JSON.parse(
37506
+ localStorage.getItem("user") ?? "{}"
37507
+ );
37505
37508
  const onBeforeStartScan = () => {
37506
- if (window.Cypress) {
37509
+ const isTest = window.Cypress || window.__wdio;
37510
+ const isStaging = window.location.hostname.includes("staging");
37511
+ const isCompanyProdTest = companyId === "2009458985643544576";
37512
+ if (isTest && (isStaging || isCompanyProdTest)) {
37507
37513
  startScanForTest();
37508
37514
  } else {
37509
37515
  startScan();
@@ -37516,31 +37522,27 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
37516
37522
  life: 3e3,
37517
37523
  group: toastConnectingGroup.value
37518
37524
  });
37525
+ const code2 = window.__e2eMockScanCode__ || v4();
37526
+ const serialNumber = window.__e2eMockSerialNumber__ || v4();
37519
37527
  setTimeout(async () => {
37520
37528
  var _a;
37521
37529
  emit("connect");
37522
37530
  emit("connected", {
37523
37531
  jenisDevice: "Handheld",
37524
- serialNumber: v4(),
37532
+ serialNumber,
37525
37533
  API: "v2",
37526
37534
  rfidScan: true,
37527
37535
  qrScan: true,
37528
37536
  name: "Device Test"
37529
37537
  });
37530
37538
  if (props.bulk) {
37531
- emit("scan", v4(), "serialNumber");
37539
+ emit("scan", code2, serialNumber);
37532
37540
  } else {
37533
- const code2 = v4();
37534
37541
  validatingCode.value = !!props.scanValidation;
37535
- const valid = await ((_a = props.scanValidation) == null ? void 0 : _a.call(
37536
- props,
37537
- scanType.value,
37538
- code2,
37539
- getSerialNumber()
37540
- )) ?? true;
37542
+ const valid = await ((_a = props.scanValidation) == null ? void 0 : _a.call(props, scanType.value, code2, serialNumber)) ?? true;
37541
37543
  validatingCode.value = false;
37542
37544
  if (valid) {
37543
- emit("scan", code2, "serialNumber");
37545
+ emit("scan", code2, serialNumber);
37544
37546
  handleScanStopped();
37545
37547
  }
37546
37548
  }