@7365admin1/layer-common 4.2.5-staging.270 → 4.2.5-staging.272

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 (40) hide show
  1. package/components/AddPassKeyToVisitor.vue +0 -1
  2. package/components/AttendanceCheckInOutDialog.vue +0 -1
  3. package/components/AttendanceMain.vue +0 -1
  4. package/components/BtnUploadFile.vue +1 -3
  5. package/components/BuildingForm.vue +0 -1
  6. package/components/BuildingUnitFormEdit.vue +0 -1
  7. package/components/BulletinBoardManagement.vue +1 -1
  8. package/components/CameraForm.vue +0 -1
  9. package/components/CameraMain.vue +0 -1
  10. package/components/Carousel.vue +0 -1
  11. package/components/Chat/Information.vue +1 -1
  12. package/components/Chat/Message.vue +2 -1
  13. package/components/DrawImage.vue +0 -1
  14. package/components/Facility/BookingSetup.vue +1 -2
  15. package/components/FeedbackDetail.vue +1 -2
  16. package/components/FeedbackMain.vue +0 -2
  17. package/components/Input/File.vue +1 -6
  18. package/components/PasswordConfirmation.vue +1 -1
  19. package/components/ScanVisitorQRCode.vue +0 -2
  20. package/components/ServiceProviderMain.vue +0 -2
  21. package/components/SiteSettings.vue +0 -2
  22. package/components/VehicleForm.vue +55 -16
  23. package/components/VehicleManagement.vue +30 -2
  24. package/components/VisitorForm.vue +2 -18
  25. package/components/VisitorManagement.vue +1 -1
  26. package/components/VisitorPassKeyQRScanner.vue +0 -1
  27. package/components/WorkOrder/Detail.vue +1 -2
  28. package/components/WorkOrder/Main.vue +1 -1
  29. package/composables/useComment.ts +1 -1
  30. package/composables/useKey.ts +0 -3
  31. package/composables/usePassKey.ts +0 -1
  32. package/composables/useRole.ts +1 -1
  33. package/composables/useUploadFiles.ts +1 -1
  34. package/composables/useUtils.ts +1 -2
  35. package/composables/useVerification.ts +0 -1
  36. package/composables/useWebUsb.ts +0 -10
  37. package/middleware/01.auth.ts +0 -1
  38. package/middleware/02.org.ts +0 -2
  39. package/package.json +1 -1
  40. package/plugins/vuetify.ts +0 -2
@@ -355,7 +355,6 @@ watch(
355
355
  );
356
356
 
357
357
  keyItems.value = [...filteredRawKeys, ...manuallyRemovedKeys];
358
- console.log("keyItems: ", keyItems.value);
359
358
  },
360
359
  { deep: true, immediate: true }
361
360
  );
@@ -189,7 +189,6 @@ const openCamera = async () => {
189
189
 
190
190
  try {
191
191
  await videoElement.value.play();
192
- console.log("Camera preview started successfully");
193
192
  } catch (playErr) {
194
193
  console.error("Error playing video:", playErr);
195
194
  throw playErr;
@@ -154,7 +154,6 @@ async function handleRowClick(data: any) {
154
154
  }
155
155
 
156
156
  const onSettingsSaved = async (payload: any) => {
157
- console.log("Settings saved:", payload);
158
157
  // TODO: Implement API call to save settings
159
158
  await getAttendancesRefresh();
160
159
  };
@@ -104,10 +104,8 @@ async function uploadAttachment(e: Event) {
104
104
  value.value = res.id as string;
105
105
  await emit("upload", res);
106
106
  } catch (error) {
107
- console.log(error);
107
+ console.error(error);
108
108
  }
109
- } else {
110
- console.log("No file selected");
111
109
  }
112
110
  loading.value = false;
113
111
  }
