@haex-space/vault-sdk 3.5.1 → 3.7.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.
@@ -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-DCoY4f3Q.mjs';
4
- import { A as ApplicationContext } from '../types-fHuxbqa4.mjs';
3
+ import { H as HaexVaultSdk } from '../client-Dn4AbXbT.mjs';
4
+ import { A as ApplicationContext } from '../types-DQZCRfC-.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-mcuC3gP5.js';
4
- import { A as ApplicationContext } from '../types-fHuxbqa4.js';
3
+ import { H as HaexVaultSdk } from '../client-DH4Km77u.js';
4
+ import { A as ApplicationContext } from '../types-DQZCRfC-.js';
5
5
  import 'drizzle-orm/sqlite-proxy';
6
6
 
7
7
  declare const _default: nuxt_app.Plugin<{
@@ -36,6 +36,10 @@ var SHELL_EVENTS = {
36
36
  /** Shell session has exited */
37
37
  EXIT: "shell:exit"
38
38
  };
39
+ var MAIL_EVENTS = {
40
+ /** A watched mailbox's UID high-water mark advanced — new mail arrived. */
41
+ NEW_MESSAGES: "mail:new-messages"
42
+ };
39
43
 
40
44
  // src/types.ts
41
45
  var DEFAULT_TIMEOUT = 3e4;
@@ -258,6 +262,8 @@ var SPACE_COMMANDS = {
258
262
  unassign: "extension_space_unassign",
259
263
  /** Get space assignments for a table */
260
264
  getAssignments: "extension_space_get_assignments",
265
+ /** Get members of a shared space */
266
+ getMembers: "extension_space_get_members",
261
267
  /** List all spaces the user is a member of (with decrypted names) */
262
268
  list: "extension_space_list"};
263
269
 
@@ -308,7 +314,11 @@ var MAIL_COMMANDS = {
308
314
  /** SMTP send. Returns the assigned Message-ID. */
309
315
  sendMessage: "extension_mail_send_message",
310
316
  /** Build RFC822 bytes without sending (for Drafts via APPEND) */
311
- buildRfc822: "extension_mail_build_rfc822"
317
+ buildRfc822: "extension_mail_build_rfc822",
318
+ /** Start (or replace) a background poll watch for an account/mailbox */
319
+ startWatch: "extension_mail_start_watch",
320
+ /** Stop a background poll watch */
321
+ stopWatch: "extension_mail_stop_watch"
312
322
  };
313
323
 
314
324
  // src/commands/notifications.ts
@@ -1211,6 +1221,13 @@ var SpacesAPI = class {
1211
1221
  async listSpacesAsync() {
1212
1222
  return this.client.request(SPACE_COMMANDS.list);
1213
1223
  }
1224
+ /**
1225
+ * List members of a shared space (DID + label), flagging the current user.
1226
+ * Used to resolve assignment authors to names and to detect own vs shared-in content.
1227
+ */
1228
+ async getMembersAsync(spaceId) {
1229
+ return this.client.request(SPACE_COMMANDS.getMembers, { spaceId });
1230
+ }
1214
1231
  };
1215
1232
 
1216
1233
  // src/api/shell.ts
@@ -1431,6 +1448,41 @@ var MailAPI = class {
1431
1448
  message
1432
1449
  });
1433
1450
  }
1451
+ /**
1452
+ * Start (or replace) a background poll watch for `accountId`/`mailboxName`.
1453
+ * The host resolves credentials itself from `accountId` — no `ImapConfig`
1454
+ * is passed in. Requires `mail` permission with action `poll` on the
1455
+ * account's IMAP host (prompted on first call, same as `fetch`/`send`).
1456
+ *
1457
+ * `intervalSeconds` is clamped host-side to [30, 3600]. Listen for
1458
+ * results via `onNewMessages`.
1459
+ */
1460
+ async startWatchingAsync(accountId, mailboxName, intervalSeconds) {
1461
+ return this.client.request(MAIL_COMMANDS.startWatch, {
1462
+ accountId,
1463
+ mailboxName,
1464
+ intervalSeconds
1465
+ });
1466
+ }
1467
+ /** Stop a background poll watch previously started with `startWatchingAsync`. */
1468
+ async stopWatchingAsync(accountId, mailboxName) {
1469
+ return this.client.request(MAIL_COMMANDS.stopWatch, {
1470
+ accountId,
1471
+ mailboxName
1472
+ });
1473
+ }
1474
+ /**
1475
+ * Register a callback for new-mail notifications from any active watch.
1476
+ * `event.data` is a `MailNewMessagesEvent` — check `accountId`/`mailboxName`
1477
+ * before refreshing if watching more than one account.
1478
+ */
1479
+ onNewMessages(callback) {
1480
+ this.client.on(MAIL_EVENTS.NEW_MESSAGES, callback);
1481
+ }
1482
+ /** Remove a new-mail callback registered with `onNewMessages`. */
1483
+ offNewMessages(callback) {
1484
+ this.client.off(MAIL_EVENTS.NEW_MESSAGES, callback);
1485
+ }
1434
1486
  };
1435
1487
 
1436
1488
  // src/api/notifications.ts
@@ -1724,6 +1776,7 @@ async function setupTauriEventListeners(ctx, log, onEvent, onContextChange) {
1724
1776
  EXTERNAL_EVENTS.REQUEST,
1725
1777
  EXTERNAL_EVENTS.ACTION_REQUEST,
1726
1778
  NOTIFICATION_EVENTS.CLICK,
1779
+ MAIL_EVENTS.NEW_MESSAGES,
1727
1780
  ...Object.values(LOCALSEND_EVENTS)
1728
1781
  ]) {
1729
1782
  await forwardEvent(listen, log, onEvent, listenOptions, eventName);