@apocaliss92/nodelink-js 0.4.7 → 0.4.10
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/{DiagnosticsTools-UMN4C7SY.js → DiagnosticsTools-RNIDFEJK.js} +2 -2
- package/dist/{chunk-TR3V5FTO.js → chunk-EDLMKBG2.js} +226 -3
- package/dist/chunk-EDLMKBG2.js.map +1 -0
- package/dist/{chunk-GKLOJJ34.js → chunk-HGQ53FB3.js} +1023 -341
- package/dist/chunk-HGQ53FB3.js.map +1 -0
- package/dist/cli/rtsp-server.cjs +1172 -312
- package/dist/cli/rtsp-server.cjs.map +1 -1
- package/dist/cli/rtsp-server.js +2 -2
- package/dist/index.cjs +1407 -329
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +989 -6
- package/dist/index.d.ts +1050 -5
- package/dist/index.js +232 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-GKLOJJ34.js.map +0 -1
- package/dist/chunk-TR3V5FTO.js.map +0 -1
- /package/dist/{DiagnosticsTools-UMN4C7SY.js.map → DiagnosticsTools-RNIDFEJK.js.map} +0 -0
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
sampleStreams,
|
|
13
13
|
sanitizeFixtureData,
|
|
14
14
|
testChannelStreams
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EDLMKBG2.js";
|
|
16
16
|
export {
|
|
17
17
|
captureModelFixtures,
|
|
18
18
|
collectCgiDiagnostics,
|
|
@@ -28,4 +28,4 @@ export {
|
|
|
28
28
|
sanitizeFixtureData,
|
|
29
29
|
testChannelStreams
|
|
30
30
|
};
|
|
31
|
-
//# sourceMappingURL=DiagnosticsTools-
|
|
31
|
+
//# sourceMappingURL=DiagnosticsTools-RNIDFEJK.js.map
|
|
@@ -858,6 +858,137 @@ var ReolinkCgiApi = class _ReolinkCgiApi {
|
|
|
858
858
|
const param = channel == null ? {} : { channel };
|
|
859
859
|
return await this.call("GetPtzPreset", param, 1);
|
|
860
860
|
}
|
|
861
|
+
// ── Isp / Image (colour, flip, day-night, exposure) ──────────────
|
|
862
|
+
async GetIsp(channel) {
|
|
863
|
+
const param = channel == null ? {} : { channel };
|
|
864
|
+
return await this.call("GetIsp", param, 1);
|
|
865
|
+
}
|
|
866
|
+
async SetIsp(isp) {
|
|
867
|
+
return await this.call("SetIsp", isp, 0);
|
|
868
|
+
}
|
|
869
|
+
async GetImage(channel) {
|
|
870
|
+
const param = channel == null ? {} : { channel };
|
|
871
|
+
return await this.call("GetImage", param, 1);
|
|
872
|
+
}
|
|
873
|
+
async SetImage(image) {
|
|
874
|
+
return await this.call("SetImage", image, 0);
|
|
875
|
+
}
|
|
876
|
+
// ── AudioCfg (mute / volume) ─────────────────────────────────────
|
|
877
|
+
async GetAudioCfg(channel) {
|
|
878
|
+
const param = channel == null ? {} : { channel };
|
|
879
|
+
return await this.call("GetAudioCfg", param, 1);
|
|
880
|
+
}
|
|
881
|
+
async SetAudioCfg(audio) {
|
|
882
|
+
return await this.call("SetAudioCfg", audio, 0);
|
|
883
|
+
}
|
|
884
|
+
// ── Enc setter (Get already exists above) ────────────────────────
|
|
885
|
+
async SetEnc(enc) {
|
|
886
|
+
return await this.call("SetEnc", enc, 0);
|
|
887
|
+
}
|
|
888
|
+
// ── MdAlarm (motion detection sensitivity / regions) ─────────────
|
|
889
|
+
async GetMdAlarm(channel) {
|
|
890
|
+
const param = channel == null ? {} : { channel };
|
|
891
|
+
return await this.call("GetMdAlarm", param, 1);
|
|
892
|
+
}
|
|
893
|
+
async SetMdAlarm(md) {
|
|
894
|
+
return await this.call("SetMdAlarm", md, 0);
|
|
895
|
+
}
|
|
896
|
+
// ── IrLights ─────────────────────────────────────────────────────
|
|
897
|
+
async GetIrLights(channel) {
|
|
898
|
+
const param = channel == null ? {} : { channel };
|
|
899
|
+
return await this.call("GetIrLights", param, 1);
|
|
900
|
+
}
|
|
901
|
+
async SetIrLights(ir) {
|
|
902
|
+
return await this.call("SetIrLights", ir, 0);
|
|
903
|
+
}
|
|
904
|
+
// ── AiCfg (smart-detection enable + class filter) ────────────────
|
|
905
|
+
async GetAiCfg(channel) {
|
|
906
|
+
const param = channel == null ? {} : { channel };
|
|
907
|
+
return await this.call("GetAiCfg", param, 1);
|
|
908
|
+
}
|
|
909
|
+
async SetAiCfg(ai) {
|
|
910
|
+
return await this.call("SetAiCfg", ai, 0);
|
|
911
|
+
}
|
|
912
|
+
// ── Mask (privacy-mask zones) ────────────────────────────────────
|
|
913
|
+
async GetMask(channel) {
|
|
914
|
+
return await this.call("GetMask", { channel }, 1);
|
|
915
|
+
}
|
|
916
|
+
async SetMask(mask) {
|
|
917
|
+
return await this.call("SetMask", mask, 0);
|
|
918
|
+
}
|
|
919
|
+
// ── AudioNoise (input noise reduction) ───────────────────────────
|
|
920
|
+
async GetAudioNoise(channel) {
|
|
921
|
+
return await this.call("GetAudioNoise", { channel }, 1);
|
|
922
|
+
}
|
|
923
|
+
async SetAudioNoise(noise) {
|
|
924
|
+
return await this.call("SetAudioNoise", noise, 0);
|
|
925
|
+
}
|
|
926
|
+
// ── Rec / RecV20 (recording schedule) ────────────────────────────
|
|
927
|
+
async GetRec(channel) {
|
|
928
|
+
return await this.call("GetRec", { channel }, 1);
|
|
929
|
+
}
|
|
930
|
+
async SetRec(rec) {
|
|
931
|
+
return await this.call("SetRec", rec, 0);
|
|
932
|
+
}
|
|
933
|
+
/** Newer firmwares advertise `GetRecV20` / `SetRecV20` with the
|
|
934
|
+
* weekly-schedule `table` field. Same payload shape as `Rec`. */
|
|
935
|
+
async GetRecV20(channel) {
|
|
936
|
+
return await this.call("GetRecV20", { channel }, 1);
|
|
937
|
+
}
|
|
938
|
+
async SetRecV20(rec) {
|
|
939
|
+
return await this.call("SetRecV20", rec, 0);
|
|
940
|
+
}
|
|
941
|
+
// ── Email (SMTP alert) ───────────────────────────────────────────
|
|
942
|
+
async GetEmail(channel) {
|
|
943
|
+
return await this.call("GetEmail", { channel }, 1);
|
|
944
|
+
}
|
|
945
|
+
async SetEmail(email) {
|
|
946
|
+
return await this.call("SetEmail", email, 0);
|
|
947
|
+
}
|
|
948
|
+
/** V20 variant on newer firmwares with weekly-schedule `table`. */
|
|
949
|
+
async GetEmailV20(channel) {
|
|
950
|
+
return await this.call("GetEmailV20", { channel }, 1);
|
|
951
|
+
}
|
|
952
|
+
async SetEmailV20(email) {
|
|
953
|
+
return await this.call("SetEmailV20", email, 0);
|
|
954
|
+
}
|
|
955
|
+
// ── Push (Reolink-cloud push notifications) ──────────────────────
|
|
956
|
+
async GetPush(channel) {
|
|
957
|
+
return await this.call("GetPush", { channel }, 1);
|
|
958
|
+
}
|
|
959
|
+
async SetPush(push) {
|
|
960
|
+
return await this.call("SetPush", push, 0);
|
|
961
|
+
}
|
|
962
|
+
async GetPushV20(channel) {
|
|
963
|
+
return await this.call("GetPushV20", { channel }, 1);
|
|
964
|
+
}
|
|
965
|
+
async SetPushV20(push) {
|
|
966
|
+
return await this.call("SetPushV20", push, 0);
|
|
967
|
+
}
|
|
968
|
+
// ── AudioAlarm (siren-on-event) ──────────────────────────────────
|
|
969
|
+
async GetAudioAlarm(channel) {
|
|
970
|
+
return await this.call("GetAudioAlarm", { channel }, 1);
|
|
971
|
+
}
|
|
972
|
+
async SetAudioAlarm(audio) {
|
|
973
|
+
return await this.call("SetAudioAlarm", audio, 0);
|
|
974
|
+
}
|
|
975
|
+
async SetAudioAlarmV20(audio) {
|
|
976
|
+
return await this.call("SetAudioAlarmV20", audio, 0);
|
|
977
|
+
}
|
|
978
|
+
// ── AutoFocus (PTZ AF) ───────────────────────────────────────────
|
|
979
|
+
async GetAutoFocus(channel) {
|
|
980
|
+
return await this.call("GetAutoFocus", { channel }, 1);
|
|
981
|
+
}
|
|
982
|
+
async SetAutoFocus(af) {
|
|
983
|
+
return await this.call("SetAutoFocus", af, 0);
|
|
984
|
+
}
|
|
985
|
+
// ── AiAlarm (per-class smart-detection thresholds) ───────────────
|
|
986
|
+
async GetAiAlarm(channel, aiType) {
|
|
987
|
+
return await this.call("GetAiAlarm", { channel, ai_type: aiType }, 1);
|
|
988
|
+
}
|
|
989
|
+
async SetAiAlarm(ai) {
|
|
990
|
+
return await this.call("SetAiAlarm", ai, 0);
|
|
991
|
+
}
|
|
861
992
|
async GetAudioAlarmV20(channel) {
|
|
862
993
|
const param = channel == null ? {} : { channel };
|
|
863
994
|
return await this.call("GetAudioAlarmV20", param, 0);
|
|
@@ -2367,6 +2498,22 @@ var BC_CMD_ID_GET_AI_CFG = 299;
|
|
|
2367
2498
|
var BC_CMD_ID_SET_AI_CFG = 300;
|
|
2368
2499
|
var BC_CMD_ID_GET_SIREN_STATUS = 547;
|
|
2369
2500
|
var BC_CMD_ID_SET_AUDIO_TASK = 231;
|
|
2501
|
+
var BC_CMD_ID_SET_VIDEO_INPUT = 25;
|
|
2502
|
+
var BC_CMD_ID_SET_DAY_NIGHT_THRESHOLD = 297;
|
|
2503
|
+
var BC_CMD_ID_GET_ENC = 56;
|
|
2504
|
+
var BC_CMD_ID_SET_ENC = 57;
|
|
2505
|
+
var BC_CMD_ID_GET_PRIVACY_MASK = 52;
|
|
2506
|
+
var BC_CMD_ID_SET_PRIVACY_MASK = 53;
|
|
2507
|
+
var BC_CMD_ID_SET_AI_DENOISE = 440;
|
|
2508
|
+
var BC_CMD_ID_SET_LED_STATE = 209;
|
|
2509
|
+
var BC_CMD_ID_SET_AUDIO_CFG = 265;
|
|
2510
|
+
var BC_CMD_ID_SET_RECORD = 82;
|
|
2511
|
+
var BC_CMD_ID_SET_RECORD_CFG = 55;
|
|
2512
|
+
var BC_CMD_ID_SET_EMAIL_TASK = 216;
|
|
2513
|
+
var BC_CMD_ID_GET_PUSH_TASK = 219;
|
|
2514
|
+
var BC_CMD_ID_SET_PUSH_TASK = 218;
|
|
2515
|
+
var BC_CMD_ID_GET_AUTO_FOCUS = 224;
|
|
2516
|
+
var BC_CMD_ID_SET_AUTO_FOCUS = 225;
|
|
2370
2517
|
var BC_CMD_ID_CMD_123 = 123;
|
|
2371
2518
|
var BC_CMD_ID_CMD_209 = 209;
|
|
2372
2519
|
var BC_CMD_ID_CMD_265 = 265;
|
|
@@ -4024,7 +4171,7 @@ var BaichuanVideoStream = class _BaichuanVideoStream extends EventEmitter {
|
|
|
4024
4171
|
const allowMsgNum0Fallback = this.acceptAnyStreamType && frame.header.msgNum === 0;
|
|
4025
4172
|
if (!allowMsgNum0Fallback) {
|
|
4026
4173
|
const frameCount = this._msgNumMismatchCount = (this._msgNumMismatchCount || 0) + 1;
|
|
4027
|
-
if (frameCount <= 5) {
|
|
4174
|
+
if (frameCount <= 5 && this.client.getDebugConfig().general) {
|
|
4028
4175
|
this.logger?.log(
|
|
4029
4176
|
`[BaichuanVideoStream] Frame msgNum mismatch: received=${frame.header.msgNum}, expected=${this.activeMsgNum}, channel=${this.channel}, profile=${this.profile}, variant=${this.variant} (frame discarded)`
|
|
4030
4177
|
);
|
|
@@ -4034,7 +4181,7 @@ var BaichuanVideoStream = class _BaichuanVideoStream extends EventEmitter {
|
|
|
4034
4181
|
}
|
|
4035
4182
|
if (!this.acceptAnyStreamType && !this.expectedStreamTypes.has(frame.header.streamType)) {
|
|
4036
4183
|
const frameCount = this._streamTypeMismatchCount = (this._streamTypeMismatchCount || 0) + 1;
|
|
4037
|
-
if (frameCount <= 5) {
|
|
4184
|
+
if (frameCount <= 5 && this.client.getDebugConfig().general) {
|
|
4038
4185
|
this.logger?.log(
|
|
4039
4186
|
`[BaichuanVideoStream] Frame streamType mismatch: received=${frame.header.streamType}, expectedAny=[${[
|
|
4040
4187
|
...this.expectedStreamTypes
|
|
@@ -4886,6 +5033,60 @@ function buildFloodlightManualXml(channelId, status, durationSeconds = 180) {
|
|
|
4886
5033
|
function buildWhiteLedStateXml(channelId, state) {
|
|
4887
5034
|
return buildFloodlightManualXml(channelId, state ? 1 : 0);
|
|
4888
5035
|
}
|
|
5036
|
+
var XML_HEADER = `<?xml version="1.0" encoding="UTF-8" ?>`;
|
|
5037
|
+
function ensureXmlHeader(xml) {
|
|
5038
|
+
const trimmed = xml.trimStart();
|
|
5039
|
+
if (trimmed.startsWith("<?xml")) return xml;
|
|
5040
|
+
return `${XML_HEADER}
|
|
5041
|
+
${xml}`;
|
|
5042
|
+
}
|
|
5043
|
+
function applyXmlTagPatch(xml, tag, value) {
|
|
5044
|
+
if (value === void 0) return xml;
|
|
5045
|
+
const v = typeof value === "boolean" ? value ? 1 : 0 : value;
|
|
5046
|
+
const re = new RegExp(`<${tag}>[^<]*</${tag}>`);
|
|
5047
|
+
return xml.replace(re, `<${tag}>${v}</${tag}>`);
|
|
5048
|
+
}
|
|
5049
|
+
function patchNestedTag(xml, parent, child, value) {
|
|
5050
|
+
if (value === void 0) return xml;
|
|
5051
|
+
const v = typeof value === "boolean" ? value ? 1 : 0 : value;
|
|
5052
|
+
const re = new RegExp(
|
|
5053
|
+
`(<${parent}[^>]*>[\\s\\S]*?<${child}>)[^<]*(</${child}>[\\s\\S]*?</${parent}>)`
|
|
5054
|
+
);
|
|
5055
|
+
return xml.replace(re, `$1${v}$2`);
|
|
5056
|
+
}
|
|
5057
|
+
function applyStreamPatch(xml, streamTag, patch) {
|
|
5058
|
+
if (!patch) return xml;
|
|
5059
|
+
const re = new RegExp(
|
|
5060
|
+
`(<${streamTag}[^>]*>)([\\s\\S]*?)(</${streamTag}>)`
|
|
5061
|
+
);
|
|
5062
|
+
return xml.replace(re, (_match, open, body, close) => {
|
|
5063
|
+
let next = body;
|
|
5064
|
+
if (patch.bitRate !== void 0) {
|
|
5065
|
+
next = applyXmlTagPatch(next, "bitRate", patch.bitRate);
|
|
5066
|
+
}
|
|
5067
|
+
if (patch.frameRate !== void 0) {
|
|
5068
|
+
next = applyXmlTagPatch(next, "frameRate", patch.frameRate);
|
|
5069
|
+
next = applyXmlTagPatch(next, "frame", patch.frameRate);
|
|
5070
|
+
}
|
|
5071
|
+
if (patch.videoEncType !== void 0) {
|
|
5072
|
+
const intVal = patch.videoEncType === "h265" ? 1 : 0;
|
|
5073
|
+
next = applyXmlTagPatch(next, "videoEncType", intVal);
|
|
5074
|
+
}
|
|
5075
|
+
return `${open}${next}${close}`;
|
|
5076
|
+
});
|
|
5077
|
+
}
|
|
5078
|
+
function normalizeDayNightMode(input) {
|
|
5079
|
+
const stripped = String(input).replace(/&/g, "And");
|
|
5080
|
+
if (!stripped) return stripped;
|
|
5081
|
+
const first = stripped[0];
|
|
5082
|
+
if (first === void 0) return stripped;
|
|
5083
|
+
return first.toLowerCase() + stripped.slice(1);
|
|
5084
|
+
}
|
|
5085
|
+
function normalizeOpenClose(input) {
|
|
5086
|
+
const v = String(input).toLowerCase();
|
|
5087
|
+
if (v === "on" || v === "open" || v === "1" || v === "true") return "open";
|
|
5088
|
+
return "close";
|
|
5089
|
+
}
|
|
4889
5090
|
function buildAbilityInfoExtensionXml(username) {
|
|
4890
5091
|
return `<?xml version="1.0" encoding="UTF-8" ?>
|
|
4891
5092
|
<Extension version="1.1">
|
|
@@ -7703,6 +7904,22 @@ export {
|
|
|
7703
7904
|
BC_CMD_ID_SET_AI_CFG,
|
|
7704
7905
|
BC_CMD_ID_GET_SIREN_STATUS,
|
|
7705
7906
|
BC_CMD_ID_SET_AUDIO_TASK,
|
|
7907
|
+
BC_CMD_ID_SET_VIDEO_INPUT,
|
|
7908
|
+
BC_CMD_ID_SET_DAY_NIGHT_THRESHOLD,
|
|
7909
|
+
BC_CMD_ID_GET_ENC,
|
|
7910
|
+
BC_CMD_ID_SET_ENC,
|
|
7911
|
+
BC_CMD_ID_GET_PRIVACY_MASK,
|
|
7912
|
+
BC_CMD_ID_SET_PRIVACY_MASK,
|
|
7913
|
+
BC_CMD_ID_SET_AI_DENOISE,
|
|
7914
|
+
BC_CMD_ID_SET_LED_STATE,
|
|
7915
|
+
BC_CMD_ID_SET_AUDIO_CFG,
|
|
7916
|
+
BC_CMD_ID_SET_RECORD,
|
|
7917
|
+
BC_CMD_ID_SET_RECORD_CFG,
|
|
7918
|
+
BC_CMD_ID_SET_EMAIL_TASK,
|
|
7919
|
+
BC_CMD_ID_GET_PUSH_TASK,
|
|
7920
|
+
BC_CMD_ID_SET_PUSH_TASK,
|
|
7921
|
+
BC_CMD_ID_GET_AUTO_FOCUS,
|
|
7922
|
+
BC_CMD_ID_SET_AUTO_FOCUS,
|
|
7706
7923
|
BC_CMD_ID_CMD_123,
|
|
7707
7924
|
BC_CMD_ID_CMD_209,
|
|
7708
7925
|
BC_CMD_ID_CMD_265,
|
|
@@ -7747,6 +7964,12 @@ export {
|
|
|
7747
7964
|
buildSirenTimesXml,
|
|
7748
7965
|
buildFloodlightManualXml,
|
|
7749
7966
|
buildWhiteLedStateXml,
|
|
7967
|
+
ensureXmlHeader,
|
|
7968
|
+
applyXmlTagPatch,
|
|
7969
|
+
patchNestedTag,
|
|
7970
|
+
applyStreamPatch,
|
|
7971
|
+
normalizeDayNightMode,
|
|
7972
|
+
normalizeOpenClose,
|
|
7750
7973
|
buildAbilityInfoExtensionXml,
|
|
7751
7974
|
normalizeDebugOptions,
|
|
7752
7975
|
recordingsTraceLog,
|
|
@@ -7797,4 +8020,4 @@ export {
|
|
|
7797
8020
|
parseRecordingFileName,
|
|
7798
8021
|
ReolinkCgiApi
|
|
7799
8022
|
};
|
|
7800
|
-
//# sourceMappingURL=chunk-
|
|
8023
|
+
//# sourceMappingURL=chunk-EDLMKBG2.js.map
|