@@ -414,7 +414,6 @@ async function submit() {
414
414
 
415
415
  if (prop.mode === "edit") {
416
416
 
417
- console.log('Updating building with levels:', building.value.levels);
418
417
 
419
418
  if (JSON.stringify(initialBuildingLevels.value) !== JSON.stringify(building.value.levels)) {
420
419
  await batchUpdateLevels(building.value.levels as { _id: string; name: string }[]);
@@ -535,7 +535,6 @@ async function submit() {
535
535
  const handleUpdateOwner = async ({ person, isOwner }: { person: TPeople; isOwner: boolean }) => {
536
536
  const owners = peopleItems.value.filter(p => p.isOwner)
537
537
  message.value = ""
538
- // console.log('Updating owner status for', person._id, 'to', isOwner)
539
538
 
540
539
  const userId = person._id ?? null;
541
540
 
@@ -304,7 +304,7 @@ async function handleProceedDeleteAnnouncement() {
304
304
  }
305
305
  } catch (error: any) {
306
306
  const errorMessage = error?.response?._data?.message;
307
- console.log("[ERROR]", error);
307
+ console.error("[ERROR]", error);
308
308
  showMessage(
309
309
  errorMessage || "Something went wrong. Please try again later.",
310
310
  "error"
@@ -288,7 +288,6 @@ camera.value.site = prop.site;
288
288
  if (prop.mode === "edit") {
289
289
  camera.value = JSON.parse(JSON.stringify(prop.camera));
290
290
  }
291
- console.log("prop.camera", prop?.camera);
292
291
  camera.value.site = prop.site;
293
292
  camera.value.type = prop.type;
294
293
  camera.value.category =
@@ -521,7 +521,6 @@ const camera = ref<TSiteCamera>({
521
521
  });
522
522
 
523
523
  function handleRowClick(_: any, data: any) {
524
- console.log("row clicked", data.item);
525
524
  dialogPreview.value = true;
526
525
  camera.value = JSON.parse(JSON.stringify(data.item));
527
526
  }
@@ -305,7 +305,6 @@ watchEffect(async (onCleanup) => {
305
305
  isConverting.value = false;
306
306
  // Replace the entire array at once to avoid "doubling" or partial updates
307
307
  mediaItems.value = newMediaItems;
308
- console.log("watchEffect mediaItems updated:", mediaItems.value);
309
308
  }
310
309
  });
311
310
 
@@ -354,7 +354,7 @@ async function deleteFile(value: string) {
354
354
  (file) => file !== value
355
355
  );
356
356
  } catch (error) {
357
- console.log(error);
357
+ console.error(error);
358
358
  showMessage("Failed to delete file", "error");
359
359
  }
360
360
  }
@@ -154,8 +154,9 @@ const quickChatOptions = [
154
154
  "We are here to help.",
155
155
  ];
156
156
 
157
+ // Placeholder: choosing a quick-chat option is not wired to anything yet.
157
158
  const selectQuickChat = (msg: string) => {
158
- console.log("Quick Chat Selected:", msg);
159
+ void msg;
159
160
  };
160
161
  </script>
161
162
 
@@ -152,7 +152,6 @@ async function draw(e: any) {
152
152
  const submit = () => {
153
153
  canvas.toBlob((blob: any) => {
154
154
  const url = URL.createObjectURL(blob);
155
- console.log("URL", url);
156
155
 
157
156
  emit("onSubmit", url, props.imageIdx!);
158
157
  });
@@ -939,7 +939,7 @@ const upsertChecklist = () => {
939
939
  } else if (Array.isArray(facility.value.securityCheckList)) {
940
940
  facility.value.securityCheckList.push(newItem);
941
941
  } else {
942
- console.log("Error in adding security checklist");
942
+ console.error("Error in adding security checklist");
943
943
  }
944
944
  } else {
945
945
  isEditing.value = false;
@@ -981,7 +981,6 @@ const confirmRemarks = () => {
981
981
  };
982
982
 
983
983
  const deleteChecklist = (index: string) => {
984
- console.log("delete checklist", index);
985
984
  selectedIndex.value = index;
986
985
  isDeleteItem.value = true;
987
986
  };
@@ -330,7 +330,6 @@ async function handleCompletionFileAdded(file: File) {
330
330
  // }
331
331
  // }
332
332
 
333
- console.log("completionAttachments.value", completionAttachments.value);
334
333
  } catch (error) {
335
334
  console.error("Error uploading completion file:", error);
336
335
  showMessage("Failed to upload file", "error");
@@ -347,7 +346,7 @@ async function handleCompletionFileDeleted(value: string) {
347
346
  (file) => file !== value
348
347
  );
349
348
  } catch (error) {
350
- console.log(error);
349
+ console.error(error);
351
350
  showMessage("Failed to delete file", "error");
352
351
  }
353
352
  }
@@ -927,7 +927,6 @@ const { addFile, deleteFile: _deleteFile } = useFile();
927
927
  // (file) => file !== value
928
928
  // );
929
929
  // } catch (error) {
930
- // console.log(error);
931
930
  // showMessage("Failed to delete file", "error");
932
931
  // }
933
932
  // }
@@ -943,7 +942,6 @@ const categories = computed(() =>
943
942
  );
944
943
 
945
944
  function tableRowClickHandler(_: any, data: any) {
946
- // console.log(data.item);
947
945
  selectedFeedback.value = data.item;
948
946
  dialogPreview.value = true;
949
947
  }
@@ -168,10 +168,6 @@ function selectAttachment() {
168
168
 
169
169
  function onFileChange() {
170
170
  if (files.value.length) {
171
- console.log(
172
- "onFileChange triggered with files:",
173
- files.value.map((f) => f.name)
174
- );
175
171
 
176
172
  const maxFiles = props.maxFiles || 5;
177
173
  if (files.value.length > maxFiles) {
@@ -181,7 +177,6 @@ function onFileChange() {
181
177
  }
182
178
 
183
179
  files.value.forEach((file) => {
184
- console.log(`Emitting 'add' event for file: ${file.name}`);
185
180
  // For each file, we'll also need to store its original name
186
181
  // This will be associated with the file URL in the parent component
187
182
  emit("add", file);
@@ -192,7 +187,7 @@ function onFileChange() {
192
187
  }
193
188
 
194
189
  function onImageError(file: string) {
195
- console.log(`Image error for file: ${file}`);
190
+ console.error(`Image error for file: ${file}`);
196
191
  emit("errored", file);
197
192
  }
198
193
 
@@ -97,7 +97,7 @@ async function handleConfirm() {
97
97
 
98
98
  } catch (err: any) {
99
99
  const errMessage = err?.response?._data?.message || 'Something went wrong. Please try again.';
100
- console.log('[ERROR]', err)
100
+ console.error('[ERROR]', err)
101
101
  errorMessage.value = errMessage;
102
102
  } finally {
103
103
  processingPassword.value = false;
@@ -77,8 +77,6 @@ const showNotFoundMessage = ref<boolean>(false);
77
77
  const errorMessage = ref<string>("");
78
78
 
79
79
  const handleScanVisitorQRCode = async () => {
80
- console.log("startScanner cameraFacingMode", cameraFacingMode.value);
81
- console.log("STARTING QR Code Scanner...");
82
80
  if (html5QrCodeInstance.value) return;
83
81
  const config = { fps: 10, qrbox: { width: 250, height: 250 } };
84
82
  html5QrCodeInstance.value = new $Html5Qrcode("reader");
@@ -929,7 +929,6 @@ if (!user?._id) return;
929
929
  siteId: props.siteId,
930
930
  });
931
931
 
932
- console.log("serviceProviders", serviceProviders);
933
932
 
934
933
  if (serviceProviders?.length) {
935
934
  messageServiceProvider.value =
@@ -980,7 +979,6 @@ const canSubmitInvite = computed(() => {
980
979
  watch(
981
980
  () => serviceProviderInvite.value.email,
982
981
  async (value) => {
983
- console.log("typing:", value);
984
982
  await checkExistingAccount(value);
985
983
  }
986
984
  );
@@ -410,7 +410,6 @@ await useLazyAsyncData(`anpr-settings-${props.siteId}`, async () => {
410
410
  site: props.siteId,
411
411
  userType: "site",
412
412
  });
413
- console.log("data", data);
414
413
  if (typeof data?.ANPRSwitches == "object") {
415
414
  ANPRSwitches.value = data?.ANPRSwitches;
416
415
  }
@@ -431,7 +430,6 @@ const saveANPRSettings = async () => {
431
430
  updatedBy: props.createdBy,
432
431
  userType: "site",
433
432
  };
434
- console.log("saveANPRSettings data:", data);
435
433
  await createUpdateANPRSettings(data);
436
434
  show("Saved successfully", "success");
437
435
  } catch (error) {
@@ -433,6 +433,13 @@ const prop = defineProps({
433
433
  type: Object as PropType<Partial<TVehicle> | null>,
434
434
  default: null,
435
435
  },
436
+ // Id -> name for this record's block/level/unit, taken from the list row,
437
+ // which the API already resolved. Lets the dialog name a value its own
438
+ // dropdown cannot offer, instead of falling through to the raw id.
439
+ nameHints: {
440
+ type: Object as PropType<Record<string, string>>,
441
+ default: () => ({}),
442
+ },
436
443
  plateNumberId: {
437
444
  type: String,
438
445
  default: "",
@@ -538,14 +545,23 @@ const shouldShowField = (fieldKey: string): boolean => {
538
545
  * that list, which is how the Season Pass edit dialog came to show
539
546
  * `6a31fd37917fb18ef1a21a0a` in all three fields instead of names.
540
547
  *
541
- * Two different causes end in the same place, and neither is fixable in the
542
- * repository: the site list has simply not arrived yet, and - measured on
543
- * staging - a stored unit id that points at a building unit which has since
544
- * been DELETED, so it can NEVER appear in the list however the row is fetched.
548
+ * A Mongo id is never shown to a person. The name is available: the vehicle
549
+ * LIST resolves it server-side (`getVehicles` $lookup's buildings /
550
+ * building-levels / building-units) while the edit dialog's own fetch
551
+ * (`getSpecificVehicleById`, a plain findOne) returns raw ids. `VehicleManagement`
552
+ * therefore hands the already-resolved names down as `nameHints`, an id -> name
553
+ * map taken from the list row - no extra request, no change to what is stored.
554
+ *
555
+ * Three cases, in order:
556
+ * - the list has not arrived yet -> "Loading unit..."
557
+ * - a name is known but not in the list -> "Tower Ten (no longer selectable)"
558
+ * - no name can be found at all -> plain sentence, still no id
545
559
  *
546
- * So the fix is here, at the display layer: an id with no name gets an explicit
547
- * item saying why there is no name. A Mongo id is not a name, and a blank field
548
- * with no explanation is not better than one.
560
+ * Measured on staging, both non-loading cases are real. A block drops out of
561
+ * the picker once it has no ACTIVE units left (`getBuildingWithUnitsList` lists
562
+ * only buildings that still have units), so "Tower Ten" is a live building the
563
+ * form cannot offer; and a stored unit id can point at a building unit that has
564
+ * since been deleted, which no name lookup can answer.
549
565
  *
550
566
  * The stored value is left untouched - the field still submits the same id, so
551
567
  * saving an unrelated edit does not silently rewrite someone's unit.
@@ -554,29 +570,47 @@ function withUnresolved(
554
570
  items: TDefaultOptionObj[],
555
571
  value: unknown,
556
572
  pending: boolean,
557
- noun: string
573
+ noun: string,
574
+ nameHints: Record<string, string>
558
575
  ): TDefaultOptionObj[] {
559
- const id =
560
- typeof value === "string" ? value : ((value as any)?._id ?? "");
576
+ const id = idOf(value);
561
577
  if (!id || items.some((item) => item.value === id)) return items;
562
578
 
579
+ const name = nameHints[id];
580
+
581
+ // The id belongs in a log, not on screen. Support needs it; the property
582
+ // manager does not.
583
+ if (!pending && !name) {
584
+ console.warn(`[VehicleForm] no name resolved for ${noun} id ${id}`);
585
+ }
586
+
563
587
  return [
564
588
  {
565
589
  title: pending
566
- ? `Loading ${noun}…`
567
- : `This ${noun} is no longer on the site list (${id})`,
590
+ ? `Loading ${noun}...`
591
+ : name
592
+ ? `${name} (no longer selectable)`
593
+ : `This ${noun} is no longer on the site list`,
568
594
  value: id,
569
595
  },
570
596
  ...items,
571
597
  ];
572
598
  }
573
599
 
600
+ /** Block/level/unit arrive either as a raw id string or as a `{_id, name}` object. */
601
+ function idOf(value: unknown): string {
602
+ return typeof value === "string"
603
+ ? value
604
+ : String((value as any)?._id ?? "");
605
+ }
606
+
574
607
  const blockItems = computed(() =>
575
608
  withUnresolved(
576
609
  blocksArray.value,
577
610
  vehicle.block,
578
611
  blockListDataPending.value,
579
- "block"
612
+ "block",
613
+ prop.nameHints
580
614
  )
581
615
  );
582
616
 
@@ -585,7 +619,8 @@ const levelItems = computed(() =>
585
619
  levelsArray.value,
586
620
  vehicle.level,
587
621
  levelListDataPending.value,
588
- "level"
622
+ "level",
623
+ prop.nameHints
589
624
  )
590
625
  );
591
626
 
@@ -594,7 +629,8 @@ const unitItems = computed(() =>
594
629
  unitsArray.value,
595
630
  vehicle.unit,
596
631
  unitListDataPending.value,
597
- "unit"
632
+ "unit",
633
+ prop.nameHints
598
634
  )
599
635
  );
600
636
 
@@ -602,8 +638,11 @@ const searchUnitName = computed(() => {
602
638
  // Same rule as the fields: never put a raw id in front of a person. The
603
639
  // dialog title used to fall through to `vehicle.unit`, so a deleted unit
604
640
  // titled the panel with its ObjectId.
641
+ const id = idOf(vehicle.unit);
605
642
  return (
606
- unitsArray.value.find((u) => u.value === vehicle.unit)?.title || "-"
643
+ unitsArray.value.find((u) => u.value === id)?.title ||
644
+ prop.nameHints[id] ||
645
+ "-"
607
646
  );
608
647
  });
609
648
 
@@ -85,13 +85,13 @@
85
85
 
86
86
  <v-dialog v-model="dialog.createVehicle" v-if="vehicleType" width="450" persistent>
87
87
  <VehicleForm :type="vehicleType" :mode="mode" :vehicle-data="selectedVehicleObject"
88
- :plate-number-id="selectedPlateNumberId" @back="handleBackToSelection" @done="handleAddVehicleComplete"
88
+ :plate-number-id="selectedPlateNumberId" :name-hints="nameHints" @back="handleBackToSelection" @done="handleAddVehicleComplete"
89
89
  :org="org" :site="props.site" @close:all="handleCloseAll" />
90
90
  </v-dialog>
91
91
 
92
92
  <v-dialog v-model="dialog.updateVehicle" v-if="vehicleType" width="450" persistent>
93
93
  <VehicleForm :type="vehicleType" :mode="mode" :vehicle-data="selectedPlateNumberObject"
94
- :plate-number-id="selectedPlateNumberId" @back="handleBackToSelection" @done="handleAddVehicleComplete"
94
+ :plate-number-id="selectedPlateNumberId" :name-hints="nameHints" @back="handleBackToSelection" @done="handleAddVehicleComplete"
95
95
  :org="org" :site="props.site" @close:all="handleCloseAll" @close="handleCloseAll" />
96
96
  </v-dialog>
97
97
 
@@ -371,6 +371,34 @@ const selectedVehicleObject = computed(() => {
371
371
  return items.value.find(item => item?._id === selectedVehicleId.value) || {}
372
372
  })
373
373
 
374
+ /**
375
+ * The edit dialog fetches its record with `getSpecificVehicleById`, a plain
376
+ * findOne, so block/level/unit come back as raw ObjectIds. The LIST does the
377
+ * work already - `getVehicles` $lookup's buildings, building-levels and
378
+ * building-units, which is why this table can print "Tower Ten" for the same
379
+ * record. Hand those resolved names down so the dialog never has to fall back
380
+ * to an id it cannot name.
381
+ *
382
+ * Id -> name, not the objects themselves: the form binds ids, and passing a
383
+ * `{_id, name}` object into its autocompletes is what broke it before.
384
+ */
385
+ const nameHints = computed<Record<string, string>>(() => {
386
+ const plateId = selectedPlateNumberId.value;
387
+ const row: any =
388
+ items.value.find(
389
+ (r: any) =>
390
+ r?._id === plateId ||
391
+ (Array.isArray(r?.plates) && r.plates.some((p: any) => p?._id === plateId))
392
+ ) || selectedVehicleObject.value;
393
+
394
+ const hints: Record<string, string> = {};
395
+ for (const key of ["block", "level", "unit"]) {
396
+ const field = row?.[key];
397
+ if (field?._id && field?.name) hints[String(field._id)] = String(field.name);
398
+ }
399
+ return hints;
400
+ })
401
+
374
402
  const { data: getVehiclesReq, refresh: getVehiclesRefresh, pending: getVehiclesPending } =
375
403
  await useLazyAsyncData(
376
404
  `get-all-vehicles-${props.site}`,
@@ -1397,7 +1397,7 @@ async function proceedNonCheckedOutCheckout(visitorId: string) {
1397
1397
  }
1398
1398
  } catch (error: any) {
1399
1399
  const checkoutErrorMessage = error?.response?._data?.message;
1400
- console.log("[ERROR]", error);
1400
+ console.error("[ERROR]", error);
1401
1401
  errorMessage.value =
1402
1402
  checkoutErrorMessage || "An error occurred while checking out the vehicle.";
1403
1403
  } finally {
@@ -1425,7 +1425,7 @@ async function handleNfcReturnCheckout() {
1425
1425
  }
1426
1426
  } catch (error: any) {
1427
1427
  const checkoutErrorMessage = error?.response?._data?.message;
1428
- console.log("[ERROR]", error);
1428
+ console.error("[ERROR]", error);
1429
1429
  errorMessage.value =
1430
1430
  checkoutErrorMessage || "An error occurred while returning the NFC card.";
1431
1431
  } finally {
@@ -2085,12 +2085,6 @@ async function submit(options: { skipNonCheckedOutCheck?: boolean } = {}) {
2085
2085
  );
2086
2086
  continue;
2087
2087
  }
2088
- console.log(
2089
- "[QR Print] Sending to printer — accessLevel:",
2090
- qrCode.accessLevel,
2091
- "liftLevel:",
2092
- qrCode.liftAccessLevel
2093
- );
2094
2088
  const printResult = await testConnection(
2095
2089
  vendorId,
2096
2090
  productId,
@@ -2101,12 +2095,6 @@ async function submit(options: { skipNonCheckedOutCheck?: boolean } = {}) {
2101
2095
  companyName,
2102
2096
  address
2103
2097
  );
2104
- console.log(
2105
- "[QR Print] Print result for card",
2106
- qrCode._id,
2107
- ":",
2108
- printResult
2109
- );
2110
2098
  }
2111
2099
  }
2112
2100
  }
@@ -2395,10 +2383,6 @@ onMounted(() => {
2395
2383
  currentAutofillSource.value = null;
2396
2384
 
2397
2385
  if (prop.mode === "register" && prop.visitorData) {
2398
- console.log(
2399
- "Register mode, prefill visitor data",
2400
- prop.visitorData?.plateNumber
2401
- );
2402
2386
  visitor.plateNumber = prop.visitorData?.plateNumber || "";
2403
2387
  }
2404
2388
  });
@@ -2370,7 +2370,7 @@ async function proceedCheckout() {
2370
2370
  }
2371
2371
  } catch (error: any) {
2372
2372
  const errorMessage = error?.response?._data?.message;
2373
- console.log("[ERROR]", error);
2373
+ console.error("[ERROR]", error);
2374
2374
  showMessage(
2375
2375
  errorMessage || "Something went wrong. Please try again later.",
2376
2376
  "error"
@@ -72,7 +72,6 @@ const handleScanVisitorQRCode = async () => {
72
72
  async (qrCodeMessage: string) => {
73
73
  showNotFoundMessage.value = false;
74
74
  scannedValue.value = qrCodeMessage;
75
- console.log(`QR Code scanned: ${qrCodeMessage}`);
76
75
  setTimeout(() => {
77
76
  closeDialog();
78
77
  }, 100);
@@ -199,7 +199,7 @@ async function deleteFile(value: string) {
199
199
  (file) => file !== value
200
200
  );
201
201
  } catch (error) {
202
- console.log(error);
202
+ console.error(error);
203
203
  showMessage("Failed to delete file", "error");
204
204
  }
205
205
  }
@@ -227,7 +227,6 @@ async function submitWorkOrder() {
227
227
  let res: Record<string, any> = {};
228
228
 
229
229
  if (isEditMode.value) {
230
- console.log("updating...");
231
230
  res = await updateWorkOrder(workOrder.value._id as string, payload);
232
231
  } else {
233
232
  res = await createWorkOrder(payload);
@@ -458,7 +458,7 @@ async function deleteFile(value: string) {
458
458
  (file) => file !== value
459
459
  );
460
460
  } catch (error) {
461
- console.log(error);
461
+ console.error(error);
462
462
  showMessage("Failed to delete file", "error");
463
463
  }
464
464
  }
@@ -114,7 +114,7 @@ export default function useComment() {
114
114
  const seenBy = await updateSeenBy(updateSeenIds, currentUser.value?._id);
115
115
  }
116
116
  } catch (error) {
117
- console.log("error :", error);
117
+ console.error("error :", error);
118
118
  } finally {
119
119
  isCommentsLoaded.value = false;
120
120
  }
@@ -129,7 +129,6 @@ export default function useKey() {
129
129
  }
130
130
 
131
131
  function setKey(data?: TKeyLog) {
132
- console.log("data", data);
133
132
  keyLog.value = data || new MKeyLog();
134
133
  }
135
134
 
@@ -329,7 +328,6 @@ export default function useKey() {
329
328
  },
330
329
  });
331
330
  keyList.value = response;
332
- console.log("keyList", keyList.value);
333
331
  return response;
334
332
  }
335
333
 
@@ -351,7 +349,6 @@ export default function useKey() {
351
349
  },
352
350
  });
353
351
  keyList.value = response;
354
- console.log("keyList", keyList.value);
355
352
  return response;
356
353
  }
357
354
  return {
@@ -100,7 +100,6 @@ export default function usePassKey() {
100
100
  statuses,
101
101
  }) as any;
102
102
 
103
- console.log("_passKeys.items", _passKeys.items);
104
103
 
105
104
  passKeys.value = _passKeys.items as TPassKey[];
106
105
  pageRange.value = _passKeys.pageRange;
@@ -111,7 +111,7 @@ export default function useRole() {
111
111
  const _role = await getRoleById(res.role);
112
112
  Object.assign(role.value, _role);
113
113
  } catch (error) {
114
- console.log(error);
114
+ console.error(error);
115
115
  }
116
116
  }
117
117
 
@@ -69,7 +69,7 @@ export default function useUploadFiles() {
69
69
  results.push(fileId); // Collect the file ID
70
70
  files.value = [];
71
71
  } catch (e) {
72
- console.log("Error occurred while attaching images.", e);
72
+ console.error("Error occurred while attaching images.", e);
73
73
  }
74
74
  }
75
75
 
@@ -407,7 +407,6 @@ export default function useUtils() {
407
407
  const desiredDurationInSeconds = 24 * 60 * 60;
408
408
  const remainingTimeInSeconds =
409
409
  desiredDurationInSeconds - differenceInSeconds;
410
- console.log(remainingTimeInSeconds);
411
410
  return remainingTimeInSeconds;
412
411
  }
413
412
 
@@ -497,7 +496,7 @@ export default function useUtils() {
497
496
  const response = await fetch(url, { method: "GET" });
498
497
  return response.blob();
499
498
  } catch (error: any) {
500
- console.log(error);
499
+ console.error(error);
501
500
  }
502
501
  }
503
502
 
@@ -21,7 +21,6 @@ export default function useVerification() {
21
21
  }
22
22
 
23
23
  function cancelUserInvitation(id: string) {
24
- console.log("Calling API to cancel:", id);
25
24
  return useNuxtApp().$api<Record<string, any>>(
26
25
  `/api/verifications/${id}/cancel`,
27
26
  {
@@ -191,19 +191,15 @@ export default function useWebUsb() {
191
191
  }
192
192
  try {
193
193
  let devices = await navigator.usb.getDevices();
194
- console.log("[WebUSB] Available devices:", devices.map((d: USBDevice) => `${d.vendorId}:${d.productId}`));
195
194
  let device = devices.find(
196
195
  (d: USBDevice) => d.vendorId === vendorId && d.productId === productId,
197
196
  );
198
197
  if (!device) {
199
- console.log("[WebUSB] Device not in granted list, requesting permission for", vendorId, productId);
200
198
  device = await navigator.usb.requestDevice({
201
199
  filters: [{ vendorId, productId }],
202
200
  });
203
201
  }
204
- console.log("[WebUSB] Opening device:", device.vendorId, device.productId);
205
202
  await preparePrinterDevice(device);
206
- console.log("[WebUSB] Device opened and interface claimed.");
207
203
  return device;
208
204
  } catch (error: unknown) {
209
205
  console.error("Error connecting to USB device:", error);
@@ -511,9 +507,7 @@ export default function useWebUsb() {
511
507
  qrSubText?: string,
512
508
  ) => {
513
509
  try {
514
- console.log("[WebUSB] printQrCode start — doorLevel:", doorLevel, "liftLevel:", liftLevel, "company:", companyName, "address:", address);
515
510
  const { endpointNumber } = getPrinterConnection(device);
516
- console.log("[WebUSB] Using endpoint:", endpointNumber);
517
511
 
518
512
  const canvas = await createReceiptLayout(
519
513
  urlImage,
@@ -524,16 +518,12 @@ export default function useWebUsb() {
524
518
  qrHeader,
525
519
  qrSubText,
526
520
  );
527
- console.log("[WebUSB] Canvas created:", canvas.width, "x", canvas.height);
528
521
  const rasterData = canvasToRaster(canvas);
529
- console.log("[WebUSB] Raster data size:", rasterData.byteLength, "bytes");
530
522
 
531
523
  await device.transferOut(endpointNumber, rasterData.buffer);
532
- console.log("[WebUSB] Raster data sent.");
533
524
 
534
525
  const CUT = new Uint8Array([0x1d, 0x56, 0x41, 0x10]);
535
526
  await device.transferOut(endpointNumber, CUT.buffer);
536
- console.log("[WebUSB] Cut command sent.");
537
527
 
538
528
  return { success: true, message: "QR print sent successfully" };
539
529
  } catch (error: unknown) {
@@ -6,7 +6,6 @@ export default defineNuxtRouteMiddleware(async (route) => {
6
6
 
7
7
  const serviceProviderEmail = (route.query.email as string) ?? "";
8
8
 
9
- console.log(serviceProviderEmail);
10
9
 
11
10
  if (serviceProviderEmail) {
12
11
  useCookie("service-provider-email", cookieConfig).value =
@@ -9,10 +9,8 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
9
9
 
10
10
  const { organization, org } = to.params;
11
11
 
12
- // console.log('org-aut-middleware running', hexSchema.safeParse(organization).success)
13
12
 
14
13
  if (!hexSchema.safeParse(organization || org).success) {
15
- console.log('[02.org] middleware run')
16
14
  return navigateTo(
17
15
  { name: "require-organization-membership" },
18
16
  { replace: true }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.2.5-staging.270",
5
+ "version": "4.2.5-staging.272",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
@@ -234,9 +234,7 @@ export default defineNuxtPlugin((app) => {
234
234
  // hiddenTabs: ['upload'],
235
235
  divider: true,
236
236
  // upload(file: File) {
237
- // console.log("file :>> ", file);
238
237
  // const url = URL.createObjectURL(file);
239
- // console.log("mock upload api :>> ", url);
240
238
  // return Promise.resolve(url);
241
239
  // },
242
240
  upload(file: File) {