@haex-space/vault-sdk 3.2.8 → 3.3.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/{client-BBD-YsPv.d.ts → client-BW3ayV19.d.mts} +82 -2
- package/dist/{client-DaS2fAf-.d.mts → client-Cm23j1wm.d.ts} +82 -2
- package/dist/index.d.mts +30 -6
- package/dist/index.d.ts +30 -6
- package/dist/index.js +51 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49 -2
- 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 +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +46 -0
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +46 -0
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.d.mts +2 -2
- package/dist/runtime/nuxt.plugin.client.d.ts +2 -2
- package/dist/runtime/nuxt.plugin.client.js +46 -0
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +46 -0
- package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
- package/dist/svelte.d.mts +2 -2
- package/dist/svelte.d.ts +2 -2
- package/dist/svelte.js +46 -0
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +46 -0
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-Cji-mUN0.d.mts → types-fHuxbqa4.d.mts} +9 -1
- package/dist/{types-Cji-mUN0.d.ts → types-fHuxbqa4.d.ts} +9 -1
- package/dist/vue.d.mts +2 -2
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +46 -0
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +46 -0
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as nuxt_app from 'nuxt/app';
|
|
2
2
|
import { ShallowRef } from 'vue';
|
|
3
|
-
import { H as HaexVaultSdk } from '../client-
|
|
4
|
-
import { A as ApplicationContext } from '../types-
|
|
3
|
+
import { H as HaexVaultSdk } from '../client-BW3ayV19.mjs';
|
|
4
|
+
import { A as ApplicationContext } from '../types-fHuxbqa4.mjs';
|
|
5
5
|
import 'drizzle-orm/sqlite-proxy';
|
|
6
6
|
|
|
7
7
|
declare const _default: nuxt_app.Plugin<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as nuxt_app from 'nuxt/app';
|
|
2
2
|
import { ShallowRef } from 'vue';
|
|
3
|
-
import { H as HaexVaultSdk } from '../client-
|
|
4
|
-
import { A as ApplicationContext } from '../types-
|
|
3
|
+
import { H as HaexVaultSdk } from '../client-Cm23j1wm.js';
|
|
4
|
+
import { A as ApplicationContext } from '../types-fHuxbqa4.js';
|
|
5
5
|
import 'drizzle-orm/sqlite-proxy';
|
|
6
6
|
|
|
7
7
|
declare const _default: nuxt_app.Plugin<{
|
|
@@ -21,6 +21,10 @@ var HAEXTENSION_EVENTS = {
|
|
|
21
21
|
* subscribe via `client.on(HAEXTENSION_EVENTS.PERMISSION_RESOLVED, ...)`. */
|
|
22
22
|
PERMISSION_RESOLVED: "extension:permission-resolved"
|
|
23
23
|
};
|
|
24
|
+
var NOTIFICATION_EVENTS = {
|
|
25
|
+
/** A click on one of this extension's notifications (body or action button). */
|
|
26
|
+
CLICK: "haextension:notification:click"
|
|
27
|
+
};
|
|
24
28
|
var EXTERNAL_EVENTS = {
|
|
25
29
|
/** External request from authorized client */
|
|
26
30
|
REQUEST: "haextension:external:request",
|
|
@@ -305,6 +309,14 @@ var MAIL_COMMANDS = {
|
|
|
305
309
|
buildRfc822: "extension_mail_build_rfc822"
|
|
306
310
|
};
|
|
307
311
|
|
|
312
|
+
// src/commands/notifications.ts
|
|
313
|
+
var NOTIFICATION_COMMANDS = {
|
|
314
|
+
/** Show an OS notification. Returns the assigned notification id. */
|
|
315
|
+
show: "extension_notifications_show",
|
|
316
|
+
/** Dismiss a previously shown notification (only own notifications). */
|
|
317
|
+
dismiss: "extension_notifications_dismiss"
|
|
318
|
+
};
|
|
319
|
+
|
|
308
320
|
// src/api/storage.ts
|
|
309
321
|
var StorageAPI = class {
|
|
310
322
|
constructor(client) {
|
|
@@ -1404,6 +1416,38 @@ var MailAPI = class {
|
|
|
1404
1416
|
}
|
|
1405
1417
|
};
|
|
1406
1418
|
|
|
1419
|
+
// src/api/notifications.ts
|
|
1420
|
+
var NotificationsAPI = class {
|
|
1421
|
+
constructor(client) {
|
|
1422
|
+
this.client = client;
|
|
1423
|
+
}
|
|
1424
|
+
/** Show a notification. Returns its id so it can be dismissed later. */
|
|
1425
|
+
async show(opts) {
|
|
1426
|
+
return this.client.request(NOTIFICATION_COMMANDS.show, {
|
|
1427
|
+
options: opts
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
/** Dismiss a previously shown notification (only own notifications). */
|
|
1431
|
+
async dismiss(id) {
|
|
1432
|
+
return this.client.request(NOTIFICATION_COMMANDS.dismiss, { id });
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Listen for clicks on this extension's notifications. Useful when the
|
|
1436
|
+
* extension is already open and wants to react in-app (e.g. router.push the
|
|
1437
|
+
* `path`) instead of relying on the host to focus the webview.
|
|
1438
|
+
*
|
|
1439
|
+
* Returns an unsubscribe function.
|
|
1440
|
+
*/
|
|
1441
|
+
onClick(handler) {
|
|
1442
|
+
const wrapped = (event) => {
|
|
1443
|
+
const data = event.data;
|
|
1444
|
+
if (data) handler(data);
|
|
1445
|
+
};
|
|
1446
|
+
this.client.on(NOTIFICATION_EVENTS.CLICK, wrapped);
|
|
1447
|
+
return () => this.client.off(NOTIFICATION_EVENTS.CLICK, wrapped);
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
|
|
1407
1451
|
// src/messages.ts
|
|
1408
1452
|
var HAEXSPACE_MESSAGE_TYPES = {
|
|
1409
1453
|
/** Debug message for development/troubleshooting */
|
|
@@ -1662,6 +1706,7 @@ async function setupTauriEventListeners(ctx, log, onEvent, onContextChange) {
|
|
|
1662
1706
|
HAEXTENSION_EVENTS.PERMISSION_RESOLVED,
|
|
1663
1707
|
EXTERNAL_EVENTS.REQUEST,
|
|
1664
1708
|
EXTERNAL_EVENTS.ACTION_REQUEST,
|
|
1709
|
+
NOTIFICATION_EVENTS.CLICK,
|
|
1665
1710
|
...Object.values(LOCALSEND_EVENTS)
|
|
1666
1711
|
]) {
|
|
1667
1712
|
await forwardEvent(listen, log, onEvent, listenOptions, eventName);
|
|
@@ -2137,6 +2182,7 @@ var HaexVaultSdk = class {
|
|
|
2137
2182
|
this.shell = new ShellAPI(this);
|
|
2138
2183
|
this.passwords = new PasswordsAPI(this);
|
|
2139
2184
|
this.mail = new MailAPI(this);
|
|
2185
|
+
this.notifications = new NotificationsAPI(this);
|
|
2140
2186
|
installConsoleForwarding(this.config.debug);
|
|
2141
2187
|
this.on(HAEXTENSION_EVENTS.PERMISSION_RESOLVED, (event) => {
|
|
2142
2188
|
const data = event.data;
|