@7365admin1/core 3.133.1 → 3.134.0

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
@@ -323,6 +323,7 @@ __export(src_exports, {
323
323
  ROBOT_TYPES: () => ROBOT_TYPES,
324
324
  RobotCloudError: () => RobotCloudError,
325
325
  RobotCredentialsError: () => RobotCredentialsError,
326
+ SECRET_SETTING: () => SECRET_SETTING,
326
327
  SELF_SERVICE_RESEND_COOLDOWN_MS: () => SELF_SERVICE_RESEND_COOLDOWN_MS,
327
328
  SELF_SIGNUP_PLATFORM: () => SELF_SIGNUP_PLATFORM,
328
329
  SELF_SIGNUP_STATUS: () => SELF_SIGNUP_STATUS,
@@ -619,18 +620,26 @@ __export(src_exports, {
619
620
  orgRoleSets: () => orgRoleSets,
620
621
  orgSchema: () => orgSchema,
621
622
  ounitechAlertRecord: () => ounitechAlertRecord,
623
+ ounitechAppAction: () => ounitechAppAction,
622
624
  ounitechCleaning: () => ounitechCleaning,
623
625
  ounitechConsumable: () => ounitechConsumable,
624
626
  ounitechCurrentMap: () => ounitechCurrentMap,
625
627
  ounitechFault: () => ounitechFault,
628
+ ounitechFloorMapHistory: () => ounitechFloorMapHistory,
626
629
  ounitechJobWords: () => ounitechJobWords,
627
630
  ounitechMapShare: () => ounitechMapShare,
631
+ ounitechMapVersion: () => ounitechMapVersion,
628
632
  ounitechMapView: () => ounitechMapView,
633
+ ounitechObstacleImage: () => ounitechObstacleImage,
629
634
  ounitechPowerPlan: () => ounitechPowerPlan,
630
635
  ounitechReadings: () => ounitechReadings,
631
636
  ounitechRobotFromHomeRow: () => ounitechRobotFromHomeRow,
637
+ ounitechSettings: () => ounitechSettings,
638
+ ounitechShapes: () => ounitechShapes,
639
+ ounitechStatusLog: () => ounitechStatusLog,
632
640
  ounitechTaskRecord: () => ounitechTaskRecord,
633
641
  ounitechTime: () => ounitechTime,
642
+ ounitechTrack: () => ounitechTrack,
634
643
  overnight_parking_requests_namespace_collection: () => overnight_parking_requests_namespace_collection,
635
644
  padbotAccountKey: () => padbotAccountKey,
636
645
  padbotAlarmFault: () => padbotAlarmFault,
@@ -64262,6 +64271,17 @@ var ROBOT_CLOUD_PATHS = {
64262
64271
  workHours: "/portal/workhours/get-work-hours",
64263
64272
  haltPlans: "/portal/halt-plan/get",
64264
64273
  stationState: "/portal/detailstate/get-station-detail-state",
64274
+ // Read-only map layers and logs (2026-09-30: every read in the document is used).
64275
+ wallList: "/portal/maps/get-wall-list",
64276
+ safeZoneList: "/portal/maps/get-safezone-list",
64277
+ slowZoneList: "/portal/maps/get-slowzone-list",
64278
+ obstacleLayer: "/portal/obstacles/get-obstacle-layer",
64279
+ teachTrack: "/portal/teach/get-teach-track",
64280
+ mapVersions: "/portal/maps/get-map-version-list",
64281
+ floorMapHistory: "/portal/maps/v2405/get-floor-maplist",
64282
+ robotLog: "/portal/report/get-robot-log-list",
64283
+ userLog: "/portal/userlog/get-user-logs",
64284
+ cleaningSetting: "/portal/setting/get-cleaning-setting",
64265
64285
  mapList: "/portal/maps/get-map-list",
64266
64286
  fileUrl: "/portal/maps/get-file-url",
64267
64287
  tracking: "/portal/robots/tracking",
@@ -64562,7 +64582,17 @@ var STEP_NAMES = {
64562
64582
  [ROBOT_CLOUD_PATHS.haltPlans]: "the power schedule",
64563
64583
  [ROBOT_CLOUD_PATHS.stationState]: "the base station state",
64564
64584
  [ROBOT_CLOUD_PATHS.alertList]: "the alert history",
64565
- [ROBOT_CLOUD_PATHS.liftList]: "the lift list"
64585
+ [ROBOT_CLOUD_PATHS.liftList]: "the lift list",
64586
+ [ROBOT_CLOUD_PATHS.wallList]: "the virtual walls",
64587
+ [ROBOT_CLOUD_PATHS.safeZoneList]: "the safe zones",
64588
+ [ROBOT_CLOUD_PATHS.slowZoneList]: "the slow zones",
64589
+ [ROBOT_CLOUD_PATHS.obstacleLayer]: "the obstacle layer",
64590
+ [ROBOT_CLOUD_PATHS.teachTrack]: "the taught route",
64591
+ [ROBOT_CLOUD_PATHS.mapVersions]: "the map versions",
64592
+ [ROBOT_CLOUD_PATHS.floorMapHistory]: "the floor's map history",
64593
+ [ROBOT_CLOUD_PATHS.robotLog]: "the robot status log",
64594
+ [ROBOT_CLOUD_PATHS.userLog]: "the app action log",
64595
+ [ROBOT_CLOUD_PATHS.cleaningSetting]: "the robot settings"
64566
64596
  };
64567
64597
  var robotCloudStepName = (path5) => STEP_NAMES[path5] ?? path5;
64568
64598
  var SUCCESS_CODES = /* @__PURE__ */ new Set(["0", "200"]);
@@ -64782,6 +64812,40 @@ function useRobotCloudService(credentials, options = {}) {
64782
64812
  );
64783
64813
  return data.state ?? null;
64784
64814
  }
64815
+ async function getMapShapes(kind, mapId) {
64816
+ const [path5, list] = kind === "walls" ? [ROBOT_CLOUD_PATHS.wallList, "wallList"] : kind === "safe" ? [ROBOT_CLOUD_PATHS.safeZoneList, "safeZoneList"] : [ROBOT_CLOUD_PATHS.slowZoneList, "slowZoneList"];
64817
+ const data = await post(path5, { mapId }, list);
64818
+ return Array.isArray(data[list]) ? data[list] : [];
64819
+ }
64820
+ async function getObstacleLayer(robotId) {
64821
+ return post(ROBOT_CLOUD_PATHS.obstacleLayer, { robotId, version: 0 });
64822
+ }
64823
+ async function getTeachTrack(robotId, offset) {
64824
+ return post(ROBOT_CLOUD_PATHS.teachTrack, { robotId, offset }, "trackList");
64825
+ }
64826
+ async function getMapVersions(mapId) {
64827
+ return post(ROBOT_CLOUD_PATHS.mapVersions, { mapId }, "versionList");
64828
+ }
64829
+ async function getFloorMapHistory(sceneId, floorNo2) {
64830
+ return post(ROBOT_CLOUD_PATHS.floorMapHistory, { sceneId, floorNo: floorNo2 }, "mapList");
64831
+ }
64832
+ async function getRobotLog(robotId, sceneId, timeFrom, timeTo) {
64833
+ return post(
64834
+ ROBOT_CLOUD_PATHS.robotLog,
64835
+ { robotId: String(robotId), sceneId: String(sceneId), timeFrom, timeTo, key: "", pageNo: 1, pageSize: 50 },
64836
+ "logList"
64837
+ );
64838
+ }
64839
+ async function getUserLogs(robotId, startTime, endTime) {
64840
+ return post(
64841
+ ROBOT_CLOUD_PATHS.userLog,
64842
+ { robotId, pageNo: 1, pageSize: 50, startTime, endTime, keyword: "" },
64843
+ "actionList"
64844
+ );
64845
+ }
64846
+ async function getCleaningSetting(robotId) {
64847
+ return post(ROBOT_CLOUD_PATHS.cleaningSetting, { robotId });
64848
+ }
64785
64849
  async function getMaps(robotSn) {
64786
64850
  const data = await post(
64787
64851
  ROBOT_CLOUD_PATHS.mapList,
@@ -64867,6 +64931,14 @@ function useRobotCloudService(credentials, options = {}) {
64867
64931
  getHaltPlans,
64868
64932
  getStationState,
64869
64933
  getLiftList,
64934
+ getMapShapes,
64935
+ getObstacleLayer,
64936
+ getTeachTrack,
64937
+ getMapVersions,
64938
+ getFloorMapHistory,
64939
+ getRobotLog,
64940
+ getUserLogs,
64941
+ getCleaningSetting,
64870
64942
  getMaps,
64871
64943
  getFileUrls,
64872
64944
  getPlans,
@@ -65061,22 +65133,48 @@ function ounitechFault(list) {
65061
65133
  return { code: "error", message: String(list[0]).slice(0, 200) };
65062
65134
  return { code: "error", message: "The robot reports an error" };
65063
65135
  }
65064
- function ounitechMapShare(map, x, y) {
65136
+ function ounitechMapShare(map, x, y, clamp4 = false) {
65065
65137
  const w = map?.width, h = map?.height, r = map?.resolution;
65066
65138
  const wx = num(x), wy = num(y);
65067
65139
  if (!finite(w) || !finite(h) || !finite(r) || w <= 0 || h <= 0 || r <= 0 || wx === void 0 || wy === void 0)
65068
65140
  return null;
65069
- const sx = (wx - (num(map?.originX) ?? 0)) / r / w * 100;
65070
- const sy = 100 - (wy - (num(map?.originY) ?? 0)) / r / h * 100;
65141
+ let sx = (wx - (num(map?.originX) ?? 0)) / r / w * 100;
65142
+ let sy = 100 - (wy - (num(map?.originY) ?? 0)) / r / h * 100;
65143
+ if (clamp4)
65144
+ sx = Math.min(100, Math.max(0, sx)), sy = Math.min(100, Math.max(0, sy));
65071
65145
  if (sx < 0 || sx > 100 || sy < 0 || sy > 100)
65072
65146
  return null;
65073
65147
  return { x: Math.round(sx * 100) / 100, y: Math.round(sy * 100) / 100 };
65074
65148
  }
65075
- function ounitechMapView(m, imageUrl, partitionImageUrl, size) {
65149
+ var SHAPE_WORDS = { wall: "Virtual wall", safe: "Safe zone", slow: "Slow zone" };
65150
+ function ounitechShapes(map, kind, list) {
65151
+ return (Array.isArray(list) ? list : []).flatMap((z5, i) => {
65152
+ const points = (Array.isArray(z5?.pointList) ? z5.pointList : []).flatMap((p) => {
65153
+ const at2 = Array.isArray(p) ? ounitechMapShare(map, p[0], p[1], true) : null;
65154
+ return at2 ? [at2] : [];
65155
+ });
65156
+ const name = String(z5?.wallName ?? z5?.zoneName ?? "").trim();
65157
+ return points.length >= 2 ? [{ kind, name: name || `${SHAPE_WORDS[kind]} ${i + 1}`, points }] : [];
65158
+ });
65159
+ }
65160
+ function ounitechTrack(map, list) {
65161
+ const on = (Array.isArray(list) ? list : []).filter((p) => p && (p.mapid == null || String(p.mapid) === map?.mapId));
65162
+ const step = Math.max(1, Math.ceil(on.length / 500));
65163
+ return on.filter((_, i) => i % step === 0).flatMap((p) => {
65164
+ const at2 = ounitechMapShare(map, p.x, p.y, true);
65165
+ return at2 ? [at2] : [];
65166
+ });
65167
+ }
65168
+ function ounitechMapView(m, imageUrl, partitionImageUrl, size, shapes = {}) {
65076
65169
  const floorNo2 = Number.isInteger(m.floorNo) ? m.floorNo : null;
65077
65170
  const width = size?.width ?? null;
65078
65171
  const height = size?.height ?? null;
65079
65172
  const frame2 = { width, height, resolution: m.resolution, originX: m.originX, originY: m.originY };
65173
+ const zones = [
65174
+ ...ounitechShapes(frame2, "wall", Array.isArray(shapes.walls) && shapes.walls.length ? shapes.walls : m.wallList),
65175
+ ...ounitechShapes(frame2, "safe", shapes.safe),
65176
+ ...ounitechShapes(frame2, "slow", shapes.slow)
65177
+ ];
65080
65178
  const areas = (Array.isArray(m.areaList) ? m.areaList : []).filter((a) => typeof a?.areaName === "string" && a.areaName.trim()).map((a) => {
65081
65179
  const px = num(a.x), py = num(a.y);
65082
65180
  const at2 = width && height && px !== void 0 && py !== void 0 && (px > 0 || py > 0) && px <= width && py <= height ? { x: Math.round(px / width * 1e4) / 100, y: Math.round(py / height * 1e4) / 100 } : null;
@@ -65106,7 +65204,11 @@ function ounitechMapView(m, imageUrl, partitionImageUrl, size) {
65106
65204
  positionApproximate: true,
65107
65205
  // The raw areas, kept for older screens.
65108
65206
  areaList: areas.map(({ at: _at, ...a }) => a),
65109
- areas: areas.map((a) => ({ name: a.areaName, at: a.at }))
65207
+ areas: areas.map((a) => ({ name: a.areaName, at: a.at })),
65208
+ /** Virtual walls (the robot never crosses), safe zones and slow zones, drawn on the map. */
65209
+ zones,
65210
+ /** The route the robot was taught (get-teach-track), set per robot by getMaps. */
65211
+ taughtRoute: []
65110
65212
  };
65111
65213
  }
65112
65214
  function ounitechCurrentMap(maps, taskMapId, floorNo2) {
@@ -65333,10 +65435,115 @@ function ounitechPowerPlan(p) {
65333
65435
  enabled: p.enableFlag !== false
65334
65436
  };
65335
65437
  }
65438
+ function ounitechStatusLog(l, tz = 480) {
65439
+ const code = num(l.typeFlag);
65440
+ const words = code !== void 0 ? ROBOT_STATUS_NAMES[code] : void 0;
65441
+ return {
65442
+ at: ounitechTime(l.timeFrom, tz),
65443
+ status: words ? code === 15 || code === 16 ? `${words} (mid-job)` : words : String(l.typeName ?? "").trim() || `Status ${l.typeFlag ?? "?"}`
65444
+ };
65445
+ }
65446
+ var ACTION_WORDS = {
65447
+ \u539F\u5730\u505C\u6B62: "Stopped in place",
65448
+ \u4E0B\u53D1\u6E05\u6D01: "Started a cleaning job",
65449
+ \u793A\u6559\u8DEF\u5F84\u63A7\u5236: "Controlled a taught route",
65450
+ \u6682\u505C: "Paused",
65451
+ \u7EE7\u7EED: "Resumed",
65452
+ \u56DE\u5145: "Sent back to charge",
65453
+ \u7ED3\u675F\u6E05\u6D01: "Ended the cleaning job",
65454
+ \u5F00\u673A: "Switched on",
65455
+ \u5173\u673A: "Switched off"
65456
+ };
65457
+ function ounitechAppAction(a, tz = 480) {
65458
+ const raw = String(a.actionName ?? "").trim();
65459
+ return {
65460
+ at: ounitechTime(a.createTime, tz),
65461
+ action: ACTION_WORDS[raw] ?? (raw ? /[㐀-鿿]/.test(raw) ? `App action: ${raw}` : raw : "App action"),
65462
+ by: String(a.userName ?? "").trim() || null
65463
+ };
65464
+ }
65465
+ function ounitechMapVersion(v, tz = 480) {
65466
+ return { version: num(v.versionNo) ?? null, latest: v.latestFlag === true, createdAt: ounitechTime(v.createTime, tz) };
65467
+ }
65468
+ function ounitechFloorMapHistory(m, tz = 480) {
65469
+ const area = num(m.totalArea);
65470
+ return {
65471
+ name: String(m.mapName ?? "").trim() || `Map ${m.mapId ?? ""}`.trim(),
65472
+ areaM2: area !== void 0 ? Math.round(area * 10) / 10 : null,
65473
+ latest: m.latestFlag === true,
65474
+ inUse: m.enableFlag === true,
65475
+ createdAt: ounitechTime(m.createTime, tz),
65476
+ updatedAt: ounitechTime(m.updateTime, tz)
65477
+ };
65478
+ }
65479
+ var SETTINGS = {
65480
+ soundLevel: { group: "Sound", label: "Sound level", unit: "%" },
65481
+ enableWorkSound: { group: "Sound", label: "Sounds while working" },
65482
+ clean_speed_mode: { group: "Cleaning", label: "Cleaning speed" },
65483
+ fanLevel: { group: "Cleaning", label: "Suction level" },
65484
+ waterGear: { group: "Cleaning", label: "Water level" },
65485
+ planningWidth: { group: "Cleaning", label: "Cleaning path width" },
65486
+ alongWallFlag: { group: "Cleaning", label: "Edge cleaning" },
65487
+ alongWallDistance: { group: "Cleaning", label: "Edge distance" },
65488
+ enablePlanFlag: { group: "Cleaning", label: "Schedules switched on" },
65489
+ slowZoneSpeed: { group: "Cleaning", label: "Speed in slow zones", unit: "m/s" },
65490
+ minCleanBatteryPerc: { group: "Battery", label: "Lowest battery to start cleaning", unit: "%" },
65491
+ normalCleanBatteryPerc: { group: "Battery", label: "Normal cleaning battery", unit: "%" },
65492
+ backChargeThreshold: { group: "Battery", label: "Return-to-charge battery level", unit: "%" },
65493
+ chargeCompIntervalDay: { group: "Battery", label: "Full charge every", unit: "days" },
65494
+ obsAvoidSens: { group: "Safety", label: "Obstacle avoidance sensitivity" },
65495
+ obsDetectionHeight: { group: "Safety", label: "Obstacle detection height" },
65496
+ enableCliffDetect: { group: "Safety", label: "Cliff (drop) detection" },
65497
+ ultrasonicSwitch: { group: "Safety", label: "Ultrasonic sensors" },
65498
+ panicButtonMode: { group: "Safety", label: "Emergency button mode" },
65499
+ autoUpdateMap: { group: "Maps", label: "Update the map automatically" },
65500
+ autoUpdateVirtualWall: { group: "Maps", label: "Update virtual walls automatically" },
65501
+ autoUpdateZoneMap: { group: "Maps", label: "Update the area map automatically" },
65502
+ stationAutoDrain: { group: "Base station", label: "Station drains automatically" },
65503
+ language: { group: "Robot", label: "Robot language" },
65504
+ timeZone: { group: "Robot", label: "Robot time zone" }
65505
+ };
65506
+ var SECRET_SETTING = /wifi|pwd|password|secret|token/i;
65507
+ var LANG_WORDS = { zh: "Chinese", en: "English" };
65508
+ function ounitechSettings(s) {
65509
+ const out = [];
65510
+ for (const [key, v] of Object.entries(s ?? {})) {
65511
+ if (key === "ok" || key === "msg" || SECRET_SETTING.test(key) || v == null || typeof v === "object")
65512
+ continue;
65513
+ const raw = String(v).trim();
65514
+ if (raw === "")
65515
+ continue;
65516
+ const d = SETTINGS[key] ?? { group: "Other settings", label: key };
65517
+ let value;
65518
+ if (typeof v === "boolean")
65519
+ value = v ? "On" : "Off";
65520
+ else if (key === "language")
65521
+ value = LANG_WORDS[raw] ?? raw;
65522
+ else if (key === "timeZone" && num(raw) !== void 0)
65523
+ value = `UTC${num(raw) >= 0 ? "+" : ""}${raw}`;
65524
+ else
65525
+ value = d.unit ? `${raw} ${d.unit}` : raw;
65526
+ out.push({ key, group: d.group, label: d.label, value, attention: false });
65527
+ }
65528
+ const order = ["Cleaning", "Battery", "Safety", "Maps", "Sound", "Base station", "Robot", "Other settings"];
65529
+ return out.sort((a, b) => order.indexOf(a.group) - order.indexOf(b.group));
65530
+ }
65531
+ function ounitechObstacleImage(o) {
65532
+ const b64 = typeof o?.image === "string" ? o.image.replace(/^data:image\/\w+;base64,/, "").trim() : "";
65533
+ if (!b64 || !/^[A-Za-z0-9+/=\s]+$/.test(b64.slice(0, 200)))
65534
+ return null;
65535
+ if (b64.length > 15e5)
65536
+ return { version: num(o?.version) ?? null, image: null, tooLarge: true };
65537
+ const type = b64.startsWith("/9j/") ? "jpeg" : "png";
65538
+ return { version: num(o?.version) ?? null, image: `data:image/${type};base64,${b64}`, tooLarge: false };
65539
+ }
65336
65540
  var MAP_TTL_MS = 10 * 6e4;
65337
65541
  var RECORDS_TTL_MS = 2 * 6e4;
65338
65542
  var mapCache = /* @__PURE__ */ new Map();
65339
65543
  var recordsCache = /* @__PURE__ */ new Map();
65544
+ var SLOW_TTL_MS = 10 * 6e4;
65545
+ var slowCache = /* @__PURE__ */ new Map();
65546
+ var trackCache = /* @__PURE__ */ new Map();
65340
65547
  function cached2(cache3, field, key, ttl, load) {
65341
65548
  const hit = cache3.get(key);
65342
65549
  if (hit && Date.now() - hit.at < ttl)
@@ -65349,6 +65556,8 @@ function cached2(cache3, field, key, ttl, load) {
65349
65556
  function clearOunitechCaches() {
65350
65557
  mapCache.clear();
65351
65558
  recordsCache.clear();
65559
+ slowCache.clear();
65560
+ trackCache.clear();
65352
65561
  }
65353
65562
  var robotTime = (d) => robotCloudTimestamp(d, "yyyy-MM-dd HH:mm:ss", "Asia/Shanghai");
65354
65563
  function createOunitechAdapter(credentials, options) {
@@ -65362,12 +65571,15 @@ function createOunitechAdapter(credentials, options) {
65362
65571
  const keys = list.flatMap((m) => [m.backgroundFileKey, m.partitionFileKey]).filter((k) => typeof k === "string" && !!k);
65363
65572
  const files = keys.length ? await cloud.previewFiles(keys).catch(() => []) : [];
65364
65573
  const url2 = (k) => files.find((f) => f.fileKey === k)?.url || null;
65365
- return Promise.all(
65366
- list.map(async (m) => {
65367
- const imageUrl = url2(m.backgroundFileKey);
65368
- return ounitechMapView(m, imageUrl, url2(m.partitionFileKey), imageUrl ? await fetchPngSize(imageUrl) : null);
65369
- })
65370
- );
65574
+ const views = [];
65575
+ for (const m of list) {
65576
+ const imageUrl = url2(m.backgroundFileKey);
65577
+ const id = num(m.mapId);
65578
+ const layer = (kind) => id !== void 0 ? cloud.getMapShapes(kind, id).catch(() => []) : Promise.resolve([]);
65579
+ const shapes = { walls: await layer("walls"), safe: await layer("safe"), slow: await layer("slow") };
65580
+ views.push(ounitechMapView(m, imageUrl, url2(m.partitionFileKey), imageUrl ? await fetchPngSize(imageUrl) : null, shapes));
65581
+ }
65582
+ return views;
65371
65583
  });
65372
65584
  }
65373
65585
  async function placed(row, robot) {
@@ -65381,6 +65593,40 @@ function createOunitechAdapter(credentials, options) {
65381
65593
  robot.planPosition = robot.position ? ounitechMapShare(map, robot.position.x, robot.position.y) : null;
65382
65594
  return robot;
65383
65595
  }
65596
+ async function slowRecords(robotSn) {
65597
+ const row = await rowFor(robotSn);
65598
+ if (!row || !finite(row.robotId))
65599
+ return {};
65600
+ const robotId = row.robotId;
65601
+ const tz = finite(row.timezone) ? row.timezone : 480;
65602
+ const now = /* @__PURE__ */ new Date();
65603
+ const since = (days) => robotTime(new Date(now.getTime() - days * 864e5));
65604
+ const part = async (read2) => {
65605
+ try {
65606
+ return { items: await read2() };
65607
+ } catch (e) {
65608
+ return { items: [], error: String(e?.message ?? e).slice(0, 300) };
65609
+ }
65610
+ };
65611
+ const maps = finite(row.sceneId) ? await floorMaps(row.sceneId).catch(() => []) : [];
65612
+ const map = ounitechCurrentMap(maps, row.taskState?.mapId, Number.isInteger(row.floorNo) ? row.floorNo : null);
65613
+ const mapId = map ? num(map.mapId) : void 0;
65614
+ const floorNo2 = map?.floorNo ?? (Number.isInteger(row.floorNo) ? row.floorNo : null);
65615
+ const sceneId = finite(row.sceneId) ? row.sceneId : null;
65616
+ const statusLog = sceneId !== null ? await part(async () => ((await cloud.getRobotLog(robotId, sceneId, since(7), robotTime(now))).logList ?? []).map((l) => ounitechStatusLog(l, tz))) : { items: [] };
65617
+ const appActions = await part(async () => ((await cloud.getUserLogs(robotId, since(30), robotTime(now))).actionList ?? []).map((a) => ounitechAppAction(a, tz)));
65618
+ const settings = await part(async () => ounitechSettings(await cloud.getCleaningSetting(robotId)));
65619
+ const obstacles = await part(async () => {
65620
+ const o = ounitechObstacleImage(await cloud.getObstacleLayer(robotId));
65621
+ return o ? [o] : [];
65622
+ });
65623
+ const mapVersions = mapId !== void 0 ? await part(async () => ((await cloud.getMapVersions(mapId)).versionList ?? []).map((v) => ounitechMapVersion(v, tz))) : { items: [] };
65624
+ const mapHistory = sceneId !== null && floorNo2 !== null ? await part(async () => ((await cloud.getFloorMapHistory(sceneId, floorNo2)).mapList ?? []).map((m) => ounitechFloorMapHistory(m, tz))) : { items: [] };
65625
+ const mapLayers = {
65626
+ items: map ? [{ map: map.mapDisplayName || null, zones: map.zones.map((z5) => ({ kind: z5.kind, name: z5.name })) }] : []
65627
+ };
65628
+ return { statusLog, appActions, settings, obstacles, mapVersions, mapHistory, mapLayers };
65629
+ }
65384
65630
  async function rowFor(robotSn) {
65385
65631
  return (await cloud.getHomeRobots()).find((r) => r.robotSn === robotSn) ?? null;
65386
65632
  }
@@ -65444,7 +65690,18 @@ function createOunitechAdapter(credentials, options) {
65444
65690
  const row = await rowFor(robotSn);
65445
65691
  if (!row || !finite(row.sceneId))
65446
65692
  return [];
65447
- return floorMaps(row.sceneId);
65693
+ const maps = await floorMaps(row.sceneId);
65694
+ const robotId = row.robotId;
65695
+ if (!finite(robotId))
65696
+ return maps;
65697
+ const track = await cached2(
65698
+ trackCache,
65699
+ "value",
65700
+ `${options?.baseUrl ?? ""}|${credentials.appid}|${robotId}`,
65701
+ SLOW_TTL_MS,
65702
+ async () => (await cloud.getTeachTrack(robotId, robotTime(new Date(Date.now() - 365 * 864e5)))).trackList ?? []
65703
+ ).catch(() => []);
65704
+ return maps.map((m) => ({ ...m, taughtRoute: ounitechTrack(m, track) }));
65448
65705
  },
65449
65706
  async getMapImages(_robotSn, fileKeys) {
65450
65707
  return cloud.previewFiles(fileKeys);
@@ -65470,7 +65727,7 @@ function createOunitechAdapter(credentials, options) {
65470
65727
  * after another (gentler on the rate limit); each part carries its own error.
65471
65728
  */
65472
65729
  async getRecords(robotSn) {
65473
- return cached2(recordsCache, "value", `${options?.baseUrl ?? ""}|${credentials.appid}|${robotSn}`, RECORDS_TTL_MS, async () => {
65730
+ const fast = cached2(recordsCache, "value", `${options?.baseUrl ?? ""}|${credentials.appid}|${robotSn}`, RECORDS_TTL_MS, async () => {
65474
65731
  const row = await rowFor(robotSn);
65475
65732
  if (!row || !finite(row.robotId))
65476
65733
  return { supported: true, error: `Serial ${robotSn} is not on this Ounitech account.` };
@@ -65513,6 +65770,8 @@ function createOunitechAdapter(credentials, options) {
65513
65770
  });
65514
65771
  return { supported: true, readAt: now.toISOString(), tasks, alerts, consumables, power, lifts, readings, station };
65515
65772
  });
65773
+ const slow = await cached2(slowCache, "value", `${options?.baseUrl ?? ""}|${credentials.appid}|${robotSn}`, SLOW_TTL_MS, () => slowRecords(robotSn));
65774
+ return { ...slow, ...await fast };
65516
65775
  },
65517
65776
  /**
65518
65777
  * Staff Diagnose: every other read-only chapter-6 call, with the vendor's
@@ -65544,8 +65803,8 @@ function createOunitechAdapter(credentials, options) {
65544
65803
  return { count: list.length, robots: list.slice(0, 3).map((r) => ({ robotSn: r.robotSn, statusName: r.statusName })) };
65545
65804
  });
65546
65805
  await run("serial-based map list (chapter 2)", ROBOT_CLOUD_PATHS.mapList, { robotSn }, async () => {
65547
- const maps = await cloud.getMaps(robotSn);
65548
- return { count: maps.length, floors: maps.map((m) => m.floorNo) };
65806
+ const maps2 = await cloud.getMaps(robotSn);
65807
+ return { count: maps2.length, floors: maps2.map((m) => m.floorNo) };
65549
65808
  });
65550
65809
  const row = await rowFor(robotSn).catch(() => null);
65551
65810
  if (!row || !finite(row.robotId)) {
@@ -65597,6 +65856,50 @@ function createOunitechAdapter(credentials, options) {
65597
65856
  return (r.liftlist ?? []).map((l) => ({ liftno: l.liftno, liftname: l.liftname, floorno: l.floorno, onlineflag: l.onlineflag, enableflag: l.enableflag }));
65598
65857
  });
65599
65858
  }
65859
+ const maps = finite(row.sceneId) ? await floorMaps(row.sceneId).catch(() => []) : [];
65860
+ const map = ounitechCurrentMap(maps, row.taskState?.mapId, Number.isInteger(row.floorNo) ? row.floorNo : null);
65861
+ const mapId = map ? num(map.mapId) : void 0;
65862
+ if (mapId !== void 0) {
65863
+ await run("virtual walls (get-wall-list)", ROBOT_CLOUD_PATHS.wallList, { mapId }, async () => cut(await cloud.getMapShapes("walls", mapId)));
65864
+ await run("safe zones (get-safezone-list)", ROBOT_CLOUD_PATHS.safeZoneList, { mapId }, async () => cut(await cloud.getMapShapes("safe", mapId)));
65865
+ await run("slow zones (get-slowzone-list)", ROBOT_CLOUD_PATHS.slowZoneList, { mapId }, async () => cut(await cloud.getMapShapes("slow", mapId)));
65866
+ await run("map versions (get-map-version-list)", ROBOT_CLOUD_PATHS.mapVersions, { mapId }, async () => cut((await cloud.getMapVersions(mapId)).versionList ?? []));
65867
+ }
65868
+ if (finite(row.sceneId) && map?.floorNo != null) {
65869
+ const sceneId = row.sceneId;
65870
+ const floorNo2 = map.floorNo;
65871
+ await run(
65872
+ "floor map history (v2405/get-floor-maplist)",
65873
+ ROBOT_CLOUD_PATHS.floorMapHistory,
65874
+ { sceneId, floorNo: floorNo2 },
65875
+ async () => cut((await cloud.getFloorMapHistory(sceneId, floorNo2)).mapList ?? [])
65876
+ );
65877
+ }
65878
+ await run("obstacle layer (get-obstacle-layer)", ROBOT_CLOUD_PATHS.obstacleLayer, { robotId, version: 0 }, async () => {
65879
+ const o = await cloud.getObstacleLayer(robotId);
65880
+ return { version: o.version ?? null, imageChars: typeof o.image === "string" ? o.image.length : 0 };
65881
+ });
65882
+ await run("taught route (get-teach-track)", ROBOT_CLOUD_PATHS.teachTrack, { robotId, offset: window.timeFrom }, async () => {
65883
+ const r = await cloud.getTeachTrack(robotId, window.timeFrom);
65884
+ return { points: r.trackList?.length ?? 0, since: r.since ?? null, first: cut(r.trackList ?? []) };
65885
+ });
65886
+ if (finite(row.sceneId)) {
65887
+ const sceneId = row.sceneId;
65888
+ await run("robot status log, last 7 days (get-robot-log-list)", ROBOT_CLOUD_PATHS.robotLog, { robotId, sceneId, ...window }, async () => {
65889
+ const r = await cloud.getRobotLog(robotId, sceneId, window.timeFrom, window.timeTo);
65890
+ return { total: r.total ?? r.logList?.length ?? 0, latest: cut(r.logList ?? []) };
65891
+ });
65892
+ }
65893
+ await run("app action log, last 7 days (get-user-logs)", ROBOT_CLOUD_PATHS.userLog, { robotId, startTime: window.timeFrom, endTime: window.timeTo }, async () => {
65894
+ const r = await cloud.getUserLogs(robotId, window.timeFrom, window.timeTo);
65895
+ return { total: r.total ?? r.actionList?.length ?? 0, latest: cut((r.actionList ?? []).map(({ userPhone: _p, ...a }) => a)) };
65896
+ });
65897
+ await run(
65898
+ "robot settings (get-cleaning-setting)",
65899
+ ROBOT_CLOUD_PATHS.cleaningSetting,
65900
+ { robotId },
65901
+ async () => Object.fromEntries(Object.entries(await cloud.getCleaningSetting(robotId)).filter(([k]) => !SECRET_SETTING.test(k) && k !== "ok" && k !== "msg"))
65902
+ );
65600
65903
  steps.push({
65601
65904
  step: "current job (robot list taskState)",
65602
65905
  path: ROBOT_CLOUD_PATHS.homeRobotList,
@@ -107532,6 +107835,7 @@ function usePersonalEmergencyChainController() {
107532
107835
  ROBOT_TYPES,
107533
107836
  RobotCloudError,
107534
107837
  RobotCredentialsError,
107838
+ SECRET_SETTING,
107535
107839
  SELF_SERVICE_RESEND_COOLDOWN_MS,
107536
107840
  SELF_SIGNUP_PLATFORM,
107537
107841
  SELF_SIGNUP_STATUS,
@@ -107828,18 +108132,26 @@ function usePersonalEmergencyChainController() {
107828
108132
  orgRoleSets,
107829
108133
  orgSchema,
107830
108134
  ounitechAlertRecord,
108135
+ ounitechAppAction,
107831
108136
  ounitechCleaning,
107832
108137
  ounitechConsumable,
107833
108138
  ounitechCurrentMap,
107834
108139
  ounitechFault,
108140
+ ounitechFloorMapHistory,
107835
108141
  ounitechJobWords,
107836
108142
  ounitechMapShare,
108143
+ ounitechMapVersion,
107837
108144
  ounitechMapView,
108145
+ ounitechObstacleImage,
107838
108146
  ounitechPowerPlan,
107839
108147
  ounitechReadings,
107840
108148
  ounitechRobotFromHomeRow,
108149
+ ounitechSettings,
108150
+ ounitechShapes,
108151
+ ounitechStatusLog,
107841
108152
  ounitechTaskRecord,
107842
108153
  ounitechTime,
108154
+ ounitechTrack,
107843
108155
  overnight_parking_requests_namespace_collection,
107844
108156
  padbotAccountKey,
107845
108157
  padbotAlarmFault,