@7365admin1/core 3.32.2-staging.75 → 3.32.2-staging.76

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.
@@ -0,0 +1,19 @@
1
+ ---
2
+ "@7365admin1/core": patch
3
+ ---
4
+
5
+ Stop logging camera and mailer credentials
6
+
7
+ Six places wrote a secret or a resident's details to stdout on an ordinary code
8
+ path. `getTrafficJunction` dumped the whole `TSiteCamera` object — including the
9
+ camera's `username` and plaintext `password` — on every reconnect, and
10
+ `addPlateNumber` logged its argument, which carries the same password plus a
11
+ resident's plate number and owner name. `checkOutBySiteAndPlate` logged the
12
+ matched visitor transaction. `siteCameraRepo.updateById` logged the re-read
13
+ camera document, and `vehicleService.add` logged the whole array of a site's
14
+ cameras, both with credentials in them. `sendEmail` printed `MAILER_PASSWORD`
15
+ itself on every message sent.
16
+
17
+ All now log identifiers, counts and outcomes only, through the module's logger
18
+ rather than `console.log`; the mailer line is removed outright because it
19
+ carried nothing but the secret.
package/dist/index.js CHANGED
@@ -22700,7 +22700,6 @@ async function sendEmail({ to, subject, text, html }) {
22700
22700
  pass: MAILER_PASSWORD
22701
22701
  }
22702
22702
  });
22703
- console.log(MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT);
22704
22703
  const mailOptions = {
22705
22704
  from: `Seven 365 <${MAILER_EMAIL}>`,
22706
22705
  to,
@@ -24970,7 +24969,9 @@ function useDahuaService() {
24970
24969
  return;
24971
24970
  try {
24972
24971
  const result = await _checkOutBySiteAndPlate(site, plateNumber2);
24973
- console.log("checkOutBySiteAndPlate result", result);
24972
+ loggerDahua.info(
24973
+ `checkOutBySiteAndPlate matched=${Boolean(result)} type=${result?.type ?? "none"}`
24974
+ );
24974
24975
  if (onDetected2 && result?.type != "resident" && result?.site) {
24975
24976
  onDetected2({ reload: true, site: result?.site?.toString(), siteName: camera?.siteName, cameraDirection: camera?.direction, direction });
24976
24977
  }
@@ -25269,7 +25270,9 @@ function useDahuaService() {
25269
25270
  );
25270
25271
  }
25271
25272
  async function getTrafficJunction(camera, signal, onDetected) {
25272
- console.log(`getTrafficJunction camera object`, camera);
25273
+ loggerDahua.info(
25274
+ `getTrafficJunction starting for camera ${camera?._id} [${camera?.siteName}-${camera?.direction}] host ${camera?.host}`
25275
+ );
25273
25276
  let authFailureCount = 0;
25274
25277
  let connectionFailureCount = 0;
25275
25278
  let alertedFailureCount = 0;
@@ -25456,7 +25459,9 @@ function useDahuaService() {
25456
25459
  return match ? match[1] : null;
25457
25460
  }
25458
25461
  async function addPlateNumber(value) {
25459
- console.log("addPlateNumber called with value:", value);
25462
+ loggerDahua.info(
25463
+ `addPlateNumber called for host ${value?.host} mode ${value?.mode}`
25464
+ );
25460
25465
  let recno = null;
25461
25466
  const validation = import_joi40.default.object({
25462
25467
  host: import_joi40.default.string().required(),
@@ -26116,7 +26121,7 @@ function useSiteCameraRepo() {
26116
26121
  }
26117
26122
  if (result?._id) {
26118
26123
  const result2 = await findOne({ _id: new import_mongodb46.ObjectId(result._id) }, void 0, { session });
26119
- console.log("updateById result2", result2);
26124
+ import_node_server_utils74.logger.info(`Site camera ${result2?._id} re-read after update; reconnecting listener`);
26120
26125
  if (result2?._id) {
26121
26126
  const { listenToCamera } = useDahuaService();
26122
26127
  await listenToCamera(result2);
@@ -27642,7 +27647,9 @@ function useVehicleService() {
27642
27647
  siteCameras.push(...siteCameraReq.items);
27643
27648
  page++;
27644
27649
  } while (page <= pages);
27645
- console.log("add vehicle service siteCameras", siteCameras);
27650
+ import_node_server_utils78.logger.info(
27651
+ `addVehicle resolved ${siteCameras.length} site camera(s) for site ${value?.site}`
27652
+ );
27646
27653
  }
27647
27654
  for (const plateNumber of plateNumbers) {
27648
27655
  const vehicleValue = {