@haex-space/vault-sdk 5.5.0 → 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-CtUpYUH7.d.ts → client-5T310pDa.d.mts} +142 -3
- package/dist/{client-BFDgj2tC.d.mts → client-r56Io3Ns.d.ts} +142 -3
- package/dist/haex_bundle_bg.wasm +0 -0
- package/dist/index.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +47 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -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 +56 -2
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +55 -1
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.js +53 -0
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +53 -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 +56 -2
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +55 -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 +56 -2
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +55 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -16,6 +16,9 @@ var HAEXTENSION_EVENTS = {
|
|
|
16
16
|
FILE_CHANGED: "filesync:file-changed",
|
|
17
17
|
/** Tables have been updated via sync (CRDT pull from server) */
|
|
18
18
|
SYNC_TABLES_UPDATED: "haextension:sync:tables-updated",
|
|
19
|
+
/** The user used a control of this extension's header (holzi spec 090): `{ id, kind, value? }`.
|
|
20
|
+
* Subscribe through `client.header.onEvent`. */
|
|
21
|
+
HEADER_EVENT: "haextension:header:event",
|
|
19
22
|
/** A runtime permission prompt was resolved (granted/denied) by the user.
|
|
20
23
|
* The SDK uses this to auto-retry the original request; extensions may also
|
|
21
24
|
* subscribe via `client.on(HAEXTENSION_EVENTS.PERMISSION_RESOLVED, ...)`. */
|
|
@@ -203,8 +206,20 @@ var EXTENSION_COMMANDS = {
|
|
|
203
206
|
getInfo: "extension_get_info",
|
|
204
207
|
/** Get application context (theme, locale, etc.) */
|
|
205
208
|
getContext: "extension_context_get",
|
|
209
|
+
/** Set application context (host-only, updates stored context for extensions) */
|
|
210
|
+
setContext: "extension_context_set",
|
|
211
|
+
/** Broadcast event to ALL extension webview windows (host-only, desktop only) */
|
|
212
|
+
webviewBroadcast: "extension_webview_broadcast",
|
|
213
|
+
/** Emit event to all webviews of a SPECIFIC extension (host-only, desktop only) */
|
|
214
|
+
webviewEmit: "extension_webview_emit",
|
|
215
|
+
/** Filter sync tables by extension permissions (returns filtered map) */
|
|
216
|
+
filterSyncTables: "extension_filter_sync_tables",
|
|
217
|
+
/** Emit sync tables to webviews (host-only, desktop only) */
|
|
218
|
+
emitSyncTables: "extension_emit_sync_tables",
|
|
206
219
|
/** Ask the host to mark (or unmark) this extension's own tab as wanting attention */
|
|
207
220
|
tabAttention: "extension_tab_attention",
|
|
221
|
+
/** Replace the header of this extension's own tab (holzi spec 090): `null` */
|
|
222
|
+
headerSet: "extension_header_set",
|
|
208
223
|
/** Ask the user to confirm, in a dialog the host draws over this extension's tab */
|
|
209
224
|
dialogConfirm: "extension_dialog_confirm",
|
|
210
225
|
/** Take the request the user gave this extension (holzi spec 063): `null` or `{ action, mail }` */
|
|
@@ -2110,6 +2125,43 @@ var TabAPI = class {
|
|
|
2110
2125
|
}
|
|
2111
2126
|
};
|
|
2112
2127
|
|
|
2128
|
+
// src/api/header.ts
|
|
2129
|
+
var NOT_SUPPORTED2 = 8e3;
|
|
2130
|
+
function isUnknownMethod(error) {
|
|
2131
|
+
if (error?.code === NOT_SUPPORTED2) return true;
|
|
2132
|
+
const text = typeof error === "string" ? error : error?.message;
|
|
2133
|
+
return typeof text === "string" && /^Unknown method\b/.test(text);
|
|
2134
|
+
}
|
|
2135
|
+
var HeaderAPI = class {
|
|
2136
|
+
constructor(client) {
|
|
2137
|
+
this.client = client;
|
|
2138
|
+
}
|
|
2139
|
+
/**
|
|
2140
|
+
* Replace the header with `description`. Resolves `true` when the host applied it, and `false`
|
|
2141
|
+
* when the host has no header (haex-vault 2.x); the extension keeps running either way. Every
|
|
2142
|
+
* other error rejects, such as `3001` for a description the host refuses (the previous header
|
|
2143
|
+
* stays).
|
|
2144
|
+
*/
|
|
2145
|
+
async set(description) {
|
|
2146
|
+
try {
|
|
2147
|
+
await this.client.request(EXTENSION_COMMANDS.headerSet, { ...description });
|
|
2148
|
+
return true;
|
|
2149
|
+
} catch (error) {
|
|
2150
|
+
if (isUnknownMethod(error)) return false;
|
|
2151
|
+
throw error;
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
/** Listen for the user using a control of this extension's header. Returns an unsubscribe function. */
|
|
2155
|
+
onEvent(handler) {
|
|
2156
|
+
const wrapped = (event) => {
|
|
2157
|
+
const data = event.data;
|
|
2158
|
+
if (data) handler(data);
|
|
2159
|
+
};
|
|
2160
|
+
this.client.on(HAEXTENSION_EVENTS.HEADER_EVENT, wrapped);
|
|
2161
|
+
return () => this.client.off(HAEXTENSION_EVENTS.HEADER_EVENT, wrapped);
|
|
2162
|
+
}
|
|
2163
|
+
};
|
|
2164
|
+
|
|
2113
2165
|
// src/api/dialog.ts
|
|
2114
2166
|
var DialogAPI = class {
|
|
2115
2167
|
constructor(client) {
|
|
@@ -3139,6 +3191,7 @@ var HaexVaultSdk = class {
|
|
|
3139
3191
|
this.mail = new MailAPI(this);
|
|
3140
3192
|
this.notifications = new NotificationsAPI(this);
|
|
3141
3193
|
this.tab = new TabAPI(this);
|
|
3194
|
+
this.header = new HeaderAPI(this);
|
|
3142
3195
|
this.dialog = new DialogAPI(this);
|
|
3143
3196
|
this.openers = new OpenersAPI(this);
|
|
3144
3197
|
this.tools = new ToolsAPI({
|