@haex-space/vault-sdk 3.3.0 → 3.4.0

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.
@@ -295,6 +295,8 @@ var MAIL_COMMANDS = {
295
295
  fetchEnvelopes: "extension_mail_fetch_envelopes",
296
296
  /** Full message fetch (envelope + body + attachment metadata) */
297
297
  fetchMessage: "extension_mail_fetch_message",
298
+ /** Fetch a single attachment's bytes (base64) by part index */
299
+ fetchAttachment: "extension_mail_fetch_attachment",
298
300
  /** Set or unset IMAP flags on a UID set */
299
301
  setFlags: "extension_mail_set_flags",
300
302
  /** MOVE messages between mailboxes (COPY+EXPUNGE fallback) */
@@ -1359,6 +1361,21 @@ var MailAPI = class {
1359
1361
  uid
1360
1362
  });
1361
1363
  }
1364
+ /**
1365
+ * Fetch a single attachment's raw bytes by its `partIndex` (from the
1366
+ * `attachments` array of a fetched `MailMessage`), returned as a
1367
+ * standard-alphabet base64 string. The base64 form drops straight into
1368
+ * `OutgoingAttachment.data` when forwarding, and decodes to bytes for
1369
+ * viewing or downloading.
1370
+ */
1371
+ async fetchAttachmentAsync(imap, mailbox, uid, partIndex) {
1372
+ return this.client.request(MAIL_COMMANDS.fetchAttachment, {
1373
+ imap,
1374
+ mailbox,
1375
+ uid,
1376
+ partIndex
1377
+ });
1378
+ }
1362
1379
  /**
1363
1380
  * Set or unset IMAP flags. Use `flags=["\\Seen"]` + `add=true` to
1364
1381
  * mark messages as read; `add=false` removes the flag(s).