@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.
@@ -19143,6 +19143,13 @@ var ReolinkBaichuanApi = class _ReolinkBaichuanApi {
19143
19143
  * Once closed, the API instance should not be reused.
19144
19144
  */
19145
19145
  _closed = false;
19146
+ /**
19147
+ * Off-handle for the auto-bridge between the global email-push bus
19148
+ * and this api's `simpleEventListeners`. Set in the constructor
19149
+ * when `emailPushCameraId` is provided; released in `close()`.
19150
+ * `undefined` means no bridge was requested for this api.
19151
+ */
19152
+ emailPushAutoBridgeOff;
19146
19153
  // ─────────────────────────────────────────────────────────────────────────────
19147
19154
  // SOCKET POOL - Tag-based socket management
19148
19155
  // ─────────────────────────────────────────────────────────────────────────────
@@ -20485,6 +20492,12 @@ var ReolinkBaichuanApi = class _ReolinkBaichuanApi {
20485
20492
  this.rebootAfterConsecutiveEconnreset = Math.floor(econnresetThreshold);
20486
20493
  }
20487
20494
  this.setupGeneralClientListeners();
20495
+ if (opts.emailPushCameraId) {
20496
+ this.emailPushAutoBridgeOff = this.subscribeEmailPushEvents({
20497
+ cameraId: opts.emailPushCameraId,
20498
+ channel: opts.emailPushChannel ?? 0
20499
+ });
20500
+ }
20488
20501
  }
20489
20502
  /**
20490
20503
  * CGI forward: fetch RTSP URL for a channel via `GetRtspUrl`.
@@ -21608,6 +21621,13 @@ var ReolinkBaichuanApi = class _ReolinkBaichuanApi {
21608
21621
  async close(options) {
21609
21622
  if (this._closed) return;
21610
21623
  this._closed = true;
21624
+ if (this.emailPushAutoBridgeOff) {
21625
+ try {
21626
+ this.emailPushAutoBridgeOff();
21627
+ } catch {
21628
+ }
21629
+ this.emailPushAutoBridgeOff = void 0;
21630
+ }
21611
21631
  if (this.sessionGuardIntervalTimer) {
21612
21632
  clearInterval(this.sessionGuardIntervalTimer);
21613
21633
  this.sessionGuardIntervalTimer = void 0;