@haex-space/vault-sdk 4.6.0 → 4.7.1
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/{client-CcNhK76M.d.mts → client--CgEtJ4G.d.ts} +51 -3
- package/dist/{client-DIvNHfx-.d.ts → client-BlUizM-l.d.mts} +51 -3
- package/dist/index.d.mts +14 -5
- package/dist/index.d.ts +14 -5
- package/dist/index.js +51 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +51 -1
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +51 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +51 -1
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.js +51 -1
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +51 -1
- package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
- package/dist/svelte.d.mts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/svelte.js +51 -1
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +51 -1
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-snPkjDCj.d.mts → types-3iifP-Q1.d.mts} +2 -0
- package/dist/{types-snPkjDCj.d.ts → types-3iifP-Q1.d.ts} +2 -0
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +51 -1
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +51 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -352,6 +352,12 @@ var MAIL_COMMANDS = {
|
|
|
352
352
|
fetchMessage: "extension_mail_fetch_message",
|
|
353
353
|
/** Fetch a single attachment's bytes (base64) by part index */
|
|
354
354
|
fetchAttachment: "extension_mail_fetch_attachment",
|
|
355
|
+
/** Search a mailbox on the server by criteria; answers UIDs, newest first */
|
|
356
|
+
search: "extension_mail_search",
|
|
357
|
+
/** CREATE a mailbox (reports whether it was already there) */
|
|
358
|
+
createMailbox: "extension_mail_create_mailbox",
|
|
359
|
+
/** Delete messages for good: `\Deleted` plus UID EXPUNGE of exactly those UIDs */
|
|
360
|
+
deleteMessages: "extension_mail_delete_messages",
|
|
355
361
|
/** Set or unset IMAP flags on a UID set */
|
|
356
362
|
setFlags: "extension_mail_set_flags",
|
|
357
363
|
/** MOVE messages between mailboxes (COPY+EXPUNGE fallback) */
|
|
@@ -1662,6 +1668,45 @@ var MailAPI = class {
|
|
|
1662
1668
|
partIndex
|
|
1663
1669
|
});
|
|
1664
1670
|
}
|
|
1671
|
+
/**
|
|
1672
|
+
* Search a whole mailbox on the server. Answers the UIDs of the newest `limit` hits (1 to 1000;
|
|
1673
|
+
* all that fit one answer when omitted), newest first, and the number of all hits. Fetch their
|
|
1674
|
+
* envelopes with `fetchEnvelopesAsync` and a `uidList` range.
|
|
1675
|
+
*/
|
|
1676
|
+
async searchMessagesAsync(imap, mailbox, criteria, limit) {
|
|
1677
|
+
return this.client.request(MAIL_COMMANDS.search, {
|
|
1678
|
+
imap,
|
|
1679
|
+
mailbox,
|
|
1680
|
+
criteria,
|
|
1681
|
+
limit
|
|
1682
|
+
});
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Create a mailbox. Resolves to `false`, not an error, when it already existed. The name may
|
|
1686
|
+
* contain the server's hierarchy delimiter; `*` and `%` are not allowed.
|
|
1687
|
+
*/
|
|
1688
|
+
async createMailboxAsync(imap, mailbox) {
|
|
1689
|
+
const { created } = await this.client.request(
|
|
1690
|
+
MAIL_COMMANDS.createMailbox,
|
|
1691
|
+
{ imap, mailbox }
|
|
1692
|
+
);
|
|
1693
|
+
return created;
|
|
1694
|
+
}
|
|
1695
|
+
/**
|
|
1696
|
+
* Delete messages for good: flags exactly these UIDs `\Deleted` and expunges exactly them, so
|
|
1697
|
+
* other messages marked `\Deleted` stay. Refused with an error on a server without UIDPLUS,
|
|
1698
|
+
* before anything is marked. If the expunge fails after marking, the messages stay in the
|
|
1699
|
+
* mailbox flagged `\Deleted` and the call rejects; do not show them as deleted. At most 1000 UIDs
|
|
1700
|
+
* per call. For a message that can still be recovered, use `moveMessagesAsync` into the trash
|
|
1701
|
+
* instead.
|
|
1702
|
+
*/
|
|
1703
|
+
async deleteMessagesAsync(imap, mailbox, uids) {
|
|
1704
|
+
return this.client.request(MAIL_COMMANDS.deleteMessages, {
|
|
1705
|
+
imap,
|
|
1706
|
+
mailbox,
|
|
1707
|
+
uids
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1665
1710
|
/**
|
|
1666
1711
|
* Set or unset IMAP flags. Use `flags=["\\Seen"]` + `add=true` to
|
|
1667
1712
|
* mark messages as read; `add=false` removes the flag(s).
|
|
@@ -2678,6 +2723,11 @@ var PermissionWaiterRegistry = class {
|
|
|
2678
2723
|
for (const callback of [...set]) callback(decision);
|
|
2679
2724
|
}
|
|
2680
2725
|
};
|
|
2726
|
+
function promptedKey(error) {
|
|
2727
|
+
const details = error.details ?? {};
|
|
2728
|
+
const field = (name) => typeof details[name] === "string" ? details[name] : error[name];
|
|
2729
|
+
return permissionKey(field("resourceType"), field("action"), field("target"));
|
|
2730
|
+
}
|
|
2681
2731
|
function toDeniedError(error) {
|
|
2682
2732
|
return { ...error, code: 1002 /* DENIED */ };
|
|
2683
2733
|
}
|
|
@@ -2690,7 +2740,7 @@ async function withPermissionRetry(send, registry, log, timeoutMs = PERMISSION_D
|
|
|
2690
2740
|
if (!isPermissionPromptError(error) || attempt >= MAX_PERMISSION_PROMPTS) {
|
|
2691
2741
|
throw error;
|
|
2692
2742
|
}
|
|
2693
|
-
const key =
|
|
2743
|
+
const key = promptedKey(error);
|
|
2694
2744
|
const times = asked.get(key) ?? 0;
|
|
2695
2745
|
if (times >= MAX_PERMISSION_RETRIES) throw error;
|
|
2696
2746
|
asked.set(key, times + 1);
|