@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.
package/dist/node.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { H as HaextensionConfig, g as getExtensionDir, r as readHaextensionConfig } from './config-D_HXjsEV.mjs';
2
- import { E as ExtensionManifest } from './types-fHuxbqa4.mjs';
2
+ import { E as ExtensionManifest } from './types-DQZCRfC-.mjs';
3
3
 
4
4
  interface ReadManifestOptions {
5
5
  /** Root directory of the project */
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { H as HaextensionConfig, g as getExtensionDir, r as readHaextensionConfig } from './config-D_HXjsEV.js';
2
- import { E as ExtensionManifest } from './types-fHuxbqa4.js';
2
+ import { E as ExtensionManifest } from './types-DQZCRfC-.js';
3
3
 
4
4
  interface ReadManifestOptions {
5
5
  /** Root directory of the project */
package/dist/react.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { H as HaexVaultSdk, S as StorageAPI } from './client-DCoY4f3Q.mjs';
1
+ import { H as HaexVaultSdk, S as StorageAPI } from './client-Dn4AbXbT.mjs';
2
2
  import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
3
- import { H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext } from './types-fHuxbqa4.mjs';
3
+ import { H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext } from './types-DQZCRfC-.mjs';
4
4
 
5
5
  /**
6
6
  * React hook for HaexVault SDK
package/dist/react.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { H as HaexVaultSdk, S as StorageAPI } from './client-mcuC3gP5.js';
1
+ import { H as HaexVaultSdk, S as StorageAPI } from './client-DH4Km77u.js';
2
2
  import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
3
- import { H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext } from './types-fHuxbqa4.js';
3
+ import { H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext } from './types-DQZCRfC-.js';
4
4
 
5
5
  /**
6
6
  * React hook for HaexVault SDK
package/dist/react.js CHANGED
@@ -419,6 +419,10 @@ var SHELL_EVENTS = {
419
419
  /** Shell session has exited */
420
420
  EXIT: "shell:exit"
421
421
  };
422
+ var MAIL_EVENTS = {
423
+ /** A watched mailbox's UID high-water mark advanced — new mail arrived. */
424
+ NEW_MESSAGES: "mail:new-messages"
425
+ };
422
426
 
423
427
  // src/types.ts
424
428
  var DEFAULT_TIMEOUT = 3e4;
@@ -641,6 +645,8 @@ var SPACE_COMMANDS = {
641
645
  unassign: "extension_space_unassign",
642
646
  /** Get space assignments for a table */
643
647
  getAssignments: "extension_space_get_assignments",
648
+ /** Get members of a shared space */
649
+ getMembers: "extension_space_get_members",
644
650
  /** List all spaces the user is a member of (with decrypted names) */
645
651
  list: "extension_space_list"};
646
652
 
@@ -691,7 +697,11 @@ var MAIL_COMMANDS = {
691
697
  /** SMTP send. Returns the assigned Message-ID. */
692
698
  sendMessage: "extension_mail_send_message",
693
699
  /** Build RFC822 bytes without sending (for Drafts via APPEND) */
694
- buildRfc822: "extension_mail_build_rfc822"
700
+ buildRfc822: "extension_mail_build_rfc822",
701
+ /** Start (or replace) a background poll watch for an account/mailbox */
702
+ startWatch: "extension_mail_start_watch",
703
+ /** Stop a background poll watch */
704
+ stopWatch: "extension_mail_stop_watch"
695
705
  };
696
706
 
697
707
  // src/commands/notifications.ts
@@ -1569,6 +1579,13 @@ var SpacesAPI = class {
1569
1579
  async listSpacesAsync() {
1570
1580
  return this.client.request(SPACE_COMMANDS.list);
1571
1581
  }
1582
+ /**
1583
+ * List members of a shared space (DID + label), flagging the current user.
1584
+ * Used to resolve assignment authors to names and to detect own vs shared-in content.
1585
+ */
1586
+ async getMembersAsync(spaceId) {
1587
+ return this.client.request(SPACE_COMMANDS.getMembers, { spaceId });
1588
+ }
1572
1589
  };
1573
1590
 
1574
1591
  // src/api/shell.ts
@@ -1789,6 +1806,41 @@ var MailAPI = class {
1789
1806
  message
1790
1807
  });
1791
1808
  }
1809
+ /**
1810
+ * Start (or replace) a background poll watch for `accountId`/`mailboxName`.
1811
+ * The host resolves credentials itself from `accountId` — no `ImapConfig`
1812
+ * is passed in. Requires `mail` permission with action `poll` on the
1813
+ * account's IMAP host (prompted on first call, same as `fetch`/`send`).
1814
+ *
1815
+ * `intervalSeconds` is clamped host-side to [30, 3600]. Listen for
1816
+ * results via `onNewMessages`.
1817
+ */
1818
+ async startWatchingAsync(accountId, mailboxName, intervalSeconds) {
1819
+ return this.client.request(MAIL_COMMANDS.startWatch, {
1820
+ accountId,
1821
+ mailboxName,
1822
+ intervalSeconds
1823
+ });
1824
+ }
1825
+ /** Stop a background poll watch previously started with `startWatchingAsync`. */
1826
+ async stopWatchingAsync(accountId, mailboxName) {
1827
+ return this.client.request(MAIL_COMMANDS.stopWatch, {
1828
+ accountId,
1829
+ mailboxName
1830
+ });
1831
+ }
1832
+ /**
1833
+ * Register a callback for new-mail notifications from any active watch.
1834
+ * `event.data` is a `MailNewMessagesEvent` — check `accountId`/`mailboxName`
1835
+ * before refreshing if watching more than one account.
1836
+ */
1837
+ onNewMessages(callback) {
1838
+ this.client.on(MAIL_EVENTS.NEW_MESSAGES, callback);
1839
+ }
1840
+ /** Remove a new-mail callback registered with `onNewMessages`. */
1841
+ offNewMessages(callback) {
1842
+ this.client.off(MAIL_EVENTS.NEW_MESSAGES, callback);
1843
+ }
1792
1844
  };
1793
1845
 
1794
1846
  // src/api/notifications.ts
@@ -1991,6 +2043,7 @@ async function setupTauriEventListeners(ctx, log, onEvent, onContextChange) {
1991
2043
  EXTERNAL_EVENTS.REQUEST,
1992
2044
  EXTERNAL_EVENTS.ACTION_REQUEST,
1993
2045
  NOTIFICATION_EVENTS.CLICK,
2046
+ MAIL_EVENTS.NEW_MESSAGES,
1994
2047
  ...Object.values(LOCALSEND_EVENTS)
1995
2048
  ]) {
1996
2049
  await forwardEvent(listen, log, onEvent, listenOptions, eventName);