@apocaliss92/nodelink-js 0.4.30 → 0.4.31

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.
@@ -3,7 +3,7 @@ import {
3
3
  BaichuanRtspServer,
4
4
  ReolinkBaichuanApi,
5
5
  autoDetectDeviceType
6
- } from "../chunk-AZZKLRJV.js";
6
+ } from "../chunk-XVFCEFM6.js";
7
7
  import "../chunk-AHY4L7JI.js";
8
8
  import {
9
9
  __require
package/dist/index.cjs CHANGED
@@ -41131,8 +41131,10 @@ function createEmailPushServer(params) {
41131
41131
  let server;
41132
41132
  let status = buildInitialStatus(config);
41133
41133
  function parseRecipient(rcpt) {
41134
- const [local, domain] = rcpt.toLowerCase().split("@");
41135
- if (!local || !domain) return void 0;
41134
+ const at = rcpt.lastIndexOf("@");
41135
+ if (at <= 0 || at === rcpt.length - 1) return void 0;
41136
+ const local = rcpt.slice(0, at);
41137
+ const domain = rcpt.slice(at + 1).toLowerCase();
41136
41138
  return { local, domain };
41137
41139
  }
41138
41140
  function resolveCameraIdFromRecipient(rcpt) {
@@ -41155,9 +41157,6 @@ function createEmailPushServer(params) {
41155
41157
  return;
41156
41158
  }
41157
41159
  const receivedAtMs = Date.now();
41158
- const imageAttachment = (parsed.attachments ?? []).find(
41159
- (a) => a && typeof a.contentType === "string" && a.contentType.toLowerCase().startsWith("image/") && Buffer.isBuffer(a.content)
41160
- );
41161
41160
  const event = {
41162
41161
  cameraId,
41163
41162
  recipient,
@@ -41165,18 +41164,11 @@ function createEmailPushServer(params) {
41165
41164
  receivedAtMs,
41166
41165
  subject: parsed.subject ?? "",
41167
41166
  from: typeof parsed.from === "object" && parsed.from !== null && "text" in parsed.from ? String(parsed.from.text) : "",
41168
- bodyExcerpt: (parsed.text ?? "").slice(0, 500),
41169
- ...imageAttachment ? {
41170
- attachment: {
41171
- contentType: imageAttachment.contentType,
41172
- data: imageAttachment.content,
41173
- ...imageAttachment.filename ? { filename: imageAttachment.filename } : {}
41174
- }
41175
- } : {}
41167
+ bodyExcerpt: (parsed.text ?? "").slice(0, 500)
41176
41168
  };
41177
41169
  status.messagesAccepted++;
41178
41170
  log.info(
41179
- `Email push for camera=${cameraId} type=${event.inferredType} attachment=${event.attachment ? `${event.attachment.contentType} ${event.attachment.data.length}B` : "none"} subject="${event.subject.slice(0, 80)}"`
41171
+ `Email push for camera=${cameraId} type=${event.inferredType} subject="${event.subject.slice(0, 80)}"`
41180
41172
  );
41181
41173
  emitEmailPushEvent(event);
41182
41174
  }