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