@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
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).
|
|
@@ -3044,6 +3089,11 @@ var PermissionWaiterRegistry = class {
|
|
|
3044
3089
|
for (const callback of [...set]) callback(decision);
|
|
3045
3090
|
}
|
|
3046
3091
|
};
|
|
3092
|
+
function promptedKey(error) {
|
|
3093
|
+
const details = error.details ?? {};
|
|
3094
|
+
const field = (name) => typeof details[name] === "string" ? details[name] : error[name];
|
|
3095
|
+
return permissionKey(field("resourceType"), field("action"), field("target"));
|
|
3096
|
+
}
|
|
3047
3097
|
function toDeniedError(error) {
|
|
3048
3098
|
return { ...error, code: 1002 /* DENIED */ };
|
|
3049
3099
|
}
|
|
@@ -3056,7 +3106,7 @@ async function withPermissionRetry(send, registry, log, timeoutMs = PERMISSION_D
|
|
|
3056
3106
|
if (!isPermissionPromptError(error) || attempt >= MAX_PERMISSION_PROMPTS) {
|
|
3057
3107
|
throw error;
|
|
3058
3108
|
}
|
|
3059
|
-
const key =
|
|
3109
|
+
const key = promptedKey(error);
|
|
3060
3110
|
const times = asked.get(key) ?? 0;
|
|
3061
3111
|
if (times >= MAX_PERMISSION_RETRIES) throw error;
|
|
3062
3112
|
asked.set(key, times + 1);
|