@apocaliss92/nodelink-js 0.1.14 → 0.1.18

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.
@@ -2287,6 +2287,8 @@ var BC_CLASS_FILE_DOWNLOAD = 25730;
2287
2287
  function bcHeaderHasPayloadOffset(messageClass) {
2288
2288
  return messageClass === BC_CLASS_MODERN_24 || messageClass === BC_CLASS_MODERN_24_ALT || messageClass === BC_CLASS_FILE_DOWNLOAD;
2289
2289
  }
2290
+ var BC_CMD_ID_LOGIN = 1;
2291
+ var BC_CMD_ID_LOGOUT = 2;
2290
2292
  var BC_CMD_ID_VIDEO = 3;
2291
2293
  var BC_CMD_ID_VIDEO_STOP = 4;
2292
2294
  var BC_CMD_ID_FILE_INFO_LIST_REPLAY = 5;
@@ -4641,7 +4643,9 @@ function buildRtspUrl(params) {
4641
4643
  // src/protocol/xml.ts
4642
4644
  function xmlEscape(text) {
4643
4645
  if (text === void 0 || text === null || typeof text !== "string") {
4644
- const error = new Error(`xmlEscape: expected string but got ${typeof text}: ${text}`);
4646
+ const error = new Error(
4647
+ `xmlEscape: expected string but got ${typeof text}: ${text}`
4648
+ );
4645
4649
  throw error;
4646
4650
  }
4647
4651
  return text.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&apos;");
@@ -4660,6 +4664,13 @@ function buildLoginXml(userNameHash, passwordHash) {
4660
4664
  </LoginNet>
4661
4665
  </body>`;
4662
4666
  }
4667
+ function buildLogoutXml() {
4668
+ return `<?xml version="1.0" encoding="UTF-8" ?>
4669
+ <body>
4670
+ <Logout version="1.1">
4671
+ </Logout>
4672
+ </body>`;
4673
+ }
4663
4674
  function buildChannelExtensionXml(channelId) {
4664
4675
  if (channelId === void 0 || channelId === null) {
4665
4676
  return `<?xml version="1.0" encoding="UTF-8" ?><Extension version="1.1"></Extension>`;
@@ -4681,7 +4692,9 @@ function buildBinaryExtensionXml(channelId) {
4681
4692
  }
4682
4693
  function buildPreviewXml(handle, streamType, channelId) {
4683
4694
  if (!streamType || typeof streamType !== "string") {
4684
- throw new Error(`buildPreviewXml: streamType is required (string) but got: ${typeof streamType} = ${streamType}`);
4695
+ throw new Error(
4696
+ `buildPreviewXml: streamType is required (string) but got: ${typeof streamType} = ${streamType}`
4697
+ );
4685
4698
  }
4686
4699
  const channelIdXml = channelId !== void 0 ? `<channelId>${channelId}</channelId>
4687
4700
  ` : "";
@@ -4695,13 +4708,19 @@ ${channelIdXml}<handle>${handle}</handle>
4695
4708
  }
4696
4709
  function buildPreviewXmlV11(params) {
4697
4710
  if (!Number.isFinite(params.channelId)) {
4698
- throw new Error(`buildPreviewXmlV11: channelId must be finite, got: ${params.channelId}`);
4711
+ throw new Error(
4712
+ `buildPreviewXmlV11: channelId must be finite, got: ${params.channelId}`
4713
+ );
4699
4714
  }
4700
4715
  if (!Number.isFinite(params.handle)) {
4701
- throw new Error(`buildPreviewXmlV11: handle must be finite, got: ${params.handle}`);
4716
+ throw new Error(
4717
+ `buildPreviewXmlV11: handle must be finite, got: ${params.handle}`
4718
+ );
4702
4719
  }
4703
4720
  if (!params.streamType || typeof params.streamType !== "string") {
4704
- throw new Error(`buildPreviewXmlV11: streamType is required (string) but got: ${typeof params.streamType} = ${params.streamType}`);
4721
+ throw new Error(
4722
+ `buildPreviewXmlV11: streamType is required (string) but got: ${typeof params.streamType} = ${params.streamType}`
4723
+ );
4705
4724
  }
4706
4725
  return `<?xml version="1.0" encoding="UTF-8" ?>
4707
4726
  <body>
@@ -4724,10 +4743,14 @@ ${channelIdXml}<handle>${handle}</handle>
4724
4743
  }
4725
4744
  function buildPreviewStopXmlV11(params) {
4726
4745
  if (!Number.isFinite(params.channelId)) {
4727
- throw new Error(`buildPreviewStopXmlV11: channelId must be finite, got: ${params.channelId}`);
4746
+ throw new Error(
4747
+ `buildPreviewStopXmlV11: channelId must be finite, got: ${params.channelId}`
4748
+ );
4728
4749
  }
4729
4750
  if (!Number.isFinite(params.handle)) {
4730
- throw new Error(`buildPreviewStopXmlV11: handle must be finite, got: ${params.handle}`);
4751
+ throw new Error(
4752
+ `buildPreviewStopXmlV11: handle must be finite, got: ${params.handle}`
4753
+ );
4731
4754
  }
4732
4755
  return `<?xml version="1.0" encoding="UTF-8" ?>
4733
4756
  <body>
@@ -4753,7 +4776,12 @@ function buildPtzControlXml(channelId, command, speed) {
4753
4776
  </body>`;
4754
4777
  }
4755
4778
  function buildPtzPresetXml(channelId, presetId, command, name) {
4756
- return buildPtzPresetXmlV2(channelId, presetId, command, name === void 0 ? void 0 : { name });
4779
+ return buildPtzPresetXmlV2(
4780
+ channelId,
4781
+ presetId,
4782
+ command,
4783
+ name === void 0 ? void 0 : { name }
4784
+ );
4757
4785
  }
4758
4786
  function buildPtzPresetXmlV2(channelId, presetId, command, options) {
4759
4787
  let nameXml = "";
@@ -7137,6 +7165,8 @@ export {
7137
7165
  BC_CLASS_MODERN_24_ALT,
7138
7166
  BC_CLASS_FILE_DOWNLOAD,
7139
7167
  bcHeaderHasPayloadOffset,
7168
+ BC_CMD_ID_LOGIN,
7169
+ BC_CMD_ID_LOGOUT,
7140
7170
  BC_CMD_ID_VIDEO,
7141
7171
  BC_CMD_ID_VIDEO_STOP,
7142
7172
  BC_CMD_ID_FILE_INFO_LIST_REPLAY,
@@ -7235,6 +7265,7 @@ export {
7235
7265
  AesStreamDecryptor,
7236
7266
  xmlEscape,
7237
7267
  buildLoginXml,
7268
+ buildLogoutXml,
7238
7269
  buildChannelExtensionXml,
7239
7270
  buildBinaryExtensionXml,
7240
7271
  buildPreviewXml,
@@ -7297,4 +7328,4 @@ export {
7297
7328
  parseRecordingFileName,
7298
7329
  ReolinkCgiApi
7299
7330
  };
7300
- //# sourceMappingURL=chunk-QEA2V52E.js.map
7331
+ //# sourceMappingURL=chunk-ZE7D7LI4.js.map