@apocaliss92/nodelink-js 0.4.31 → 0.4.32

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.
@@ -3,7 +3,7 @@ import {
3
3
  BaichuanRtspServer,
4
4
  ReolinkBaichuanApi,
5
5
  autoDetectDeviceType
6
- } from "../chunk-XVFCEFM6.js";
6
+ } from "../chunk-5Z7NVPV6.js";
7
7
  import "../chunk-AHY4L7JI.js";
8
8
  import {
9
9
  __require
package/dist/index.cjs CHANGED
@@ -19820,6 +19820,13 @@ var ReolinkBaichuanApi = class _ReolinkBaichuanApi {
19820
19820
  * Once closed, the API instance should not be reused.
19821
19821
  */
19822
19822
  _closed = false;
19823
+ /**
19824
+ * Off-handle for the auto-bridge between the global email-push bus
19825
+ * and this api's `simpleEventListeners`. Set in the constructor
19826
+ * when `emailPushCameraId` is provided; released in `close()`.
19827
+ * `undefined` means no bridge was requested for this api.
19828
+ */
19829
+ emailPushAutoBridgeOff;
19823
19830
  // ─────────────────────────────────────────────────────────────────────────────
19824
19831
  // SOCKET POOL - Tag-based socket management
19825
19832
  // ─────────────────────────────────────────────────────────────────────────────
@@ -21162,6 +21169,12 @@ var ReolinkBaichuanApi = class _ReolinkBaichuanApi {
21162
21169
  this.rebootAfterConsecutiveEconnreset = Math.floor(econnresetThreshold);
21163
21170
  }
21164
21171
  this.setupGeneralClientListeners();
21172
+ if (opts.emailPushCameraId) {
21173
+ this.emailPushAutoBridgeOff = this.subscribeEmailPushEvents({
21174
+ cameraId: opts.emailPushCameraId,
21175
+ channel: opts.emailPushChannel ?? 0
21176
+ });
21177
+ }
21165
21178
  }
21166
21179
  /**
21167
21180
  * CGI forward: fetch RTSP URL for a channel via `GetRtspUrl`.
@@ -22285,6 +22298,13 @@ var ReolinkBaichuanApi = class _ReolinkBaichuanApi {
22285
22298
  async close(options) {
22286
22299
  if (this._closed) return;
22287
22300
  this._closed = true;
22301
+ if (this.emailPushAutoBridgeOff) {
22302
+ try {
22303
+ this.emailPushAutoBridgeOff();
22304
+ } catch {
22305
+ }
22306
+ this.emailPushAutoBridgeOff = void 0;
22307
+ }
22288
22308
  if (this.sessionGuardIntervalTimer) {
22289
22309
  clearInterval(this.sessionGuardIntervalTimer);
22290
22310
  this.sessionGuardIntervalTimer = void 0;