@apocaliss92/nodelink-js 0.4.34-beta.0 → 0.4.34

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.
@@ -24126,6 +24126,17 @@ async function discoverReolinkDevices(options = {}) {
24126
24126
  }
24127
24127
 
24128
24128
  // src/reolink/autodetect.ts
24129
+ var ALL_UDP_DISCOVERY_METHODS = [
24130
+ "local-direct",
24131
+ "local-broadcast",
24132
+ "remote",
24133
+ "relay",
24134
+ "map"
24135
+ ];
24136
+ function selectViableUdpMethods(hasUid, methods = ALL_UDP_DISCOVERY_METHODS) {
24137
+ if (hasUid) return [...methods];
24138
+ return methods.filter((m) => m === "local-direct");
24139
+ }
24129
24140
  function normalizeUid(uid) {
24130
24141
  const v = uid?.trim();
24131
24142
  return v ? v : void 0;
@@ -24617,7 +24628,7 @@ async function autoDetectDeviceType(inputs) {
24617
24628
  }
24618
24629
  if (!normalizedUid) {
24619
24630
  logger?.log?.(
24620
- `[AutoDetect] UID discovery failed; will try local-direct without UID first.`
24631
+ `[AutoDetect] UID discovery failed; only local-direct can run without a UID. If the camera is sleeping or on a different subnet, supply its UID to enable BCUDP P2P fallback (remote/relay/map) which can wake it via Reolink's servers.`
24621
24632
  );
24622
24633
  }
24623
24634
  }
@@ -24670,8 +24681,7 @@ async function autoDetectDeviceType(inputs) {
24670
24681
  api: udpApi
24671
24682
  };
24672
24683
  };
24673
- const methodsToTry = ["local-direct", "local-broadcast", "remote", "relay", "map"];
24674
- const viableMethods = normalizedUid ? methodsToTry : methodsToTry.filter((m) => m === "local-direct" || m === "local-broadcast");
24684
+ const viableMethods = selectViableUdpMethods(Boolean(normalizedUid));
24675
24685
  return await runUdpMethodsParallel(
24676
24686
  viableMethods,
24677
24687
  async (m, isAborted) => {
@@ -24777,9 +24787,11 @@ export {
24777
24787
  discoverViaTcpPortScan,
24778
24788
  discoverViaOnvif,
24779
24789
  discoverReolinkDevices,
24790
+ ALL_UDP_DISCOVERY_METHODS,
24791
+ selectViableUdpMethods,
24780
24792
  normalizeUid,
24781
24793
  maskUid,
24782
24794
  isTcpFailureThatShouldFallbackToUdp,
24783
24795
  autoDetectDeviceType
24784
24796
  };
24785
- //# sourceMappingURL=chunk-ZRDPJAXB.js.map
24797
+ //# sourceMappingURL=chunk-OJ5RWPGY.js.map