@haex-space/vault-sdk 5.4.2 → 5.5.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.
@@ -396,6 +396,10 @@ var MAIL_COMMANDS = {
396
396
  search: "extension_mail_search",
397
397
  /** CREATE a mailbox (reports whether it was already there) */
398
398
  createMailbox: "extension_mail_create_mailbox",
399
+ /** DELETE a mailbox (never INBOX) */
400
+ deleteMailbox: "extension_mail_delete_mailbox",
401
+ /** RENAME a mailbox (never INBOX) */
402
+ renameMailbox: "extension_mail_rename_mailbox",
399
403
  /** Delete messages for good: `\Deleted` plus UID EXPUNGE of exactly those UIDs */
400
404
  deleteMessages: "extension_mail_delete_messages",
401
405
  /** Set or unset IMAP flags on a UID set */
@@ -1927,6 +1931,25 @@ var MailAPI = class {
1927
1931
  );
1928
1932
  return created;
1929
1933
  }
1934
+ /**
1935
+ * Delete a mailbox. `mailbox` is the IMAP-encoded name (modified UTF-7), like in every other
1936
+ * call. `INBOX` can be neither deleted nor renamed; the host refuses it. Whether the mailbox's
1937
+ * messages and child mailboxes go with it, and whether a missing mailbox is an error, is up to
1938
+ * the server. Needs the same `fetch` permission as the other IMAP calls.
1939
+ */
1940
+ async deleteMailboxAsync(imap, mailbox) {
1941
+ return this.client.request(MAIL_COMMANDS.deleteMailbox, { imap, mailbox });
1942
+ }
1943
+ /**
1944
+ * Rename a mailbox from `from` to `to`, both IMAP-encoded names (modified UTF-7). `to` may
1945
+ * contain the server's hierarchy delimiter to move the mailbox in the tree; `*` and `%` are not
1946
+ * allowed. `INBOX` can be neither deleted nor renamed; the host refuses it. Whether child
1947
+ * mailboxes follow and whether an existing `to` is an error is up to the server. Needs the same
1948
+ * `fetch` permission as the other IMAP calls.
1949
+ */
1950
+ async renameMailboxAsync(imap, from, to) {
1951
+ return this.client.request(MAIL_COMMANDS.renameMailbox, { imap, from, to });
1952
+ }
1930
1953
  /**
1931
1954
  * Delete messages for good: flags exactly these UIDs `\Deleted` and expunges exactly them, so
1932
1955
  * other messages marked `\Deleted` stay. Refused with an error on a server without UIDPLUS,