@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.
package/dist/svelte.mjs CHANGED
@@ -678,6 +678,8 @@ var MAIL_COMMANDS = {
678
678
  fetchEnvelopes: "extension_mail_fetch_envelopes",
679
679
  /** Full message fetch (envelope + body + attachment metadata) */
680
680
  fetchMessage: "extension_mail_fetch_message",
681
+ /** Fetch a single attachment's bytes (base64) by part index */
682
+ fetchAttachment: "extension_mail_fetch_attachment",
681
683
  /** Set or unset IMAP flags on a UID set */
682
684
  setFlags: "extension_mail_set_flags",
683
685
  /** MOVE messages between mailboxes (COPY+EXPUNGE fallback) */
@@ -1717,6 +1719,21 @@ var MailAPI = class {
1717
1719
  uid
1718
1720
  });
1719
1721
  }
1722
+ /**
1723
+ * Fetch a single attachment's raw bytes by its `partIndex` (from the
1724
+ * `attachments` array of a fetched `MailMessage`), returned as a
1725
+ * standard-alphabet base64 string. The base64 form drops straight into
1726
+ * `OutgoingAttachment.data` when forwarding, and decodes to bytes for
1727
+ * viewing or downloading.
1728
+ */
1729
+ async fetchAttachmentAsync(imap, mailbox, uid, partIndex) {
1730
+ return this.client.request(MAIL_COMMANDS.fetchAttachment, {
1731
+ imap,
1732
+ mailbox,
1733
+ uid,
1734
+ partIndex
1735
+ });
1736
+ }
1720
1737
  /**
1721
1738
  * Set or unset IMAP flags. Use `flags=["\\Seen"]` + `add=true` to
1722
1739
  * mark messages as read; `add=false` removes the flag(s).