@haex-space/vault-sdk 5.4.1 → 5.5.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.
@@ -2196,6 +2196,21 @@ declare class MailAPI {
2196
2196
  * contain the server's hierarchy delimiter; `*` and `%` are not allowed.
2197
2197
  */
2198
2198
  createMailboxAsync(imap: ImapConfig, mailbox: string): Promise<boolean>;
2199
+ /**
2200
+ * Delete a mailbox. `mailbox` is the IMAP-encoded name (modified UTF-7), like in every other
2201
+ * call. `INBOX` can be neither deleted nor renamed; the host refuses it. Whether the mailbox's
2202
+ * messages and child mailboxes go with it, and whether a missing mailbox is an error, is up to
2203
+ * the server. Needs the same `fetch` permission as the other IMAP calls.
2204
+ */
2205
+ deleteMailboxAsync(imap: ImapConfig, mailbox: string): Promise<void>;
2206
+ /**
2207
+ * Rename a mailbox from `from` to `to`, both IMAP-encoded names (modified UTF-7). `to` may
2208
+ * contain the server's hierarchy delimiter to move the mailbox in the tree; `*` and `%` are not
2209
+ * allowed. `INBOX` can be neither deleted nor renamed; the host refuses it. Whether child
2210
+ * mailboxes follow and whether an existing `to` is an error is up to the server. Needs the same
2211
+ * `fetch` permission as the other IMAP calls.
2212
+ */
2213
+ renameMailboxAsync(imap: ImapConfig, from: string, to: string): Promise<void>;
2199
2214
  /**
2200
2215
  * Delete messages for good: flags exactly these UIDs `\Deleted` and expunges exactly them, so
2201
2216
  * other messages marked `\Deleted` stay. Refused with an error on a server without UIDPLUS,
@@ -2196,6 +2196,21 @@ declare class MailAPI {
2196
2196
  * contain the server's hierarchy delimiter; `*` and `%` are not allowed.
2197
2197
  */
2198
2198
  createMailboxAsync(imap: ImapConfig, mailbox: string): Promise<boolean>;
2199
+ /**
2200
+ * Delete a mailbox. `mailbox` is the IMAP-encoded name (modified UTF-7), like in every other
2201
+ * call. `INBOX` can be neither deleted nor renamed; the host refuses it. Whether the mailbox's
2202
+ * messages and child mailboxes go with it, and whether a missing mailbox is an error, is up to
2203
+ * the server. Needs the same `fetch` permission as the other IMAP calls.
2204
+ */
2205
+ deleteMailboxAsync(imap: ImapConfig, mailbox: string): Promise<void>;
2206
+ /**
2207
+ * Rename a mailbox from `from` to `to`, both IMAP-encoded names (modified UTF-7). `to` may
2208
+ * contain the server's hierarchy delimiter to move the mailbox in the tree; `*` and `%` are not
2209
+ * allowed. `INBOX` can be neither deleted nor renamed; the host refuses it. Whether child
2210
+ * mailboxes follow and whether an existing `to` is an error is up to the server. Needs the same
2211
+ * `fetch` permission as the other IMAP calls.
2212
+ */
2213
+ renameMailboxAsync(imap: ImapConfig, from: string, to: string): Promise<void>;
2199
2214
  /**
2200
2215
  * Delete messages for good: flags exactly these UIDs `\Deleted` and expunges exactly them, so
2201
2216
  * other messages marked `\Deleted` stay. Refused with an error on a server without UIDPLUS,
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HaexVaultSdk } from './client-HdPYJ_9t.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 MailFields, $ as MailMessage, a0 as MailNewMessagesEvent, a1 as MailSearchCriteria, a2 as MailSearchResult, a3 as MailboxInfo, a4 as MessageEnvelope, a5 as ModelAccessRequest, a6 as ModelEffort, a7 as ModelJob, a8 as ModelJobAttempt, a9 as ModelJobCompletion, aa as ModelJobErrorCode, ab as ModelJobFormat, ac as ModelJobImage, ad as ModelJobProvenance, ae as ModelJobStep, af as ModelPlace, ag as ModelsAPI, ah as NotificationAction, ai as NotificationClickEvent, aj as NotificationOptions, ak as NotificationsAPI, al as OpenRequest, am as OpenersAPI, an as OutgoingAttachment, ao as OutgoingMessage, ap as PEER_ERROR_KINDS, aq as PasswordInput, ar as PasswordItemFull, as as PasswordItemSummary, at as PasswordKeyValue, au as PasswordKeyValueInput, av as PasswordsAPI, aw as PeerChannelClosed, ax as PeerChannelOpened, ay as PeerError, az as PeerErrorKind, aA as PeerErrorReason, aB as PeerEventMap, aC as PeerEventType, aD as PeerInviteStatus, aE as PeerJoined, aF as PeerMessage, aG as PeerVisibility, aH as PeersAPI, aI as PendingAuthorization, aJ as PendingTransfer, aK as PermissionsAPI, aL as RemoteAddBackendRequest, aM as RemoteFolderBackendInfo, aN as RemoteS3BackendInfo, aO as RemoteS3Config, aP as RemoteS3Proposal, aQ as RemoteS3PublicConfig, aR as RemoteSftpProposal, aS as RemoteStorageAPI, aT as RemoteStorageBackendInfo, aU as RemoteStorageBackendType, aV as RemoteStorageObjectInfo, aW as RemoteUpdateBackendRequest, aX as RemoteWebDavProposal, aY as RequestedExtension, aZ as SelectFileOptions, a_ as SelectFolderOptions, a$ as ServerInfo, b0 as ServerStatus, b1 as SessionAuthorization, b2 as SharedSpace, b3 as ShellAPI, b4 as ShellCreateOptions, b5 as ShellCreateResponse, b6 as ShellExitEvent, b7 as ShellOutputEvent, b8 as SmtpConfig, b9 as SpaceAccessTokenInfo, ba as SpaceAssignment, bb as SpaceInvite, bc as SpaceKeyGrantInfo, bd as SpaceMember, be as SpaceMemberInfo, bf as SpacesAPI, bg as SyncBackendInfo, bh as TabAPI, bi as ToolContext, bj as ToolHandler, bk as ToolsAPI, bl as TransferDirection, bm as TransferProgress, bn as TransferState, bo as WebAPI, bp as canExternalClientSendRequests, bq as isExternalClientConnected } from './client-HdPYJ_9t.mjs';
1
+ import { H as HaexVaultSdk } from './client-BFDgj2tC.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 MailFields, $ as MailMessage, a0 as MailNewMessagesEvent, a1 as MailSearchCriteria, a2 as MailSearchResult, a3 as MailboxInfo, a4 as MessageEnvelope, a5 as ModelAccessRequest, a6 as ModelEffort, a7 as ModelJob, a8 as ModelJobAttempt, a9 as ModelJobCompletion, aa as ModelJobErrorCode, ab as ModelJobFormat, ac as ModelJobImage, ad as ModelJobProvenance, ae as ModelJobStep, af as ModelPlace, ag as ModelsAPI, ah as NotificationAction, ai as NotificationClickEvent, aj as NotificationOptions, ak as NotificationsAPI, al as OpenRequest, am as OpenersAPI, an as OutgoingAttachment, ao as OutgoingMessage, ap as PEER_ERROR_KINDS, aq as PasswordInput, ar as PasswordItemFull, as as PasswordItemSummary, at as PasswordKeyValue, au as PasswordKeyValueInput, av as PasswordsAPI, aw as PeerChannelClosed, ax as PeerChannelOpened, ay as PeerError, az as PeerErrorKind, aA as PeerErrorReason, aB as PeerEventMap, aC as PeerEventType, aD as PeerInviteStatus, aE as PeerJoined, aF as PeerMessage, aG as PeerVisibility, aH as PeersAPI, aI as PendingAuthorization, aJ as PendingTransfer, aK as PermissionsAPI, aL as RemoteAddBackendRequest, aM as RemoteFolderBackendInfo, aN as RemoteS3BackendInfo, aO as RemoteS3Config, aP as RemoteS3Proposal, aQ as RemoteS3PublicConfig, aR as RemoteSftpProposal, aS as RemoteStorageAPI, aT as RemoteStorageBackendInfo, aU as RemoteStorageBackendType, aV as RemoteStorageObjectInfo, aW as RemoteUpdateBackendRequest, aX as RemoteWebDavProposal, aY as RequestedExtension, aZ as SelectFileOptions, a_ as SelectFolderOptions, a$ as ServerInfo, b0 as ServerStatus, b1 as SessionAuthorization, b2 as SharedSpace, b3 as ShellAPI, b4 as ShellCreateOptions, b5 as ShellCreateResponse, b6 as ShellExitEvent, b7 as ShellOutputEvent, b8 as SmtpConfig, b9 as SpaceAccessTokenInfo, ba as SpaceAssignment, bb as SpaceInvite, bc as SpaceKeyGrantInfo, bd as SpaceMember, be as SpaceMemberInfo, bf as SpacesAPI, bg as SyncBackendInfo, bh as TabAPI, bi as ToolContext, bj as ToolHandler, bk as ToolsAPI, bl as TransferDirection, bm as TransferProgress, bn as TransferState, bo as WebAPI, bp as canExternalClientSendRequests, bq as isExternalClientConnected } from './client-BFDgj2tC.mjs';
3
3
  import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-CNxDNQgb.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 OPENER_EVENTS, X as OpenerEvent, Y as PEERS_EVENTS, Z as PeersEvent, _ as PermissionDeniedError, $ as PermissionErrorBase, a0 as PermissionErrorCode, a1 as PermissionPromptError, P as PermissionResponse, a2 as PermissionStatus, R as RequestOptions, a3 as SHELL_EVENTS, a4 as SearchQuery, a5 as SearchRequestEvent, S as SearchResult, a6 as ShellEvent, a7 as SyncTablesUpdatedEvent, a8 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a9 as getTableName, aa as isPermissionDeniedError, ab as isPermissionError, ac as isPermissionPromptError } from './types-CNxDNQgb.mjs';
5
5
  export { H as HaextensionConfig } from './config-P_6DqTHl.mjs';
@@ -208,7 +208,8 @@ type PeerCommand = (typeof PEER_COMMANDS)[keyof typeof PEER_COMMANDS];
208
208
  * Mail Commands (IMAP fetch + SMTP send).
209
209
  *
210
210
  * Permissions are split protocol-wise: `fetch` covers all IMAP
211
- * operations (list/read/search/flag/move/append/create/delete), `send` covers SMTP, `poll`
211
+ * operations (list/read/search/flag/move/append, create/delete/rename mailbox,
212
+ * delete messages), `send` covers SMTP, `poll`
212
213
  * covers background new-mail watching (startWatch/stopWatch). Target
213
214
  * matches mail-server hostnames; subdomain match is supported, so
214
215
  * target="gmail.com" grants access to "imap.gmail.com" and
@@ -229,6 +230,10 @@ declare const MAIL_COMMANDS: {
229
230
  readonly search: "extension_mail_search";
230
231
  /** CREATE a mailbox (reports whether it was already there) */
231
232
  readonly createMailbox: "extension_mail_create_mailbox";
233
+ /** DELETE a mailbox (never INBOX) */
234
+ readonly deleteMailbox: "extension_mail_delete_mailbox";
235
+ /** RENAME a mailbox (never INBOX) */
236
+ readonly renameMailbox: "extension_mail_rename_mailbox";
232
237
  /** Delete messages for good: `\Deleted` plus UID EXPUNGE of exactly those UIDs */
233
238
  readonly deleteMessages: "extension_mail_delete_messages";
234
239
  /** Set or unset IMAP flags on a UID set */
@@ -953,6 +958,8 @@ declare const TAURI_COMMANDS: {
953
958
  readonly fetchAttachment: "extension_mail_fetch_attachment";
954
959
  readonly search: "extension_mail_search";
955
960
  readonly createMailbox: "extension_mail_create_mailbox";
961
+ readonly deleteMailbox: "extension_mail_delete_mailbox";
962
+ readonly renameMailbox: "extension_mail_rename_mailbox";
956
963
  readonly deleteMessages: "extension_mail_delete_messages";
957
964
  readonly setFlags: "extension_mail_set_flags";
958
965
  readonly moveMessages: "extension_mail_move_messages";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HaexVaultSdk } from './client-CgngeKPm.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 MailFields, $ as MailMessage, a0 as MailNewMessagesEvent, a1 as MailSearchCriteria, a2 as MailSearchResult, a3 as MailboxInfo, a4 as MessageEnvelope, a5 as ModelAccessRequest, a6 as ModelEffort, a7 as ModelJob, a8 as ModelJobAttempt, a9 as ModelJobCompletion, aa as ModelJobErrorCode, ab as ModelJobFormat, ac as ModelJobImage, ad as ModelJobProvenance, ae as ModelJobStep, af as ModelPlace, ag as ModelsAPI, ah as NotificationAction, ai as NotificationClickEvent, aj as NotificationOptions, ak as NotificationsAPI, al as OpenRequest, am as OpenersAPI, an as OutgoingAttachment, ao as OutgoingMessage, ap as PEER_ERROR_KINDS, aq as PasswordInput, ar as PasswordItemFull, as as PasswordItemSummary, at as PasswordKeyValue, au as PasswordKeyValueInput, av as PasswordsAPI, aw as PeerChannelClosed, ax as PeerChannelOpened, ay as PeerError, az as PeerErrorKind, aA as PeerErrorReason, aB as PeerEventMap, aC as PeerEventType, aD as PeerInviteStatus, aE as PeerJoined, aF as PeerMessage, aG as PeerVisibility, aH as PeersAPI, aI as PendingAuthorization, aJ as PendingTransfer, aK as PermissionsAPI, aL as RemoteAddBackendRequest, aM as RemoteFolderBackendInfo, aN as RemoteS3BackendInfo, aO as RemoteS3Config, aP as RemoteS3Proposal, aQ as RemoteS3PublicConfig, aR as RemoteSftpProposal, aS as RemoteStorageAPI, aT as RemoteStorageBackendInfo, aU as RemoteStorageBackendType, aV as RemoteStorageObjectInfo, aW as RemoteUpdateBackendRequest, aX as RemoteWebDavProposal, aY as RequestedExtension, aZ as SelectFileOptions, a_ as SelectFolderOptions, a$ as ServerInfo, b0 as ServerStatus, b1 as SessionAuthorization, b2 as SharedSpace, b3 as ShellAPI, b4 as ShellCreateOptions, b5 as ShellCreateResponse, b6 as ShellExitEvent, b7 as ShellOutputEvent, b8 as SmtpConfig, b9 as SpaceAccessTokenInfo, ba as SpaceAssignment, bb as SpaceInvite, bc as SpaceKeyGrantInfo, bd as SpaceMember, be as SpaceMemberInfo, bf as SpacesAPI, bg as SyncBackendInfo, bh as TabAPI, bi as ToolContext, bj as ToolHandler, bk as ToolsAPI, bl as TransferDirection, bm as TransferProgress, bn as TransferState, bo as WebAPI, bp as canExternalClientSendRequests, bq as isExternalClientConnected } from './client-CgngeKPm.js';
1
+ import { H as HaexVaultSdk } from './client-CtUpYUH7.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 MailFields, $ as MailMessage, a0 as MailNewMessagesEvent, a1 as MailSearchCriteria, a2 as MailSearchResult, a3 as MailboxInfo, a4 as MessageEnvelope, a5 as ModelAccessRequest, a6 as ModelEffort, a7 as ModelJob, a8 as ModelJobAttempt, a9 as ModelJobCompletion, aa as ModelJobErrorCode, ab as ModelJobFormat, ac as ModelJobImage, ad as ModelJobProvenance, ae as ModelJobStep, af as ModelPlace, ag as ModelsAPI, ah as NotificationAction, ai as NotificationClickEvent, aj as NotificationOptions, ak as NotificationsAPI, al as OpenRequest, am as OpenersAPI, an as OutgoingAttachment, ao as OutgoingMessage, ap as PEER_ERROR_KINDS, aq as PasswordInput, ar as PasswordItemFull, as as PasswordItemSummary, at as PasswordKeyValue, au as PasswordKeyValueInput, av as PasswordsAPI, aw as PeerChannelClosed, ax as PeerChannelOpened, ay as PeerError, az as PeerErrorKind, aA as PeerErrorReason, aB as PeerEventMap, aC as PeerEventType, aD as PeerInviteStatus, aE as PeerJoined, aF as PeerMessage, aG as PeerVisibility, aH as PeersAPI, aI as PendingAuthorization, aJ as PendingTransfer, aK as PermissionsAPI, aL as RemoteAddBackendRequest, aM as RemoteFolderBackendInfo, aN as RemoteS3BackendInfo, aO as RemoteS3Config, aP as RemoteS3Proposal, aQ as RemoteS3PublicConfig, aR as RemoteSftpProposal, aS as RemoteStorageAPI, aT as RemoteStorageBackendInfo, aU as RemoteStorageBackendType, aV as RemoteStorageObjectInfo, aW as RemoteUpdateBackendRequest, aX as RemoteWebDavProposal, aY as RequestedExtension, aZ as SelectFileOptions, a_ as SelectFolderOptions, a$ as ServerInfo, b0 as ServerStatus, b1 as SessionAuthorization, b2 as SharedSpace, b3 as ShellAPI, b4 as ShellCreateOptions, b5 as ShellCreateResponse, b6 as ShellExitEvent, b7 as ShellOutputEvent, b8 as SmtpConfig, b9 as SpaceAccessTokenInfo, ba as SpaceAssignment, bb as SpaceInvite, bc as SpaceKeyGrantInfo, bd as SpaceMember, be as SpaceMemberInfo, bf as SpacesAPI, bg as SyncBackendInfo, bh as TabAPI, bi as ToolContext, bj as ToolHandler, bk as ToolsAPI, bl as TransferDirection, bm as TransferProgress, bn as TransferState, bo as WebAPI, bp as canExternalClientSendRequests, bq as isExternalClientConnected } from './client-CtUpYUH7.js';
3
3
  import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-CNxDNQgb.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 OPENER_EVENTS, X as OpenerEvent, Y as PEERS_EVENTS, Z as PeersEvent, _ as PermissionDeniedError, $ as PermissionErrorBase, a0 as PermissionErrorCode, a1 as PermissionPromptError, P as PermissionResponse, a2 as PermissionStatus, R as RequestOptions, a3 as SHELL_EVENTS, a4 as SearchQuery, a5 as SearchRequestEvent, S as SearchResult, a6 as ShellEvent, a7 as SyncTablesUpdatedEvent, a8 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a9 as getTableName, aa as isPermissionDeniedError, ab as isPermissionError, ac as isPermissionPromptError } from './types-CNxDNQgb.js';
