@7365admin1/core 3.122.1 → 3.122.2

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.mjs CHANGED
@@ -64698,6 +64698,16 @@ function padbotCanReachMap(maps, fromMapId, toMapId) {
64698
64698
  };
64699
64699
  return group(fromMapId) !== "" && group(fromMapId) === group(toMapId);
64700
64700
  }
64701
+ function padbotCurrentMap(maps, ids2, floor) {
64702
+ const list = (Array.isArray(maps) ? maps : []).filter((m) => typeof m?.mapId === "string" && m.mapId);
64703
+ for (const id of ids2) {
64704
+ const hit = typeof id === "string" && id ? list.find((m) => m.mapId === id) : null;
64705
+ if (hit)
64706
+ return hit;
64707
+ }
64708
+ const onFloor = Number.isInteger(floor) ? list.filter((m) => m.floor === floor) : [];
64709
+ return onFloor.length === 1 ? onFloor[0] : null;
64710
+ }
64701
64711
  var PADBOT_OTHER_MAP_TEXT = "The robot must be on this map first.";
64702
64712
  function padbotAlarmFault(alarm) {
64703
64713
  if (!alarm?.alarmType)
@@ -64996,11 +65006,13 @@ function createPadbotAdapter(credentials, options = {}) {
64996
65006
  ]);
64997
65007
  const lx = num(loc?.worldX ?? loc?.x);
64998
65008
  const ly = num(loc?.worldY ?? loc?.y);
65009
+ if (typeof loc?.mapId === "string" && loc.mapId)
65010
+ robot.mapId = loc.mapId;
65011
+ const map = await maps(robotSn).then((all) => padbotCurrentMap(all, [robot.mapId, st["1007"]?.mapId], robot.floorNo)).catch(() => null);
65012
+ if (map)
65013
+ robot.mapId = map.mapId;
64999
65014
  if (lx !== null && ly !== null) {
65000
65015
  robot.position = { x: lx, y: ly, theta: (num(loc.yaw ?? loc.r) ?? 0) * Math.PI / 180 };
65001
- if (typeof loc.mapId === "string" && loc.mapId)
65002
- robot.mapId = loc.mapId;
65003
- const map = await maps(robotSn).then((all) => (all ?? []).find((m) => m.mapId === (loc.mapId ?? st["1007"]?.mapId))).catch(() => null);
65004
65016
  robot.planPosition = padbotPlanShare(map, lx, ly);
65005
65017
  }
65006
65018
  if (!robot.position)
@@ -65185,6 +65197,27 @@ function registerPadbotBrand() {
65185
65197
  registerPadbotBrand();
65186
65198
 
65187
65199
  // src/services/robot-fleet.service.ts
65200
+ function fleetStateItem(id, s, lastSeenAt) {
65201
+ return {
65202
+ id,
65203
+ ok: true,
65204
+ monitorable: true,
65205
+ online: s.online,
65206
+ mode: s.mode,
65207
+ statusName: s.statusName,
65208
+ model: s.model,
65209
+ batteryPercent: s.batteryPercent,
65210
+ floorNo: s.floorNo,
65211
+ floorKnown: s.floorKnown,
65212
+ mapId: s.mapId ?? null,
65213
+ position: s.position,
65214
+ planPosition: s.planPosition,
65215
+ fault: s.fault,
65216
+ capabilities: s.capabilities,
65217
+ profile: s.profile,
65218
+ lastSeenAt: lastSeenAt ? new Date(lastSeenAt) : null
65219
+ };
65220
+ }
65188
65221
  var OUNITECH_REGION_BASE_URLS = [
65189
65222
  "https://app.frankfurt.robotcloud.top",
65190
65223
  "https://app.singapore.robotcloud.top",
@@ -69987,24 +70020,7 @@ async function readLiveItems(robots) {
69987
70020
  if (s.fault)
69988
70021
  void notifyRobotFault(robot, s.fault);
69989
70022
  const seen2 = liveEntry(id)?.lastSeenAt;
69990
- items.push({
69991
- id,
69992
- ok: true,
69993
- monitorable: true,
69994
- online: s.online,
69995
- mode: s.mode,
69996
- statusName: s.statusName,
69997
- model: s.model,
69998
- batteryPercent: s.batteryPercent,
69999
- floorNo: s.floorNo,
70000
- floorKnown: s.floorKnown,
70001
- position: s.position,
70002
- planPosition: s.planPosition,
70003
- fault: s.fault,
70004
- capabilities: s.capabilities,
70005
- profile: s.profile,
70006
- lastSeenAt: seen2 ? new Date(seen2) : null
70007
- });
70023
+ items.push(fleetStateItem(id, s, seen2));
70008
70024
  } catch (e) {
70009
70025
  const text2 = String(e?.message ?? "");
70010
70026
  items.push({
@@ -104912,6 +104928,7 @@ export {
104912
104928
  ffmpegFrameArgs,
104913
104929
  ffmpegPath,
104914
104930
  filterByAccess,
104931
+ fleetStateItem,
104915
104932
  floorNoOf,
104916
104933
  floorPlanBodySchema,
104917
104934
  flushNotificationEmails,
@@ -105037,6 +105054,7 @@ export {
105037
105054
  padbotCanReachMap,
105038
105055
  padbotCheckpointVisit,
105039
105056
  padbotCommandLog,
105057
+ padbotCurrentMap,
105040
105058
  padbotDriveBlock,
105041
105059
  padbotDriveLimits,
105042
105060
  padbotDriveSignal,