@apocaliss92/nodelink-js 0.4.19 → 0.4.20

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/index.d.cts CHANGED
@@ -5474,6 +5474,19 @@ declare class ReolinkBaichuanApi {
5474
5474
  private _isMultiFocal;
5475
5475
  /** Maximum dedicated sessions allowed before triggering a reboot (default: 7). */
5476
5476
  private maxDedicatedSessionsBeforeReboot;
5477
+ /**
5478
+ * Opt-in: when `false` (default), the lib never starts the 60s periodic
5479
+ * `getOnlineUserList` poll and never schedules an automatic reboot based
5480
+ * on the session count. The post-socket-create probe at line ~1859 is
5481
+ * also skipped. Consumers that want the legacy behaviour can pass
5482
+ * `enableSessionGuard: true` to the constructor.
5483
+ *
5484
+ * Rationale: on BCUDP (battery cameras) the periodic poll wakes the
5485
+ * camera every minute and triggers a perpetual sleeping↔awake cycle —
5486
+ * see issue #18. Even on AC cameras the auto-reboot side effect is
5487
+ * surprising; making it explicit avoids astonishment.
5488
+ */
5489
+ private sessionGuardEnabled;
5477
5490
  private sessionGuardRebootInFlight;
5478
5491
  private sessionGuardLastRebootAtMs;
5479
5492
  /** Track last known session count and IDs for change detection. */
@@ -5829,6 +5842,18 @@ declare class ReolinkBaichuanApi {
5829
5842
  rebootAfterConsecutiveEconnreset?: number;
5830
5843
  /** If true, avoid using HTTP/CGI fallbacks and discovery paths (native Baichuan only). */
5831
5844
  nativeOnly?: boolean;
5845
+ /**
5846
+ * Enable the periodic session-count guard: every 60s the lib polls
5847
+ * `getOnlineUserList` (cmd_id 120) and triggers a device reboot if
5848
+ * sessions from our IP exceed `maxDedicatedSessionsBeforeReboot`.
5849
+ *
5850
+ * Default: `false`. The poll wakes battery cameras on every tick and
5851
+ * its only side effect — an automatic reboot — is a heavy-hand fix
5852
+ * for a problem that rarely materialises in practice. Set to `true`
5853
+ * only if you specifically need the legacy auto-recovery behaviour;
5854
+ * even then the lib skips the poll on UDP transport.
5855
+ */
5856
+ enableSessionGuard?: boolean;
5832
5857
  });
5833
5858
  /**
5834
5859
  * CGI forward: fetch RTSP URL for a channel via `GetRtspUrl`.
package/dist/index.d.ts CHANGED
@@ -6389,6 +6389,19 @@ export declare class ReolinkBaichuanApi {
6389
6389
  private _isMultiFocal;
6390
6390
  /** Maximum dedicated sessions allowed before triggering a reboot (default: 7). */
6391
6391
  private maxDedicatedSessionsBeforeReboot;
6392
+ /**
6393
+ * Opt-in: when `false` (default), the lib never starts the 60s periodic
6394
+ * `getOnlineUserList` poll and never schedules an automatic reboot based
6395
+ * on the session count. The post-socket-create probe at line ~1859 is
6396
+ * also skipped. Consumers that want the legacy behaviour can pass
6397
+ * `enableSessionGuard: true` to the constructor.
6398
+ *
6399
+ * Rationale: on BCUDP (battery cameras) the periodic poll wakes the
6400
+ * camera every minute and triggers a perpetual sleeping↔awake cycle —
6401
+ * see issue #18. Even on AC cameras the auto-reboot side effect is
6402
+ * surprising; making it explicit avoids astonishment.
6403
+ */
6404
+ private sessionGuardEnabled;
6392
6405
  private sessionGuardRebootInFlight;
6393
6406
  private sessionGuardLastRebootAtMs;
6394
6407
  /** Track last known session count and IDs for change detection. */
@@ -6744,6 +6757,18 @@ export declare class ReolinkBaichuanApi {
6744
6757
  rebootAfterConsecutiveEconnreset?: number;
6745
6758
  /** If true, avoid using HTTP/CGI fallbacks and discovery paths (native Baichuan only). */
6746
6759
  nativeOnly?: boolean;
6760
+ /**
6761
+ * Enable the periodic session-count guard: every 60s the lib polls
6762
+ * `getOnlineUserList` (cmd_id 120) and triggers a device reboot if
6763
+ * sessions from our IP exceed `maxDedicatedSessionsBeforeReboot`.
6764
+ *
6765
+ * Default: `false`. The poll wakes battery cameras on every tick and
6766
+ * its only side effect — an automatic reboot — is a heavy-hand fix
6767
+ * for a problem that rarely materialises in practice. Set to `true`
6768
+ * only if you specifically need the legacy auto-recovery behaviour;
6769
+ * even then the lib skips the poll on UDP transport.
6770
+ */
6771
+ enableSessionGuard?: boolean;
6747
6772
  });
6748
6773
  /**
6749
6774
  * CGI forward: fetch RTSP URL for a channel via `GetRtspUrl`.
package/dist/index.js CHANGED
@@ -45,7 +45,7 @@ import {
45
45
  parseSupportXml,
46
46
  setGlobalLogger,
47
47
  xmlIndicatesFloodlight
48
- } from "./chunk-5M7BGMLV.js";
48
+ } from "./chunk-XUL2Y2AL.js";
49
49
  import {
50
50
  ReolinkCgiApi,
51
51
  ReolinkHttpClient,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apocaliss92/nodelink-js",
3
- "version": "0.4.19",
3
+ "version": "0.4.20",
4
4
  "description": "TypeScript library implementing Reolink Baichuan protocol (control + streaming) with CGI and RTSP helpers. Full TypeScript support with comprehensive type definitions.",
5
5
  "license": "MIT",
6
6
  "author": "",