@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/index.mjs CHANGED
@@ -1077,6 +1077,8 @@ var MAIL_COMMANDS = {
1077
1077
  fetchEnvelopes: "extension_mail_fetch_envelopes",
1078
1078
  /** Full message fetch (envelope + body + attachment metadata) */
1079
1079
  fetchMessage: "extension_mail_fetch_message",
1080
+ /** Fetch a single attachment's bytes (base64) by part index */
1081
+ fetchAttachment: "extension_mail_fetch_attachment",
1080
1082
  /** Set or unset IMAP flags on a UID set */
1081
1083
  setFlags: "extension_mail_set_flags",
1082
1084
  /** MOVE messages between mailboxes (COPY+EXPUNGE fallback) */
@@ -2143,6 +2145,21 @@ var MailAPI = class {
2143
2145
  uid
2144
2146
  });
2145
2147
  }
2148
+ /**
2149
+ * Fetch a single attachment's raw bytes by its `partIndex` (from the
2150
+ * `attachments` array of a fetched `MailMessage`), returned as a
2151
+ * standard-alphabet base64 string. The base64 form drops straight into
2152
+ * `OutgoingAttachment.data` when forwarding, and decodes to bytes for
2153
+ * viewing or downloading.
2154
+ */
2155
+ async fetchAttachmentAsync(imap, mailbox, uid, partIndex) {
2156
+ return this.client.request(MAIL_COMMANDS.fetchAttachment, {
2157
+ imap,
2158
+ mailbox,
2159
+ uid,
2160
+ partIndex
2161
+ });
2162
+ }
2146
2163
  /**
2147
2164
  * Set or unset IMAP flags. Use `flags=["\\Seen"]` + `add=true` to
2148
2165
  * mark messages as read; `add=false` removes the flag(s).