@bobfrankston/rmfmail 1.2.252 → 1.2.253

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.
Files changed (49) hide show
  1. package/client/android-bootstrap.bundle.js +27 -30
  2. package/client/android-bootstrap.bundle.js.map +2 -2
  3. package/client/app.bundle.js +23 -0
  4. package/client/app.bundle.js.map +3 -3
  5. package/client/app.js +26 -0
  6. package/client/app.js.map +1 -1
  7. package/client/app.ts +24 -0
  8. package/client/compose/compose.bundle.js +37 -3
  9. package/client/compose/compose.bundle.js.map +3 -3
  10. package/client/compose/compose.css +13 -0
  11. package/client/compose/compose.js +41 -1
  12. package/client/compose/compose.js.map +1 -1
  13. package/client/compose/compose.ts +38 -1
  14. package/client/lib/api-client.js +7 -0
  15. package/client/lib/api-client.js.map +1 -1
  16. package/client/lib/api-client.ts +8 -0
  17. package/client/lib/mailxapi.js +10 -2
  18. package/package.json +3 -3
  19. package/packages/mailx-imap/package-lock.json +2 -2
  20. package/packages/mailx-imap/package.json +1 -1
  21. package/packages/mailx-service/index.d.ts +19 -1
  22. package/packages/mailx-service/index.d.ts.map +1 -1
  23. package/packages/mailx-service/index.js +27 -2
  24. package/packages/mailx-service/index.js.map +1 -1
  25. package/packages/mailx-service/index.ts +28 -2
  26. package/packages/mailx-service/jsonrpc.js +3 -1
  27. package/packages/mailx-service/jsonrpc.js.map +1 -1
  28. package/packages/mailx-service/jsonrpc.ts +3 -1
  29. package/packages/mailx-service/package.json +1 -1
  30. package/packages/mailx-settings/package.json +1 -1
  31. package/packages/mailx-store/package.json +1 -1
  32. package/packages/mailx-store-web/android-bootstrap.js +1 -1
  33. package/packages/mailx-store-web/android-bootstrap.js.map +1 -1
  34. package/packages/mailx-store-web/android-bootstrap.ts +1 -1
  35. package/packages/mailx-store-web/package.json +1 -1
  36. package/packages/mailx-store-web/web-service.d.ts +5 -1
  37. package/packages/mailx-store-web/web-service.d.ts.map +1 -1
  38. package/packages/mailx-store-web/web-service.js +5 -1
  39. package/packages/mailx-store-web/web-service.js.map +1 -1
  40. package/packages/mailx-store-web/web-service.ts +5 -1
  41. package/packages/mailx-types/mailx-api.d.ts +17 -1
  42. package/packages/mailx-types/mailx-api.d.ts.map +1 -1
  43. package/packages/mailx-types/mailx-api.ts +10 -1
  44. package/packages/mailx-types/mime-build.d.ts.map +1 -1
  45. package/packages/mailx-types/mime-build.js +35 -30
  46. package/packages/mailx-types/mime-build.js.map +1 -1
  47. package/packages/mailx-types/mime-build.ts +44 -32
  48. package/packages/mailx-types/package.json +1 -1
  49. /package/packages/mailx-imap/{node_modules.npmglobalize-stash-85680 → node_modules.npmglobalize-stash-54924}/.package-lock.json +0 -0
@@ -2458,13 +2458,11 @@ function buildMimeMessage(opts) {
2458
2458
  const commonHeaders = headers.filter((h) => h !== null);
2459
2459
  if (opts.simpleHtml) {
2460
2460
  const body = opts.bodyHtml || opts.bodyText || "";
2461
- const raw2 = [
2462
- ...commonHeaders,
2463
- `Content-Type: text/html; charset=UTF-8`,
2464
- `Content-Transfer-Encoding: quoted-printable`
2465
- ].join("\r\n") + `\r
2466
- \r
2467
- ` + encodeQuotedPrintable(body);
2461
+ const htmlPart = {
2462
+ headers: [`Content-Type: text/html; charset=UTF-8`, `Content-Transfer-Encoding: quoted-printable`],
2463
+ body: encodeQuotedPrintable(body)
2464
+ };
2465
+ const raw2 = wrapWithAttachments(commonHeaders, htmlPart, opts.attachments || [], newBoundary);
2468
2466
  return { raw: raw2, messageId, inlineImageCount: 0 };
2469
2467
  }
2470
2468
  const extracted = hasHtml ? extractInlineImages(opts.bodyHtml, opts.domain) : { html: "", images: [] };
@@ -2523,39 +2521,37 @@ ${wrap76(im.base64)}\r
2523
2521
  body: textEncoded
2524
2522
  };
2525
2523
  };
