@haex-space/vault-sdk 4.6.0 → 4.7.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/react.mjs CHANGED
@@ -805,6 +805,12 @@ var MAIL_COMMANDS = {
805
805
  fetchMessage: "extension_mail_fetch_message",
806
806
  /** Fetch a single attachment's bytes (base64) by part index */
807
807
  fetchAttachment: "extension_mail_fetch_attachment",
808
+ /** Search a mailbox on the server by criteria; answers UIDs, newest first */
809
+ search: "extension_mail_search",
810
+ /** CREATE a mailbox (reports whether it was already there) */
811
+ createMailbox: "extension_mail_create_mailbox",
812
+ /** Delete messages for good: `\Deleted` plus UID EXPUNGE of exactly those UIDs */
813
+ deleteMessages: "extension_mail_delete_messages",
808
814
  /** Set or unset IMAP flags on a UID set */
809
815
  setFlags: "extension_mail_set_flags",
810
816
  /** MOVE messages between mailboxes (COPY+EXPUNGE fallback) */
@@ -2106,6 +2112,45 @@ var MailAPI = class {
2106
2112
  partIndex
2107
2113
  });
2108
2114
  }
2115
+ /**
2116
+ * Search a whole mailbox on the server. Answers the UIDs of the newest `limit` hits (1 to 1000;
2117
+ * all that fit one answer when omitted), newest first, and the number of all hits. Fetch their
2118
+ * envelopes with `fetchEnvelopesAsync` and a `uidList` range.
2119
+ */
2120
+ async searchMessagesAsync(imap, mailbox, criteria, limit) {
2121
+ return this.client.request(MAIL_COMMANDS.search, {
2122
+ imap,
2123
+ mailbox,
2124
+ criteria,
2125
+ limit
2126
+ });
2127
+ }
2128
+ /**
2129
+ * Create a mailbox. Resolves to `false`, not an error, when it already existed. The name may
2130
+ * contain the server's hierarchy delimiter; `*` and `%` are not allowed.
2131
+ */
2132
+ async createMailboxAsync(imap, mailbox) {
2133
+ const { created } = await this.client.request(
2134
+ MAIL_COMMANDS.createMailbox,
2135
+ { imap, mailbox }
2136
+ );
2137
+ return created;
2138
+ }
2139
+ /**
2140
+ * Delete messages for good: flags exactly these UIDs `\Deleted` and expunges exactly them, so
2141
+ * other messages marked `\Deleted` stay. Refused with an error on a server without UIDPLUS,
2142
+ * before anything is marked. If the expunge fails after marking, the messages stay in the
2143
+ * mailbox flagged `\Deleted` and the call rejects; do not show them as deleted. At most 1000 UIDs
2144
+ * per call. For a message that can still be recovered, use `moveMessagesAsync` into the trash
2145
+ * instead.
2146
+ */
2147
+ async deleteMessagesAsync(imap, mailbox, uids) {
2148
+ return this.client.request(MAIL_COMMANDS.deleteMessages, {
2149
+ imap,
2150
+ mailbox,
2151
+ uids
2152
+ });
2153
+ }
2109
2154
  /**
2110
2155
  * Set or unset IMAP flags. Use `flags=["\\Seen"]` + `add=true` to
2111
2156
  * mark messages as read; `add=false` removes the flag(s).