@apocaliss92/nodelink-js 0.4.31 → 0.4.33
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/README.md +34 -2
- package/dist/{chunk-XVFCEFM6.js → chunk-OZL6C2YJ.js} +50 -1
- package/dist/{chunk-XVFCEFM6.js.map → chunk-OZL6C2YJ.js.map} +1 -1
- package/dist/cli/rtsp-server.cjs +49 -0
- package/dist/cli/rtsp-server.cjs.map +1 -1
- package/dist/cli/rtsp-server.js +1 -1
- package/dist/index.cjs +49 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -5702,6 +5702,13 @@ declare class ReolinkBaichuanApi {
|
|
|
5702
5702
|
* Once closed, the API instance should not be reused.
|
|
5703
5703
|
*/
|
|
5704
5704
|
private _closed;
|
|
5705
|
+
/**
|
|
5706
|
+
* Off-handle for the auto-bridge between the global email-push bus
|
|
5707
|
+
* and this api's `simpleEventListeners`. Set in the constructor
|
|
5708
|
+
* when `emailPushCameraId` is provided; released in `close()`.
|
|
5709
|
+
* `undefined` means no bridge was requested for this api.
|
|
5710
|
+
*/
|
|
5711
|
+
private emailPushAutoBridgeOff;
|
|
5705
5712
|
/**
|
|
5706
5713
|
* Socket pool with tag-based allocation strategy.
|
|
5707
5714
|
* Tags determine which sockets are shared vs dedicated:
|
|
@@ -5872,6 +5879,21 @@ declare class ReolinkBaichuanApi {
|
|
|
5872
5879
|
private simpleEventWatchdogLastRecoveryAt;
|
|
5873
5880
|
private readonly simpleEventWatchdogIntervalMs;
|
|
5874
5881
|
private readonly simpleEventWatchdogSilenceThresholdMs;
|
|
5882
|
+
/**
|
|
5883
|
+
* Whether the silence-based resubscribe path of the watchdog is
|
|
5884
|
+
* enabled. On UDP (battery cameras) silence is the *normal* state
|
|
5885
|
+
* while the device sleeps — firing `ensureSimpleEventSubscribed`
|
|
5886
|
+
* every 5 minutes wakes the camera on every tick, drains the
|
|
5887
|
+
* battery, and is observably wrong because the cam emits a
|
|
5888
|
+
* sleep/awake push when it actually wakes for motion.
|
|
5889
|
+
*
|
|
5890
|
+
* Defaults: `false` on UDP, `true` on TCP / `auto`. The subscription-
|
|
5891
|
+
* failed recovery path (Case 2) stays active regardless — it only
|
|
5892
|
+
* runs when the connection is alive, doesn't wake anyone, and is
|
|
5893
|
+
* useful on every transport when the initial subscribe call lost
|
|
5894
|
+
* the response packet.
|
|
5895
|
+
*/
|
|
5896
|
+
private eventWatchdogSilenceResubscribeEnabled;
|
|
5875
5897
|
private statePollingInterval;
|
|
5876
5898
|
private udpSleepInferenceInterval;
|
|
5877
5899
|
private readonly udpLastInferredSleepStateByChannel;
|
|
@@ -6216,6 +6238,37 @@ declare class ReolinkBaichuanApi {
|
|
|
6216
6238
|
* out on TCP, or `true` to opt in on UDP (not recommended).
|
|
6217
6239
|
*/
|
|
6218
6240
|
enableEventResubscribe?: boolean;
|
|
6241
|
+
/**
|
|
6242
|
+
* When set, the api auto-subscribes to the global email-push bus
|
|
6243
|
+
* and translates each matching delivery (`event.cameraId ===
|
|
6244
|
+
* emailPushCameraId`) into `dispatchSimpleEvent` — so any
|
|
6245
|
+
* consumer registered via `api.onSimpleEvent(...)` receives
|
|
6246
|
+
* native Baichuan push AND SMTP-delivered motion through the
|
|
6247
|
+
* exact same stream, with no second subscription needed. The
|
|
6248
|
+
* bridge survives TCP transient disconnects (it's a JS-level
|
|
6249
|
+
* fan-out, not a network operation) and is released
|
|
6250
|
+
* automatically by `close()`.
|
|
6251
|
+
*
|
|
6252
|
+
* Pair with `emailPushChannel` when the camera lives on a
|
|
6253
|
+
* non-zero channel (NVR children, multi-channel cams).
|
|
6254
|
+
*/
|
|
6255
|
+
emailPushCameraId?: string;
|
|
6256
|
+
/** Channel reported on the synthesised event. Default 0. */
|
|
6257
|
+
emailPushChannel?: number;
|
|
6258
|
+
/**
|
|
6259
|
+
* Enable the watchdog's silence-based resubscribe path (Case 1
|
|
6260
|
+
* in `simpleEventWatchdogTick`): when no event arrives for 5
|
|
6261
|
+
* minutes the lib forces an `ensureSimpleEventSubscribed` call.
|
|
6262
|
+
*
|
|
6263
|
+
* Default: `true` for non-UDP transports (TCP / `auto`),
|
|
6264
|
+
* `false` for UDP. On UDP (battery cams) silence is the normal
|
|
6265
|
+
* state while the device sleeps — running this path wakes the
|
|
6266
|
+
* cam every 5 minutes for no real benefit, since the cam emits
|
|
6267
|
+
* its own sleep/awake push when it actually wakes for motion.
|
|
6268
|
+
* The subscription-failed recovery path (Case 2) stays active
|
|
6269
|
+
* regardless and is safe on every transport.
|
|
6270
|
+
*/
|
|
6271
|
+
enableEventWatchdogSilenceResubscribe?: boolean;
|
|
6219
6272
|
});
|
|
6220
6273
|
/**
|
|
6221
6274
|
* CGI forward: fetch RTSP URL for a channel via `GetRtspUrl`.
|
package/dist/index.d.ts
CHANGED
|
@@ -6687,6 +6687,13 @@ export declare class ReolinkBaichuanApi {
|
|
|
6687
6687
|
* Once closed, the API instance should not be reused.
|
|
6688
6688
|
*/
|
|
6689
6689
|
private _closed;
|
|
6690
|
+
/**
|
|
6691
|
+
* Off-handle for the auto-bridge between the global email-push bus
|
|
6692
|
+
* and this api's `simpleEventListeners`. Set in the constructor
|
|
6693
|
+
* when `emailPushCameraId` is provided; released in `close()`.
|
|
6694
|
+
* `undefined` means no bridge was requested for this api.
|
|
6695
|
+
*/
|
|
6696
|
+
private emailPushAutoBridgeOff;
|
|
6690
6697
|
/**
|
|
6691
6698
|
* Socket pool with tag-based allocation strategy.
|
|
6692
6699
|
* Tags determine which sockets are shared vs dedicated:
|
|
@@ -6857,6 +6864,21 @@ export declare class ReolinkBaichuanApi {
|
|
|
6857
6864
|
private simpleEventWatchdogLastRecoveryAt;
|
|
6858
6865
|
private readonly simpleEventWatchdogIntervalMs;
|
|
6859
6866
|
private readonly simpleEventWatchdogSilenceThresholdMs;
|
|
6867
|
+
/**
|
|
6868
|
+
* Whether the silence-based resubscribe path of the watchdog is
|
|
6869
|
+
* enabled. On UDP (battery cameras) silence is the *normal* state
|
|
6870
|
+
* while the device sleeps — firing `ensureSimpleEventSubscribed`
|
|
6871
|
+
* every 5 minutes wakes the camera on every tick, drains the
|
|
6872
|
+
* battery, and is observably wrong because the cam emits a
|
|
6873
|
+
* sleep/awake push when it actually wakes for motion.
|
|
6874
|
+
*
|
|
6875
|
+
* Defaults: `false` on UDP, `true` on TCP / `auto`. The subscription-
|
|
6876
|
+
* failed recovery path (Case 2) stays active regardless — it only
|
|
6877
|
+
* runs when the connection is alive, doesn't wake anyone, and is
|
|
6878
|
+
* useful on every transport when the initial subscribe call lost
|
|
6879
|
+
* the response packet.
|
|
6880
|
+
*/
|
|
6881
|
+
private eventWatchdogSilenceResubscribeEnabled;
|
|
6860
6882
|
private statePollingInterval;
|
|
6861
6883
|
private udpSleepInferenceInterval;
|
|
6862
6884
|
private readonly udpLastInferredSleepStateByChannel;
|
|
@@ -7201,6 +7223,37 @@ export declare class ReolinkBaichuanApi {
|
|
|
7201
7223
|
* out on TCP, or `true` to opt in on UDP (not recommended).
|
|
7202
7224
|
*/
|
|
7203
7225
|
enableEventResubscribe?: boolean;
|
|
7226
|
+
/**
|
|
7227
|
+
* When set, the api auto-subscribes to the global email-push bus
|
|
7228
|
+
* and translates each matching delivery (`event.cameraId ===
|
|
7229
|
+
* emailPushCameraId`) into `dispatchSimpleEvent` — so any
|
|
7230
|
+
* consumer registered via `api.onSimpleEvent(...)` receives
|
|
7231
|
+
* native Baichuan push AND SMTP-delivered motion through the
|
|
7232
|
+
* exact same stream, with no second subscription needed. The
|
|
7233
|
+
* bridge survives TCP transient disconnects (it's a JS-level
|
|
7234
|
+
* fan-out, not a network operation) and is released
|
|
7235
|
+
* automatically by `close()`.
|
|
7236
|
+
*
|
|
7237
|
+
* Pair with `emailPushChannel` when the camera lives on a
|
|
7238
|
+
* non-zero channel (NVR children, multi-channel cams).
|
|
7239
|
+
*/
|
|
7240
|
+
emailPushCameraId?: string;
|
|
7241
|
+
/** Channel reported on the synthesised event. Default 0. */
|
|
7242
|
+
emailPushChannel?: number;
|
|
7243
|
+
/**
|
|
7244
|
+
* Enable the watchdog's silence-based resubscribe path (Case 1
|
|
7245
|
+
* in `simpleEventWatchdogTick`): when no event arrives for 5
|
|
7246
|
+
* minutes the lib forces an `ensureSimpleEventSubscribed` call.
|
|
7247
|
+
*
|
|
7248
|
+
* Default: `true` for non-UDP transports (TCP / `auto`),
|
|
7249
|
+
* `false` for UDP. On UDP (battery cams) silence is the normal
|
|
7250
|
+
* state while the device sleeps — running this path wakes the
|
|
7251
|
+
* cam every 5 minutes for no real benefit, since the cam emits
|
|
7252
|
+
* its own sleep/awake push when it actually wakes for motion.
|
|
7253
|
+
* The subscription-failed recovery path (Case 2) stays active
|
|
7254
|
+
* regardless and is safe on every transport.
|
|
7255
|
+
*/
|
|
7256
|
+
enableEventWatchdogSilenceResubscribe?: boolean;
|
|
7204
7257
|
});
|
|
7205
7258
|
/**
|
|
7206
7259
|
* CGI forward: fetch RTSP URL for a channel via `GetRtspUrl`.
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apocaliss92/nodelink-js",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.33",
|
|
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": "",
|