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