2526
- const attachments = opts.attachments || [];
2527
- let raw;
2528
- if (attachments.length > 0) {
2529
- const mixedBoundary = newBoundary();
2530
- const inner = makeInner();
2531
- const parts = [
2532
- `--${mixedBoundary}\r
2524
+ const raw = wrapWithAttachments(commonHeaders, makeInner(), opts.attachments || [], newBoundary);
2525
+ return { raw, messageId, inlineImageCount: inlineImages.length };
2526
+ }
2527
+ function wrapWithAttachments(commonHeaders, inner, attachments, newBoundary) {
2528
+ if (attachments.length === 0) {
2529
+ return [...commonHeaders, ...inner.headers].join("\r\n") + `\r
2530
+ \r
2531
+ ` + inner.body;
2532
+ }
2533
+ const mixedBoundary = newBoundary();
2534
+ const parts = [
2535
+ `--${mixedBoundary}\r
2533
2536
  ` + inner.headers.join("\r\n") + `\r
2534
2537
  \r
2535
2538
  ` + inner.body
2536
- ];
2537
- for (const att of attachments) {
2538
- const filename = (att.filename || "attachment").replace(/[\r\n"]/g, "_");
2539
- const mime = att.mimeType || "application/octet-stream";
2540
- parts.push(`--${mixedBoundary}\r
2539
+ ];
2540
+ for (const att of attachments) {
2541
+ const filename = (att.filename || "attachment").replace(/[\r\n"]/g, "_");
2542
+ const mime = att.mimeType || "application/octet-stream";
2543
+ parts.push(`--${mixedBoundary}\r
2541
2544
  Content-Type: ${mime}; name="${filename}"\r
2542
2545
  Content-Disposition: attachment; filename="${filename}"\r
2543
2546
  Content-Transfer-Encoding: base64\r
2544
2547
  \r
2545
2548
  ${wrap76(att.dataBase64 || "")}\r
2546
2549
  `);
2547
- }
2548
- raw = [...commonHeaders, `Content-Type: multipart/mixed; boundary="${mixedBoundary}"`].join("\r\n") + `\r
2550
+ }
2551
+ return [...commonHeaders, `Content-Type: multipart/mixed; boundary="${mixedBoundary}"`].join("\r\n") + `\r
2549
2552
  \r
2550
2553
  ` + parts.join("") + `--${mixedBoundary}--\r
2551
2554
  `;
2552
- } else {
2553
- const inner = makeInner();
2554
- raw = [...commonHeaders, ...inner.headers].join("\r\n") + `\r
2555
- \r
2556
- ` + inner.body;
2557
- }
2558
- return { raw, messageId, inlineImageCount: inlineImages.length };
2559
2555
  }
2560
2556
  var init_mime_build = __esm({
2561
2557
  "packages/mailx-types/mime-build.js"() {
@@ -6492,7 +6488,7 @@ var WebMailxService = class _WebMailxService {
6492
6488
  await this.syncManager.undeleteMessage(accountId, uid, folderId);
6493
6489
  }
6494
6490
  // ── Drafts ──
6495
- async saveDraft(accountId, subject, bodyHtml, bodyText, to, cc, previousDraftUid, draftId, bcc, from) {
6491
+ async saveDraft(accountId, subject, bodyHtml, bodyText, to, cc, previousDraftUid, draftId, bcc, from, attachments) {
6496
6492
  const settings = await loadSettings();
6497
6493
  const account = settings.accounts.find((a) => a.id === accountId);
6498
6494
  if (!account)
@@ -6506,6 +6502,7 @@ var WebMailxService = class _WebMailxService {
6506
6502
  subject: subject || "(no subject)",
6507
6503
  bodyHtml,
6508
6504
  bodyText,
6505
+ attachments,
6509
6506
  domain: account.email.split("@")[1] || "mailx.local",
6510
6507
  extraHeaders: [`X-Mailx-Draft-ID: ${id}`],
6511
6508
  omitMessageId: true,
@@ -11753,7 +11750,7 @@ function installBridge() {
11753
11750
  await service.send(msg);
11754
11751
  return { ok: true };
11755
11752
  },
11756
- saveDraft: (p) => service.saveDraft(p.accountId, p.subject, p.bodyHtml, p.bodyText, p.to, p.cc, p.previousDraftUid, p.draftId, p.bcc, p.from),
11753
+ saveDraft: (p) => service.saveDraft(p.accountId, p.subject, p.bodyHtml, p.bodyText, p.to, p.cc, p.previousDraftUid, p.draftId, p.bcc, p.from, p.attachments),
11757
11754
  deleteDraft: async (accountId, draftUid) => {
11758
11755
  await service.deleteDraft(accountId, draftUid);
11759
11756
  return { ok: true };