@apocaliss92/nodelink-js 0.4.12 → 0.4.14
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/README.md +24 -0
- package/dist/BaichuanVideoStream-HGPU2MZ3.js +7 -0
- package/dist/{DiagnosticsTools-HGJGVQXZ.js → DiagnosticsTools-BQOWJ23L.js} +3 -3
- package/dist/{chunk-IJG45AOT.js → chunk-2JNXKT3C.js} +2 -2
- package/dist/{chunk-W2ANCJVM.js → chunk-C57QV7IL.js} +21 -1
- package/dist/chunk-C57QV7IL.js.map +1 -0
- package/dist/{chunk-ND73IJIB.js → chunk-WKETZFBI.js} +609 -9
- package/dist/chunk-WKETZFBI.js.map +1 -0
- package/dist/cli/rtsp-server.cjs +609 -4
- package/dist/cli/rtsp-server.cjs.map +1 -1
- package/dist/cli/rtsp-server.js +3 -3
- package/dist/index.cjs +628 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +357 -31
- package/dist/index.d.ts +377 -26
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/BaichuanVideoStream-PHQG4A2L.js +0 -7
- package/dist/chunk-ND73IJIB.js.map +0 -1
- package/dist/chunk-W2ANCJVM.js.map +0 -1
- /package/dist/{BaichuanVideoStream-PHQG4A2L.js.map → BaichuanVideoStream-HGPU2MZ3.js.map} +0 -0
- /package/dist/{DiagnosticsTools-HGJGVQXZ.js.map → DiagnosticsTools-BQOWJ23L.js.map} +0 -0
- /package/dist/{chunk-IJG45AOT.js.map → chunk-2JNXKT3C.js.map} +0 -0
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
runAllDiagnosticsConsecutively,
|
|
31
31
|
runMultifocalDiagnosticsConsecutively,
|
|
32
32
|
xmlEscape
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-2JNXKT3C.js";
|
|
34
34
|
import {
|
|
35
35
|
BC_CLASS_FILE_DOWNLOAD,
|
|
36
36
|
BC_CLASS_LEGACY,
|
|
@@ -65,6 +65,7 @@ import {
|
|
|
65
65
|
BC_CMD_ID_GET_AUDIO_CFG,
|
|
66
66
|
BC_CMD_ID_GET_AUDIO_TASK,
|
|
67
67
|
BC_CMD_ID_GET_AUTO_FOCUS,
|
|
68
|
+
BC_CMD_ID_GET_AUTO_REBOOT,
|
|
68
69
|
BC_CMD_ID_GET_BATTERY_INFO,
|
|
69
70
|
BC_CMD_ID_GET_BATTERY_INFO_LIST,
|
|
70
71
|
BC_CMD_ID_GET_DAY_NIGHT_THRESHOLD,
|
|
@@ -72,6 +73,8 @@ import {
|
|
|
72
73
|
BC_CMD_ID_GET_DING_DONG_CFG,
|
|
73
74
|
BC_CMD_ID_GET_DING_DONG_LIST,
|
|
74
75
|
BC_CMD_ID_GET_DING_DONG_SILENT,
|
|
76
|
+
BC_CMD_ID_GET_DST,
|
|
77
|
+
BC_CMD_ID_GET_EMAIL,
|
|
75
78
|
BC_CMD_ID_GET_EMAIL_TASK,
|
|
76
79
|
BC_CMD_ID_GET_ENC,
|
|
77
80
|
BC_CMD_ID_GET_FTP_TASK,
|
|
@@ -79,6 +82,7 @@ import {
|
|
|
79
82
|
BC_CMD_ID_GET_KIT_AP_CFG,
|
|
80
83
|
BC_CMD_ID_GET_LED_STATE,
|
|
81
84
|
BC_CMD_ID_GET_MOTION_ALARM,
|
|
85
|
+
BC_CMD_ID_GET_NTP,
|
|
82
86
|
BC_CMD_ID_GET_ONLINE_USER_LIST,
|
|
83
87
|
BC_CMD_ID_GET_OSD_DATETIME,
|
|
84
88
|
BC_CMD_ID_GET_PIR_INFO,
|
|
@@ -117,15 +121,21 @@ import {
|
|
|
117
121
|
BC_CMD_ID_SET_AUDIO_CFG,
|
|
118
122
|
BC_CMD_ID_SET_AUDIO_TASK,
|
|
119
123
|
BC_CMD_ID_SET_AUTO_FOCUS,
|
|
124
|
+
BC_CMD_ID_SET_AUTO_REBOOT,
|
|
120
125
|
BC_CMD_ID_SET_DAY_NIGHT_THRESHOLD,
|
|
121
126
|
BC_CMD_ID_SET_DING_DONG_CFG,
|
|
122
127
|
BC_CMD_ID_SET_DING_DONG_SILENT,
|
|
128
|
+
BC_CMD_ID_SET_DST,
|
|
129
|
+
BC_CMD_ID_SET_EMAIL,
|
|
130
|
+
BC_CMD_ID_SET_EMAIL_TASK,
|
|
123
131
|
BC_CMD_ID_SET_ENC,
|
|
124
132
|
BC_CMD_ID_SET_LED_STATE,
|
|
125
133
|
BC_CMD_ID_SET_MOTION_ALARM,
|
|
134
|
+
BC_CMD_ID_SET_NTP,
|
|
126
135
|
BC_CMD_ID_SET_OSD_DATETIME,
|
|
127
136
|
BC_CMD_ID_SET_PIR_INFO,
|
|
128
137
|
BC_CMD_ID_SET_PRIVACY_MASK,
|
|
138
|
+
BC_CMD_ID_SET_SYSTEM_GENERAL,
|
|
129
139
|
BC_CMD_ID_SET_VIDEO_INPUT,
|
|
130
140
|
BC_CMD_ID_SET_WHITE_LED_STATE,
|
|
131
141
|
BC_CMD_ID_SET_WHITE_LED_TASK,
|
|
@@ -135,6 +145,7 @@ import {
|
|
|
135
145
|
BC_CMD_ID_TALK_ABILITY,
|
|
136
146
|
BC_CMD_ID_TALK_CONFIG,
|
|
137
147
|
BC_CMD_ID_TALK_RESET,
|
|
148
|
+
BC_CMD_ID_TEST_EMAIL,
|
|
138
149
|
BC_CMD_ID_UDP_KEEP_ALIVE,
|
|
139
150
|
BC_CMD_ID_VIDEO,
|
|
140
151
|
BC_CMD_ID_VIDEO_STOP,
|
|
@@ -165,7 +176,7 @@ import {
|
|
|
165
176
|
splitAnnexBToNalPayloads2,
|
|
166
177
|
talkTraceLog,
|
|
167
178
|
traceLog
|
|
168
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-C57QV7IL.js";
|
|
169
180
|
|
|
170
181
|
// src/protocol/framing.ts
|
|
171
182
|
function encodeHeader(h) {
|
|
@@ -8334,6 +8345,304 @@ function parseXmlFragmentToJson(xml) {
|
|
|
8334
8345
|
return parsed.root;
|
|
8335
8346
|
}
|
|
8336
8347
|
|
|
8348
|
+
// src/reolink/baichuan/utils/email.ts
|
|
8349
|
+
var parseInt01 = (text) => {
|
|
8350
|
+
if (text === void 0) return void 0;
|
|
8351
|
+
return text.trim() === "1" ? 1 : 0;
|
|
8352
|
+
};
|
|
8353
|
+
var parseNumberSafe = (text) => {
|
|
8354
|
+
if (text === void 0) return void 0;
|
|
8355
|
+
const n = Number(text);
|
|
8356
|
+
return Number.isFinite(n) ? n : void 0;
|
|
8357
|
+
};
|
|
8358
|
+
var VALID_ATTACHMENT_TYPES = [
|
|
8359
|
+
"picture",
|
|
8360
|
+
"video",
|
|
8361
|
+
"none"
|
|
8362
|
+
];
|
|
8363
|
+
var VALID_TEXT_TYPES = ["withText", "noText"];
|
|
8364
|
+
var normalizeAttachmentType = (text) => {
|
|
8365
|
+
const t = (text ?? "").trim();
|
|
8366
|
+
return VALID_ATTACHMENT_TYPES.includes(t) ? t : "picture";
|
|
8367
|
+
};
|
|
8368
|
+
var normalizeTextType = (text) => {
|
|
8369
|
+
const t = (text ?? "").trim();
|
|
8370
|
+
return VALID_TEXT_TYPES.includes(t) ? t : "withText";
|
|
8371
|
+
};
|
|
8372
|
+
function parseEmailConfigFromXml(xml) {
|
|
8373
|
+
const cfg = {
|
|
8374
|
+
smtpServer: getXmlText(xml, "smtpServer") ?? "",
|
|
8375
|
+
userName: getXmlText(xml, "userName") ?? "",
|
|
8376
|
+
password: getXmlText(xml, "password") ?? "",
|
|
8377
|
+
address1: getXmlText(xml, "address1") ?? "",
|
|
8378
|
+
address2: getXmlText(xml, "address2") ?? "",
|
|
8379
|
+
address3: getXmlText(xml, "address3") ?? "",
|
|
8380
|
+
smtpPort: parseNumberSafe(getXmlText(xml, "smtpPort")) ?? 0,
|
|
8381
|
+
sendNickname: getXmlText(xml, "sendNickname") ?? "",
|
|
8382
|
+
attachment: parseInt01(getXmlText(xml, "attachment")) ?? 0,
|
|
8383
|
+
attachmentType: normalizeAttachmentType(getXmlText(xml, "attachmentType")),
|
|
8384
|
+
textType: normalizeTextType(getXmlText(xml, "textType")),
|
|
8385
|
+
ssl: parseInt01(getXmlText(xml, "ssl")) ?? 0,
|
|
8386
|
+
interval: parseNumberSafe(getXmlText(xml, "interval")) ?? 30
|
|
8387
|
+
};
|
|
8388
|
+
const senderMaxLen = parseNumberSafe(getXmlText(xml, "senderMaxLen"));
|
|
8389
|
+
if (senderMaxLen !== void 0) cfg.senderMaxLen = senderMaxLen;
|
|
8390
|
+
const pwdMaxLen = parseNumberSafe(getXmlText(xml, "pwdMaxLen"));
|
|
8391
|
+
if (pwdMaxLen !== void 0) cfg.pwdMaxLen = pwdMaxLen;
|
|
8392
|
+
const ability = parseNumberSafe(getXmlText(xml, "emailAttachAbility"));
|
|
8393
|
+
if (ability !== void 0) cfg.emailAttachAbility = ability;
|
|
8394
|
+
return cfg;
|
|
8395
|
+
}
|
|
8396
|
+
function buildSetEmailXml(current, patch) {
|
|
8397
|
+
const merged = { ...current, ...patch };
|
|
8398
|
+
return ensureXmlHeader(
|
|
8399
|
+
`<body><Email version="1.1"><smtpServer>${xmlEscape(merged.smtpServer)}</smtpServer><userName>${xmlEscape(merged.userName)}</userName><password>${xmlEscape(merged.password)}</password><address1>${xmlEscape(merged.address1)}</address1><address2>${xmlEscape(merged.address2)}</address2><address3>${xmlEscape(merged.address3)}</address3><smtpPort>${merged.smtpPort}</smtpPort><sendNickname>${xmlEscape(merged.sendNickname)}</sendNickname><attachment>${merged.attachment}</attachment><attachmentType>${merged.attachmentType}</attachmentType><textType>${merged.textType}</textType><ssl>${merged.ssl}</ssl><interval>${merged.interval}</interval></Email></body>`
|
|
8400
|
+
);
|
|
8401
|
+
}
|
|
8402
|
+
function parseEmailTaskFromXml(xml) {
|
|
8403
|
+
const channelId = parseNumberSafe(getXmlText(xml, "channelId")) ?? 0;
|
|
8404
|
+
const enable = parseInt01(getXmlText(xml, "enable")) ?? 0;
|
|
8405
|
+
const items = [];
|
|
8406
|
+
const itemRe = /<item>([\s\S]*?)<\/item>/g;
|
|
8407
|
+
let match;
|
|
8408
|
+
while ((match = itemRe.exec(xml)) !== null) {
|
|
8409
|
+
const block = match[1] ?? "";
|
|
8410
|
+
items.push({
|
|
8411
|
+
type: getXmlText(block, "type") ?? "none",
|
|
8412
|
+
valueTable: getXmlText(block, "valueTable") ?? ""
|
|
8413
|
+
});
|
|
8414
|
+
}
|
|
8415
|
+
return { channelId, enable, typeScheduleList: items };
|
|
8416
|
+
}
|
|
8417
|
+
function buildEmailScheduleValueTable(spec) {
|
|
8418
|
+
if (spec.kind === "always") return "1".repeat(168);
|
|
8419
|
+
const grid = new Array(168).fill("0");
|
|
8420
|
+
if (spec.kind === "never") return grid.join("");
|
|
8421
|
+
for (const w of spec.windows) {
|
|
8422
|
+
const startH = Math.max(0, Math.min(24, w.startHour));
|
|
8423
|
+
const endH = Math.max(startH, Math.min(24, w.endHour));
|
|
8424
|
+
for (const d of w.days) {
|
|
8425
|
+
if (d < 0 || d > 6) continue;
|
|
8426
|
+
for (let h = startH; h < endH; h++) {
|
|
8427
|
+
grid[d * 24 + h] = "1";
|
|
8428
|
+
}
|
|
8429
|
+
}
|
|
8430
|
+
}
|
|
8431
|
+
return grid.join("");
|
|
8432
|
+
}
|
|
8433
|
+
function buildSetEmailTaskXml(task) {
|
|
8434
|
+
const items = task.typeScheduleList.map(
|
|
8435
|
+
(item) => `<item><type>${xmlEscape(item.type)}</type><valueTable>${xmlEscape(item.valueTable)}</valueTable></item>`
|
|
8436
|
+
).join("");
|
|
8437
|
+
return ensureXmlHeader(
|
|
8438
|
+
`<body><EmailTask version="1.1"><channelId>${task.channelId}</channelId><enable>${task.enable}</enable><typeScheduleList>${items}</typeScheduleList></EmailTask></body>`
|
|
8439
|
+
);
|
|
8440
|
+
}
|
|
8441
|
+
|
|
8442
|
+
// src/reolink/baichuan/utils/ntp.ts
|
|
8443
|
+
var parseNumberSafe2 = (text) => {
|
|
8444
|
+
if (text === void 0) return void 0;
|
|
8445
|
+
const n = Number(text);
|
|
8446
|
+
return Number.isFinite(n) ? n : void 0;
|
|
8447
|
+
};
|
|
8448
|
+
var parseInt012 = (text) => {
|
|
8449
|
+
if (text === void 0) return void 0;
|
|
8450
|
+
return text.trim() === "1" ? 1 : 0;
|
|
8451
|
+
};
|
|
8452
|
+
function parseNtpConfigFromXml(xml) {
|
|
8453
|
+
return {
|
|
8454
|
+
enable: parseInt012(getXmlText(xml, "enable")) ?? 0,
|
|
8455
|
+
server: getXmlText(xml, "server") ?? "",
|
|
8456
|
+
synchronizeInterval: parseNumberSafe2(getXmlText(xml, "synchronizeInterval")) ?? 1440,
|
|
8457
|
+
port: parseNumberSafe2(getXmlText(xml, "port")) ?? 123
|
|
8458
|
+
};
|
|
8459
|
+
}
|
|
8460
|
+
function buildSetNtpXml(current, patch) {
|
|
8461
|
+
const merged = { ...current, ...patch };
|
|
8462
|
+
return ensureXmlHeader(
|
|
8463
|
+
`<body><Ntp version="1.1"><enable>${merged.enable}</enable><server>${xmlEscape(merged.server)}</server><synchronizeInterval>${merged.synchronizeInterval}</synchronizeInterval><port>${merged.port}</port></Ntp></body>`
|
|
8464
|
+
);
|
|
8465
|
+
}
|
|
8466
|
+
|
|
8467
|
+
// src/reolink/baichuan/utils/dst.ts
|
|
8468
|
+
var parseNumberSafe3 = (text) => {
|
|
8469
|
+
if (text === void 0) return void 0;
|
|
8470
|
+
const n = Number(text);
|
|
8471
|
+
return Number.isFinite(n) ? n : void 0;
|
|
8472
|
+
};
|
|
8473
|
+
var parseInt013 = (text) => {
|
|
8474
|
+
if (text === void 0) return void 0;
|
|
8475
|
+
return text.trim() === "1" ? 1 : 0;
|
|
8476
|
+
};
|
|
8477
|
+
var VALID_WEEKDAYS = [
|
|
8478
|
+
"Sunday",
|
|
8479
|
+
"Monday",
|
|
8480
|
+
"Tuesday",
|
|
8481
|
+
"Wednesday",
|
|
8482
|
+
"Thursday",
|
|
8483
|
+
"Friday",
|
|
8484
|
+
"Saturday"
|
|
8485
|
+
];
|
|
8486
|
+
var normalizeWeekday = (text) => {
|
|
8487
|
+
const t = (text ?? "").trim();
|
|
8488
|
+
return VALID_WEEKDAYS.includes(t) ? t : "Sunday";
|
|
8489
|
+
};
|
|
8490
|
+
function parseDstConfigFromXml(xml) {
|
|
8491
|
+
const cfg = {
|
|
8492
|
+
enable: parseInt013(getXmlText(xml, "enable")) ?? 0,
|
|
8493
|
+
offset: parseNumberSafe3(getXmlText(xml, "offset")) ?? 1,
|
|
8494
|
+
startMonth: parseNumberSafe3(getXmlText(xml, "startMonth")) ?? 3,
|
|
8495
|
+
startWeekIndex: parseNumberSafe3(getXmlText(xml, "startWeekIndex")) ?? 5,
|
|
8496
|
+
startWeekday: normalizeWeekday(getXmlText(xml, "startWeekday")),
|
|
8497
|
+
startHour: parseNumberSafe3(getXmlText(xml, "startHour")) ?? 2,
|
|
8498
|
+
startMinute: parseNumberSafe3(getXmlText(xml, "startMinute")) ?? 0,
|
|
8499
|
+
startSecond: parseNumberSafe3(getXmlText(xml, "startSecond")) ?? 0,
|
|
8500
|
+
endMonth: parseNumberSafe3(getXmlText(xml, "endMonth")) ?? 10,
|
|
8501
|
+
endWeekIndex: parseNumberSafe3(getXmlText(xml, "endWeekIndex")) ?? 4,
|
|
8502
|
+
endWeekday: normalizeWeekday(getXmlText(xml, "endWeekday")),
|
|
8503
|
+
endHour: parseNumberSafe3(getXmlText(xml, "endHour")) ?? 3,
|
|
8504
|
+
endMinute: parseNumberSafe3(getXmlText(xml, "endMinute")) ?? 0,
|
|
8505
|
+
endSecond: parseNumberSafe3(getXmlText(xml, "endSecond")) ?? 0
|
|
8506
|
+
};
|
|
8507
|
+
const version = parseNumberSafe3(getXmlText(xml, "version"));
|
|
8508
|
+
if (version !== void 0) cfg.version = version;
|
|
8509
|
+
return cfg;
|
|
8510
|
+
}
|
|
8511
|
+
function buildSetDstXml(current, patch) {
|
|
8512
|
+
const merged = { ...current, ...patch };
|
|
8513
|
+
return ensureXmlHeader(
|
|
8514
|
+
`<body><Dst version="1.1"><enable>${merged.enable}</enable><offset>${merged.offset}</offset><startMonth>${merged.startMonth}</startMonth><startWeekIndex>${merged.startWeekIndex}</startWeekIndex><startWeekday>${xmlEscape(merged.startWeekday)}</startWeekday><startHour>${merged.startHour}</startHour><startMinute>${merged.startMinute}</startMinute><startSecond>${merged.startSecond}</startSecond><endMonth>${merged.endMonth}</endMonth><endWeekIndex>${merged.endWeekIndex}</endWeekIndex><endWeekday>${xmlEscape(merged.endWeekday)}</endWeekday><endHour>${merged.endHour}</endHour><endMinute>${merged.endMinute}</endMinute><endSecond>${merged.endSecond}</endSecond></Dst></body>`
|
|
8515
|
+
);
|
|
8516
|
+
}
|
|
8517
|
+
|
|
8518
|
+
// src/reolink/baichuan/utils/autoReboot.ts
|
|
8519
|
+
var parseNumberSafe4 = (text) => {
|
|
8520
|
+
if (text === void 0) return void 0;
|
|
8521
|
+
const n = Number(text);
|
|
8522
|
+
return Number.isFinite(n) ? n : void 0;
|
|
8523
|
+
};
|
|
8524
|
+
var parseInt014 = (text) => {
|
|
8525
|
+
if (text === void 0) return void 0;
|
|
8526
|
+
return text.trim() === "1" ? 1 : 0;
|
|
8527
|
+
};
|
|
8528
|
+
var VALID_WEEKDAYS2 = [
|
|
8529
|
+
"Sunday",
|
|
8530
|
+
"Monday",
|
|
8531
|
+
"Tuesday",
|
|
8532
|
+
"Wednesday",
|
|
8533
|
+
"Thursday",
|
|
8534
|
+
"Friday",
|
|
8535
|
+
"Saturday",
|
|
8536
|
+
"everyday"
|
|
8537
|
+
];
|
|
8538
|
+
var normalizeWeekday2 = (text) => {
|
|
8539
|
+
const t = (text ?? "").trim();
|
|
8540
|
+
return VALID_WEEKDAYS2.includes(t) ? t : "Sunday";
|
|
8541
|
+
};
|
|
8542
|
+
function parseAutoRebootFromXml(xml) {
|
|
8543
|
+
return {
|
|
8544
|
+
enable: parseInt014(getXmlText(xml, "enable")) ?? 0,
|
|
8545
|
+
weekDay: normalizeWeekday2(getXmlText(xml, "weekDay")),
|
|
8546
|
+
hour: parseNumberSafe4(getXmlText(xml, "hour")) ?? 0,
|
|
8547
|
+
minute: parseNumberSafe4(getXmlText(xml, "minute")) ?? 0,
|
|
8548
|
+
second: parseNumberSafe4(getXmlText(xml, "second")) ?? 0
|
|
8549
|
+
};
|
|
8550
|
+
}
|
|
8551
|
+
function buildSetAutoRebootXml(current, patch) {
|
|
8552
|
+
const merged = { ...current, ...patch };
|
|
8553
|
+
return ensureXmlHeader(
|
|
8554
|
+
`<body><AutoReboot version="1.1"><enable>${merged.enable}</enable><weekDay>${xmlEscape(merged.weekDay)}</weekDay><hour>${merged.hour}</hour><minute>${merged.minute}</minute><second>${merged.second}</second></AutoReboot></body>`
|
|
8555
|
+
);
|
|
8556
|
+
}
|
|
8557
|
+
|
|
8558
|
+
// src/reolink/baichuan/utils/systemGeneral.ts
|
|
8559
|
+
var parseNumberSafe5 = (text) => {
|
|
8560
|
+
if (text === void 0) return void 0;
|
|
8561
|
+
const n = Number(text);
|
|
8562
|
+
return Number.isFinite(n) ? n : void 0;
|
|
8563
|
+
};
|
|
8564
|
+
var parseInt015 = (text) => {
|
|
8565
|
+
if (text === void 0) return void 0;
|
|
8566
|
+
return text.trim() === "1" ? 1 : 0;
|
|
8567
|
+
};
|
|
8568
|
+
var VALID_OSD_FORMATS = ["DMY", "MDY", "YMD"];
|
|
8569
|
+
var normalizeOsdFormat = (text) => {
|
|
8570
|
+
const t = (text ?? "").trim();
|
|
8571
|
+
return VALID_OSD_FORMATS.includes(t) ? t : "YMD";
|
|
8572
|
+
};
|
|
8573
|
+
function parseSystemGeneralFromXml(xml) {
|
|
8574
|
+
return {
|
|
8575
|
+
timeZone: parseNumberSafe5(getXmlText(xml, "timeZone")) ?? 0,
|
|
8576
|
+
osdFormat: normalizeOsdFormat(getXmlText(xml, "osdFormat")),
|
|
8577
|
+
year: parseNumberSafe5(getXmlText(xml, "year")) ?? 0,
|
|
8578
|
+
month: parseNumberSafe5(getXmlText(xml, "month")) ?? 0,
|
|
8579
|
+
day: parseNumberSafe5(getXmlText(xml, "day")) ?? 0,
|
|
8580
|
+
hour: parseNumberSafe5(getXmlText(xml, "hour")) ?? 0,
|
|
8581
|
+
minute: parseNumberSafe5(getXmlText(xml, "minute")) ?? 0,
|
|
8582
|
+
second: parseNumberSafe5(getXmlText(xml, "second")) ?? 0,
|
|
8583
|
+
deviceId: parseNumberSafe5(getXmlText(xml, "deviceId")) ?? 0,
|
|
8584
|
+
timeFormat: parseInt015(getXmlText(xml, "timeFormat")) ?? 0,
|
|
8585
|
+
language: getXmlText(xml, "language") ?? "English",
|
|
8586
|
+
deviceName: getXmlText(xml, "deviceName") ?? "",
|
|
8587
|
+
loginLock: parseInt015(getXmlText(xml, "loginLock")) ?? 0,
|
|
8588
|
+
lockTime: parseNumberSafe5(getXmlText(xml, "lockTime")) ?? 0,
|
|
8589
|
+
allowedTimes: parseNumberSafe5(getXmlText(xml, "allowedTimes")) ?? 0,
|
|
8590
|
+
isDst: parseInt015(getXmlText(xml, "isDst")) ?? 0
|
|
8591
|
+
};
|
|
8592
|
+
}
|
|
8593
|
+
function buildSetSystemGeneralXml(patch) {
|
|
8594
|
+
const parts = [];
|
|
8595
|
+
const isDeviceNameOnly = patch.deviceName !== void 0 && patch.timeZone === void 0 && patch.osdFormat === void 0 && patch.timeFormat === void 0 && patch.language === void 0 && patch.loginLock === void 0 && patch.lockTime === void 0 && patch.allowedTimes === void 0 && patch.manualTime === void 0;
|
|
8596
|
+
if (isDeviceNameOnly) {
|
|
8597
|
+
parts.push("<year>0</year>");
|
|
8598
|
+
parts.push(`<deviceName>${xmlEscape(patch.deviceName)}</deviceName>`);
|
|
8599
|
+
parts.push("<deviceNameOnly>1</deviceNameOnly>");
|
|
8600
|
+
} else if (patch.manualTime !== void 0) {
|
|
8601
|
+
const mt = patch.manualTime;
|
|
8602
|
+
if (patch.timeZone !== void 0)
|
|
8603
|
+
parts.push(`<timeZone>${patch.timeZone}</timeZone>`);
|
|
8604
|
+
if (patch.osdFormat !== void 0)
|
|
8605
|
+
parts.push(`<osdFormat>${patch.osdFormat}</osdFormat>`);
|
|
8606
|
+
parts.push(`<year>${mt.year}</year>`);
|
|
8607
|
+
parts.push(`<month>${mt.month}</month>`);
|
|
8608
|
+
parts.push(`<day>${mt.day}</day>`);
|
|
8609
|
+
parts.push(`<hour>${mt.hour}</hour>`);
|
|
8610
|
+
parts.push(`<minute>${mt.minute}</minute>`);
|
|
8611
|
+
parts.push(`<second>${mt.second}</second>`);
|
|
8612
|
+
if (patch.timeFormat !== void 0)
|
|
8613
|
+
parts.push(`<timeFormat>${patch.timeFormat}</timeFormat>`);
|
|
8614
|
+
if (patch.language !== void 0)
|
|
8615
|
+
parts.push(`<language>${xmlEscape(patch.language)}</language>`);
|
|
8616
|
+
if (patch.deviceName !== void 0)
|
|
8617
|
+
parts.push(`<deviceName>${xmlEscape(patch.deviceName)}</deviceName>`);
|
|
8618
|
+
if (patch.loginLock !== void 0)
|
|
8619
|
+
parts.push(`<loginLock>${patch.loginLock}</loginLock>`);
|
|
8620
|
+
if (patch.lockTime !== void 0)
|
|
8621
|
+
parts.push(`<lockTime>${patch.lockTime}</lockTime>`);
|
|
8622
|
+
if (patch.allowedTimes !== void 0)
|
|
8623
|
+
parts.push(`<allowedTimes>${patch.allowedTimes}</allowedTimes>`);
|
|
8624
|
+
} else {
|
|
8625
|
+
if (patch.timeZone !== void 0)
|
|
8626
|
+
parts.push(`<timeZone>${patch.timeZone}</timeZone>`);
|
|
8627
|
+
if (patch.osdFormat !== void 0)
|
|
8628
|
+
parts.push(`<osdFormat>${patch.osdFormat}</osdFormat>`);
|
|
8629
|
+
if (patch.timeFormat !== void 0)
|
|
8630
|
+
parts.push(`<timeFormat>${patch.timeFormat}</timeFormat>`);
|
|
8631
|
+
if (patch.language !== void 0)
|
|
8632
|
+
parts.push(`<language>${xmlEscape(patch.language)}</language>`);
|
|
8633
|
+
if (patch.loginLock !== void 0)
|
|
8634
|
+
parts.push(`<loginLock>${patch.loginLock}</loginLock>`);
|
|
8635
|
+
if (patch.lockTime !== void 0)
|
|
8636
|
+
parts.push(`<lockTime>${patch.lockTime}</lockTime>`);
|
|
8637
|
+
if (patch.allowedTimes !== void 0)
|
|
8638
|
+
parts.push(`<allowedTimes>${patch.allowedTimes}</allowedTimes>`);
|
|
8639
|
+
parts.push("<year>0</year>");
|
|
8640
|
+
}
|
|
8641
|
+
return ensureXmlHeader(
|
|
8642
|
+
`<body><SystemGeneral version="1.1">${parts.join("")}</SystemGeneral></body>`
|
|
8643
|
+
);
|
|
8644
|
+
}
|
|
8645
|
+
|
|
8337
8646
|
// src/reolink/baichuan/ReolinkBaichuanApi.ts
|
|
8338
8647
|
import { Jimp, JimpMime } from "jimp";
|
|
8339
8648
|
|
|
@@ -12488,7 +12797,7 @@ var ReolinkBaichuanApi = class _ReolinkBaichuanApi {
|
|
|
12488
12797
|
return;
|
|
12489
12798
|
}
|
|
12490
12799
|
this.objectDetectionStreamStartInFlight = (async () => {
|
|
12491
|
-
const { BaichuanVideoStream: BaichuanVideoStream2 } = await import("./BaichuanVideoStream-
|
|
12800
|
+
const { BaichuanVideoStream: BaichuanVideoStream2 } = await import("./BaichuanVideoStream-HGPU2MZ3.js");
|
|
12492
12801
|
const sessionKey = `live:object-detections:ch0:sub`;
|
|
12493
12802
|
const dedicated = await this.createDedicatedSession(sessionKey);
|
|
12494
12803
|
const stream = new BaichuanVideoStream2({
|
|
@@ -19084,7 +19393,7 @@ ${xml}`
|
|
|
19084
19393
|
* @returns Test results for all stream types and profiles
|
|
19085
19394
|
*/
|
|
19086
19395
|
async testChannelStreams(channel, logger) {
|
|
19087
|
-
const { testChannelStreams } = await import("./DiagnosticsTools-
|
|
19396
|
+
const { testChannelStreams } = await import("./DiagnosticsTools-BQOWJ23L.js");
|
|
19088
19397
|
return await testChannelStreams({
|
|
19089
19398
|
api: this,
|
|
19090
19399
|
channel: this.normalizeChannel(channel),
|
|
@@ -19100,7 +19409,7 @@ ${xml}`
|
|
|
19100
19409
|
* @returns Complete diagnostics for all channels and streams
|
|
19101
19410
|
*/
|
|
19102
19411
|
async collectMultifocalDiagnostics(logger) {
|
|
19103
|
-
const { collectMultifocalDiagnostics } = await import("./DiagnosticsTools-
|
|
19412
|
+
const { collectMultifocalDiagnostics } = await import("./DiagnosticsTools-BQOWJ23L.js");
|
|
19104
19413
|
return await collectMultifocalDiagnostics({
|
|
19105
19414
|
api: this,
|
|
19106
19415
|
logger
|
|
@@ -20064,7 +20373,26 @@ ${xml}`
|
|
|
20064
20373
|
*/
|
|
20065
20374
|
async getEncOptions(channel, options) {
|
|
20066
20375
|
const list = await this.getStreamInfoList(channel, options);
|
|
20067
|
-
|
|
20376
|
+
const built = buildEncOptions(list, channel);
|
|
20377
|
+
try {
|
|
20378
|
+
const enc = await this.getEnc(channel, options);
|
|
20379
|
+
const compression = enc.body?.Compression;
|
|
20380
|
+
const mergeGop = (target, stream) => {
|
|
20381
|
+
if (!target || !stream) return;
|
|
20382
|
+
const g = stream.gop;
|
|
20383
|
+
if (!g) return;
|
|
20384
|
+
target.gopRange = {
|
|
20385
|
+
...g.cur !== void 0 ? { cur: g.cur } : {},
|
|
20386
|
+
...g.min !== void 0 ? { min: g.min } : {},
|
|
20387
|
+
...g.max !== void 0 ? { max: g.max } : {}
|
|
20388
|
+
};
|
|
20389
|
+
};
|
|
20390
|
+
mergeGop(built.mainStream, compression?.mainStream);
|
|
20391
|
+
mergeGop(built.subStream, compression?.subStream);
|
|
20392
|
+
mergeGop(built.thirdStream, compression?.thirdStream);
|
|
20393
|
+
} catch {
|
|
20394
|
+
}
|
|
20395
|
+
return built;
|
|
20068
20396
|
}
|
|
20069
20397
|
/**
|
|
20070
20398
|
* Read the camera's `<VersionInfo>` block (cmd_id=80). Returns the
|
|
@@ -20169,7 +20497,279 @@ ${xml}`
|
|
|
20169
20497
|
...channel != null ? { channel } : {},
|
|
20170
20498
|
...options?.timeoutMs != null ? { timeoutMs: options.timeoutMs } : {}
|
|
20171
20499
|
});
|
|
20172
|
-
return
|
|
20500
|
+
return parseEmailTaskFromXml(xml);
|
|
20501
|
+
}
|
|
20502
|
+
/**
|
|
20503
|
+
* SetEmailTask via Baichuan (cmdId=216). Updates the email alarm schedule
|
|
20504
|
+
* (per-event-type 7×24 valueTable + master enable).
|
|
20505
|
+
*
|
|
20506
|
+
* Reolink expects the FULL `typeScheduleList` — pass the array from a prior
|
|
20507
|
+
* GET and only flip the entries you care about. Slots you don't track must
|
|
20508
|
+
* be sent back unchanged to avoid the camera dropping them.
|
|
20509
|
+
*/
|
|
20510
|
+
async setEmailTask(channel, task, options) {
|
|
20511
|
+
const ch = this.normalizeChannel(channel);
|
|
20512
|
+
const payloadXml = buildSetEmailTaskXml({ ...task, channelId: ch });
|
|
20513
|
+
await this.sendXml({
|
|
20514
|
+
cmdId: BC_CMD_ID_SET_EMAIL_TASK,
|
|
20515
|
+
channel: ch,
|
|
20516
|
+
payloadXml,
|
|
20517
|
+
...options?.timeoutMs != null ? { timeoutMs: options.timeoutMs } : {}
|
|
20518
|
+
});
|
|
20519
|
+
}
|
|
20520
|
+
/**
|
|
20521
|
+
* Convenience wrapper that patches the schedule of one or more trigger
|
|
20522
|
+
* types on the camera's EmailTask without touching the others.
|
|
20523
|
+
*
|
|
20524
|
+
* Pass a high-level schedule spec (`always` / `never` / explicit windows)
|
|
20525
|
+
* and the trigger types it should apply to. The method:
|
|
20526
|
+
*
|
|
20527
|
+
* 1. Reads the current EmailTask via GET (so we keep every existing slot).
|
|
20528
|
+
* 2. Builds the new `valueTable` once from `schedule`.
|
|
20529
|
+
* 3. Replaces the `valueTable` of every matching `type` in the list.
|
|
20530
|
+
* 4. Appends entries for any requested type not already present.
|
|
20531
|
+
* 5. Writes the merged list back via SET.
|
|
20532
|
+
*
|
|
20533
|
+
* Returns the list of types that were actually touched.
|
|
20534
|
+
*/
|
|
20535
|
+
async patchEmailSchedule(channel, spec, options) {
|
|
20536
|
+
const current = await this.getEmailTask(channel, options);
|
|
20537
|
+
const newValueTable = buildEmailScheduleValueTable(spec.schedule);
|
|
20538
|
+
const targetSet = new Set(spec.types);
|
|
20539
|
+
const touched = [];
|
|
20540
|
+
const updatedList = current.typeScheduleList.map((item) => {
|
|
20541
|
+
if (targetSet.has(item.type)) {
|
|
20542
|
+
touched.push(item.type);
|
|
20543
|
+
return { ...item, valueTable: newValueTable };
|
|
20544
|
+
}
|
|
20545
|
+
return item;
|
|
20546
|
+
});
|
|
20547
|
+
for (const t of spec.types) {
|
|
20548
|
+
if (!current.typeScheduleList.some((item) => item.type === t)) {
|
|
20549
|
+
updatedList.push({ type: t, valueTable: newValueTable });
|
|
20550
|
+
touched.push(t);
|
|
20551
|
+
}
|
|
20552
|
+
}
|
|
20553
|
+
await this.setEmailTask(
|
|
20554
|
+
channel,
|
|
20555
|
+
{
|
|
20556
|
+
channelId: current.channelId,
|
|
20557
|
+
enable: spec.enable ?? current.enable,
|
|
20558
|
+
typeScheduleList: updatedList
|
|
20559
|
+
},
|
|
20560
|
+
options
|
|
20561
|
+
);
|
|
20562
|
+
return { touchedTypes: touched };
|
|
20563
|
+
}
|
|
20564
|
+
// ====================================================================
|
|
20565
|
+
// Email server (cmdId 42/43/141), NTP (38/39), DST (106/107),
|
|
20566
|
+
// SystemGeneral SET (105), AutoReboot (100/101).
|
|
20567
|
+
// Schemas derived from Reolink Client pcap (2026-05-16).
|
|
20568
|
+
// ====================================================================
|
|
20569
|
+
/**
|
|
20570
|
+
* Read the SMTP email configuration (cmdId=42). Returns the full `<Email>`
|
|
20571
|
+
* block including capability hints (`senderMaxLen`, `pwdMaxLen`,
|
|
20572
|
+
* `emailAttachAbility`).
|
|
20573
|
+
*/
|
|
20574
|
+
async getEmail(options) {
|
|
20575
|
+
const xml = await this.sendXml({
|
|
20576
|
+
cmdId: BC_CMD_ID_GET_EMAIL,
|
|
20577
|
+
...options?.timeoutMs != null ? { timeoutMs: options.timeoutMs } : {}
|
|
20578
|
+
});
|
|
20579
|
+
return parseEmailConfigFromXml(xml);
|
|
20580
|
+
}
|
|
20581
|
+
/**
|
|
20582
|
+
* Patch the SMTP email configuration (cmdId=43). Reads the current config
|
|
20583
|
+
* first then merges the patch — Reolink rejects partial `<Email>` blocks.
|
|
20584
|
+
*/
|
|
20585
|
+
async setEmail(patch, options) {
|
|
20586
|
+
const current = await this.getEmail(options);
|
|
20587
|
+
const payloadXml = buildSetEmailXml(current, patch);
|
|
20588
|
+
await this.sendXml({
|
|
20589
|
+
cmdId: BC_CMD_ID_SET_EMAIL,
|
|
20590
|
+
payloadXml,
|
|
20591
|
+
...options?.timeoutMs != null ? { timeoutMs: options.timeoutMs } : {}
|
|
20592
|
+
});
|
|
20593
|
+
}
|
|
20594
|
+
/**
|
|
20595
|
+
* Send a test email using either the current config or an override patch
|
|
20596
|
+
* (cmdId=141). Returns true when the camera reports 200 (test succeeded),
|
|
20597
|
+
* false when it reports 482 (test failed — server unreachable / bad creds).
|
|
20598
|
+
* Other non-200 codes propagate as exceptions via `sendXml`.
|
|
20599
|
+
*/
|
|
20600
|
+
async testEmail(patch, options) {
|
|
20601
|
+
const current = await this.getEmail(options);
|
|
20602
|
+
const payloadXml = buildSetEmailXml(current, patch ?? {});
|
|
20603
|
+
const timeoutMs = options?.timeoutMs ?? 6e4;
|
|
20604
|
+
try {
|
|
20605
|
+
await this.sendXml({
|
|
20606
|
+
cmdId: BC_CMD_ID_TEST_EMAIL,
|
|
20607
|
+
payloadXml,
|
|
20608
|
+
timeoutMs
|
|
20609
|
+
});
|
|
20610
|
+
return true;
|
|
20611
|
+
} catch (err) {
|
|
20612
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
20613
|
+
if (msg.includes("response_code 482") || msg.includes("response_code=482")) {
|
|
20614
|
+
return false;
|
|
20615
|
+
}
|
|
20616
|
+
throw err;
|
|
20617
|
+
}
|
|
20618
|
+
}
|
|
20619
|
+
/**
|
|
20620
|
+
* Read the NTP server configuration (cmdId=38).
|
|
20621
|
+
*/
|
|
20622
|
+
async getNtp(options) {
|
|
20623
|
+
const xml = await this.sendXml({
|
|
20624
|
+
cmdId: BC_CMD_ID_GET_NTP,
|
|
20625
|
+
...options?.timeoutMs != null ? { timeoutMs: options.timeoutMs } : {}
|
|
20626
|
+
});
|
|
20627
|
+
return parseNtpConfigFromXml(xml);
|
|
20628
|
+
}
|
|
20629
|
+
/**
|
|
20630
|
+
* Patch the NTP server configuration (cmdId=39). Reads the current state
|
|
20631
|
+
* first and merges the patch — Reolink rejects partial `<Ntp>` blocks.
|
|
20632
|
+
*/
|
|
20633
|
+
async setNtp(patch, options) {
|
|
20634
|
+
const current = await this.getNtp(options);
|
|
20635
|
+
const payloadXml = buildSetNtpXml(current, patch);
|
|
20636
|
+
await this.sendXml({
|
|
20637
|
+
cmdId: BC_CMD_ID_SET_NTP,
|
|
20638
|
+
payloadXml,
|
|
20639
|
+
...options?.timeoutMs != null ? { timeoutMs: options.timeoutMs } : {}
|
|
20640
|
+
});
|
|
20641
|
+
}
|
|
20642
|
+
/**
|
|
20643
|
+
* Patch SystemGeneral (cmdId=105). Supports partial payloads: include only
|
|
20644
|
+
* the fields you want to change. By default the builder emits `<year>0</year>`
|
|
20645
|
+
* as the "do not set manual clock" marker; pass `manualTime` to actually
|
|
20646
|
+
* set the date/time. Setting only `deviceName` automatically uses the
|
|
20647
|
+
* Reolink Client's `deviceNameOnly=1` shape.
|
|
20648
|
+
*/
|
|
20649
|
+
async setSystemGeneral(patch, options) {
|
|
20650
|
+
const payloadXml = buildSetSystemGeneralXml(patch);
|
|
20651
|
+
await this.sendXml({
|
|
20652
|
+
cmdId: BC_CMD_ID_SET_SYSTEM_GENERAL,
|
|
20653
|
+
payloadXml,
|
|
20654
|
+
...options?.timeoutMs != null ? { timeoutMs: options.timeoutMs } : {}
|
|
20655
|
+
});
|
|
20656
|
+
}
|
|
20657
|
+
/**
|
|
20658
|
+
* Read the Daylight Saving Time configuration (cmdId=106).
|
|
20659
|
+
*/
|
|
20660
|
+
async getDst(options) {
|
|
20661
|
+
const xml = await this.sendXml({
|
|
20662
|
+
cmdId: BC_CMD_ID_GET_DST,
|
|
20663
|
+
...options?.timeoutMs != null ? { timeoutMs: options.timeoutMs } : {}
|
|
20664
|
+
});
|
|
20665
|
+
return parseDstConfigFromXml(xml);
|
|
20666
|
+
}
|
|
20667
|
+
/**
|
|
20668
|
+
* Patch the DST configuration (cmdId=107). Reads the current state first
|
|
20669
|
+
* and merges the patch.
|
|
20670
|
+
*/
|
|
20671
|
+
async setDst(patch, options) {
|
|
20672
|
+
const current = await this.getDst(options);
|
|
20673
|
+
const payloadXml = buildSetDstXml(current, patch);
|
|
20674
|
+
await this.sendXml({
|
|
20675
|
+
cmdId: BC_CMD_ID_SET_DST,
|
|
20676
|
+
payloadXml,
|
|
20677
|
+
...options?.timeoutMs != null ? { timeoutMs: options.timeoutMs } : {}
|
|
20678
|
+
});
|
|
20679
|
+
}
|
|
20680
|
+
/**
|
|
20681
|
+
* Read the auto-reboot schedule (cmdId=101).
|
|
20682
|
+
*/
|
|
20683
|
+
async getAutoReboot(options) {
|
|
20684
|
+
const xml = await this.sendXml({
|
|
20685
|
+
cmdId: BC_CMD_ID_GET_AUTO_REBOOT,
|
|
20686
|
+
...options?.timeoutMs != null ? { timeoutMs: options.timeoutMs } : {}
|
|
20687
|
+
});
|
|
20688
|
+
return parseAutoRebootFromXml(xml);
|
|
20689
|
+
}
|
|
20690
|
+
/**
|
|
20691
|
+
* Patch the auto-reboot schedule (cmdId=100).
|
|
20692
|
+
*/
|
|
20693
|
+
async setAutoReboot(patch, options) {
|
|
20694
|
+
const current = await this.getAutoReboot(options);
|
|
20695
|
+
const payloadXml = buildSetAutoRebootXml(current, patch);
|
|
20696
|
+
await this.sendXml({
|
|
20697
|
+
cmdId: BC_CMD_ID_SET_AUTO_REBOOT,
|
|
20698
|
+
payloadXml,
|
|
20699
|
+
...options?.timeoutMs != null ? { timeoutMs: options.timeoutMs } : {}
|
|
20700
|
+
});
|
|
20701
|
+
}
|
|
20702
|
+
/**
|
|
20703
|
+
* High-level helper that configures the camera to deliver motion alerts via
|
|
20704
|
+
* SMTP to the local nodelink manager. Orchestrates `setEmail` + `setEmailTask`
|
|
20705
|
+
* in a single call so UI code can offer "auto-configure" without juggling
|
|
20706
|
+
* the underlying commands.
|
|
20707
|
+
*
|
|
20708
|
+
* Pass `runTest: true` to also send a test email (cmdId=141). Returns a
|
|
20709
|
+
* structured result describing each leg of the flow so the caller can show
|
|
20710
|
+
* granular feedback.
|
|
20711
|
+
*
|
|
20712
|
+
* @param params Auto-configuration parameters
|
|
20713
|
+
* @param channel Logical channel (default 0). Used for the EmailTask SET.
|
|
20714
|
+
*/
|
|
20715
|
+
async setupEmailPushToManager(params, channel, options) {
|
|
20716
|
+
const port = params.managerPort ?? 2525;
|
|
20717
|
+
const domain = params.domain ?? "nodelink.local";
|
|
20718
|
+
const recipient = `${params.recipientLocalPart}@${domain}`;
|
|
20719
|
+
const triggers = params.triggerTypes ?? ["MD", "people", "vehicle"];
|
|
20720
|
+
const attachmentType = params.attachmentType ?? "picture";
|
|
20721
|
+
const interval = params.interval ?? 30;
|
|
20722
|
+
const emailPatch = {
|
|
20723
|
+
smtpServer: params.managerHost,
|
|
20724
|
+
smtpPort: port,
|
|
20725
|
+
userName: params.authUsername ?? recipient,
|
|
20726
|
+
password: params.authPassword ?? "",
|
|
20727
|
+
address1: recipient,
|
|
20728
|
+
address2: "",
|
|
20729
|
+
address3: "",
|
|
20730
|
+
sendNickname: params.sendNickname ?? params.recipientLocalPart,
|
|
20731
|
+
attachment: attachmentType === "none" ? 0 : 1,
|
|
20732
|
+
attachmentType,
|
|
20733
|
+
textType: "withText",
|
|
20734
|
+
ssl: 0,
|
|
20735
|
+
interval
|
|
20736
|
+
};
|
|
20737
|
+
await this.setEmail(emailPatch, options);
|
|
20738
|
+
const fullWeekOn = "1".repeat(168);
|
|
20739
|
+
const current = await this.getEmailTask(channel, options);
|
|
20740
|
+
const triggerSet = new Set(triggers);
|
|
20741
|
+
const touched = [];
|
|
20742
|
+
const updatedList = current.typeScheduleList.map((item) => {
|
|
20743
|
+
if (triggerSet.has(item.type)) {
|
|
20744
|
+
touched.push(item.type);
|
|
20745
|
+
return { ...item, valueTable: fullWeekOn };
|
|
20746
|
+
}
|
|
20747
|
+
return item;
|
|
20748
|
+
});
|
|
20749
|
+
for (const t of triggers) {
|
|
20750
|
+
if (!current.typeScheduleList.some((item) => item.type === t)) {
|
|
20751
|
+
updatedList.push({ type: t, valueTable: fullWeekOn });
|
|
20752
|
+
touched.push(t);
|
|
20753
|
+
}
|
|
20754
|
+
}
|
|
20755
|
+
await this.setEmailTask(
|
|
20756
|
+
channel,
|
|
20757
|
+
{
|
|
20758
|
+
channelId: current.channelId,
|
|
20759
|
+
enable: 1,
|
|
20760
|
+
typeScheduleList: updatedList
|
|
20761
|
+
},
|
|
20762
|
+
options
|
|
20763
|
+
);
|
|
20764
|
+
const result = {
|
|
20765
|
+
setEmail: { applied: true },
|
|
20766
|
+
setEmailTask: { applied: true, touchedTypes: touched }
|
|
20767
|
+
};
|
|
20768
|
+
if (params.runTest) {
|
|
20769
|
+
const ok = await this.testEmail(emailPatch, options);
|
|
20770
|
+
result.testEmail = { success: ok };
|
|
20771
|
+
}
|
|
20772
|
+
return result;
|
|
20173
20773
|
}
|
|
20174
20774
|
/**
|
|
20175
20775
|
* Get siren-on-motion state via AudioTask (cmdId=232).
|
|
@@ -20438,7 +21038,7 @@ ${xml}`
|
|
|
20438
21038
|
cmdId: BC_CMD_ID_GET_SYSTEM_GENERAL,
|
|
20439
21039
|
...options?.timeoutMs != null ? { timeoutMs: options.timeoutMs } : {}
|
|
20440
21040
|
});
|
|
20441
|
-
return
|
|
21041
|
+
return parseSystemGeneralFromXml(xml);
|
|
20442
21042
|
}
|
|
20443
21043
|
/**
|
|
20444
21044
|
* Get device support/capability flags.
|
|
@@ -23280,4 +23880,4 @@ export {
|
|
|
23280
23880
|
isTcpFailureThatShouldFallbackToUdp,
|
|
23281
23881
|
autoDetectDeviceType
|
|
23282
23882
|
};
|
|
23283
|
-
//# sourceMappingURL=chunk-
|
|
23883
|
+
//# sourceMappingURL=chunk-WKETZFBI.js.map
|