@apocaliss92/nodelink-js 0.4.28 → 0.4.30

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.
@@ -20908,6 +20908,7 @@ var ReolinkBaichuanApi = class _ReolinkBaichuanApi {
20908
20908
  */
20909
20909
  subscribeEmailPushEvents(params) {
20910
20910
  const channel = params.channel ?? 0;
20911
+ const onEvent = params.onEvent;
20911
20912
  const matches = "match" in params ? params.match : (event) => event.cameraId === params.cameraId;
20912
20913
  const off = onEmailPushEvent((event) => {
20913
20914
  if (!matches(event)) return;
@@ -20923,6 +20924,15 @@ var ReolinkBaichuanApi = class _ReolinkBaichuanApi {
20923
20924
  timestamp: event.receivedAtMs
20924
20925
  });
20925
20926
  }
20927
+ if (onEvent) {
20928
+ try {
20929
+ onEvent(event);
20930
+ } catch (err) {
20931
+ this.logger.warn?.(
20932
+ `[ReolinkBaichuanApi] subscribeEmailPushEvents onEvent threw: ${err instanceof Error ? err.message : err}`
20933
+ );
20934
+ }
20935
+ }
20926
20936
  });
20927
20937
  return off;
20928
20938
  }