@haex-space/vault-sdk 5.4.2 → 5.6.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/autofill.js +1 -1
- package/dist/autofill.js.map +1 -1
- package/dist/autofill.mjs +1 -1
- package/dist/autofill.mjs.map +1 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{client-HdPYJ_9t.d.mts → client-5T310pDa.d.mts} +157 -3
- package/dist/{client-CgngeKPm.d.ts → client-r56Io3Ns.d.ts} +157 -3
- package/dist/haex_bundle_bg.wasm +0 -0
- package/dist/index.d.mts +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.js +70 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -2
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.mjs +1 -1
- package/dist/node.mjs.map +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/nuxt.js.map +1 -1
- package/dist/passgen.js +1 -1
- package/dist/passgen.js.map +1 -1
- package/dist/passgen.mjs +1 -1
- package/dist/passgen.mjs.map +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +79 -2
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +78 -1
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.js +76 -0
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +76 -0
- 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 +79 -2
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +78 -1
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-CNxDNQgb.d.mts → types-keveJwPq.d.mts} +3 -0
- package/dist/{types-CNxDNQgb.d.ts → types-keveJwPq.d.ts} +3 -0
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +79 -2
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +78 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/svelte.mjs
CHANGED
|
@@ -13,7 +13,7 @@ var __esm = (fn, res, err) => function __init() {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
var init_esm_shims = __esm({
|
|
16
|
-
"node_modules/.pnpm/tsup@9.0.0_jiti@2.7.0_postcss@8.5.
|
|
16
|
+
"node_modules/.pnpm/tsup@9.0.0_jiti@2.7.0_postcss@8.5.33_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/esm_shims.js"() {
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
|
|
@@ -444,6 +444,9 @@ var HAEXTENSION_EVENTS = {
|
|
|
444
444
|
FILE_CHANGED: "filesync:file-changed",
|
|
445
445
|
/** Tables have been updated via sync (CRDT pull from server) */
|
|
446
446
|
SYNC_TABLES_UPDATED: "haextension:sync:tables-updated",
|
|
447
|
+
/** The user used a control of this extension's header (holzi spec 090): `{ id, kind, value? }`.
|
|
448
|
+
* Subscribe through `client.header.onEvent`. */
|
|
449
|
+
HEADER_EVENT: "haextension:header:event",
|
|
447
450
|
/** A runtime permission prompt was resolved (granted/denied) by the user.
|
|
448
451
|
* The SDK uses this to auto-retry the original request; extensions may also
|
|
449
452
|
* subscribe via `client.on(HAEXTENSION_EVENTS.PERMISSION_RESOLVED, ...)`. */
|
|
@@ -647,8 +650,20 @@ var EXTENSION_COMMANDS = {
|
|
|
647
650
|
getInfo: "extension_get_info",
|
|
648
651
|
/** Get application context (theme, locale, etc.) */
|
|
649
652
|
getContext: "extension_context_get",
|
|
653
|
+
/** Set application context (host-only, updates stored context for extensions) */
|
|
654
|
+
setContext: "extension_context_set",
|
|
655
|
+
/** Broadcast event to ALL extension webview windows (host-only, desktop only) */
|
|
656
|
+
webviewBroadcast: "extension_webview_broadcast",
|
|
657
|
+
/** Emit event to all webviews of a SPECIFIC extension (host-only, desktop only) */
|
|
658
|
+
webviewEmit: "extension_webview_emit",
|
|
659
|
+
/** Filter sync tables by extension permissions (returns filtered map) */
|
|
660
|
+
filterSyncTables: "extension_filter_sync_tables",
|
|
661
|
+
/** Emit sync tables to webviews (host-only, desktop only) */
|
|
662
|
+
emitSyncTables: "extension_emit_sync_tables",
|
|
650
663
|
/** Ask the host to mark (or unmark) this extension's own tab as wanting attention */
|
|
651
664
|
tabAttention: "extension_tab_attention",
|
|
665
|
+
/** Replace the header of this extension's own tab (holzi spec 090): `null` */
|
|
666
|
+
headerSet: "extension_header_set",
|
|
652
667
|
/** Ask the user to confirm, in a dialog the host draws over this extension's tab */
|
|
653
668
|
dialogConfirm: "extension_dialog_confirm",
|
|
654
669
|
/** Take the request the user gave this extension (holzi spec 063): `null` or `{ action, mail }` */
|
|
@@ -852,6 +867,10 @@ var MAIL_COMMANDS = {
|
|
|
852
867
|
search: "extension_mail_search",
|
|
853
868
|
/** CREATE a mailbox (reports whether it was already there) */
|
|
854
869
|
createMailbox: "extension_mail_create_mailbox",
|
|
870
|
+
/** DELETE a mailbox (never INBOX) */
|
|
871
|
+
deleteMailbox: "extension_mail_delete_mailbox",
|
|
872
|
+
/** RENAME a mailbox (never INBOX) */
|
|
873
|
+
renameMailbox: "extension_mail_rename_mailbox",
|
|
855
874
|
/** Delete messages for good: `\Deleted` plus UID EXPUNGE of exactly those UIDs */
|
|
856
875
|
deleteMessages: "extension_mail_delete_messages",
|
|
857
876
|
/** Set or unset IMAP flags on a UID set */
|
|
@@ -2376,6 +2395,25 @@ var MailAPI = class {
|
|
|
2376
2395
|
);
|
|
2377
2396
|
return created;
|
|
2378
2397
|
}
|
|
2398
|
+
/**
|
|
2399
|
+
* Delete a mailbox. `mailbox` is the IMAP-encoded name (modified UTF-7), like in every other
|
|
2400
|
+
* call. `INBOX` can be neither deleted nor renamed; the host refuses it. Whether the mailbox's
|
|
2401
|
+
* messages and child mailboxes go with it, and whether a missing mailbox is an error, is up to
|
|
2402
|
+
* the server. Needs the same `fetch` permission as the other IMAP calls.
|
|
2403
|
+
*/
|
|
2404
|
+
async deleteMailboxAsync(imap, mailbox) {
|
|
2405
|
+
return this.client.request(MAIL_COMMANDS.deleteMailbox, { imap, mailbox });
|
|
2406
|
+
}
|
|
2407
|
+
/**
|
|
2408
|
+
* Rename a mailbox from `from` to `to`, both IMAP-encoded names (modified UTF-7). `to` may
|
|
2409
|
+
* contain the server's hierarchy delimiter to move the mailbox in the tree; `*` and `%` are not
|
|
2410
|
+
* allowed. `INBOX` can be neither deleted nor renamed; the host refuses it. Whether child
|
|
2411
|
+
* mailboxes follow and whether an existing `to` is an error is up to the server. Needs the same
|
|
2412
|
+
* `fetch` permission as the other IMAP calls.
|
|
2413
|
+
*/
|
|
2414
|
+
async renameMailboxAsync(imap, from, to) {
|
|
2415
|
+
return this.client.request(MAIL_COMMANDS.renameMailbox, { imap, from, to });
|
|
2416
|
+
}
|
|
2379
2417
|
/**
|
|
2380
2418
|
* Delete messages for good: flags exactly these UIDs `\Deleted` and expunges exactly them, so
|
|
2381
2419
|
* other messages marked `\Deleted` stay. Refused with an error on a server without UIDPLUS,
|
|
@@ -2536,6 +2574,44 @@ var TabAPI = class {
|
|
|
2536
2574
|
}
|
|
2537
2575
|
};
|
|
2538
2576
|
|
|
2577
|
+
// src/api/header.ts
|
|
2578
|
+
init_esm_shims();
|
|
2579
|
+
var NOT_SUPPORTED2 = 8e3;
|
|
2580
|
+
function isUnknownMethod(error) {
|
|
2581
|
+
if (error?.code === NOT_SUPPORTED2) return true;
|
|
2582
|
+
const text = typeof error === "string" ? error : error?.message;
|
|
2583
|
+
return typeof text === "string" && /^Unknown method\b/.test(text);
|
|
2584
|
+
}
|
|
2585
|
+
var HeaderAPI = class {
|
|
2586
|
+
constructor(client) {
|
|
2587
|
+
this.client = client;
|
|
2588
|
+
}
|
|
2589
|
+
/**
|
|
2590
|
+
* Replace the header with `description`. Resolves `true` when the host applied it, and `false`
|
|
2591
|
+
* when the host has no header (haex-vault 2.x); the extension keeps running either way. Every
|
|
2592
|
+
* other error rejects, such as `3001` for a description the host refuses (the previous header
|
|
2593
|
+
* stays).
|
|
2594
|
+
*/
|
|
2595
|
+
async set(description) {
|
|
2596
|
+
try {
|
|
2597
|
+
await this.client.request(EXTENSION_COMMANDS.headerSet, { ...description });
|
|
2598
|
+
return true;
|
|
2599
|
+
} catch (error) {
|
|
2600
|
+
if (isUnknownMethod(error)) return false;
|
|
2601
|
+
throw error;
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
/** Listen for the user using a control of this extension's header. Returns an unsubscribe function. */
|
|
2605
|
+
onEvent(handler) {
|
|
2606
|
+
const wrapped = (event) => {
|
|
2607
|
+
const data = event.data;
|
|
2608
|
+
if (data) handler(data);
|
|
2609
|
+
};
|
|
2610
|
+
this.client.on(HAEXTENSION_EVENTS.HEADER_EVENT, wrapped);
|
|
2611
|
+
return () => this.client.off(HAEXTENSION_EVENTS.HEADER_EVENT, wrapped);
|
|
2612
|
+
}
|
|
2613
|
+
};
|
|
2614
|
+
|
|
2539
2615
|
// src/api/dialog.ts
|
|
2540
2616
|
init_esm_shims();
|
|
2541
2617
|
var DialogAPI = class {
|
|
@@ -3486,6 +3562,7 @@ var HaexVaultSdk = class {
|
|
|
3486
3562
|
this.mail = new MailAPI(this);
|
|
3487
3563
|
this.notifications = new NotificationsAPI(this);
|
|
3488
3564
|
this.tab = new TabAPI(this);
|
|
3565
|
+
this.header = new HeaderAPI(this);
|
|
3489
3566
|
this.dialog = new DialogAPI(this);
|
|
3490
3567
|
this.openers = new OpenersAPI(this);
|
|
3491
3568
|
this.tools = new ToolsAPI({
|