@haex-space/vault-sdk 3.2.8 → 3.4.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--_QYySP0.d.ts} +90 -2
- package/dist/{client-DaS2fAf-.d.mts → client-C9FyPkqp.d.mts} +90 -2
- package/dist/index.d.mts +33 -6
- package/dist/index.d.ts +33 -6
- package/dist/index.js +68 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -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 +63 -0
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +63 -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 +63 -0
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +63 -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 +63 -0
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +63 -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 +63 -0
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +63 -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-C9FyPkqp.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--_QYySP0.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",
|
|
@@ -293,6 +297,8 @@ var MAIL_COMMANDS = {
|
|
|
293
297
|
fetchEnvelopes: "extension_mail_fetch_envelopes",
|
|
294
298
|
/** Full message fetch (envelope + body + attachment metadata) */
|
|
295
299
|
fetchMessage: "extension_mail_fetch_message",
|
|
300
|
+
/** Fetch a single attachment's bytes (base64) by part index */
|
|
301
|
+
fetchAttachment: "extension_mail_fetch_attachment",
|
|
296
302
|
/** Set or unset IMAP flags on a UID set */
|
|
297
303
|
setFlags: "extension_mail_set_flags",
|
|
298
304
|
/** MOVE messages between mailboxes (COPY+EXPUNGE fallback) */
|
|
@@ -305,6 +311,14 @@ var MAIL_COMMANDS = {
|
|
|
305
311
|
buildRfc822: "extension_mail_build_rfc822"
|
|
306
312
|
};
|
|
307
313
|
|
|
314
|
+
// src/commands/notifications.ts
|
|
315
|
+
var NOTIFICATION_COMMANDS = {
|
|
316
|
+
/** Show an OS notification. Returns the assigned notification id. */
|
|
317
|
+
show: "extension_notifications_show",
|
|
318
|
+
/** Dismiss a previously shown notification (only own notifications). */
|
|
319
|
+
dismiss: "extension_notifications_dismiss"
|
|
320
|
+
};
|
|
321
|
+
|
|
308
322
|
// src/api/storage.ts
|
|
309
323
|
var StorageAPI = class {
|
|
310
324
|
constructor(client) {
|
|
@@ -1349,6 +1363,21 @@ var MailAPI = class {
|
|
|
1349
1363
|
uid
|
|
1350
1364
|
});
|
|
1351
1365
|
}
|
|
1366
|
+
/**
|
|
1367
|
+
* Fetch a single attachment's raw bytes by its `partIndex` (from the
|
|
1368
|
+
* `attachments` array of a fetched `MailMessage`), returned as a
|
|
1369
|
+
* standard-alphabet base64 string. The base64 form drops straight into
|
|
1370
|
+
* `OutgoingAttachment.data` when forwarding, and decodes to bytes for
|
|
1371
|
+
* viewing or downloading.
|
|
1372
|
+
*/
|
|
1373
|
+
async fetchAttachmentAsync(imap, mailbox, uid, partIndex) {
|
|
1374
|
+
return this.client.request(MAIL_COMMANDS.fetchAttachment, {
|
|
1375
|
+
imap,
|
|
1376
|
+
mailbox,
|
|
1377
|
+
uid,
|
|
1378
|
+
partIndex
|
|
1379
|
+
});
|
|
1380
|
+
}
|
|
1352
1381
|
/**
|
|
1353
1382
|
* Set or unset IMAP flags. Use `flags=["\\Seen"]` + `add=true` to
|
|
1354
1383
|
* mark messages as read; `add=false` removes the flag(s).
|
|
@@ -1404,6 +1433,38 @@ var MailAPI = class {
|
|
|
1404
1433
|
}
|
|
1405
1434
|
};
|
|
1406
1435
|
|
|
1436
|
+
// src/api/notifications.ts
|
|
1437
|
+
var NotificationsAPI = class {
|
|
1438
|
+
constructor(client) {
|
|
1439
|
+
this.client = client;
|
|
1440
|
+
}
|
|
1441
|
+
/** Show a notification. Returns its id so it can be dismissed later. */
|
|
1442
|
+
async show(opts) {
|
|
1443
|
+
return this.client.request(NOTIFICATION_COMMANDS.show, {
|
|
1444
|
+
options: opts
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
/** Dismiss a previously shown notification (only own notifications). */
|
|
1448
|
+
async dismiss(id) {
|
|
1449
|
+
return this.client.request(NOTIFICATION_COMMANDS.dismiss, { id });
|
|
1450
|
+
}
|
|
1451
|
+
/**
|
|
1452
|
+
* Listen for clicks on this extension's notifications. Useful when the
|
|
1453
|
+
* extension is already open and wants to react in-app (e.g. router.push the
|
|
1454
|
+
* `path`) instead of relying on the host to focus the webview.
|
|
1455
|
+
*
|
|
1456
|
+
* Returns an unsubscribe function.
|
|
1457
|
+
*/
|
|
1458
|
+
onClick(handler) {
|
|
1459
|
+
const wrapped = (event) => {
|
|
1460
|
+
const data = event.data;
|
|
1461
|
+
if (data) handler(data);
|
|
1462
|
+
};
|
|
1463
|
+
this.client.on(NOTIFICATION_EVENTS.CLICK, wrapped);
|
|
1464
|
+
return () => this.client.off(NOTIFICATION_EVENTS.CLICK, wrapped);
|
|
1465
|
+
}
|
|
1466
|
+
};
|
|
1467
|
+
|
|
1407
1468
|
// src/messages.ts
|
|
1408
1469
|
var HAEXSPACE_MESSAGE_TYPES = {
|
|
1409
1470
|
/** Debug message for development/troubleshooting */
|
|
@@ -1662,6 +1723,7 @@ async function setupTauriEventListeners(ctx, log, onEvent, onContextChange) {
|
|
|
1662
1723
|
HAEXTENSION_EVENTS.PERMISSION_RESOLVED,
|
|
1663
1724
|
EXTERNAL_EVENTS.REQUEST,
|
|
1664
1725
|
EXTERNAL_EVENTS.ACTION_REQUEST,
|
|
1726
|
+
NOTIFICATION_EVENTS.CLICK,
|
|
1665
1727
|
...Object.values(LOCALSEND_EVENTS)
|
|
1666
1728
|
]) {
|
|
1667
1729
|
await forwardEvent(listen, log, onEvent, listenOptions, eventName);
|
|
@@ -2137,6 +2199,7 @@ var HaexVaultSdk = class {
|
|
|
2137
2199
|
this.shell = new ShellAPI(this);
|
|
2138
2200
|
this.passwords = new PasswordsAPI(this);
|
|
2139
2201
|
this.mail = new MailAPI(this);
|
|
2202
|
+
this.notifications = new NotificationsAPI(this);
|
|
2140
2203
|
installConsoleForwarding(this.config.debug);
|
|
2141
2204
|
this.on(HAEXTENSION_EVENTS.PERMISSION_RESOLVED, (event) => {
|
|
2142
2205
|
const data = event.data;
|