@apocaliss92/nodelink-js 0.6.2 → 0.6.4

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
@@ -3074,6 +3074,37 @@ declare class BaichuanClient extends EventEmitter<{
3074
3074
  login(maxEncryption?: MaxEncryption): Promise<void>;
3075
3075
  }
3076
3076
 
3077
+ /**
3078
+ * Ask the kernel which local IP it would use to send a UDP packet to
3079
+ * `destHost:destPort`. Uses `dgram.Socket.connect()` to bind a fresh
3080
+ * socket on a wildcard, then reads back `address()` which now reports
3081
+ * the kernel-selected source. Closes the probe socket before returning
3082
+ * — never sends a real packet.
3083
+ *
3084
+ * Throws on EHOSTUNREACH / EAI_FAIL / connect timeout. Caller treats
3085
+ * "throws" as "couldn't tell" rather than as a hard error.
3086
+ */
3087
+ declare function probeEgressForHost(destHost: string, destPort: number): Promise<{
3088
+ localAddress: string;
3089
+ localPort: number;
3090
+ }>;
3091
+ /**
3092
+ * Cheap IPv4-only same-subnet check.
3093
+ *
3094
+ * Returns:
3095
+ * - `"same"` — `destHost` falls inside the subnet of the interface
3096
+ * that owns `srcInfo.localAddress`. The kernel picked the matching NIC.
3097
+ * - `"mismatch"` — the kernel-picked source IP belongs to an interface
3098
+ * whose subnet does NOT contain `destHost`. Classic multi-NIC
3099
+ * misrouting: the dest is on the LAN but our packets are leaving via
3100
+ * Tailscale / VPN / Docker bridge with a source IP the cam will reject.
3101
+ * - `"unknown"` — `destHost` isn't a parseable IPv4 literal (probably
3102
+ * a hostname), or none of our interfaces match the source IP. Don't
3103
+ * guess — say so.
3104
+ */
3105
+ declare function isSameSubnetAsAnyLocalIface(destHost: string, srcInfo: {
3106
+ localAddress: string;
3107
+ }): "same" | "mismatch" | "unknown";
3077
3108
  type BcUdpStreamOptions = {
3078
3109
  /** Local discovery via UID (typical for battery cameras). */
3079
3110
  mode: "uid";
@@ -3124,6 +3155,8 @@ type BcUdpDiscoveryMethod = "local-broadcast" | "local-direct" | "remote" | "map
3124
3155
  * instead of silently hammering loopback with 30s of UDP timeouts.
3125
3156
  */
3126
3157
  declare function isUnroutableForP2P(ip: string): boolean;
3158
+ /** Test-only: wipe the dedup/cache state between specs. */
3159
+ declare function _clearP2pLookupDedupForTests(): void;
3127
3160
  /**
3128
3161
  * Implements BCUDP as a reliable "byte stream" (ACK + resend).
3129
3162
  */
@@ -3186,6 +3219,7 @@ declare class BcUdpStream extends EventEmitter<{
3186
3219
  private getLocalIPv4;
3187
3220
  private discoveryUidP2p;
3188
3221
  private p2pUidLookup;
3222
+ private _doP2pUidLookupWork;
3189
3223
  private p2pUidLookupOne;
3190
3224
  private p2pRegister;
3191
3225
  private p2pConnect;
@@ -11685,7 +11719,28 @@ type AutoDetectResult = {
11685
11719
  api: ReolinkBaichuanApi;
11686
11720
  };
11687
11721
  /**
11688
- * Normalize UID string (trim and return undefined if empty).
11722
+ * Normalize UID string (trim, force uppercase, return undefined if empty).
11723
+ *
11724
+ * Uppercase is non-negotiable for two reasons:
11725
+ *
11726
+ * 1. Reolink's cloud API (`apis.reolink.com/v2/devices/{uid}/server-binding`)
11727
+ * is case-sensitive: a lowercase UID returns HTTP 400
11728
+ * `invalid_parameters` and we lose the per-UID zone hint, falling back
11729
+ * to the full 24-hostname sweep. Verified empirically against a known
11730
+ * good UID — uppercase returns 200 + zone allocation, lowercase
11731
+ * returns 400 + `invalid_parameters`.
11732
+ *
11733
+ * 2. The BCUDP discovery protocol embeds `<uid>...</uid>` in the C2D_C
11734
+ * packet. Cameras compare it against their own self-UID (which they
11735
+ * store uppercase). A lowercase mismatch is silently dropped — the
11736
+ * cam appears "asleep" from `sent=N replies=0` even though it's
11737
+ * awake and on the LAN. BaichuanClient already uppercases for the
11738
+ * XOR/AES nonce derivation; normalizing here makes the whole
11739
+ * pipeline consistent.
11740
+ *
11741
+ * Users in Scrypted / config files sometimes paste UIDs in lowercase
11742
+ * (it works visually with Reolink's own UI, which normalizes
11743
+ * internally) — we shouldn't punish them for that.
11689
11744
  */
11690
11745
  declare function normalizeUid(uid?: string): string | undefined;
11691
11746
  /**
@@ -12260,4 +12315,4 @@ interface CreateEmailPushServerParams {
12260
12315
  declare function getCameraEmailAddress(cameraId: string, domain: string): string;
12261
12316
  declare function createEmailPushServer(params: CreateEmailPushServerParams): EmailPushServerInstance;
12262
12317
 
12263
- export { type AIDetectionState, type AIEvent, type AIState, ALL_UDP_DISCOVERY_METHODS, type AbilityInfo, type AccessUserListConfig, AesStreamDecryptor, type AiAlarmConfig, type AiConfig, type AiDenoiseConfig, type AiDetectCfgZone, type AiKey, type AiTypesCacheEntry, type AnyBuffer, type AudioAlarmParams, type AudioCfgConfig, type AudioConfig, type AudioNoiseConfig, type AudioTaskConfig, type AutoDetectInputs, type AutoDetectMode, type AutoDetectResult, type AutoFocusConfig, type AutoRebootConfig, type AutoRebootConfigPatch, AutodiscoveryClient, type AutodiscoveryClientOptions, BC_AES_IV, BC_CLASS_FILE_DOWNLOAD, BC_CLASS_LEGACY, BC_CLASS_MODERN_20, BC_CLASS_MODERN_24, BC_CLASS_MODERN_24_ALT, BC_CMD_ID_ABILITY_INFO, BC_CMD_ID_ALARM_EVENT_LIST, BC_CMD_ID_AUDIO_ALARM_PLAY, BC_CMD_ID_CHANNEL_INFO_ALL, BC_CMD_ID_CMD_123, BC_CMD_ID_CMD_209, BC_CMD_ID_CMD_265, BC_CMD_ID_CMD_440, BC_CMD_ID_COVER_PREVIEW, BC_CMD_ID_COVER_RESPONSE, BC_CMD_ID_COVER_STANDALONE_458, BC_CMD_ID_COVER_STANDALONE_459, BC_CMD_ID_COVER_STANDALONE_460, BC_CMD_ID_COVER_STANDALONE_461, BC_CMD_ID_COVER_STANDALONE_462, BC_CMD_ID_DEVICE_DETECT, BC_CMD_ID_DEVICE_DETECT_CANDIDATES, BC_CMD_ID_DING_DONG_CTRL, BC_CMD_ID_DING_DONG_OPT, BC_CMD_ID_FILE_INFO_LIST_CLOSE, BC_CMD_ID_FILE_INFO_LIST_DL_VIDEO, BC_CMD_ID_FILE_INFO_LIST_DOWNLOAD, BC_CMD_ID_FILE_INFO_LIST_GET, BC_CMD_ID_FILE_INFO_LIST_OPEN, BC_CMD_ID_FILE_INFO_LIST_REPLAY, BC_CMD_ID_FILE_INFO_LIST_STOP, BC_CMD_ID_FIND_REC_VIDEO_CLOSE, BC_CMD_ID_FIND_REC_VIDEO_GET, BC_CMD_ID_FIND_REC_VIDEO_OPEN, BC_CMD_ID_FLOODLIGHT_STATUS_LIST, BC_CMD_ID_GET_ABILITY_SUPPORT, BC_CMD_ID_GET_ACCESS_USER_LIST, BC_CMD_ID_GET_AI_ALARM, BC_CMD_ID_GET_AI_CFG, BC_CMD_ID_GET_AI_DENOISE, BC_CMD_ID_GET_AUDIO_ALARM, BC_CMD_ID_GET_AUDIO_CFG, BC_CMD_ID_GET_AUDIO_TASK, BC_CMD_ID_GET_AUTO_FOCUS, BC_CMD_ID_GET_AUTO_REBOOT, BC_CMD_ID_GET_BATTERY_INFO, BC_CMD_ID_GET_BATTERY_INFO_LIST, BC_CMD_ID_GET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_GET_DAY_RECORDS, BC_CMD_ID_GET_DING_DONG_CFG, BC_CMD_ID_GET_DING_DONG_LIST, BC_CMD_ID_GET_DING_DONG_SILENT, BC_CMD_ID_GET_DST, BC_CMD_ID_GET_EMAIL, BC_CMD_ID_GET_EMAIL_TASK, BC_CMD_ID_GET_ENC, BC_CMD_ID_GET_FTP_TASK, BC_CMD_ID_GET_HDD_INFO_LIST, BC_CMD_ID_GET_KIT_AP_CFG, BC_CMD_ID_GET_LED_STATE, BC_CMD_ID_GET_MOTION_ALARM, BC_CMD_ID_GET_NTP, BC_CMD_ID_GET_ONLINE_USER_LIST, BC_CMD_ID_GET_OSD_DATETIME, BC_CMD_ID_GET_PIR_INFO, BC_CMD_ID_GET_PRIVACY_MASK, BC_CMD_ID_GET_PTZ_POSITION, BC_CMD_ID_GET_PTZ_PRESET, BC_CMD_ID_GET_PUSH_TASK, BC_CMD_ID_GET_RECORD, BC_CMD_ID_GET_RECORD_CFG, BC_CMD_ID_GET_REC_ENC_CFG, BC_CMD_ID_GET_SIREN_STATUS, BC_CMD_ID_GET_SLEEP_STATE, BC_CMD_ID_GET_SNAPSHOT, BC_CMD_ID_GET_STREAM_INFO_LIST, BC_CMD_ID_GET_SUPPORT, BC_CMD_ID_GET_SYSTEM_GENERAL, BC_CMD_ID_GET_TIMELAPSE_CFG, BC_CMD_ID_GET_UID, BC_CMD_ID_GET_VERSION_INFO, BC_CMD_ID_GET_VIDEO_INPUT, BC_CMD_ID_GET_WHITE_LED, BC_CMD_ID_GET_WIFI, BC_CMD_ID_GET_WIFI_SIGNAL, BC_CMD_ID_GET_ZOOM_FOCUS, BC_CMD_ID_LOGIN, BC_CMD_ID_LOGOUT, BC_CMD_ID_PING, BC_CMD_ID_PTZ_CONTROL, BC_CMD_ID_PTZ_CONTROL_PRESET, BC_CMD_ID_PUSH_COORDINATE_POINT_LIST, BC_CMD_ID_PUSH_DINGDONG_LIST, BC_CMD_ID_PUSH_NET_INFO, BC_CMD_ID_PUSH_SERIAL, BC_CMD_ID_PUSH_SLEEP_STATUS, BC_CMD_ID_PUSH_VIDEO_INPUT, BC_CMD_ID_QUICK_REPLY_PLAY, BC_CMD_ID_SET_AI_ALARM, BC_CMD_ID_SET_AI_CFG, BC_CMD_ID_SET_AI_DENOISE, BC_CMD_ID_SET_AUDIO_CFG, BC_CMD_ID_SET_AUDIO_TASK, BC_CMD_ID_SET_AUTO_FOCUS, BC_CMD_ID_SET_AUTO_REBOOT, BC_CMD_ID_SET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_SET_DING_DONG_CFG, BC_CMD_ID_SET_DING_DONG_SILENT, BC_CMD_ID_SET_DST, BC_CMD_ID_SET_EMAIL, BC_CMD_ID_SET_EMAIL_TASK, BC_CMD_ID_SET_ENC, BC_CMD_ID_SET_LED_STATE, BC_CMD_ID_SET_MOTION_ALARM, BC_CMD_ID_SET_NTP, BC_CMD_ID_SET_OSD_DATETIME, BC_CMD_ID_SET_PIR_INFO, BC_CMD_ID_SET_PRIVACY_MASK, BC_CMD_ID_SET_PUSH_TASK, BC_CMD_ID_SET_RECORD, BC_CMD_ID_SET_RECORD_CFG, BC_CMD_ID_SET_SYSTEM_GENERAL, BC_CMD_ID_SET_VIDEO_INPUT, BC_CMD_ID_SET_WHITE_LED_STATE, BC_CMD_ID_SET_WHITE_LED_TASK, BC_CMD_ID_SET_ZOOM_FOCUS, BC_CMD_ID_SUPPORT, BC_CMD_ID_TALK, BC_CMD_ID_TALK_ABILITY, BC_CMD_ID_TALK_CONFIG, BC_CMD_ID_TALK_RESET, BC_CMD_ID_TEST_EMAIL, BC_CMD_ID_UDP_KEEP_ALIVE, BC_CMD_ID_VIDEO, BC_CMD_ID_VIDEO_STOP, BC_MAGIC, BC_MAGIC_REV, BC_TCP_DEFAULT_PORT, BC_XML_KEY, type BackchannelCodec, type BackchannelRoute, type BaichuanCachedPush, BaichuanClient, type BaichuanClientOptions, type BaichuanCoordinatePointListPush, type BaichuanDingdongListPush, type BaichuanEndpointsServerOptions, BaichuanEventEmitter, type BaichuanFloodlightStatusPush, type BaichuanFrame, BaichuanFrameParser, type BaichuanGetOsdDatetimeResult, type BaichuanHeader, BaichuanHlsServer, type BaichuanHlsServerOptions, BaichuanHttpStreamServer, type BaichuanHttpStreamServerOptions, type BaichuanLedState, BaichuanMjpegServer, type BaichuanMjpegServerOptions, type BaichuanNetInfoPush, type BaichuanOsdChannelName, type BaichuanOsdDatetime, type BaichuanRecordCfg, type BaichuanRecordSchedule, BaichuanRtspBackchannelServer, type BaichuanRtspBackchannelServerOptions, BaichuanRtspServer, type BaichuanRtspServerOptions, type BaichuanSerialPush, type BaichuanSettingsPushCacheEntry, type BaichuanSirenStatusPush, type BaichuanSleepState, type BaichuanSleepStatusPush, type BaichuanStreamEncodeTable, type BaichuanStreamInfo, type BaichuanStreamInfoList, type BaichuanTransport, type BaichuanVersionInfo, type BaichuanVideoInputPush, BaichuanVideoStream, type BaichuanVideoStreamOptions, BaichuanWebRTCServer, type BaichuanWebRTCServerOptions, type BaichuanWifi, type BaichuanWifiSignal, type BatteryInfo, type BatteryInfoResponse, type BcMedia, type BcMediaAac, type BcMediaAdpcm, BcMediaAnnexBDecoder, type BcMediaAnnexBDecoderStats, type BcMediaAnnexBInfo, type BcMediaAudioFrame, type BcMediaAudioType, BcMediaCodec, type BcMediaIframe, type BcMediaInfoV1, type BcMediaInfoV2, type BcMediaPframe, type BcMediaType, type BcMediaVideoFrame, type BcMediaVideoType, type BcUdpDiscoveryMethod, BcUdpStream, type BcUdpStreamOptions, type CgiAbility, type CgiAbilityChn, type CgiAbilityLeaf, type CgiAiAlarm, type CgiAiCfg, type CgiAiKey, type CgiAiStateValue, type CgiAudioAlarm, type CgiAudioAlarmPlayParam, type CgiAudioCfg, type CgiAudioNoise, type CgiAutoFocus, type CgiBattery, type CgiChannelStatusEntry, type CgiChnTypeInfoValue, type CgiDetectionState, type CgiDevInfo, type CgiDeviceInfoEntries, type CgiEmail, type CgiEnc, type CgiEncStream, type CgiEncValue, type CgiGetAbilityResponse, type CgiGetAbilityValue, type CgiGetAiAlarmValue, type CgiGetAiCfgValue, type CgiGetAiStateResponse, type CgiGetAudioAlarmValue, type CgiGetAudioCfgValue, type CgiGetAudioNoiseValue, type CgiGetAutoFocusValue, type CgiGetChannelstatusResponse, type CgiGetChannelstatusValue, type CgiGetChnTypeInfoResponse, type CgiGetDevInfoResponse, type CgiGetDevInfoValue, type CgiGetEmailValue, type CgiGetEncResponse, type CgiGetImageValue, type CgiGetIrLightsValue, type CgiGetIspValue, type CgiGetMaskValue, type CgiGetMdAlarmValue, type CgiGetOsdValue, type CgiGetPushValue, type CgiGetRecValue, type CgiGetRtspUrlResponse, type CgiGetRtspUrlValue, type CgiGetVideoclipsParams, type CgiImage, type CgiIrLights, type CgiIsp, type CgiMask, type CgiMaskShelter, type CgiMdAlarm, type CgiMdAlarmScope, type CgiMdAlarmSens, type CgiNetPort, type CgiOsd, type CgiPirInfo, type CgiPtzPreset, type CgiPush, type CgiRec, type CgiRecSchedule, type CgiSetAiAlarmParam, type CgiSetAiCfgParam, type CgiSetAudioAlarmParam, type CgiSetAudioCfgParam, type CgiSetAudioNoiseParam, type CgiSetAutoFocusParam, type CgiSetEmailParam, type CgiSetEncParam, type CgiSetImageParam, type CgiSetIrLightsParam, type CgiSetIspParam, type CgiSetMaskParam, type CgiSetMdAlarmParam, type CgiSetOsdParam, type CgiSetPirInfoParam, type CgiSetPushParam, type CgiSetRecParam, type CgiSetWhiteLedParam, type CgiWhiteLed, type ChannelPushCacheEntry, type ChannelPushDataEntry, type ChannelRecordingFile, type ChannelStreamMetadata, type ChimeAlarmCfg, type ChimeCfg, type ChimeDevice, type ChimeParams, type CollectNvrDiagnosticsOptions, CompositeRtspServer, type CompositeRtspServerOptions, CompositeStream, type CompositeStreamOptions, type CompositeStreamPipOptions, type CompressionStream, type CreateEmailPushServerParams, DEFAULT_SHELTER_CANVAS, DUAL_LENS_DUAL_MOTION_MODELS, DUAL_LENS_MODELS, DUAL_LENS_SINGLE_MOTION_MODELS, type DayNightThresholdConfig, type DayOfWeek, type DebugConfig, type DebugOptions, type DeviceAbilities, type DeviceCapabilities, type DeviceCapabilitiesCacheEntry, type DeviceCapabilitiesDebugInfo, type DeviceCapabilitiesResult, type DeviceInfoResponse, type DeviceInputData, type DeviceObjectType, type DeviceStatusResponse, type DeviceSupportFlags, type DeviceType, type DiagnosticsCollectorResult, type DiagnosticsStreamKind, type DiscoveredDevice, type DiscoveryOptions, type DownloadRecordingParams, type DstConfig, type DstConfigPatch, type DualLensChannelAnalysis, type DualLensChannelInfo, type EmailAttachmentType, type EmailConfig, type EmailConfigPatch, type EmailPushEvent, type EmailPushInferredType, type EmailPushLogger, type EmailPushServerConfig, type EmailPushServerInstance, type EmailPushServerStatus, type EmailPushTlsOptions, type EmailTaskConfig, type EmailTaskScheduleItem, type EmailTextType, type EncConfig, type EncOptions, type EncResolutionOption, type EncStreamOptions, type EncStreamPatch, type EncryptionProtocol, type Events, type EventsResponse, type FloodlightTaskConfig, type FloodlightTaskState, type FtpTaskConfig, type GetRecordingVideoResult, type GetRecordingVideoStats, type GetVideoclipsParams, type GetVodUrlParams, Go2rtcTcpServer, type Go2rtcTcpServerOptions, H264RtpDepacketizer, H265RtpDepacketizer, type HardwiredChimeState, type HddInfoListConfig, type HlsCodec, type HlsHttpResponse, type HlsServerStatus, type HlsSession, HlsSessionManager, type HlsSessionManagerOptions, type HlsSessionParams, Intercom, type IntercomOptions, type IrLightsConfig, type IspConfig, type JsonObject, type JsonPrimitive, type JsonValue, type LastSleepProbe, type LoadTlsParams, type LogLevel, type Logger, type LoggerCallback, type LoginResponseValue, type MaskConfig, type MaxEncryption, type MediaStream, type MjpegFrame, MjpegTransformer, type MjpegTransformerOptions, type ModelFixtureCaptureResult, type MotionAlarmConfig, type MotionEvent, type MotionSensitivityBand, type MotionZoneScope, MpegTsMuxer, type MpegTsMuxerOptions, NVR_HUB_EXACT_TYPES, NVR_HUB_MODEL_PATTERNS, type NativeVideoStreamVariant, type NtpConfig, type NtpConfigPatch, type NvrChannelsSummaryCacheEntry, type OnlineUserListConfig, type OsdChannel, type OsdConfig, type OsdDateFormat, type OsdTime, type ParsedRecordingFileName, type PipPosition, type PirConfig, type PirState, type PlaybackSnapshotStreamInfo, type PrivacyMaskZones, type PtzCommand, type PtzPosition, type PtzPreset, type RecEncConfig, type RecordingAudioCodec, type RecordingDetectionClass, type RecordingDevType, type RecordingFile, type RecordingPlaybackUrls, type RecordingStreamType, type RecordingVideoCodec, type RecordingVodFlags, type RecordingVodStreamHint, type RecordingsCacheEntry, type RecordingsQueueItem, type ReolinkAiNotification, ReolinkBaichuanApi, type ReolinkBaichuanChannelIdentity, type ReolinkBaichuanChannelInfo, type ReolinkBaichuanDeviceSummary, type ReolinkBaichuanNetworkInfo, type ReolinkBaichuanPorts, ReolinkCgiApi, type ReolinkCmdRequest, type ReolinkCmdResponse, type ReolinkCmdResponseExt, type ReolinkDayNightNotification, type ReolinkDetectionBox, type ReolinkDetectionDecodeState, type ReolinkDetectionEvent, type ReolinkDeviceInfo, type ReolinkDeviceInfoTag, type ReolinkEvent, ReolinkHttpClient, type ReolinkHttpClientOptions, type ReolinkJson, type ReolinkMotionNotification, type ReolinkNvrChannelInfo, type ReolinkNvrDeviceGroupSummary, type ReolinkNvrDeviceGroupsResult, type ReolinkSimpleEvent, type ReolinkSimpleEventType, type ReolinkSupportedStream, type ReolinkVideoStreamOptionsResult, type ReolinkVisitorNotification, type ReplayHttpServer, type ReplayHttpServerOptions, type ResponseMediaStreamOptions, type Rfc4571ApiFactoryContext, type Rfc4571Client, Rfc4571Muxer, type Rfc4571ReplayServer, type Rfc4571ReplayServerOptions, type Rfc4571TcpServer, type Rfc4571TcpServerOptions, type RtpPacketizationOptions, RtspBackchannel, type RtspBackchannelOptions, type RtspCreateOptions, type RtspProxyServerOptions, type RtspStreamProfile, type RunAllDiagnosticsConsecutivelyParams, type RunAllDiagnosticsConsecutivelyResult, type RunMultifocalDiagnosticsConsecutivelyParams, type RunMultifocalDiagnosticsConsecutivelyResult, type ShelterCanvas, type ShelterRect, type SirenState, type SirenStatusConfig, type SleepInferenceDecision, type SleepInferenceInput, type SleepInferencePending, type SleepState, type SleepStatus, type StreamMetadata, type StreamProfile, type StreamSamplingOptions, type StreamSamplingSelection, type SupportConfig, type SupportInfo, type SupportItem, type SystemGeneralConfig, type SystemGeneralPatch, type TalkAbility$1 as TalkAbility, type TalkAudioConfig, type TalkConfig, type TalkSession$1 as TalkSession, type TalkSessionInfo, type TimeFormat, type TimelapseCfgConfig, type TrackShelterRect, type TwoWayAudioConfig, type UdpDiscoveryMethod, type UnknownChunkListener, type VideoCodec, type VideoInputConfig, type VideoParamSets, type VideoStreamOptions, type VideoStreamOptionsCacheEntry, type VideoType, type VideoclipClientInfo, type VideoclipModeDecision, type VideoclipThumbnailResult, type VideoclipTranscodeMode, type VodFile, type VodSearchResponse, type VodSearchResult, type VodSearchStatus, type WakeUpOptions, type WebRTCAnswer, type WebRTCIceCandidate, type WebRTCOffer, type WebRTCSessionInfo, type WhiteLedConfig, type WhiteLedState, type WirelessChimeSilentState, type XmlJsonObject, type XmlJsonPrimitive, type XmlJsonValue, type ZoomFocusStatus, type ZoomFocusTriplet, _resetEmailPushBusForTests, abilitiesHasAny, aesDecrypt, aesEncrypt, alawToPcm16, applyStreamPatch, applyXmlTagPatch, asLogger, autoDetectDeviceType, bcDecrypt, bcEncrypt, bcHeaderHasPayloadOffset, buildAacAudioSpecificConfigHex, buildAbilityInfoExtensionXml, buildBinaryExtensionXml, buildChannelExtensionXml, buildFloodlightManualXml, buildHlsRedirectUrl, buildLoginXml, buildLogoutXml, buildPreviewStopXml, buildPreviewStopXmlV11, buildPreviewXml, buildPreviewXmlV11, buildPtzControlXml, buildPtzPresetXml, buildPtzPresetXmlV2, buildRfc4571Sdp, buildRtspPath, buildRtspUrl, buildSirenManualXml, buildSirenTimesXml, buildStartZoomFocusXml, buildWhiteLedStateXml, captureModelFixtures, collectCgiDiagnostics, collectMultifocalDiagnostics, collectNativeDiagnostics, collectNvrDiagnostics, computeDeviceCapabilities, computeExpectedStreamCompatibility, convertToAnnexB as convertH265ToAnnexB, convertToAnnexB$1 as convertToAnnexB, convertToLengthPrefixed, createBaichuanEndpointsServer, createDebugGateLogger, createDiagnosticsBundle, createEmailPushServer, createLogger, createMjpegBoundary, createNativeStream, createNullLogger, createReplayHttpServer, createRfc4571TcpServer, createRfc4571TcpServerForReplay, createRtspProxyServer, createTaggedLogger, decideSleepInferenceTransition, decideVideoclipTranscodeMode, decodeAiDetectCfg, decodeHeader, decodeMotionScopeBitmap, decodePrivacyMaskZones, decodeShelterCoord, deriveAesKey, detectIosClient, detectVideoCodecFromNal, discoverReolinkDevices, discoverViaArpTable, discoverViaDhcpListener, discoverViaHttpScan, discoverViaOnvif, discoverViaTcpPortScan, discoverViaUdpBroadcast, discoverViaUdpDirect, emitEmailPushEvent, encodeHeader, encodeImaAdpcm, encodeMotionScopeBitmap, encodeMotionSensitivityListXml, encodeShelterCoord, encodeShelterListXml, encodeTrackShelterListXml, ensureXmlHeader, extractCanvasFromShelterXml, extractH264ParamSetsFromAccessUnit, extractH265ParamSetsFromAccessUnit, extractPpsFromAnnexB, extractSpsFromAnnexB, extractVpsFromAnnexB, flattenAbilitiesForChannel, formatMjpegFrame, fullCoverageScope, getCameraEmailAddress, getConstructedVideoStreamOptions, getEmailPushCameraResolver, getGlobalLogger, getH265NalType, getLastEmailPushEvent, getMjpegContentType, getRecentEmailPushEvents, getSupportItemForChannel, getVideoStream, getVideoclipClientInfo, getXmlText, hasStartCodes as hasH265StartCodes, hasStartCodes$1 as hasStartCodes, isDualLenseModel, isH264KeyframeAnnexB, isH265Irap, isH265KeyframeAnnexB, isNvrHubModel, isTcpFailureThatShouldFallbackToUdp, isUnroutableForP2P, isValidH264AnnexBAccessUnit, isValidH265AnnexBAccessUnit, loadEmailPushTls, mapEmailPushInferredType, maskUid, md5HexUpper, md5StrModern, mulawToPcm16, normalizeDayNightMode, normalizeOpenClose, normalizeUid, onEmailPushEvent, packetizeAacAdtsFrame, packetizeAacRawFrame, packetizeH264, packetizeH265, parseAdtsHeader, parseBcMedia, parseRecordingFileName, parseRtpPacket, parseSupportXml, patchAiDetectCfgXml, patchMotionSensitivityListXml, patchNestedTag, patchShelterXml, printNvrDiagnostics, runAllDiagnosticsConsecutively, runMultifocalDiagnosticsConsecutively, sampleStreams, sanitizeFixtureData, selectViableUdpMethods, setEmailPushCameraResolver, setGlobalLogger, splitAnnexBToNalPayloads$1 as splitAnnexBToNalPayloads, splitAnnexBToNals, splitAnnexBToNalPayloads as splitH265AnnexBToNalPayloads, tcpReachabilityProbe, testChannelStreams, upsamplePcm16, upsertXmlTag, xmlEscape, xmlIndicatesFloodlight, zipDirectory };
12318
+ export { type AIDetectionState, type AIEvent, type AIState, ALL_UDP_DISCOVERY_METHODS, type AbilityInfo, type AccessUserListConfig, AesStreamDecryptor, type AiAlarmConfig, type AiConfig, type AiDenoiseConfig, type AiDetectCfgZone, type AiKey, type AiTypesCacheEntry, type AnyBuffer, type AudioAlarmParams, type AudioCfgConfig, type AudioConfig, type AudioNoiseConfig, type AudioTaskConfig, type AutoDetectInputs, type AutoDetectMode, type AutoDetectResult, type AutoFocusConfig, type AutoRebootConfig, type AutoRebootConfigPatch, AutodiscoveryClient, type AutodiscoveryClientOptions, BC_AES_IV, BC_CLASS_FILE_DOWNLOAD, BC_CLASS_LEGACY, BC_CLASS_MODERN_20, BC_CLASS_MODERN_24, BC_CLASS_MODERN_24_ALT, BC_CMD_ID_ABILITY_INFO, BC_CMD_ID_ALARM_EVENT_LIST, BC_CMD_ID_AUDIO_ALARM_PLAY, BC_CMD_ID_CHANNEL_INFO_ALL, BC_CMD_ID_CMD_123, BC_CMD_ID_CMD_209, BC_CMD_ID_CMD_265, BC_CMD_ID_CMD_440, BC_CMD_ID_COVER_PREVIEW, BC_CMD_ID_COVER_RESPONSE, BC_CMD_ID_COVER_STANDALONE_458, BC_CMD_ID_COVER_STANDALONE_459, BC_CMD_ID_COVER_STANDALONE_460, BC_CMD_ID_COVER_STANDALONE_461, BC_CMD_ID_COVER_STANDALONE_462, BC_CMD_ID_DEVICE_DETECT, BC_CMD_ID_DEVICE_DETECT_CANDIDATES, BC_CMD_ID_DING_DONG_CTRL, BC_CMD_ID_DING_DONG_OPT, BC_CMD_ID_FILE_INFO_LIST_CLOSE, BC_CMD_ID_FILE_INFO_LIST_DL_VIDEO, BC_CMD_ID_FILE_INFO_LIST_DOWNLOAD, BC_CMD_ID_FILE_INFO_LIST_GET, BC_CMD_ID_FILE_INFO_LIST_OPEN, BC_CMD_ID_FILE_INFO_LIST_REPLAY, BC_CMD_ID_FILE_INFO_LIST_STOP, BC_CMD_ID_FIND_REC_VIDEO_CLOSE, BC_CMD_ID_FIND_REC_VIDEO_GET, BC_CMD_ID_FIND_REC_VIDEO_OPEN, BC_CMD_ID_FLOODLIGHT_STATUS_LIST, BC_CMD_ID_GET_ABILITY_SUPPORT, BC_CMD_ID_GET_ACCESS_USER_LIST, BC_CMD_ID_GET_AI_ALARM, BC_CMD_ID_GET_AI_CFG, BC_CMD_ID_GET_AI_DENOISE, BC_CMD_ID_GET_AUDIO_ALARM, BC_CMD_ID_GET_AUDIO_CFG, BC_CMD_ID_GET_AUDIO_TASK, BC_CMD_ID_GET_AUTO_FOCUS, BC_CMD_ID_GET_AUTO_REBOOT, BC_CMD_ID_GET_BATTERY_INFO, BC_CMD_ID_GET_BATTERY_INFO_LIST, BC_CMD_ID_GET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_GET_DAY_RECORDS, BC_CMD_ID_GET_DING_DONG_CFG, BC_CMD_ID_GET_DING_DONG_LIST, BC_CMD_ID_GET_DING_DONG_SILENT, BC_CMD_ID_GET_DST, BC_CMD_ID_GET_EMAIL, BC_CMD_ID_GET_EMAIL_TASK, BC_CMD_ID_GET_ENC, BC_CMD_ID_GET_FTP_TASK, BC_CMD_ID_GET_HDD_INFO_LIST, BC_CMD_ID_GET_KIT_AP_CFG, BC_CMD_ID_GET_LED_STATE, BC_CMD_ID_GET_MOTION_ALARM, BC_CMD_ID_GET_NTP, BC_CMD_ID_GET_ONLINE_USER_LIST, BC_CMD_ID_GET_OSD_DATETIME, BC_CMD_ID_GET_PIR_INFO, BC_CMD_ID_GET_PRIVACY_MASK, BC_CMD_ID_GET_PTZ_POSITION, BC_CMD_ID_GET_PTZ_PRESET, BC_CMD_ID_GET_PUSH_TASK, BC_CMD_ID_GET_RECORD, BC_CMD_ID_GET_RECORD_CFG, BC_CMD_ID_GET_REC_ENC_CFG, BC_CMD_ID_GET_SIREN_STATUS, BC_CMD_ID_GET_SLEEP_STATE, BC_CMD_ID_GET_SNAPSHOT, BC_CMD_ID_GET_STREAM_INFO_LIST, BC_CMD_ID_GET_SUPPORT, BC_CMD_ID_GET_SYSTEM_GENERAL, BC_CMD_ID_GET_TIMELAPSE_CFG, BC_CMD_ID_GET_UID, BC_CMD_ID_GET_VERSION_INFO, BC_CMD_ID_GET_VIDEO_INPUT, BC_CMD_ID_GET_WHITE_LED, BC_CMD_ID_GET_WIFI, BC_CMD_ID_GET_WIFI_SIGNAL, BC_CMD_ID_GET_ZOOM_FOCUS, BC_CMD_ID_LOGIN, BC_CMD_ID_LOGOUT, BC_CMD_ID_PING, BC_CMD_ID_PTZ_CONTROL, BC_CMD_ID_PTZ_CONTROL_PRESET, BC_CMD_ID_PUSH_COORDINATE_POINT_LIST, BC_CMD_ID_PUSH_DINGDONG_LIST, BC_CMD_ID_PUSH_NET_INFO, BC_CMD_ID_PUSH_SERIAL, BC_CMD_ID_PUSH_SLEEP_STATUS, BC_CMD_ID_PUSH_VIDEO_INPUT, BC_CMD_ID_QUICK_REPLY_PLAY, BC_CMD_ID_SET_AI_ALARM, BC_CMD_ID_SET_AI_CFG, BC_CMD_ID_SET_AI_DENOISE, BC_CMD_ID_SET_AUDIO_CFG, BC_CMD_ID_SET_AUDIO_TASK, BC_CMD_ID_SET_AUTO_FOCUS, BC_CMD_ID_SET_AUTO_REBOOT, BC_CMD_ID_SET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_SET_DING_DONG_CFG, BC_CMD_ID_SET_DING_DONG_SILENT, BC_CMD_ID_SET_DST, BC_CMD_ID_SET_EMAIL, BC_CMD_ID_SET_EMAIL_TASK, BC_CMD_ID_SET_ENC, BC_CMD_ID_SET_LED_STATE, BC_CMD_ID_SET_MOTION_ALARM, BC_CMD_ID_SET_NTP, BC_CMD_ID_SET_OSD_DATETIME, BC_CMD_ID_SET_PIR_INFO, BC_CMD_ID_SET_PRIVACY_MASK, BC_CMD_ID_SET_PUSH_TASK, BC_CMD_ID_SET_RECORD, BC_CMD_ID_SET_RECORD_CFG, BC_CMD_ID_SET_SYSTEM_GENERAL, BC_CMD_ID_SET_VIDEO_INPUT, BC_CMD_ID_SET_WHITE_LED_STATE, BC_CMD_ID_SET_WHITE_LED_TASK, BC_CMD_ID_SET_ZOOM_FOCUS, BC_CMD_ID_SUPPORT, BC_CMD_ID_TALK, BC_CMD_ID_TALK_ABILITY, BC_CMD_ID_TALK_CONFIG, BC_CMD_ID_TALK_RESET, BC_CMD_ID_TEST_EMAIL, BC_CMD_ID_UDP_KEEP_ALIVE, BC_CMD_ID_VIDEO, BC_CMD_ID_VIDEO_STOP, BC_MAGIC, BC_MAGIC_REV, BC_TCP_DEFAULT_PORT, BC_XML_KEY, type BackchannelCodec, type BackchannelRoute, type BaichuanCachedPush, BaichuanClient, type BaichuanClientOptions, type BaichuanCoordinatePointListPush, type BaichuanDingdongListPush, type BaichuanEndpointsServerOptions, BaichuanEventEmitter, type BaichuanFloodlightStatusPush, type BaichuanFrame, BaichuanFrameParser, type BaichuanGetOsdDatetimeResult, type BaichuanHeader, BaichuanHlsServer, type BaichuanHlsServerOptions, BaichuanHttpStreamServer, type BaichuanHttpStreamServerOptions, type BaichuanLedState, BaichuanMjpegServer, type BaichuanMjpegServerOptions, type BaichuanNetInfoPush, type BaichuanOsdChannelName, type BaichuanOsdDatetime, type BaichuanRecordCfg, type BaichuanRecordSchedule, BaichuanRtspBackchannelServer, type BaichuanRtspBackchannelServerOptions, BaichuanRtspServer, type BaichuanRtspServerOptions, type BaichuanSerialPush, type BaichuanSettingsPushCacheEntry, type BaichuanSirenStatusPush, type BaichuanSleepState, type BaichuanSleepStatusPush, type BaichuanStreamEncodeTable, type BaichuanStreamInfo, type BaichuanStreamInfoList, type BaichuanTransport, type BaichuanVersionInfo, type BaichuanVideoInputPush, BaichuanVideoStream, type BaichuanVideoStreamOptions, BaichuanWebRTCServer, type BaichuanWebRTCServerOptions, type BaichuanWifi, type BaichuanWifiSignal, type BatteryInfo, type BatteryInfoResponse, type BcMedia, type BcMediaAac, type BcMediaAdpcm, BcMediaAnnexBDecoder, type BcMediaAnnexBDecoderStats, type BcMediaAnnexBInfo, type BcMediaAudioFrame, type BcMediaAudioType, BcMediaCodec, type BcMediaIframe, type BcMediaInfoV1, type BcMediaInfoV2, type BcMediaPframe, type BcMediaType, type BcMediaVideoFrame, type BcMediaVideoType, type BcUdpDiscoveryMethod, BcUdpStream, type BcUdpStreamOptions, type CgiAbility, type CgiAbilityChn, type CgiAbilityLeaf, type CgiAiAlarm, type CgiAiCfg, type CgiAiKey, type CgiAiStateValue, type CgiAudioAlarm, type CgiAudioAlarmPlayParam, type CgiAudioCfg, type CgiAudioNoise, type CgiAutoFocus, type CgiBattery, type CgiChannelStatusEntry, type CgiChnTypeInfoValue, type CgiDetectionState, type CgiDevInfo, type CgiDeviceInfoEntries, type CgiEmail, type CgiEnc, type CgiEncStream, type CgiEncValue, type CgiGetAbilityResponse, type CgiGetAbilityValue, type CgiGetAiAlarmValue, type CgiGetAiCfgValue, type CgiGetAiStateResponse, type CgiGetAudioAlarmValue, type CgiGetAudioCfgValue, type CgiGetAudioNoiseValue, type CgiGetAutoFocusValue, type CgiGetChannelstatusResponse, type CgiGetChannelstatusValue, type CgiGetChnTypeInfoResponse, type CgiGetDevInfoResponse, type CgiGetDevInfoValue, type CgiGetEmailValue, type CgiGetEncResponse, type CgiGetImageValue, type CgiGetIrLightsValue, type CgiGetIspValue, type CgiGetMaskValue, type CgiGetMdAlarmValue, type CgiGetOsdValue, type CgiGetPushValue, type CgiGetRecValue, type CgiGetRtspUrlResponse, type CgiGetRtspUrlValue, type CgiGetVideoclipsParams, type CgiImage, type CgiIrLights, type CgiIsp, type CgiMask, type CgiMaskShelter, type CgiMdAlarm, type CgiMdAlarmScope, type CgiMdAlarmSens, type CgiNetPort, type CgiOsd, type CgiPirInfo, type CgiPtzPreset, type CgiPush, type CgiRec, type CgiRecSchedule, type CgiSetAiAlarmParam, type CgiSetAiCfgParam, type CgiSetAudioAlarmParam, type CgiSetAudioCfgParam, type CgiSetAudioNoiseParam, type CgiSetAutoFocusParam, type CgiSetEmailParam, type CgiSetEncParam, type CgiSetImageParam, type CgiSetIrLightsParam, type CgiSetIspParam, type CgiSetMaskParam, type CgiSetMdAlarmParam, type CgiSetOsdParam, type CgiSetPirInfoParam, type CgiSetPushParam, type CgiSetRecParam, type CgiSetWhiteLedParam, type CgiWhiteLed, type ChannelPushCacheEntry, type ChannelPushDataEntry, type ChannelRecordingFile, type ChannelStreamMetadata, type ChimeAlarmCfg, type ChimeCfg, type ChimeDevice, type ChimeParams, type CollectNvrDiagnosticsOptions, CompositeRtspServer, type CompositeRtspServerOptions, CompositeStream, type CompositeStreamOptions, type CompositeStreamPipOptions, type CompressionStream, type CreateEmailPushServerParams, DEFAULT_SHELTER_CANVAS, DUAL_LENS_DUAL_MOTION_MODELS, DUAL_LENS_MODELS, DUAL_LENS_SINGLE_MOTION_MODELS, type DayNightThresholdConfig, type DayOfWeek, type DebugConfig, type DebugOptions, type DeviceAbilities, type DeviceCapabilities, type DeviceCapabilitiesCacheEntry, type DeviceCapabilitiesDebugInfo, type DeviceCapabilitiesResult, type DeviceInfoResponse, type DeviceInputData, type DeviceObjectType, type DeviceStatusResponse, type DeviceSupportFlags, type DeviceType, type DiagnosticsCollectorResult, type DiagnosticsStreamKind, type DiscoveredDevice, type DiscoveryOptions, type DownloadRecordingParams, type DstConfig, type DstConfigPatch, type DualLensChannelAnalysis, type DualLensChannelInfo, type EmailAttachmentType, type EmailConfig, type EmailConfigPatch, type EmailPushEvent, type EmailPushInferredType, type EmailPushLogger, type EmailPushServerConfig, type EmailPushServerInstance, type EmailPushServerStatus, type EmailPushTlsOptions, type EmailTaskConfig, type EmailTaskScheduleItem, type EmailTextType, type EncConfig, type EncOptions, type EncResolutionOption, type EncStreamOptions, type EncStreamPatch, type EncryptionProtocol, type Events, type EventsResponse, type FloodlightTaskConfig, type FloodlightTaskState, type FtpTaskConfig, type GetRecordingVideoResult, type GetRecordingVideoStats, type GetVideoclipsParams, type GetVodUrlParams, Go2rtcTcpServer, type Go2rtcTcpServerOptions, H264RtpDepacketizer, H265RtpDepacketizer, type HardwiredChimeState, type HddInfoListConfig, type HlsCodec, type HlsHttpResponse, type HlsServerStatus, type HlsSession, HlsSessionManager, type HlsSessionManagerOptions, type HlsSessionParams, Intercom, type IntercomOptions, type IrLightsConfig, type IspConfig, type JsonObject, type JsonPrimitive, type JsonValue, type LastSleepProbe, type LoadTlsParams, type LogLevel, type Logger, type LoggerCallback, type LoginResponseValue, type MaskConfig, type MaxEncryption, type MediaStream, type MjpegFrame, MjpegTransformer, type MjpegTransformerOptions, type ModelFixtureCaptureResult, type MotionAlarmConfig, type MotionEvent, type MotionSensitivityBand, type MotionZoneScope, MpegTsMuxer, type MpegTsMuxerOptions, NVR_HUB_EXACT_TYPES, NVR_HUB_MODEL_PATTERNS, type NativeVideoStreamVariant, type NtpConfig, type NtpConfigPatch, type NvrChannelsSummaryCacheEntry, type OnlineUserListConfig, type OsdChannel, type OsdConfig, type OsdDateFormat, type OsdTime, type ParsedRecordingFileName, type PipPosition, type PirConfig, type PirState, type PlaybackSnapshotStreamInfo, type PrivacyMaskZones, type PtzCommand, type PtzPosition, type PtzPreset, type RecEncConfig, type RecordingAudioCodec, type RecordingDetectionClass, type RecordingDevType, type RecordingFile, type RecordingPlaybackUrls, type RecordingStreamType, type RecordingVideoCodec, type RecordingVodFlags, type RecordingVodStreamHint, type RecordingsCacheEntry, type RecordingsQueueItem, type ReolinkAiNotification, ReolinkBaichuanApi, type ReolinkBaichuanChannelIdentity, type ReolinkBaichuanChannelInfo, type ReolinkBaichuanDeviceSummary, type ReolinkBaichuanNetworkInfo, type ReolinkBaichuanPorts, ReolinkCgiApi, type ReolinkCmdRequest, type ReolinkCmdResponse, type ReolinkCmdResponseExt, type ReolinkDayNightNotification, type ReolinkDetectionBox, type ReolinkDetectionDecodeState, type ReolinkDetectionEvent, type ReolinkDeviceInfo, type ReolinkDeviceInfoTag, type ReolinkEvent, ReolinkHttpClient, type ReolinkHttpClientOptions, type ReolinkJson, type ReolinkMotionNotification, type ReolinkNvrChannelInfo, type ReolinkNvrDeviceGroupSummary, type ReolinkNvrDeviceGroupsResult, type ReolinkSimpleEvent, type ReolinkSimpleEventType, type ReolinkSupportedStream, type ReolinkVideoStreamOptionsResult, type ReolinkVisitorNotification, type ReplayHttpServer, type ReplayHttpServerOptions, type ResponseMediaStreamOptions, type Rfc4571ApiFactoryContext, type Rfc4571Client, Rfc4571Muxer, type Rfc4571ReplayServer, type Rfc4571ReplayServerOptions, type Rfc4571TcpServer, type Rfc4571TcpServerOptions, type RtpPacketizationOptions, RtspBackchannel, type RtspBackchannelOptions, type RtspCreateOptions, type RtspProxyServerOptions, type RtspStreamProfile, type RunAllDiagnosticsConsecutivelyParams, type RunAllDiagnosticsConsecutivelyResult, type RunMultifocalDiagnosticsConsecutivelyParams, type RunMultifocalDiagnosticsConsecutivelyResult, type ShelterCanvas, type ShelterRect, type SirenState, type SirenStatusConfig, type SleepInferenceDecision, type SleepInferenceInput, type SleepInferencePending, type SleepState, type SleepStatus, type StreamMetadata, type StreamProfile, type StreamSamplingOptions, type StreamSamplingSelection, type SupportConfig, type SupportInfo, type SupportItem, type SystemGeneralConfig, type SystemGeneralPatch, type TalkAbility$1 as TalkAbility, type TalkAudioConfig, type TalkConfig, type TalkSession$1 as TalkSession, type TalkSessionInfo, type TimeFormat, type TimelapseCfgConfig, type TrackShelterRect, type TwoWayAudioConfig, type UdpDiscoveryMethod, type UnknownChunkListener, type VideoCodec, type VideoInputConfig, type VideoParamSets, type VideoStreamOptions, type VideoStreamOptionsCacheEntry, type VideoType, type VideoclipClientInfo, type VideoclipModeDecision, type VideoclipThumbnailResult, type VideoclipTranscodeMode, type VodFile, type VodSearchResponse, type VodSearchResult, type VodSearchStatus, type WakeUpOptions, type WebRTCAnswer, type WebRTCIceCandidate, type WebRTCOffer, type WebRTCSessionInfo, type WhiteLedConfig, type WhiteLedState, type WirelessChimeSilentState, type XmlJsonObject, type XmlJsonPrimitive, type XmlJsonValue, type ZoomFocusStatus, type ZoomFocusTriplet, _clearP2pLookupDedupForTests, _resetEmailPushBusForTests, abilitiesHasAny, aesDecrypt, aesEncrypt, alawToPcm16, applyStreamPatch, applyXmlTagPatch, asLogger, autoDetectDeviceType, bcDecrypt, bcEncrypt, bcHeaderHasPayloadOffset, buildAacAudioSpecificConfigHex, buildAbilityInfoExtensionXml, buildBinaryExtensionXml, buildChannelExtensionXml, buildFloodlightManualXml, buildHlsRedirectUrl, buildLoginXml, buildLogoutXml, buildPreviewStopXml, buildPreviewStopXmlV11, buildPreviewXml, buildPreviewXmlV11, buildPtzControlXml, buildPtzPresetXml, buildPtzPresetXmlV2, buildRfc4571Sdp, buildRtspPath, buildRtspUrl, buildSirenManualXml, buildSirenTimesXml, buildStartZoomFocusXml, buildWhiteLedStateXml, captureModelFixtures, collectCgiDiagnostics, collectMultifocalDiagnostics, collectNativeDiagnostics, collectNvrDiagnostics, computeDeviceCapabilities, computeExpectedStreamCompatibility, convertToAnnexB as convertH265ToAnnexB, convertToAnnexB$1 as convertToAnnexB, convertToLengthPrefixed, createBaichuanEndpointsServer, createDebugGateLogger, createDiagnosticsBundle, createEmailPushServer, createLogger, createMjpegBoundary, createNativeStream, createNullLogger, createReplayHttpServer, createRfc4571TcpServer, createRfc4571TcpServerForReplay, createRtspProxyServer, createTaggedLogger, decideSleepInferenceTransition, decideVideoclipTranscodeMode, decodeAiDetectCfg, decodeHeader, decodeMotionScopeBitmap, decodePrivacyMaskZones, decodeShelterCoord, deriveAesKey, detectIosClient, detectVideoCodecFromNal, discoverReolinkDevices, discoverViaArpTable, discoverViaDhcpListener, discoverViaHttpScan, discoverViaOnvif, discoverViaTcpPortScan, discoverViaUdpBroadcast, discoverViaUdpDirect, emitEmailPushEvent, encodeHeader, encodeImaAdpcm, encodeMotionScopeBitmap, encodeMotionSensitivityListXml, encodeShelterCoord, encodeShelterListXml, encodeTrackShelterListXml, ensureXmlHeader, extractCanvasFromShelterXml, extractH264ParamSetsFromAccessUnit, extractH265ParamSetsFromAccessUnit, extractPpsFromAnnexB, extractSpsFromAnnexB, extractVpsFromAnnexB, flattenAbilitiesForChannel, formatMjpegFrame, fullCoverageScope, getCameraEmailAddress, getConstructedVideoStreamOptions, getEmailPushCameraResolver, getGlobalLogger, getH265NalType, getLastEmailPushEvent, getMjpegContentType, getRecentEmailPushEvents, getSupportItemForChannel, getVideoStream, getVideoclipClientInfo, getXmlText, hasStartCodes as hasH265StartCodes, hasStartCodes$1 as hasStartCodes, isDualLenseModel, isH264KeyframeAnnexB, isH265Irap, isH265KeyframeAnnexB, isNvrHubModel, isSameSubnetAsAnyLocalIface, isTcpFailureThatShouldFallbackToUdp, isUnroutableForP2P, isValidH264AnnexBAccessUnit, isValidH265AnnexBAccessUnit, loadEmailPushTls, mapEmailPushInferredType, maskUid, md5HexUpper, md5StrModern, mulawToPcm16, normalizeDayNightMode, normalizeOpenClose, normalizeUid, onEmailPushEvent, packetizeAacAdtsFrame, packetizeAacRawFrame, packetizeH264, packetizeH265, parseAdtsHeader, parseBcMedia, parseRecordingFileName, parseRtpPacket, parseSupportXml, patchAiDetectCfgXml, patchMotionSensitivityListXml, patchNestedTag, patchShelterXml, printNvrDiagnostics, probeEgressForHost, runAllDiagnosticsConsecutively, runMultifocalDiagnosticsConsecutively, sampleStreams, sanitizeFixtureData, selectViableUdpMethods, setEmailPushCameraResolver, setGlobalLogger, splitAnnexBToNalPayloads$1 as splitAnnexBToNalPayloads, splitAnnexBToNals, splitAnnexBToNalPayloads as splitH265AnnexBToNalPayloads, tcpReachabilityProbe, testChannelStreams, upsamplePcm16, upsertXmlTag, xmlEscape, xmlIndicatesFloodlight, zipDirectory };
package/dist/index.d.ts CHANGED
@@ -3011,6 +3011,7 @@ export declare class BcUdpStream extends EventEmitter<{
3011
3011
  private getLocalIPv4;
3012
3012
  private discoveryUidP2p;
3013
3013
  private p2pUidLookup;
3014
+ private _doP2pUidLookupWork;
3014
3015
  private p2pUidLookupOne;
3015
3016
  private p2pRegister;
3016
3017
  private p2pConnect;
@@ -3971,6 +3972,9 @@ export declare interface ChimeParams {
3971
3972
  ledState?: number;
3972
3973
  }
3973
3974
 
3975
+ /** Test-only: wipe the dedup/cache state between specs. */
3976
+ export declare function _clearP2pLookupDedupForTests(): void;
3977
+
3974
3978
  export declare function collectCgiDiagnostics(params: {
3975
3979
  cgi: ReolinkCgiApi;
3976
3980
  channel?: number;
@@ -6274,6 +6278,24 @@ export declare interface IspConfig {
6274
6278
  };
6275
6279
  }
6276
6280
 
6281
+ /**
6282
+ * Cheap IPv4-only same-subnet check.
6283
+ *
6284
+ * Returns:
6285
+ * - `"same"` — `destHost` falls inside the subnet of the interface
6286
+ * that owns `srcInfo.localAddress`. The kernel picked the matching NIC.
6287
+ * - `"mismatch"` — the kernel-picked source IP belongs to an interface
6288
+ * whose subnet does NOT contain `destHost`. Classic multi-NIC
6289
+ * misrouting: the dest is on the LAN but our packets are leaving via
6290
+ * Tailscale / VPN / Docker bridge with a source IP the cam will reject.
6291
+ * - `"unknown"` — `destHost` isn't a parseable IPv4 literal (probably
6292
+ * a hostname), or none of our interfaces match the source IP. Don't
6293
+ * guess — say so.
6294
+ */
6295
+ export declare function isSameSubnetAsAnyLocalIface(destHost: string, srcInfo: {
6296
+ localAddress: string;
6297
+ }): "same" | "mismatch" | "unknown";
6298
+
6277
6299
  /**
6278
6300
  * Check if a TCP error should trigger UDP fallback.
6279
6301
  * Only transport/connection errors should fallback, not authentication errors.
@@ -6701,7 +6723,28 @@ export declare function normalizeDayNightMode(input: string): string;
6701
6723
  export declare function normalizeOpenClose(input: string): string;
6702
6724
 
6703
6725
  /**
6704
- * Normalize UID string (trim and return undefined if empty).
6726
+ * Normalize UID string (trim, force uppercase, return undefined if empty).
6727
+ *
6728
+ * Uppercase is non-negotiable for two reasons:
6729
+ *
6730
+ * 1. Reolink's cloud API (`apis.reolink.com/v2/devices/{uid}/server-binding`)
6731
+ * is case-sensitive: a lowercase UID returns HTTP 400
6732
+ * `invalid_parameters` and we lose the per-UID zone hint, falling back
6733
+ * to the full 24-hostname sweep. Verified empirically against a known
6734
+ * good UID — uppercase returns 200 + zone allocation, lowercase
6735
+ * returns 400 + `invalid_parameters`.
6736
+ *
6737
+ * 2. The BCUDP discovery protocol embeds `<uid>...</uid>` in the C2D_C
6738
+ * packet. Cameras compare it against their own self-UID (which they
6739
+ * store uppercase). A lowercase mismatch is silently dropped — the
6740
+ * cam appears "asleep" from `sent=N replies=0` even though it's
6741
+ * awake and on the LAN. BaichuanClient already uppercases for the
6742
+ * XOR/AES nonce derivation; normalizing here makes the whole
6743
+ * pipeline consistent.
6744
+ *
6745
+ * Users in Scrypted / config files sometimes paste UIDs in lowercase
6746
+ * (it works visually with Reolink's own UI, which normalizes
6747
+ * internally) — we shouldn't punish them for that.
6705
6748
  */
6706
6749
  export declare function normalizeUid(uid?: string): string | undefined;
6707
6750
 
@@ -6974,6 +7017,21 @@ export declare interface PrivacyMaskZones {
6974
7017
  canvas: ShelterCanvas;
6975
7018
  }
6976
7019
 
7020
+ /**
7021
+ * Ask the kernel which local IP it would use to send a UDP packet to
7022
+ * `destHost:destPort`. Uses `dgram.Socket.connect()` to bind a fresh
7023
+ * socket on a wildcard, then reads back `address()` which now reports
7024
+ * the kernel-selected source. Closes the probe socket before returning
7025
+ * — never sends a real packet.
7026
+ *
7027
+ * Throws on EHOSTUNREACH / EAI_FAIL / connect timeout. Caller treats
7028
+ * "throws" as "couldn't tell" rather than as a hard error.
7029
+ */
7030
+ export declare function probeEgressForHost(destHost: string, destPort: number): Promise<{
7031
+ localAddress: string;
7032
+ localPort: number;
7033
+ }>;
7034
+
6977
7035
  export declare interface PtzCommand {
6978
7036
  action: "start" | "stop";
6979
7037
  command: "Left" | "Right" | "Up" | "Down" | "ZoomIn" | "ZoomOut" | "FocusNear" | "FocusFar";
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  NVR_HUB_EXACT_TYPES,
15
15
  NVR_HUB_MODEL_PATTERNS,
16
16
  ReolinkBaichuanApi,
17
+ _clearP2pLookupDedupForTests,
17
18
  _resetEmailPushBusForTests,
18
19
  abilitiesHasAny,
19
20
  asLogger,
@@ -54,6 +55,7 @@ import {
54
55
  getVideoStream,
55
56
  isDualLenseModel,
56
57
  isNvrHubModel,
58
+ isSameSubnetAsAnyLocalIface,
57
59
  isTcpFailureThatShouldFallbackToUdp,
58
60
  isUnroutableForP2P,
59
61
  mapEmailPushInferredType,
@@ -64,12 +66,13 @@ import {
64
66
  patchAiDetectCfgXml,
65
67
  patchMotionSensitivityListXml,
66
68
  patchShelterXml,
69
+ probeEgressForHost,
67
70
  selectViableUdpMethods,
68
71
  setEmailPushCameraResolver,
69
72
  setGlobalLogger,
70
73
  tcpReachabilityProbe,
71
74
  xmlIndicatesFloodlight
72
- } from "./chunk-D4TKRGUP.js";
75
+ } from "./chunk-UL34MR4L.js";
73
76
  import {
74
77
  ReolinkCgiApi,
75
78
  ReolinkHttpClient,
@@ -10026,6 +10029,7 @@ export {
10026
10029
  ReolinkHttpClient,
10027
10030
  Rfc4571Muxer,
10028
10031
  RtspBackchannel,
10032
+ _clearP2pLookupDedupForTests,
10029
10033
  _resetEmailPushBusForTests,
10030
10034
  abilitiesHasAny,
10031
10035
  aesDecrypt,
@@ -10138,6 +10142,7 @@ export {
10138
10142
  isH265Irap,
10139
10143
  isH265KeyframeAnnexB,
10140
10144
  isNvrHubModel,
10145
+ isSameSubnetAsAnyLocalIface,
10141
10146
  isTcpFailureThatShouldFallbackToUdp,
10142
10147
  isUnroutableForP2P,
10143
10148
  isValidH264AnnexBAccessUnit,
@@ -10166,6 +10171,7 @@ export {
10166
10171
  patchNestedTag,
10167
10172
  patchShelterXml,
10168
10173
  printNvrDiagnostics,
10174
+ probeEgressForHost,
10169
10175
  runAllDiagnosticsConsecutively,
10170
10176
  runMultifocalDiagnosticsConsecutively,
10171
10177
  sampleStreams,