5
5
  export { H as HaextensionConfig } from './config-P_6DqTHl.js';
@@ -208,7 +208,8 @@ type PeerCommand = (typeof PEER_COMMANDS)[keyof typeof PEER_COMMANDS];
208
208
  * Mail Commands (IMAP fetch + SMTP send).
209
209
  *
210
210
  * Permissions are split protocol-wise: `fetch` covers all IMAP
211
- * operations (list/read/search/flag/move/append/create/delete), `send` covers SMTP, `poll`
211
+ * operations (list/read/search/flag/move/append, create/delete/rename mailbox,
212
+ * delete messages), `send` covers SMTP, `poll`
212
213
  * covers background new-mail watching (startWatch/stopWatch). Target
213
214
  * matches mail-server hostnames; subdomain match is supported, so
214
215
  * target="gmail.com" grants access to "imap.gmail.com" and
@@ -229,6 +230,10 @@ declare const MAIL_COMMANDS: {
229
230
  readonly search: "extension_mail_search";
230
231
  /** CREATE a mailbox (reports whether it was already there) */
231
232
  readonly createMailbox: "extension_mail_create_mailbox";
233
+ /** DELETE a mailbox (never INBOX) */
234
+ readonly deleteMailbox: "extension_mail_delete_mailbox";
235
+ /** RENAME a mailbox (never INBOX) */
236
+ readonly renameMailbox: "extension_mail_rename_mailbox";
232
237
  /** Delete messages for good: `\Deleted` plus UID EXPUNGE of exactly those UIDs */
233
238
  readonly deleteMessages: "extension_mail_delete_messages";
234
239
  /** Set or unset IMAP flags on a UID set */
@@ -953,6 +958,8 @@ declare const TAURI_COMMANDS: {
953
958
  readonly fetchAttachment: "extension_mail_fetch_attachment";
954
959
  readonly search: "extension_mail_search";
955
960
  readonly createMailbox: "extension_mail_create_mailbox";
961
+ readonly deleteMailbox: "extension_mail_delete_mailbox";
962
+ readonly renameMailbox: "extension_mail_rename_mailbox";
956
963
  readonly deleteMessages: "extension_mail_delete_messages";
957
964
  readonly setFlags: "extension_mail_set_flags";
958
965
  readonly moveMessages: "extension_mail_move_messages";
package/dist/index.js CHANGED
@@ -1266,6 +1266,10 @@ var MAIL_COMMANDS = {
1266
1266
  search: "extension_mail_search",
1267
1267
  /** CREATE a mailbox (reports whether it was already there) */
1268
1268
  createMailbox: "extension_mail_create_mailbox",
1269
+ /** DELETE a mailbox (never INBOX) */
1270
+ deleteMailbox: "extension_mail_delete_mailbox",
1271
+ /** RENAME a mailbox (never INBOX) */
1272
+ renameMailbox: "extension_mail_rename_mailbox",
1269
1273
  /** Delete messages for good: `\Deleted` plus UID EXPUNGE of exactly those UIDs */
1270
1274
  deleteMessages: "extension_mail_delete_messages",
1271
1275
  /** Set or unset IMAP flags on a UID set */
@@ -2821,6 +2825,25 @@ var MailAPI = class {
2821
2825
  );
2822
2826
  return created;
2823
2827
  }
2828
+ /**
2829
+ * Delete a mailbox. `mailbox` is the IMAP-encoded name (modified UTF-7), like in every other
2830
+ * call. `INBOX` can be neither deleted nor renamed; the host refuses it. Whether the mailbox's
2831
+ * messages and child mailboxes go with it, and whether a missing mailbox is an error, is up to
2832
+ * the server. Needs the same `fetch` permission as the other IMAP calls.
2833
+ */
2834
+ async deleteMailboxAsync(imap, mailbox) {
2835
+ return this.client.request(MAIL_COMMANDS.deleteMailbox, { imap, mailbox });
2836
+ }
2837
+ /**
2838
+ * Rename a mailbox from `from` to `to`, both IMAP-encoded names (modified UTF-7). `to` may
2839
+ * contain the server's hierarchy delimiter to move the mailbox in the tree; `*` and `%` are not
2840
+ * allowed. `INBOX` can be neither deleted nor renamed; the host refuses it. Whether child
2841
+ * mailboxes follow and whether an existing `to` is an error is up to the server. Needs the same
2842
+ * `fetch` permission as the other IMAP calls.
2843
+ */
2844
+ async renameMailboxAsync(imap, from, to) {
2845
+ return this.client.request(MAIL_COMMANDS.renameMailbox, { imap, from, to });
2846
+ }
2824
2847
  /**
2825
2848
  * Delete messages for good: flags exactly these UIDs `\Deleted` and expunges exactly them, so
2826
2849
  * other messages marked `\Deleted` stay. Refused with an error on a server without UIDPLUS,
@@ -3106,6 +3129,7 @@ function validateInput(schema, value) {
3106
3129
  var PROTOCOL_VERSION = "2025-11-25";
3107
3130
  var METHOD_NOT_FOUND = -32601;
3108
3131
  var INVALID_PARAMS = -32602;
3132
+ var INTERNAL_ERROR = -32603;
3109
3133
  function textResult(text, isError) {
3110
3134
  return { content: [{ type: "text", text }], isError };
3111
3135
  }
@@ -3191,11 +3215,30 @@ var ToolsServer = class {
3191
3215
  }
3192
3216
  if (!controller.signal.aborted) this.reply(id, result);
3193
3217
  }
3218
+ /**
3219
+ * Answers `id`. An answer that cannot be sent gets an error instead, so the host never waits for
3220
+ * an answer that will not come.
3221
+ */
3194
3222
  reply(id, result) {
3195
- this.options.send({ jsonrpc: "2.0", id, result });
3223
+ try {
3224
+ this.send({ jsonrpc: "2.0", id, result });
3225
+ } catch (error) {
3226
+ const reason = error instanceof Error ? error.message : String(error);
3227
+ console.warn(`[vault-sdk] tools: answer ${String(id)} could not be sent: ${reason}`);
3228
+ this.error(id, INTERNAL_ERROR, `the answer could not be sent: ${reason}`);
3229
+ }
3196
3230
  }
3197
3231
  error(id, code, message) {
3198
- this.options.send({ jsonrpc: "2.0", id, error: { code, message } });
3232
+ this.send({ jsonrpc: "2.0", id, error: { code, message } });
3233
+ }
3234
+ /**
3235
+ * Sends a JSON copy. The manifest of a Nuxt extension comes from its runtime config, a Vue
3236
+ * reactive proxy, and `postMessage` cannot clone a proxy: the input schemas of `tools/list`
3237
+ * would throw a `DataCloneError` and the host would never get the list. JSON-RPC is JSON, so the
3238
+ * copy loses nothing.
3239
+ */
3240
+ send(message) {
3241
+ this.options.send(JSON.parse(JSON.stringify(message)));
3199
3242
  }
3200
3243
  };
3201
3244