@7365admin1/core 3.122.0 → 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/CHANGELOG.md +12 -0
- package/dist/index.d.ts +49 -1
- package/dist/index.js +46 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/test/padbot.test.mjs +62 -0
- package/test/robot-model-manifest.test.mjs +3 -4
package/dist/index.mjs
CHANGED
|
@@ -63239,12 +63239,11 @@ var DEMO_BRAND_DEFINITION = {
|
|
|
63239
63239
|
capabilities: DEMO_CAPABILITIES,
|
|
63240
63240
|
// Serial-derived demo robots are cleaning (DEMO-C-###) AND security (DEMO-S-###).
|
|
63241
63241
|
types: ["cleaning", "security"],
|
|
63242
|
-
//
|
|
63243
|
-
// compact CX-1 takes jobs but no point commands
|
|
63244
|
-
|
|
63245
|
-
|
|
63246
|
-
|
|
63247
|
-
],
|
|
63242
|
+
// A simulated model, so a demo fleet shows a mixed fleet's controls: the
|
|
63243
|
+
// compact CX-1 takes jobs but no point commands. (No SP-1 profile: the
|
|
63244
|
+
// capability badge counts spot clean, so removing it would drop the demo
|
|
63245
|
+
// patrollers from Full to Basic control for a control they never show.)
|
|
63246
|
+
models: [{ name: "Demo CX-1", codes: ["CX-1"], capabilities: { spotClean: false, navigateToPoint: false, relocalize: false } }],
|
|
63248
63247
|
create: () => createDemoAdapter()
|
|
63249
63248
|
};
|
|
63250
63249
|
function registerDemoBrand() {
|
|
@@ -64699,6 +64698,16 @@ function padbotCanReachMap(maps, fromMapId, toMapId) {
|
|
|
64699
64698
|
};
|
|
64700
64699
|
return group(fromMapId) !== "" && group(fromMapId) === group(toMapId);
|
|
64701
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
|
+
}
|
|
64702
64711
|
var PADBOT_OTHER_MAP_TEXT = "The robot must be on this map first.";
|
|
64703
64712
|
function padbotAlarmFault(alarm) {
|
|
64704
64713
|
if (!alarm?.alarmType)
|
|
@@ -64997,11 +65006,13 @@ function createPadbotAdapter(credentials, options = {}) {
|
|
|
64997
65006
|
]);
|
|
64998
65007
|
const lx = num(loc?.worldX ?? loc?.x);
|
|
64999
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;
|
|
65000
65014
|
if (lx !== null && ly !== null) {
|
|
65001
65015
|
robot.position = { x: lx, y: ly, theta: (num(loc.yaw ?? loc.r) ?? 0) * Math.PI / 180 };
|
|
65002
|
-
if (typeof loc.mapId === "string" && loc.mapId)
|
|
65003
|
-
robot.mapId = loc.mapId;
|
|
65004
|
-
const map = await maps(robotSn).then((all) => (all ?? []).find((m) => m.mapId === (loc.mapId ?? st["1007"]?.mapId))).catch(() => null);
|
|
65005
65016
|
robot.planPosition = padbotPlanShare(map, lx, ly);
|
|
65006
65017
|
}
|
|
65007
65018
|
if (!robot.position)
|
|
@@ -65186,6 +65197,27 @@ function registerPadbotBrand() {
|
|
|
65186
65197
|
registerPadbotBrand();
|
|
65187
65198
|
|
|
65188
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
|
+
}
|
|
65189
65221
|
var OUNITECH_REGION_BASE_URLS = [
|
|
65190
65222
|
"https://app.frankfurt.robotcloud.top",
|
|
65191
65223
|
"https://app.singapore.robotcloud.top",
|
|
@@ -69988,24 +70020,7 @@ async function readLiveItems(robots) {
|
|
|
69988
70020
|
if (s.fault)
|
|
69989
70021
|
void notifyRobotFault(robot, s.fault);
|
|
69990
70022
|
const seen2 = liveEntry(id)?.lastSeenAt;
|
|
69991
|
-
items.push(
|
|
69992
|
-
id,
|
|
69993
|
-
ok: true,
|
|
69994
|
-
monitorable: true,
|
|
69995
|
-
online: s.online,
|
|
69996
|
-
mode: s.mode,
|
|
69997
|
-
statusName: s.statusName,
|
|
69998
|
-
model: s.model,
|
|
69999
|
-
batteryPercent: s.batteryPercent,
|
|
70000
|
-
floorNo: s.floorNo,
|
|
70001
|
-
floorKnown: s.floorKnown,
|
|
70002
|
-
position: s.position,
|
|
70003
|
-
planPosition: s.planPosition,
|
|
70004
|
-
fault: s.fault,
|
|
70005
|
-
capabilities: s.capabilities,
|
|
70006
|
-
profile: s.profile,
|
|
70007
|
-
lastSeenAt: seen2 ? new Date(seen2) : null
|
|
70008
|
-
});
|
|
70023
|
+
items.push(fleetStateItem(id, s, seen2));
|
|
70009
70024
|
} catch (e) {
|
|
70010
70025
|
const text2 = String(e?.message ?? "");
|
|
70011
70026
|
items.push({
|
|
@@ -104913,6 +104928,7 @@ export {
|
|
|
104913
104928
|
ffmpegFrameArgs,
|
|
104914
104929
|
ffmpegPath,
|
|
104915
104930
|
filterByAccess,
|
|
104931
|
+
fleetStateItem,
|
|
104916
104932
|
floorNoOf,
|
|
104917
104933
|
floorPlanBodySchema,
|
|
104918
104934
|
flushNotificationEmails,
|
|
@@ -105038,6 +105054,7 @@ export {
|
|
|
105038
105054
|
padbotCanReachMap,
|
|
105039
105055
|
padbotCheckpointVisit,
|
|
105040
105056
|
padbotCommandLog,
|
|
105057
|
+
padbotCurrentMap,
|
|
105041
105058
|
padbotDriveBlock,
|
|
105042
105059
|
padbotDriveLimits,
|
|
105043
105060
|
padbotDriveSignal,
|