@haex-space/vault-sdk 4.6.0 → 4.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.
@@ -1893,6 +1893,34 @@ type FetchRange = {
1893
1893
  type: "uidList";
1894
1894
  uids: number[];
1895
1895
  };
1896
+ /**
1897
+ * Criteria of `MailAPI.searchMessagesAsync`. All given criteria must hold. Texts are matched
1898
+ * ignoring case, are at most 200 characters long, not blank and contain no control characters;
1899
+ * leave a criterion out instead of passing `""`. Dates must name real days. At least one
1900
+ * criterion is required. This is not an IMAP expression: the host builds the command itself.
1901
+ */
1902
+ interface MailSearchCriteria {
1903
+ /** Header and body text. */
1904
+ text?: string;
1905
+ from?: string;
1906
+ to?: string;
1907
+ subject?: string;
1908
+ /** `YYYY-MM-DD`, inclusive. */
1909
+ since?: string;
1910
+ /** `YYYY-MM-DD`, exclusive. */
1911
+ before?: string;
1912
+ /** `true` for unread, `false` for read messages. */
1913
+ unseen?: boolean;
1914
+ /** `true` for flagged, `false` for not flagged messages. */
1915
+ flagged?: boolean;
1916
+ }
1917
+ /** The newest hits of a search and the number of all hits. */
1918
+ interface MailSearchResult {
1919
+ /** UIDs of the newest hits, newest (highest UID) first. */
1920
+ uids: number[];
1921
+ /** How many messages matched in all. */
1922
+ total: number;
1923
+ }
1896
1924
  interface OutgoingAttachment {
1897
1925
  filename: string;
1898
1926
  contentType: string;
@@ -1958,6 +1986,26 @@ declare class MailAPI {
1958
1986
  * viewing or downloading.
1959
1987
  */
1960
1988
  fetchAttachmentAsync(imap: ImapConfig, mailbox: string, uid: number, partIndex: number): Promise<string>;
1989
+ /**
1990
+ * Search a whole mailbox on the server. Answers the UIDs of the newest `limit` hits (1 to 1000;
1991
+ * all that fit one answer when omitted), newest first, and the number of all hits. Fetch their
1992
+ * envelopes with `fetchEnvelopesAsync` and a `uidList` range.
1993
+ */
1994
+ searchMessagesAsync(imap: ImapConfig, mailbox: string, criteria: MailSearchCriteria, limit?: number): Promise<MailSearchResult>;
1995
+ /**
1996
+ * Create a mailbox. Resolves to `false`, not an error, when it already existed. The name may
1997
+ * contain the server's hierarchy delimiter; `*` and `%` are not allowed.
1998
+ */
1999
+ createMailboxAsync(imap: ImapConfig, mailbox: string): Promise<boolean>;
2000
+ /**
2001
+ * Delete messages for good: flags exactly these UIDs `\Deleted` and expunges exactly them, so
2002
+ * other messages marked `\Deleted` stay. Refused with an error on a server without UIDPLUS,
2003
+ * before anything is marked. If the expunge fails after marking, the messages stay in the
2004
+ * mailbox flagged `\Deleted` and the call rejects; do not show them as deleted. At most 1000 UIDs
2005
+ * per call. For a message that can still be recovered, use `moveMessagesAsync` into the trash
2006
+ * instead.
2007
+ */
2008
+ deleteMessagesAsync(imap: ImapConfig, mailbox: string, uids: number[]): Promise<void>;
1961
2009
  /**
1962
2010
  * Set or unset IMAP flags. Use `flags=["\\Seen"]` + `add=true` to
1963
2011
  * mark messages as read; `add=false` removes the flag(s).
@@ -2290,5 +2338,5 @@ declare class HaexVaultSdk {
2290
2338
  private log;
2291
2339
  }
2292
2340
 
2293
- export { DatabaseAPI as D, HaexVaultSdk as H, FilesystemAPI as L, KnownPath as N, LOCALSEND_EVENTS as P, LocalSendAPI as Q, StorageAPI as S, MailAPI as V, ShellAPI as aM, SpacesAPI as aY, TabAPI as a_, ModelsAPI as ac, NotificationsAPI as ag, PasswordsAPI as ao, PermissionsAPI as ar, RemoteStorageAPI as az, ToolsAPI as b1, WebAPI as b5, canExternalClientSendRequests as b6, isExternalClientConnected as b7, ContactsAPI as i, DialogAPI as o, EncryptedFoldersAPI as t, ExternalConnectionErrorCode as x, ExternalConnectionState as y };
2294
- export type { MailNewMessagesEvent as $, AuthorizedClient as A, BlockedClient as B, ConfirmOptions as C, EncryptedFolderAccess as E, ExternalRequestEvent as F, ExternalRequestHandler as G, ExternalRequestPayload as I, ExternalResponse as J, FileStat as K, ImapConfig as M, KnownPaths as O, LocalSendEvent as R, FileInfo as T, LocalSendSettings as U, MailAccount as W, MailAddress as X, Attachment as Y, FetchRange as Z, MailMessage as _, ConnectionSecurity as a, ToolContext as a$, MailboxInfo as a0, MessageEnvelope as a1, ModelEffort as a2, ModelJob as a3, ModelJobAttempt as a4, ModelJobCompletion as a5, ModelJobErrorCode as a6, ModelJobFormat as a7, ModelJobImage as a8, ModelJobProvenance as a9, StorageBackendInfo as aA, StorageBackendType as aB, StorageObjectInfo as aC, UpdateBackendRequest as aD, WebDavProposal as aE, RequestedExtension as aF, SelectFileOptions as aG, SelectFolderOptions as aH, ServerInfo as aI, ServerStatus as aJ, SessionAuthorization as aK, SharedSpace as aL, ShellCreateOptions as aN, ShellCreateResponse as aO, ShellExitEvent as aP, ShellOutputEvent as aQ, SmtpConfig as aR, SpaceAccessTokenInfo as aS, SpaceAssignment as aT, SpaceInvite as aU, SpaceKeyGrantInfo as aV, SpaceMember as aW, SpaceMemberInfo as aX, SyncBackendInfo as aZ, ModelJobStep as aa, ModelPlace as ab, NotificationAction as ad, NotificationClickEvent as ae, NotificationOptions as af, OutgoingAttachment as ah, OutgoingMessage as ai, PasswordInput as aj, PasswordItemFull as ak, PasswordItemSummary as al, PasswordKeyValue as am, PasswordKeyValueInput as an, PendingAuthorization as ap, PendingTransfer as aq, AddBackendRequest as as, FolderBackendInfo as at, S3BackendInfo as au, S3Config as av, S3Proposal as aw, S3PublicConfig as ax, SftpProposal as ay, ContactDetail as b, ToolHandler as b0, TransferDirection as b2, TransferProgress as b3, TransferState as b4, ContactHolziAddresses as c, ContactHolziDevice as d, ContactList as e, ContactListOptions as f, ContactSummary as g, ContactValue as h, DecryptedSpace as j, DeepLink as k, Device as l, DeviceInfo as m, DeviceType as n, DirEntry as p, EncryptedFolderChoice as q, EncryptedFolderEntry as r, EncryptedFolderProviderErrorKind as s, ExtensionModel as u, ExternalAuthDecision as v, ExternalConnection as w, ExternalRequest as z };
2341
+ export { DatabaseAPI as D, HaexVaultSdk as H, FilesystemAPI as L, KnownPath as N, LOCALSEND_EVENTS as P, LocalSendAPI as Q, StorageAPI as S, MailAPI as V, RemoteStorageAPI as aB, ShellAPI as aO, SpacesAPI as a_, ModelsAPI as ae, NotificationsAPI as ai, PasswordsAPI as aq, PermissionsAPI as at, TabAPI as b0, ToolsAPI as b3, WebAPI as b7, canExternalClientSendRequests as b8, isExternalClientConnected as b9, ContactsAPI as i, DialogAPI as o, EncryptedFoldersAPI as t, ExternalConnectionErrorCode as x, ExternalConnectionState as y };
2342
+ export type { MailNewMessagesEvent as $, AuthorizedClient as A, BlockedClient as B, ConfirmOptions as C, EncryptedFolderAccess as E, ExternalRequestEvent as F, ExternalRequestHandler as G, ExternalRequestPayload as I, ExternalResponse as J, FileStat as K, ImapConfig as M, KnownPaths as O, LocalSendEvent as R, FileInfo as T, LocalSendSettings as U, MailAccount as W, MailAddress as X, Attachment as Y, FetchRange as Z, MailMessage as _, ConnectionSecurity as a, SyncBackendInfo as a$, MailSearchCriteria as a0, MailSearchResult as a1, MailboxInfo as a2, MessageEnvelope as a3, ModelEffort as a4, ModelJob as a5, ModelJobAttempt as a6, ModelJobCompletion as a7, ModelJobErrorCode as a8, ModelJobFormat as a9, SftpProposal as aA, StorageBackendInfo as aC, StorageBackendType as aD, StorageObjectInfo as aE, UpdateBackendRequest as aF, WebDavProposal as aG, RequestedExtension as aH, SelectFileOptions as aI, SelectFolderOptions as aJ, ServerInfo as aK, ServerStatus as aL, SessionAuthorization as aM, SharedSpace as aN, ShellCreateOptions as aP, ShellCreateResponse as aQ, ShellExitEvent as aR, ShellOutputEvent as aS, SmtpConfig as aT, SpaceAccessTokenInfo as aU, SpaceAssignment as aV, SpaceInvite as aW, SpaceKeyGrantInfo as aX, SpaceMember as aY, SpaceMemberInfo as aZ, ModelJobImage as aa, ModelJobProvenance as ab, ModelJobStep as ac, ModelPlace as ad, NotificationAction as af, NotificationClickEvent as ag, NotificationOptions as ah, OutgoingAttachment as aj, OutgoingMessage as ak, PasswordInput as al, PasswordItemFull as am, PasswordItemSummary as an, PasswordKeyValue as ao, PasswordKeyValueInput as ap, PendingAuthorization as ar, PendingTransfer as as, AddBackendRequest as au, FolderBackendInfo as av, S3BackendInfo as aw, S3Config as ax, S3Proposal as ay, S3PublicConfig as az, ContactDetail as b, ToolContext as b1, ToolHandler as b2, TransferDirection as b4, TransferProgress as b5, TransferState as b6, ContactHolziAddresses as c, ContactHolziDevice as d, ContactList as e, ContactListOptions as f, ContactSummary as g, ContactValue as h, DecryptedSpace as j, DeepLink as k, Device as l, DeviceInfo as m, DeviceType as n, DirEntry as p, EncryptedFolderChoice as q, EncryptedFolderEntry as r, EncryptedFolderProviderErrorKind as s, ExtensionModel as u, ExternalAuthDecision as v, ExternalConnection as w, ExternalRequest as z };
@@ -1893,6 +1893,34 @@ type FetchRange = {
1893
1893
  type: "uidList";
1894
1894
  uids: number[];
1895
1895
  };
1896
+ /**
1897
+ * Criteria of `MailAPI.searchMessagesAsync`. All given criteria must hold. Texts are matched
1898
+ * ignoring case, are at most 200 characters long, not blank and contain no control characters;
1899
+ * leave a criterion out instead of passing `""`. Dates must name real days. At least one
1900
+ * criterion is required. This is not an IMAP expression: the host builds the command itself.
1901
+ */
1902
+ interface MailSearchCriteria {
1903
+ /** Header and body text. */
1904
+ text?: string;
1905
+ from?: string;
1906
+ to?: string;
1907
+ subject?: string;
1908
+ /** `YYYY-MM-DD`, inclusive. */
1909
+ since?: string;
1910
+ /** `YYYY-MM-DD`, exclusive. */
1911
+ before?: string;
1912
+ /** `true` for unread, `false` for read messages. */
1913
+ unseen?: boolean;
1914
+ /** `true` for flagged, `false` for not flagged messages. */
1915
+ flagged?: boolean;
1916
+ }
1917
+ /** The newest hits of a search and the number of all hits. */
1918
+ interface MailSearchResult {
1919
+ /** UIDs of the newest hits, newest (highest UID) first. */
1920
+ uids: number[];
1921
+ /** How many messages matched in all. */
1922
+ total: number;
1923
+ }
1896
1924
  interface OutgoingAttachment {
1897
1925
  filename: string;
1898
1926
  contentType: string;
@@ -1958,6 +1986,26 @@ declare class MailAPI {
1958
1986
  * viewing or downloading.
1959
1987
  */
1960
1988
  fetchAttachmentAsync(imap: ImapConfig, mailbox: string, uid: number, partIndex: number): Promise<string>;
1989
+ /**
1990
+ * Search a whole mailbox on the server. Answers the UIDs of the newest `limit` hits (1 to 1000;
1991
+ * all that fit one answer when omitted), newest first, and the number of all hits. Fetch their
1992
+ * envelopes with `fetchEnvelopesAsync` and a `uidList` range.
1993
+ */
1994
+ searchMessagesAsync(imap: ImapConfig, mailbox: string, criteria: MailSearchCriteria, limit?: number): Promise<MailSearchResult>;
1995
+ /**
1996
+ * Create a mailbox. Resolves to `false`, not an error, when it already existed. The name may
1997
+ * contain the server's hierarchy delimiter; `*` and `%` are not allowed.
1998
+ */
1999
+ createMailboxAsync(imap: ImapConfig, mailbox: string): Promise<boolean>;
2000
+ /**
2001
+ * Delete messages for good: flags exactly these UIDs `\Deleted` and expunges exactly them, so
2002
+ * other messages marked `\Deleted` stay. Refused with an error on a server without UIDPLUS,
2003
+ * before anything is marked. If the expunge fails after marking, the messages stay in the
2004
+ * mailbox flagged `\Deleted` and the call rejects; do not show them as deleted. At most 1000 UIDs
2005
+ * per call. For a message that can still be recovered, use `moveMessagesAsync` into the trash
2006
+ * instead.
2007
+ */
2008
+ deleteMessagesAsync(imap: ImapConfig, mailbox: string, uids: number[]): Promise<void>;
1961
2009
  /**
1962
2010
  * Set or unset IMAP flags. Use `flags=["\\Seen"]` + `add=true` to
1963
2011
  * mark messages as read; `add=false` removes the flag(s).
@@ -2290,5 +2338,5 @@ declare class HaexVaultSdk {
2290
2338
  private log;
2291
2339
  }
2292
2340
 
2293
- export { DatabaseAPI as D, HaexVaultSdk as H, FilesystemAPI as L, KnownPath as N, LOCALSEND_EVENTS as P, LocalSendAPI as Q, StorageAPI as S, MailAPI as V, ShellAPI as aM, SpacesAPI as aY, TabAPI as a_, ModelsAPI as ac, NotificationsAPI as ag, PasswordsAPI as ao, PermissionsAPI as ar, RemoteStorageAPI as az, ToolsAPI as b1, WebAPI as b5, canExternalClientSendRequests as b6, isExternalClientConnected as b7, ContactsAPI as i, DialogAPI as o, EncryptedFoldersAPI as t, ExternalConnectionErrorCode as x, ExternalConnectionState as y };
2294
- export type { MailNewMessagesEvent as $, AuthorizedClient as A, BlockedClient as B, ConfirmOptions as C, EncryptedFolderAccess as E, ExternalRequestEvent as F, ExternalRequestHandler as G, ExternalRequestPayload as I, ExternalResponse as J, FileStat as K, ImapConfig as M, KnownPaths as O, LocalSendEvent as R, FileInfo as T, LocalSendSettings as U, MailAccount as W, MailAddress as X, Attachment as Y, FetchRange as Z, MailMessage as _, ConnectionSecurity as a, ToolContext as a$, MailboxInfo as a0, MessageEnvelope as a1, ModelEffort as a2, ModelJob as a3, ModelJobAttempt as a4, ModelJobCompletion as a5, ModelJobErrorCode as a6, ModelJobFormat as a7, ModelJobImage as a8, ModelJobProvenance as a9, StorageBackendInfo as aA, StorageBackendType as aB, StorageObjectInfo as aC, UpdateBackendRequest as aD, WebDavProposal as aE, RequestedExtension as aF, SelectFileOptions as aG, SelectFolderOptions as aH, ServerInfo as aI, ServerStatus as aJ, SessionAuthorization as aK, SharedSpace as aL, ShellCreateOptions as aN, ShellCreateResponse as aO, ShellExitEvent as aP, ShellOutputEvent as aQ, SmtpConfig as aR, SpaceAccessTokenInfo as aS, SpaceAssignment as aT, SpaceInvite as aU, SpaceKeyGrantInfo as aV, SpaceMember as aW, SpaceMemberInfo as aX, SyncBackendInfo as aZ, ModelJobStep as aa, ModelPlace as ab, NotificationAction as ad, NotificationClickEvent as ae, NotificationOptions as af, OutgoingAttachment as ah, OutgoingMessage as ai, PasswordInput as aj, PasswordItemFull as ak, PasswordItemSummary as al, PasswordKeyValue as am, PasswordKeyValueInput as an, PendingAuthorization as ap, PendingTransfer as aq, AddBackendRequest as as, FolderBackendInfo as at, S3BackendInfo as au, S3Config as av, S3Proposal as aw, S3PublicConfig as ax, SftpProposal as ay, ContactDetail as b, ToolHandler as b0, TransferDirection as b2, TransferProgress as b3, TransferState as b4, ContactHolziAddresses as c, ContactHolziDevice as d, ContactList as e, ContactListOptions as f, ContactSummary as g, ContactValue as h, DecryptedSpace as j, DeepLink as k, Device as l, DeviceInfo as m, DeviceType as n, DirEntry as p, EncryptedFolderChoice as q, EncryptedFolderEntry as r, EncryptedFolderProviderErrorKind as s, ExtensionModel as u, ExternalAuthDecision as v, ExternalConnection as w, ExternalRequest as z };
2341
+ export { DatabaseAPI as D, HaexVaultSdk as H, FilesystemAPI as L, KnownPath as N, LOCALSEND_EVENTS as P, LocalSendAPI as Q, StorageAPI as S, MailAPI as V, RemoteStorageAPI as aB, ShellAPI as aO, SpacesAPI as a_, ModelsAPI as ae, NotificationsAPI as ai, PasswordsAPI as aq, PermissionsAPI as at, TabAPI as b0, ToolsAPI as b3, WebAPI as b7, canExternalClientSendRequests as b8, isExternalClientConnected as b9, ContactsAPI as i, DialogAPI as o, EncryptedFoldersAPI as t, ExternalConnectionErrorCode as x, ExternalConnectionState as y };
2342
+ export type { MailNewMessagesEvent as $, AuthorizedClient as A, BlockedClient as B, ConfirmOptions as C, EncryptedFolderAccess as E, ExternalRequestEvent as F, ExternalRequestHandler as G, ExternalRequestPayload as I, ExternalResponse as J, FileStat as K, ImapConfig as M, KnownPaths as O, LocalSendEvent as R, FileInfo as T, LocalSendSettings as U, MailAccount as W, MailAddress as X, Attachment as Y, FetchRange as Z, MailMessage as _, ConnectionSecurity as a, SyncBackendInfo as a$, MailSearchCriteria as a0, MailSearchResult as a1, MailboxInfo as a2, MessageEnvelope as a3, ModelEffort as a4, ModelJob as a5, ModelJobAttempt as a6, ModelJobCompletion as a7, ModelJobErrorCode as a8, ModelJobFormat as a9, SftpProposal as aA, StorageBackendInfo as aC, StorageBackendType as aD, StorageObjectInfo as aE, UpdateBackendRequest as aF, WebDavProposal as aG, RequestedExtension as aH, SelectFileOptions as aI, SelectFolderOptions as aJ, ServerInfo as aK, ServerStatus as aL, SessionAuthorization as aM, SharedSpace as aN, ShellCreateOptions as aP, ShellCreateResponse as aQ, ShellExitEvent as aR, ShellOutputEvent as aS, SmtpConfig as aT, SpaceAccessTokenInfo as aU, SpaceAssignment as aV, SpaceInvite as aW, SpaceKeyGrantInfo as aX, SpaceMember as aY, SpaceMemberInfo as aZ, ModelJobImage as aa, ModelJobProvenance as ab, ModelJobStep as ac, ModelPlace as ad, NotificationAction as af, NotificationClickEvent as ag, NotificationOptions as ah, OutgoingAttachment as aj, OutgoingMessage as ak, PasswordInput as al, PasswordItemFull as am, PasswordItemSummary as an, PasswordKeyValue as ao, PasswordKeyValueInput as ap, PendingAuthorization as ar, PendingTransfer as as, AddBackendRequest as au, FolderBackendInfo as av, S3BackendInfo as aw, S3Config as ax, S3Proposal as ay, S3PublicConfig as az, ContactDetail as b, ToolContext as b1, ToolHandler as b2, TransferDirection as b4, TransferProgress as b5, TransferState as b6, ContactHolziAddresses as c, ContactHolziDevice as d, ContactList as e, ContactListOptions as f, ContactSummary as g, ContactValue as h, DecryptedSpace as j, DeepLink as k, Device as l, DeviceInfo as m, DeviceType as n, DirEntry as p, EncryptedFolderChoice as q, EncryptedFolderEntry as r, EncryptedFolderProviderErrorKind as s, ExtensionModel as u, ExternalAuthDecision as v, ExternalConnection as w, ExternalRequest as z };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HaexVaultSdk } from './client-CcNhK76M.mjs';
2
- export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, b as ContactDetail, c as ContactHolziAddresses, d as ContactHolziDevice, e as ContactList, f as ContactListOptions, g as ContactSummary, h as ContactValue, i as ContactsAPI, D as DatabaseAPI, j as DecryptedSpace, k as DeepLink, l as Device, m as DeviceInfo, n as DeviceType, o as DialogAPI, p as DirEntry, E as EncryptedFolderAccess, q as EncryptedFolderChoice, r as EncryptedFolderEntry, s as EncryptedFolderProviderErrorKind, t as EncryptedFoldersAPI, u as ExtensionModel, v as ExternalAuthDecision, w as ExternalConnection, x as ExternalConnectionErrorCode, y as ExternalConnectionState, z as ExternalRequest, F as ExternalRequestEvent, G as ExternalRequestHandler, I as ExternalRequestPayload, J as ExternalResponse, K as FileStat, L as FilesystemAPI, M as ImapConfig, N as KnownPath, O as KnownPaths, P as LOCALSEND_EVENTS, Q as LocalSendAPI, R as LocalSendEvent, T as LocalSendFileInfo, U as LocalSendSettings, V as MailAPI, W as MailAccount, X as MailAddress, Y as MailAttachment, Z as MailFetchRange, _ as MailMessage, $ as MailNewMessagesEvent, a0 as MailboxInfo, a1 as MessageEnvelope, a2 as ModelEffort, a3 as ModelJob, a4 as ModelJobAttempt, a5 as ModelJobCompletion, a6 as ModelJobErrorCode, a7 as ModelJobFormat, a8 as ModelJobImage, a9 as ModelJobProvenance, aa as ModelJobStep, ab as ModelPlace, ac as ModelsAPI, ad as NotificationAction, ae as NotificationClickEvent, af as NotificationOptions, ag as NotificationsAPI, ah as OutgoingAttachment, ai as OutgoingMessage, aj as PasswordInput, ak as PasswordItemFull, al as PasswordItemSummary, am as PasswordKeyValue, an as PasswordKeyValueInput, ao as PasswordsAPI, ap as PendingAuthorization, aq as PendingTransfer, ar as PermissionsAPI, as as RemoteAddBackendRequest, at as RemoteFolderBackendInfo, au as RemoteS3BackendInfo, av as RemoteS3Config, aw as RemoteS3Proposal, ax as RemoteS3PublicConfig, ay as RemoteSftpProposal, az as RemoteStorageAPI, aA as RemoteStorageBackendInfo, aB as RemoteStorageBackendType, aC as RemoteStorageObjectInfo, aD as RemoteUpdateBackendRequest, aE as RemoteWebDavProposal, aF as RequestedExtension, aG as SelectFileOptions, aH as SelectFolderOptions, aI as ServerInfo, aJ as ServerStatus, aK as SessionAuthorization, aL as SharedSpace, aM as ShellAPI, aN as ShellCreateOptions, aO as ShellCreateResponse, aP as ShellExitEvent, aQ as ShellOutputEvent, aR as SmtpConfig, aS as SpaceAccessTokenInfo, aT as SpaceAssignment, aU as SpaceInvite, aV as SpaceKeyGrantInfo, aW as SpaceMember, aX as SpaceMemberInfo, aY as SpacesAPI, aZ as SyncBackendInfo, a_ as TabAPI, a$ as ToolContext, b0 as ToolHandler, b1 as ToolsAPI, b2 as TransferDirection, b3 as TransferProgress, b4 as TransferState, b5 as WebAPI, b6 as canExternalClientSendRequests, b7 as isExternalClientConnected } from './client-CcNhK76M.mjs';
1
+ import { H as HaexVaultSdk } from './client-DS-j-fHu.mjs';
2
+ export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, b as ContactDetail, c as ContactHolziAddresses, d as ContactHolziDevice, e as ContactList, f as ContactListOptions, g as ContactSummary, h as ContactValue, i as ContactsAPI, D as DatabaseAPI, j as DecryptedSpace, k as DeepLink, l as Device, m as DeviceInfo, n as DeviceType, o as DialogAPI, p as DirEntry, E as EncryptedFolderAccess, q as EncryptedFolderChoice, r as EncryptedFolderEntry, s as EncryptedFolderProviderErrorKind, t as EncryptedFoldersAPI, u as ExtensionModel, v as ExternalAuthDecision, w as ExternalConnection, x as ExternalConnectionErrorCode, y as ExternalConnectionState, z as ExternalRequest, F as ExternalRequestEvent, G as ExternalRequestHandler, I as ExternalRequestPayload, J as ExternalResponse, K as FileStat, L as FilesystemAPI, M as ImapConfig, N as KnownPath, O as KnownPaths, P as LOCALSEND_EVENTS, Q as LocalSendAPI, R as LocalSendEvent, T as LocalSendFileInfo, U as LocalSendSettings, V as MailAPI, W as MailAccount, X as MailAddress, Y as MailAttachment, Z as MailFetchRange, _ as MailMessage, $ as MailNewMessagesEvent, a0 as MailSearchCriteria, a1 as MailSearchResult, a2 as MailboxInfo, a3 as MessageEnvelope, a4 as ModelEffort, a5 as ModelJob, a6 as ModelJobAttempt, a7 as ModelJobCompletion, a8 as ModelJobErrorCode, a9 as ModelJobFormat, aa as ModelJobImage, ab as ModelJobProvenance, ac as ModelJobStep, ad as ModelPlace, ae as ModelsAPI, af as NotificationAction, ag as NotificationClickEvent, ah as NotificationOptions, ai as NotificationsAPI, aj as OutgoingAttachment, ak as OutgoingMessage, al as PasswordInput, am as PasswordItemFull, an as PasswordItemSummary, ao as PasswordKeyValue, ap as PasswordKeyValueInput, aq as PasswordsAPI, ar as PendingAuthorization, as as PendingTransfer, at as PermissionsAPI, au as RemoteAddBackendRequest, av as RemoteFolderBackendInfo, aw as RemoteS3BackendInfo, ax as RemoteS3Config, ay as RemoteS3Proposal, az as RemoteS3PublicConfig, aA as RemoteSftpProposal, aB as RemoteStorageAPI, aC as RemoteStorageBackendInfo, aD as RemoteStorageBackendType, aE as RemoteStorageObjectInfo, aF as RemoteUpdateBackendRequest, aG as RemoteWebDavProposal, aH as RequestedExtension, aI as SelectFileOptions, aJ as SelectFolderOptions, aK as ServerInfo, aL as ServerStatus, aM as SessionAuthorization, aN as SharedSpace, aO as ShellAPI, aP as ShellCreateOptions, aQ as ShellCreateResponse, aR as ShellExitEvent, aS as ShellOutputEvent, aT as SmtpConfig, aU as SpaceAccessTokenInfo, aV as SpaceAssignment, aW as SpaceInvite, aX as SpaceKeyGrantInfo, aY as SpaceMember, aZ as SpaceMemberInfo, a_ as SpacesAPI, a$ as SyncBackendInfo, b0 as TabAPI, b1 as ToolContext, b2 as ToolHandler, b3 as ToolsAPI, b4 as TransferDirection, b5 as TransferProgress, b6 as TransferState, b7 as WebAPI, b8 as canExternalClientSendRequests, b9 as isExternalClientConnected } from './client-DS-j-fHu.mjs';
3
3
  import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-snPkjDCj.mjs';
4
4
  export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, E as ExtensionInfo, a as ExtensionManifest, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, B as HostErrorCode, I as IdentityClaim, G as MAIL_EVENTS, J as MODEL_JOB_EVENTS, K as MailEvent, L as ManifestI18nEntry, N as ManifestTool, O as ManifestToolEffect, Q as ModelJobEvent, T as NOTIFICATION_EVENTS, U as NotificationEvent, V as PermissionDeniedError, X as PermissionErrorBase, Y as PermissionErrorCode, Z as PermissionPromptError, P as PermissionResponse, _ as PermissionStatus, R as RequestOptions, $ as SHELL_EVENTS, a0 as SearchQuery, a1 as SearchRequestEvent, S as SearchResult, a2 as ShellEvent, a3 as SyncTablesUpdatedEvent, a4 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a5 as getTableName, a6 as isPermissionDeniedError, a7 as isPermissionError, a8 as isPermissionPromptError } from './types-snPkjDCj.mjs';
5
5
  export { H as HaextensionConfig } from './config-P_6DqTHl.mjs';
@@ -173,7 +173,7 @@ type ModelCommand = (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS];
173
173
  * Mail Commands (IMAP fetch + SMTP send).
174
174
  *
175
175
  * Permissions are split protocol-wise: `fetch` covers all IMAP
176
- * operations (list/read/flag/move/append), `send` covers SMTP, `poll`
176
+ * operations (list/read/search/flag/move/append/create/delete), `send` covers SMTP, `poll`
177
177
  * covers background new-mail watching (startWatch/stopWatch). Target
178
178
  * matches mail-server hostnames; subdomain match is supported, so
179
179
  * target="gmail.com" grants access to "imap.gmail.com" and
@@ -190,6 +190,12 @@ declare const MAIL_COMMANDS: {
190
190
  readonly fetchMessage: "extension_mail_fetch_message";
191
191
  /** Fetch a single attachment's bytes (base64) by part index */
192
192
  readonly fetchAttachment: "extension_mail_fetch_attachment";
193
+ /** Search a mailbox on the server by criteria; answers UIDs, newest first */
194
+ readonly search: "extension_mail_search";
195
+ /** CREATE a mailbox (reports whether it was already there) */
196
+ readonly createMailbox: "extension_mail_create_mailbox";
197
+ /** Delete messages for good: `\Deleted` plus UID EXPUNGE of exactly those UIDs */
198
+ readonly deleteMessages: "extension_mail_delete_messages";
193
199
  /** Set or unset IMAP flags on a UID set */
194
200
  readonly setFlags: "extension_mail_set_flags";
195
201
  /** MOVE messages between mailboxes (COPY+EXPUNGE fallback) */
@@ -895,6 +901,9 @@ declare const TAURI_COMMANDS: {
895
901
  readonly fetchEnvelopes: "extension_mail_fetch_envelopes";
896
902
  readonly fetchMessage: "extension_mail_fetch_message";
897
903
  readonly fetchAttachment: "extension_mail_fetch_attachment";
904
+ readonly search: "extension_mail_search";
905
+ readonly createMailbox: "extension_mail_create_mailbox";
906
+ readonly deleteMessages: "extension_mail_delete_messages";
898
907
  readonly setFlags: "extension_mail_set_flags";
899
908
  readonly moveMessages: "extension_mail_move_messages";
900
909
  readonly appendMessage: "extension_mail_append_message";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HaexVaultSdk } from './client-DIvNHfx-.js';
2
- export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, b as ContactDetail, c as ContactHolziAddresses, d as ContactHolziDevice, e as ContactList, f as ContactListOptions, g as ContactSummary, h as ContactValue, i as ContactsAPI, D as DatabaseAPI, j as DecryptedSpace, k as DeepLink, l as Device, m as DeviceInfo, n as DeviceType, o as DialogAPI, p as DirEntry, E as EncryptedFolderAccess, q as EncryptedFolderChoice, r as EncryptedFolderEntry, s as EncryptedFolderProviderErrorKind, t as EncryptedFoldersAPI, u as ExtensionModel, v as ExternalAuthDecision, w as ExternalConnection, x as ExternalConnectionErrorCode, y as ExternalConnectionState, z as ExternalRequest, F as ExternalRequestEvent, G as ExternalRequestHandler, I as ExternalRequestPayload, J as ExternalResponse, K as FileStat, L as FilesystemAPI, M as ImapConfig, N as KnownPath, O as KnownPaths, P as LOCALSEND_EVENTS, Q as LocalSendAPI, R as LocalSendEvent, T as LocalSendFileInfo, U as LocalSendSettings, V as MailAPI, W as MailAccount, X as MailAddress, Y as MailAttachment, Z as MailFetchRange, _ as MailMessage, $ as MailNewMessagesEvent, a0 as MailboxInfo, a1 as MessageEnvelope, a2 as ModelEffort, a3 as ModelJob, a4 as ModelJobAttempt, a5 as ModelJobCompletion, a6 as ModelJobErrorCode, a7 as ModelJobFormat, a8 as ModelJobImage, a9 as ModelJobProvenance, aa as ModelJobStep, ab as ModelPlace, ac as ModelsAPI, ad as NotificationAction, ae as NotificationClickEvent, af as NotificationOptions, ag as NotificationsAPI, ah as OutgoingAttachment, ai as OutgoingMessage, aj as PasswordInput, ak as PasswordItemFull, al as PasswordItemSummary, am as PasswordKeyValue, an as PasswordKeyValueInput, ao as PasswordsAPI, ap as PendingAuthorization, aq as PendingTransfer, ar as PermissionsAPI, as as RemoteAddBackendRequest, at as RemoteFolderBackendInfo, au as RemoteS3BackendInfo, av as RemoteS3Config, aw as RemoteS3Proposal, ax as RemoteS3PublicConfig, ay as RemoteSftpProposal, az as RemoteStorageAPI, aA as RemoteStorageBackendInfo, aB as RemoteStorageBackendType, aC as RemoteStorageObjectInfo, aD as RemoteUpdateBackendRequest, aE as RemoteWebDavProposal, aF as RequestedExtension, aG as SelectFileOptions, aH as SelectFolderOptions, aI as ServerInfo, aJ as ServerStatus, aK as SessionAuthorization, aL as SharedSpace, aM as ShellAPI, aN as ShellCreateOptions, aO as ShellCreateResponse, aP as ShellExitEvent, aQ as ShellOutputEvent, aR as SmtpConfig, aS as SpaceAccessTokenInfo, aT as SpaceAssignment, aU as SpaceInvite, aV as SpaceKeyGrantInfo, aW as SpaceMember, aX as SpaceMemberInfo, aY as SpacesAPI, aZ as SyncBackendInfo, a_ as TabAPI, a$ as ToolContext, b0 as ToolHandler, b1 as ToolsAPI, b2 as TransferDirection, b3 as TransferProgress, b4 as TransferState, b5 as WebAPI, b6 as canExternalClientSendRequests, b7 as isExternalClientConnected } from './client-DIvNHfx-.js';
1
+ import { H as HaexVaultSdk } from './client-DkVe1o-u.js';
2
+ export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, b as ContactDetail, c as ContactHolziAddresses, d as ContactHolziDevice, e as ContactList, f as ContactListOptions, g as ContactSummary, h as ContactValue, i as ContactsAPI, D as DatabaseAPI, j as DecryptedSpace, k as DeepLink, l as Device, m as DeviceInfo, n as DeviceType, o as DialogAPI, p as DirEntry, E as EncryptedFolderAccess, q as EncryptedFolderChoice, r as EncryptedFolderEntry, s as EncryptedFolderProviderErrorKind, t as EncryptedFoldersAPI, u as ExtensionModel, v as ExternalAuthDecision, w as ExternalConnection, x as ExternalConnectionErrorCode, y as ExternalConnectionState, z as ExternalRequest, F as ExternalRequestEvent, G as ExternalRequestHandler, I as ExternalRequestPayload, J as ExternalResponse, K as FileStat, L as FilesystemAPI, M as ImapConfig, N as KnownPath, O as KnownPaths, P as LOCALSEND_EVENTS, Q as LocalSendAPI, R as LocalSendEvent, T as LocalSendFileInfo, U as LocalSendSettings, V as MailAPI, W as MailAccount, X as MailAddress, Y as MailAttachment, Z as MailFetchRange, _ as MailMessage, $ as MailNewMessagesEvent, a0 as MailSearchCriteria, a1 as MailSearchResult, a2 as MailboxInfo, a3 as MessageEnvelope, a4 as ModelEffort, a5 as ModelJob, a6 as ModelJobAttempt, a7 as ModelJobCompletion, a8 as ModelJobErrorCode, a9 as ModelJobFormat, aa as ModelJobImage, ab as ModelJobProvenance, ac as ModelJobStep, ad as ModelPlace, ae as ModelsAPI, af as NotificationAction, ag as NotificationClickEvent, ah as NotificationOptions, ai as NotificationsAPI, aj as OutgoingAttachment, ak as OutgoingMessage, al as PasswordInput, am as PasswordItemFull, an as PasswordItemSummary, ao as PasswordKeyValue, ap as PasswordKeyValueInput, aq as PasswordsAPI, ar as PendingAuthorization, as as PendingTransfer, at as PermissionsAPI, au as RemoteAddBackendRequest, av as RemoteFolderBackendInfo, aw as RemoteS3BackendInfo, ax as RemoteS3Config, ay as RemoteS3Proposal, az as RemoteS3PublicConfig, aA as RemoteSftpProposal, aB as RemoteStorageAPI, aC as RemoteStorageBackendInfo, aD as RemoteStorageBackendType, aE as RemoteStorageObjectInfo, aF as RemoteUpdateBackendRequest, aG as RemoteWebDavProposal, aH as RequestedExtension, aI as SelectFileOptions, aJ as SelectFolderOptions, aK as ServerInfo, aL as ServerStatus, aM as SessionAuthorization, aN as SharedSpace, aO as ShellAPI, aP as ShellCreateOptions, aQ as ShellCreateResponse, aR as ShellExitEvent, aS as ShellOutputEvent, aT as SmtpConfig, aU as SpaceAccessTokenInfo, aV as SpaceAssignment, aW as SpaceInvite, aX as SpaceKeyGrantInfo, aY as SpaceMember, aZ as SpaceMemberInfo, a_ as SpacesAPI, a$ as SyncBackendInfo, b0 as TabAPI, b1 as ToolContext, b2 as ToolHandler, b3 as ToolsAPI, b4 as TransferDirection, b5 as TransferProgress, b6 as TransferState, b7 as WebAPI, b8 as canExternalClientSendRequests, b9 as isExternalClientConnected } from './client-DkVe1o-u.js';
3
3
  import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-snPkjDCj.js';
4
4
  export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, E as ExtensionInfo, a as ExtensionManifest, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, B as HostErrorCode, I as IdentityClaim, G as MAIL_EVENTS, J as MODEL_JOB_EVENTS, K as MailEvent, L as ManifestI18nEntry, N as ManifestTool, O as ManifestToolEffect, Q as ModelJobEvent, T as NOTIFICATION_EVENTS, U as NotificationEvent, V as PermissionDeniedError, X as PermissionErrorBase, Y as PermissionErrorCode, Z as PermissionPromptError, P as PermissionResponse, _ as PermissionStatus, R as RequestOptions, $ as SHELL_EVENTS, a0 as SearchQuery, a1 as SearchRequestEvent, S as SearchResult, a2 as ShellEvent, a3 as SyncTablesUpdatedEvent, a4 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a5 as getTableName, a6 as isPermissionDeniedError, a7 as isPermissionError, a8 as isPermissionPromptError } from './types-snPkjDCj.js';
5
5
  export { H as HaextensionConfig } from './config-P_6DqTHl.js';
@@ -173,7 +173,7 @@ type ModelCommand = (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS];
173
173
  * Mail Commands (IMAP fetch + SMTP send).
174
174
  *
175
175
  * Permissions are split protocol-wise: `fetch` covers all IMAP
176
- * operations (list/read/flag/move/append), `send` covers SMTP, `poll`
176
+ * operations (list/read/search/flag/move/append/create/delete), `send` covers SMTP, `poll`
177
177
  * covers background new-mail watching (startWatch/stopWatch). Target
178
178
  * matches mail-server hostnames; subdomain match is supported, so
179
179
  * target="gmail.com" grants access to "imap.gmail.com" and
@@ -190,6 +190,12 @@ declare const MAIL_COMMANDS: {
190
190
  readonly fetchMessage: "extension_mail_fetch_message";
191
191
  /** Fetch a single attachment's bytes (base64) by part index */
192
192
  readonly fetchAttachment: "extension_mail_fetch_attachment";
193
+ /** Search a mailbox on the server by criteria; answers UIDs, newest first */
194
+ readonly search: "extension_mail_search";
195
+ /** CREATE a mailbox (reports whether it was already there) */
196
+ readonly createMailbox: "extension_mail_create_mailbox";
197
+ /** Delete messages for good: `\Deleted` plus UID EXPUNGE of exactly those UIDs */
198
+ readonly deleteMessages: "extension_mail_delete_messages";
193
199
  /** Set or unset IMAP flags on a UID set */
194
200
  readonly setFlags: "extension_mail_set_flags";
195
201
  /** MOVE messages between mailboxes (COPY+EXPUNGE fallback) */
@@ -895,6 +901,9 @@ declare const TAURI_COMMANDS: {
895
901
  readonly fetchEnvelopes: "extension_mail_fetch_envelopes";
896
902
  readonly fetchMessage: "extension_mail_fetch_message";
897
903
  readonly fetchAttachment: "extension_mail_fetch_attachment";
904
+ readonly search: "extension_mail_search";
905
+ readonly createMailbox: "extension_mail_create_mailbox";
906
+ readonly deleteMessages: "extension_mail_delete_messages";
898
907
  readonly setFlags: "extension_mail_set_flags";
899
908
  readonly moveMessages: "extension_mail_move_messages";
900
909
  readonly appendMessage: "extension_mail_append_message";
package/dist/index.js CHANGED
@@ -1219,6 +1219,12 @@ var MAIL_COMMANDS = {
1219
1219
  fetchMessage: "extension_mail_fetch_message",
1220
1220
  /** Fetch a single attachment's bytes (base64) by part index */
1221
1221
  fetchAttachment: "extension_mail_fetch_attachment",
1222
+ /** Search a mailbox on the server by criteria; answers UIDs, newest first */
1223
+ search: "extension_mail_search",
1224
+ /** CREATE a mailbox (reports whether it was already there) */
1225
+ createMailbox: "extension_mail_create_mailbox",
1226
+ /** Delete messages for good: `\Deleted` plus UID EXPUNGE of exactly those UIDs */
1227
+ deleteMessages: "extension_mail_delete_messages",
1222
1228
  /** Set or unset IMAP flags on a UID set */
1223
1229
  setFlags: "extension_mail_set_flags",
1224
1230
  /** MOVE messages between mailboxes (COPY+EXPUNGE fallback) */
@@ -2550,6 +2556,45 @@ var MailAPI = class {
2550
2556
  partIndex
2551
2557
  });
2552
2558
  }
2559
+ /**
2560
+ * Search a whole mailbox on the server. Answers the UIDs of the newest `limit` hits (1 to 1000;
2561
+ * all that fit one answer when omitted), newest first, and the number of all hits. Fetch their
2562
+ * envelopes with `fetchEnvelopesAsync` and a `uidList` range.
2563
+ */
2564
+ async searchMessagesAsync(imap, mailbox, criteria, limit) {
2565
+ return this.client.request(MAIL_COMMANDS.search, {
2566
+ imap,
2567
+ mailbox,
2568
+ criteria,
2569
+ limit
2570
+ });
2571
+ }
2572
+ /**
2573
+ * Create a mailbox. Resolves to `false`, not an error, when it already existed. The name may
2574
+ * contain the server's hierarchy delimiter; `*` and `%` are not allowed.
2575
+ */
2576
+ async createMailboxAsync(imap, mailbox) {
2577
+ const { created } = await this.client.request(
2578
+ MAIL_COMMANDS.createMailbox,
2579
+ { imap, mailbox }
2580
+ );
2581
+ return created;
2582
+ }
2583
+ /**
2584
+ * Delete messages for good: flags exactly these UIDs `\Deleted` and expunges exactly them, so
2585
+ * other messages marked `\Deleted` stay. Refused with an error on a server without UIDPLUS,
2586
+ * before anything is marked. If the expunge fails after marking, the messages stay in the
2587
+ * mailbox flagged `\Deleted` and the call rejects; do not show them as deleted. At most 1000 UIDs
2588
+ * per call. For a message that can still be recovered, use `moveMessagesAsync` into the trash
2589
+ * instead.
2590
+ */
2591
+ async deleteMessagesAsync(imap, mailbox, uids) {
2592
+ return this.client.request(MAIL_COMMANDS.deleteMessages, {
2593
+ imap,
2594
+ mailbox,
2595
+ uids
2596
+ });
2597
+ }
2553
2598
  /**
2554
2599
  * Set or unset IMAP flags. Use `flags=["\\Seen"]` + `add=true` to
2555
2600
  * mark messages as read; `add=false` removes the flag(s).