@haex-space/vault-sdk 3.1.0 → 3.2.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-C0DPNG62.d.mts → client-GeColu97.d.mts} +263 -2
- package/dist/{client-B_B6rLIw.d.ts → client-z1jTcuQE.d.ts} +263 -2
- package/dist/index.d.mts +76 -6
- package/dist/index.d.ts +76 -6
- package/dist/index.js +212 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +209 -25
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/nuxt.js +16 -6
- package/dist/nuxt.js.map +1 -1
- package/dist/nuxt.mjs +16 -6
- package/dist/nuxt.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +205 -23
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +205 -23
- 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 +205 -27
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +205 -27
- 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 +205 -23
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +205 -23
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-DmCSegdY.d.mts → types-CDMBvvjl.d.mts} +2 -0
- package/dist/{types-DmCSegdY.d.ts → types-CDMBvvjl.d.ts} +2 -0
- package/dist/vite.js +15 -5
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +15 -5
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.d.mts +2 -2
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +205 -23
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +205 -23
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { H as HaexVaultSdk } from './client-
|
|
2
|
-
export { A as AuthorizedClient, B as BlockedClient, D as DatabaseAPI, a as DecryptedSpace, b as Device, c as DeviceInfo, d as DeviceType, e as DirEntry, E as ExternalAuthDecision, f as ExternalConnection, g as ExternalConnectionErrorCode, h as ExternalConnectionState, i as ExternalRequest, j as ExternalRequestEvent, k as ExternalRequestHandler, l as ExternalRequestPayload, m as ExternalResponse, F as FileStat, n as FilesystemAPI, K as KnownPath, o as KnownPaths, L as LOCALSEND_EVENTS, p as LocalSendAPI, q as LocalSendEvent, r as LocalSendFileInfo, s as LocalSendSettings, P as PendingAuthorization,
|
|
3
|
-
import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-
|
|
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, a as ExtensionInfo, 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, I as IdentityClaim, B as ManifestI18nEntry, G as PermissionDeniedError, J as PermissionErrorBase, K as PermissionErrorCode, L as PermissionPromptError, P as PermissionResponse, N as PermissionStatus, O as SHELL_EVENTS, Q as SearchQuery, R as SearchRequestEvent, S as SearchResult, T as ShellEvent, U as SyncTablesUpdatedEvent, V as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, X as getTableName, Y as isPermissionDeniedError, Z as isPermissionError, _ as isPermissionPromptError } from './types-
|
|
1
|
+
import { H as HaexVaultSdk } from './client-GeColu97.mjs';
|
|
2
|
+
export { A as AuthorizedClient, B as BlockedClient, C as ConnectionSecurity, D as DatabaseAPI, a as DecryptedSpace, b as Device, c as DeviceInfo, d as DeviceType, e as DirEntry, E as ExternalAuthDecision, f as ExternalConnection, g as ExternalConnectionErrorCode, h as ExternalConnectionState, i as ExternalRequest, j as ExternalRequestEvent, k as ExternalRequestHandler, l as ExternalRequestPayload, m as ExternalResponse, F as FileStat, n as FilesystemAPI, I as ImapConfig, K as KnownPath, o as KnownPaths, L as LOCALSEND_EVENTS, p as LocalSendAPI, q as LocalSendEvent, r as LocalSendFileInfo, s as LocalSendSettings, M as MailAPI, t as MailAccount, u as MailAddress, v as MailAttachment, w as MailFetchRange, x as MailMessage, y as MailboxInfo, z as MessageEnvelope, O as OutgoingAttachment, G as OutgoingMessage, P as PasswordInput, J as PasswordItemFull, N as PasswordItemSummary, Q as PasswordKeyValue, R as PasswordKeyValueInput, T as PasswordsAPI, U as PendingAuthorization, V as PendingTransfer, W as PermissionsAPI, X as RemoteAddBackendRequest, Y as RemoteS3Config, Z as RemoteS3PublicConfig, _ as RemoteStorageAPI, $ as RemoteStorageBackendInfo, a0 as RemoteStorageObjectInfo, a1 as RemoteUpdateBackendRequest, a2 as RequestedExtension, a3 as SelectFileOptions, a4 as SelectFolderOptions, a5 as ServerInfo, a6 as ServerStatus, a7 as SessionAuthorization, a8 as SharedSpace, a9 as ShellAPI, aa as ShellCreateOptions, ab as ShellCreateResponse, ac as ShellExitEvent, ad as ShellOutputEvent, ae as SmtpConfig, af as SpaceAccessTokenInfo, ag as SpaceAssignment, ah as SpaceInvite, ai as SpaceKeyGrantInfo, aj as SpaceMemberInfo, ak as SpacesAPI, al as SyncBackendInfo, am as TransferDirection, an as TransferProgress, ao as TransferState, ap as WebAPI, aq as canExternalClientSendRequests, ar as isExternalClientConnected } from './client-GeColu97.mjs';
|
|
3
|
+
import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-CDMBvvjl.mjs';
|
|
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, a as ExtensionInfo, 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, I as IdentityClaim, B as ManifestI18nEntry, G as PermissionDeniedError, J as PermissionErrorBase, K as PermissionErrorCode, L as PermissionPromptError, P as PermissionResponse, N as PermissionStatus, O as SHELL_EVENTS, Q as SearchQuery, R as SearchRequestEvent, S as SearchResult, T as ShellEvent, U as SyncTablesUpdatedEvent, V as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, X as getTableName, Y as isPermissionDeniedError, Z as isPermissionError, _ as isPermissionPromptError } from './types-CDMBvvjl.mjs';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
|
|
6
6
|
import 'drizzle-orm/sqlite-proxy';
|
|
7
7
|
|
|
@@ -82,6 +82,59 @@ declare function installBaseTag(): void;
|
|
|
82
82
|
*/
|
|
83
83
|
declare function installPolyfills(): void;
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Passwords Commands
|
|
87
|
+
*
|
|
88
|
+
* Commands for the core passwords vault. Extensions are scoped via
|
|
89
|
+
* permissions (`passwords` resource type, `target` = tag or "*").
|
|
90
|
+
*
|
|
91
|
+
* Naming convention: `extension_password_<action>`
|
|
92
|
+
*/
|
|
93
|
+
declare const PASSWORD_COMMANDS: {
|
|
94
|
+
/** List items (no secrets) within the extension's tag scope */
|
|
95
|
+
readonly list: "extension_password_list";
|
|
96
|
+
/** Read full item including secrets, by id */
|
|
97
|
+
readonly read: "extension_password_read";
|
|
98
|
+
/** Create item — must include >=1 tag in scope */
|
|
99
|
+
readonly create: "extension_password_create";
|
|
100
|
+
/** Update item — keeps >=1 tag in scope */
|
|
101
|
+
readonly update: "extension_password_update";
|
|
102
|
+
/** Delete item — must be in scope */
|
|
103
|
+
readonly delete: "extension_password_delete";
|
|
104
|
+
};
|
|
105
|
+
type PasswordCommand = (typeof PASSWORD_COMMANDS)[keyof typeof PASSWORD_COMMANDS];
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Mail Commands (IMAP fetch + SMTP send).
|
|
109
|
+
*
|
|
110
|
+
* Permissions are split protocol-wise: `fetch` covers all IMAP
|
|
111
|
+
* operations (list/read/flag/move/append), `send` covers SMTP. Target
|
|
112
|
+
* matches mail-server hostnames; subdomain match is supported, so
|
|
113
|
+
* target="gmail.com" grants access to "imap.gmail.com" and
|
|
114
|
+
* "smtp.gmail.com".
|
|
115
|
+
*
|
|
116
|
+
* Naming convention: `extension_mail_<action>`
|
|
117
|
+
*/
|
|
118
|
+
declare const MAIL_COMMANDS: {
|
|
119
|
+
/** LIST mailboxes + optional STATUS counts */
|
|
120
|
+
readonly listMailboxes: "extension_mail_list_mailboxes";
|
|
121
|
+
/** Lightweight envelope fetch for list views */
|
|
122
|
+
readonly fetchEnvelopes: "extension_mail_fetch_envelopes";
|
|
123
|
+
/** Full message fetch (envelope + body + attachment metadata) */
|
|
124
|
+
readonly fetchMessage: "extension_mail_fetch_message";
|
|
125
|
+
/** Set or unset IMAP flags on a UID set */
|
|
126
|
+
readonly setFlags: "extension_mail_set_flags";
|
|
127
|
+
/** MOVE messages between mailboxes (COPY+EXPUNGE fallback) */
|
|
128
|
+
readonly moveMessages: "extension_mail_move_messages";
|
|
129
|
+
/** APPEND a base64-encoded RFC822 message into a mailbox */
|
|
130
|
+
readonly appendMessage: "extension_mail_append_message";
|
|
131
|
+
/** SMTP send. Returns the assigned Message-ID. */
|
|
132
|
+
readonly sendMessage: "extension_mail_send_message";
|
|
133
|
+
/** Build RFC822 bytes without sending (for Drafts via APPEND) */
|
|
134
|
+
readonly buildRfc822: "extension_mail_build_rfc822";
|
|
135
|
+
};
|
|
136
|
+
type MailCommand = (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS];
|
|
137
|
+
|
|
85
138
|
/**
|
|
86
139
|
* Sync Server API Types
|
|
87
140
|
*
|
|
@@ -701,8 +754,25 @@ declare const TAURI_COMMANDS: {
|
|
|
701
754
|
readonly resize: "extension_shell_resize";
|
|
702
755
|
readonly close: "extension_shell_close";
|
|
703
756
|
};
|
|
757
|
+
readonly passwords: {
|
|
758
|
+
readonly list: "extension_password_list";
|
|
759
|
+
readonly read: "extension_password_read";
|
|
760
|
+
readonly create: "extension_password_create";
|
|
761
|
+
readonly update: "extension_password_update";
|
|
762
|
+
readonly delete: "extension_password_delete";
|
|
763
|
+
};
|
|
764
|
+
readonly mail: {
|
|
765
|
+
readonly listMailboxes: "extension_mail_list_mailboxes";
|
|
766
|
+
readonly fetchEnvelopes: "extension_mail_fetch_envelopes";
|
|
767
|
+
readonly fetchMessage: "extension_mail_fetch_message";
|
|
768
|
+
readonly setFlags: "extension_mail_set_flags";
|
|
769
|
+
readonly moveMessages: "extension_mail_move_messages";
|
|
770
|
+
readonly appendMessage: "extension_mail_append_message";
|
|
771
|
+
readonly sendMessage: "extension_mail_send_message";
|
|
772
|
+
readonly buildRfc822: "extension_mail_build_rfc822";
|
|
773
|
+
};
|
|
704
774
|
};
|
|
705
|
-
type TauriCommand = (typeof DATABASE_COMMANDS)[keyof typeof DATABASE_COMMANDS] | (typeof PERMISSIONS_COMMANDS)[keyof typeof PERMISSIONS_COMMANDS] | (typeof WEB_COMMANDS)[keyof typeof WEB_COMMANDS] | (typeof WEB_STORAGE_COMMANDS)[keyof typeof WEB_STORAGE_COMMANDS] | (typeof FILESYSTEM_COMMANDS)[keyof typeof FILESYSTEM_COMMANDS] | (typeof EXTERNAL_BRIDGE_COMMANDS)[keyof typeof EXTERNAL_BRIDGE_COMMANDS] | (typeof EXTENSION_COMMANDS)[keyof typeof EXTENSION_COMMANDS] | (typeof REMOTE_STORAGE_COMMANDS)[keyof typeof REMOTE_STORAGE_COMMANDS] | (typeof LOCALSEND_COMMANDS)[keyof typeof LOCALSEND_COMMANDS] | (typeof SPACE_COMMANDS)[keyof typeof SPACE_COMMANDS] | (typeof SHELL_COMMANDS)[keyof typeof SHELL_COMMANDS];
|
|
775
|
+
type TauriCommand = (typeof DATABASE_COMMANDS)[keyof typeof DATABASE_COMMANDS] | (typeof PERMISSIONS_COMMANDS)[keyof typeof PERMISSIONS_COMMANDS] | (typeof WEB_COMMANDS)[keyof typeof WEB_COMMANDS] | (typeof WEB_STORAGE_COMMANDS)[keyof typeof WEB_STORAGE_COMMANDS] | (typeof FILESYSTEM_COMMANDS)[keyof typeof FILESYSTEM_COMMANDS] | (typeof EXTERNAL_BRIDGE_COMMANDS)[keyof typeof EXTERNAL_BRIDGE_COMMANDS] | (typeof EXTENSION_COMMANDS)[keyof typeof EXTENSION_COMMANDS] | (typeof REMOTE_STORAGE_COMMANDS)[keyof typeof REMOTE_STORAGE_COMMANDS] | (typeof LOCALSEND_COMMANDS)[keyof typeof LOCALSEND_COMMANDS] | (typeof SPACE_COMMANDS)[keyof typeof SPACE_COMMANDS] | (typeof SHELL_COMMANDS)[keyof typeof SHELL_COMMANDS] | (typeof PASSWORD_COMMANDS)[keyof typeof PASSWORD_COMMANDS] | (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS];
|
|
706
776
|
|
|
707
777
|
interface VerifyResult {
|
|
708
778
|
valid: boolean;
|
|
@@ -1023,4 +1093,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
|
|
|
1023
1093
|
|
|
1024
1094
|
declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
|
|
1025
1095
|
|
|
1026
|
-
export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type CreateSpaceRequest, type ExportedPasskeyKeyPair, type ExportedUserKeypair, ExtensionManifest, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, type HaexspaceMessageType, type InviteMemberRequest, KEY_AGREEMENT_ALGO, type PasskeyKeyPair, type RegisterKeypairRequest, SIGNING_ALGO, SPACE_COMMANDS, type SealedData, type SignableRecord, SignedClaimPresentation, type SpaceCommand, type StorageConfig, type ErrorResponse as SyncServerErrorResponse, type ServerInfo as SyncServerInfo, type LoginRequest as SyncServerLoginRequest, type LoginResponse as SyncServerLoginResponse, type RefreshRequest as SyncServerRefreshRequest, TAURI_COMMANDS, type TauriCommand, type UserKeypair, type VerifyResult, type ZipFileEntry, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, decryptWithPrivateKeyAsync, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, encryptWithPublicKeyAsync, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generateIdentityAsync, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, hexToBytes, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, sortObjectKeysRecursively, unwrapKey, verifyClaimPresentationAsync, verifyExtensionSignature, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|
|
1096
|
+
export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type CreateSpaceRequest, type ExportedPasskeyKeyPair, type ExportedUserKeypair, ExtensionManifest, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, type HaexspaceMessageType, type InviteMemberRequest, KEY_AGREEMENT_ALGO, MAIL_COMMANDS, type MailCommand, PASSWORD_COMMANDS, type PasskeyKeyPair, type PasswordCommand, type RegisterKeypairRequest, SIGNING_ALGO, SPACE_COMMANDS, type SealedData, type SignableRecord, SignedClaimPresentation, type SpaceCommand, type StorageConfig, type ErrorResponse as SyncServerErrorResponse, type ServerInfo as SyncServerInfo, type LoginRequest as SyncServerLoginRequest, type LoginResponse as SyncServerLoginResponse, type RefreshRequest as SyncServerRefreshRequest, TAURI_COMMANDS, type TauriCommand, type UserKeypair, type VerifyResult, type ZipFileEntry, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, decryptWithPrivateKeyAsync, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, encryptWithPublicKeyAsync, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generateIdentityAsync, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, hexToBytes, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, sortObjectKeysRecursively, unwrapKey, verifyClaimPresentationAsync, verifyExtensionSignature, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { H as HaexVaultSdk } from './client-
|
|
2
|
-
export { A as AuthorizedClient, B as BlockedClient, D as DatabaseAPI, a as DecryptedSpace, b as Device, c as DeviceInfo, d as DeviceType, e as DirEntry, E as ExternalAuthDecision, f as ExternalConnection, g as ExternalConnectionErrorCode, h as ExternalConnectionState, i as ExternalRequest, j as ExternalRequestEvent, k as ExternalRequestHandler, l as ExternalRequestPayload, m as ExternalResponse, F as FileStat, n as FilesystemAPI, K as KnownPath, o as KnownPaths, L as LOCALSEND_EVENTS, p as LocalSendAPI, q as LocalSendEvent, r as LocalSendFileInfo, s as LocalSendSettings, P as PendingAuthorization,
|
|
3
|
-
import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-
|
|
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, a as ExtensionInfo, 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, I as IdentityClaim, B as ManifestI18nEntry, G as PermissionDeniedError, J as PermissionErrorBase, K as PermissionErrorCode, L as PermissionPromptError, P as PermissionResponse, N as PermissionStatus, O as SHELL_EVENTS, Q as SearchQuery, R as SearchRequestEvent, S as SearchResult, T as ShellEvent, U as SyncTablesUpdatedEvent, V as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, X as getTableName, Y as isPermissionDeniedError, Z as isPermissionError, _ as isPermissionPromptError } from './types-
|
|
1
|
+
import { H as HaexVaultSdk } from './client-z1jTcuQE.js';
|
|
2
|
+
export { A as AuthorizedClient, B as BlockedClient, C as ConnectionSecurity, D as DatabaseAPI, a as DecryptedSpace, b as Device, c as DeviceInfo, d as DeviceType, e as DirEntry, E as ExternalAuthDecision, f as ExternalConnection, g as ExternalConnectionErrorCode, h as ExternalConnectionState, i as ExternalRequest, j as ExternalRequestEvent, k as ExternalRequestHandler, l as ExternalRequestPayload, m as ExternalResponse, F as FileStat, n as FilesystemAPI, I as ImapConfig, K as KnownPath, o as KnownPaths, L as LOCALSEND_EVENTS, p as LocalSendAPI, q as LocalSendEvent, r as LocalSendFileInfo, s as LocalSendSettings, M as MailAPI, t as MailAccount, u as MailAddress, v as MailAttachment, w as MailFetchRange, x as MailMessage, y as MailboxInfo, z as MessageEnvelope, O as OutgoingAttachment, G as OutgoingMessage, P as PasswordInput, J as PasswordItemFull, N as PasswordItemSummary, Q as PasswordKeyValue, R as PasswordKeyValueInput, T as PasswordsAPI, U as PendingAuthorization, V as PendingTransfer, W as PermissionsAPI, X as RemoteAddBackendRequest, Y as RemoteS3Config, Z as RemoteS3PublicConfig, _ as RemoteStorageAPI, $ as RemoteStorageBackendInfo, a0 as RemoteStorageObjectInfo, a1 as RemoteUpdateBackendRequest, a2 as RequestedExtension, a3 as SelectFileOptions, a4 as SelectFolderOptions, a5 as ServerInfo, a6 as ServerStatus, a7 as SessionAuthorization, a8 as SharedSpace, a9 as ShellAPI, aa as ShellCreateOptions, ab as ShellCreateResponse, ac as ShellExitEvent, ad as ShellOutputEvent, ae as SmtpConfig, af as SpaceAccessTokenInfo, ag as SpaceAssignment, ah as SpaceInvite, ai as SpaceKeyGrantInfo, aj as SpaceMemberInfo, ak as SpacesAPI, al as SyncBackendInfo, am as TransferDirection, an as TransferProgress, ao as TransferState, ap as WebAPI, aq as canExternalClientSendRequests, ar as isExternalClientConnected } from './client-z1jTcuQE.js';
|
|
3
|
+
import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-CDMBvvjl.js';
|
|
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, a as ExtensionInfo, 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, I as IdentityClaim, B as ManifestI18nEntry, G as PermissionDeniedError, J as PermissionErrorBase, K as PermissionErrorCode, L as PermissionPromptError, P as PermissionResponse, N as PermissionStatus, O as SHELL_EVENTS, Q as SearchQuery, R as SearchRequestEvent, S as SearchResult, T as ShellEvent, U as SyncTablesUpdatedEvent, V as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, X as getTableName, Y as isPermissionDeniedError, Z as isPermissionError, _ as isPermissionPromptError } from './types-CDMBvvjl.js';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.js';
|
|
6
6
|
import 'drizzle-orm/sqlite-proxy';
|
|
7
7
|
|
|
@@ -82,6 +82,59 @@ declare function installBaseTag(): void;
|
|
|
82
82
|
*/
|
|
83
83
|
declare function installPolyfills(): void;
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Passwords Commands
|
|
87
|
+
*
|
|
88
|
+
* Commands for the core passwords vault. Extensions are scoped via
|
|
89
|
+
* permissions (`passwords` resource type, `target` = tag or "*").
|
|
90
|
+
*
|
|
91
|
+
* Naming convention: `extension_password_<action>`
|
|
92
|
+
*/
|
|
93
|
+
declare const PASSWORD_COMMANDS: {
|
|
94
|
+
/** List items (no secrets) within the extension's tag scope */
|
|
95
|
+
readonly list: "extension_password_list";
|
|
96
|
+
/** Read full item including secrets, by id */
|
|
97
|
+
readonly read: "extension_password_read";
|
|
98
|
+
/** Create item — must include >=1 tag in scope */
|
|
99
|
+
readonly create: "extension_password_create";
|
|
100
|
+
/** Update item — keeps >=1 tag in scope */
|
|
101
|
+
readonly update: "extension_password_update";
|
|
102
|
+
/** Delete item — must be in scope */
|
|
103
|
+
readonly delete: "extension_password_delete";
|
|
104
|
+
};
|
|
105
|
+
type PasswordCommand = (typeof PASSWORD_COMMANDS)[keyof typeof PASSWORD_COMMANDS];
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Mail Commands (IMAP fetch + SMTP send).
|
|
109
|
+
*
|
|
110
|
+
* Permissions are split protocol-wise: `fetch` covers all IMAP
|
|
111
|
+
* operations (list/read/flag/move/append), `send` covers SMTP. Target
|
|
112
|
+
* matches mail-server hostnames; subdomain match is supported, so
|
|
113
|
+
* target="gmail.com" grants access to "imap.gmail.com" and
|
|
114
|
+
* "smtp.gmail.com".
|
|
115
|
+
*
|
|
116
|
+
* Naming convention: `extension_mail_<action>`
|
|
117
|
+
*/
|
|
118
|
+
declare const MAIL_COMMANDS: {
|
|
119
|
+
/** LIST mailboxes + optional STATUS counts */
|
|
120
|
+
readonly listMailboxes: "extension_mail_list_mailboxes";
|
|
121
|
+
/** Lightweight envelope fetch for list views */
|
|
122
|
+
readonly fetchEnvelopes: "extension_mail_fetch_envelopes";
|
|
123
|
+
/** Full message fetch (envelope + body + attachment metadata) */
|
|
124
|
+
readonly fetchMessage: "extension_mail_fetch_message";
|
|
125
|
+
/** Set or unset IMAP flags on a UID set */
|
|
126
|
+
readonly setFlags: "extension_mail_set_flags";
|
|
127
|
+
/** MOVE messages between mailboxes (COPY+EXPUNGE fallback) */
|
|
128
|
+
readonly moveMessages: "extension_mail_move_messages";
|
|
129
|
+
/** APPEND a base64-encoded RFC822 message into a mailbox */
|
|
130
|
+
readonly appendMessage: "extension_mail_append_message";
|
|
131
|
+
/** SMTP send. Returns the assigned Message-ID. */
|
|
132
|
+
readonly sendMessage: "extension_mail_send_message";
|
|
133
|
+
/** Build RFC822 bytes without sending (for Drafts via APPEND) */
|
|
134
|
+
readonly buildRfc822: "extension_mail_build_rfc822";
|
|
135
|
+
};
|
|
136
|
+
type MailCommand = (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS];
|
|
137
|
+
|
|
85
138
|
/**
|
|
86
139
|
* Sync Server API Types
|
|
87
140
|
*
|
|
@@ -701,8 +754,25 @@ declare const TAURI_COMMANDS: {
|
|
|
701
754
|
readonly resize: "extension_shell_resize";
|
|
702
755
|
readonly close: "extension_shell_close";
|
|
703
756
|
};
|
|
757
|
+
readonly passwords: {
|
|
758
|
+
readonly list: "extension_password_list";
|
|
759
|
+
readonly read: "extension_password_read";
|
|
760
|
+
readonly create: "extension_password_create";
|
|
761
|
+
readonly update: "extension_password_update";
|
|
762
|
+
readonly delete: "extension_password_delete";
|
|
763
|
+
};
|
|
764
|
+
readonly mail: {
|
|
765
|
+
readonly listMailboxes: "extension_mail_list_mailboxes";
|
|
766
|
+
readonly fetchEnvelopes: "extension_mail_fetch_envelopes";
|
|
767
|
+
readonly fetchMessage: "extension_mail_fetch_message";
|
|
768
|
+
readonly setFlags: "extension_mail_set_flags";
|
|
769
|
+
readonly moveMessages: "extension_mail_move_messages";
|
|
770
|
+
readonly appendMessage: "extension_mail_append_message";
|
|
771
|
+
readonly sendMessage: "extension_mail_send_message";
|
|
772
|
+
readonly buildRfc822: "extension_mail_build_rfc822";
|
|
773
|
+
};
|
|
704
774
|
};
|
|
705
|
-
type TauriCommand = (typeof DATABASE_COMMANDS)[keyof typeof DATABASE_COMMANDS] | (typeof PERMISSIONS_COMMANDS)[keyof typeof PERMISSIONS_COMMANDS] | (typeof WEB_COMMANDS)[keyof typeof WEB_COMMANDS] | (typeof WEB_STORAGE_COMMANDS)[keyof typeof WEB_STORAGE_COMMANDS] | (typeof FILESYSTEM_COMMANDS)[keyof typeof FILESYSTEM_COMMANDS] | (typeof EXTERNAL_BRIDGE_COMMANDS)[keyof typeof EXTERNAL_BRIDGE_COMMANDS] | (typeof EXTENSION_COMMANDS)[keyof typeof EXTENSION_COMMANDS] | (typeof REMOTE_STORAGE_COMMANDS)[keyof typeof REMOTE_STORAGE_COMMANDS] | (typeof LOCALSEND_COMMANDS)[keyof typeof LOCALSEND_COMMANDS] | (typeof SPACE_COMMANDS)[keyof typeof SPACE_COMMANDS] | (typeof SHELL_COMMANDS)[keyof typeof SHELL_COMMANDS];
|
|
775
|
+
type TauriCommand = (typeof DATABASE_COMMANDS)[keyof typeof DATABASE_COMMANDS] | (typeof PERMISSIONS_COMMANDS)[keyof typeof PERMISSIONS_COMMANDS] | (typeof WEB_COMMANDS)[keyof typeof WEB_COMMANDS] | (typeof WEB_STORAGE_COMMANDS)[keyof typeof WEB_STORAGE_COMMANDS] | (typeof FILESYSTEM_COMMANDS)[keyof typeof FILESYSTEM_COMMANDS] | (typeof EXTERNAL_BRIDGE_COMMANDS)[keyof typeof EXTERNAL_BRIDGE_COMMANDS] | (typeof EXTENSION_COMMANDS)[keyof typeof EXTENSION_COMMANDS] | (typeof REMOTE_STORAGE_COMMANDS)[keyof typeof REMOTE_STORAGE_COMMANDS] | (typeof LOCALSEND_COMMANDS)[keyof typeof LOCALSEND_COMMANDS] | (typeof SPACE_COMMANDS)[keyof typeof SPACE_COMMANDS] | (typeof SHELL_COMMANDS)[keyof typeof SHELL_COMMANDS] | (typeof PASSWORD_COMMANDS)[keyof typeof PASSWORD_COMMANDS] | (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS];
|
|
706
776
|
|
|
707
777
|
interface VerifyResult {
|
|
708
778
|
valid: boolean;
|
|
@@ -1023,4 +1093,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
|
|
|
1023
1093
|
|
|
1024
1094
|
declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
|
|
1025
1095
|
|
|
1026
|
-
export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type CreateSpaceRequest, type ExportedPasskeyKeyPair, type ExportedUserKeypair, ExtensionManifest, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, type HaexspaceMessageType, type InviteMemberRequest, KEY_AGREEMENT_ALGO, type PasskeyKeyPair, type RegisterKeypairRequest, SIGNING_ALGO, SPACE_COMMANDS, type SealedData, type SignableRecord, SignedClaimPresentation, type SpaceCommand, type StorageConfig, type ErrorResponse as SyncServerErrorResponse, type ServerInfo as SyncServerInfo, type LoginRequest as SyncServerLoginRequest, type LoginResponse as SyncServerLoginResponse, type RefreshRequest as SyncServerRefreshRequest, TAURI_COMMANDS, type TauriCommand, type UserKeypair, type VerifyResult, type ZipFileEntry, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, decryptWithPrivateKeyAsync, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, encryptWithPublicKeyAsync, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generateIdentityAsync, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, hexToBytes, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, sortObjectKeysRecursively, unwrapKey, verifyClaimPresentationAsync, verifyExtensionSignature, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|
|
1096
|
+
export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type CreateSpaceRequest, type ExportedPasskeyKeyPair, type ExportedUserKeypair, ExtensionManifest, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, type HaexspaceMessageType, type InviteMemberRequest, KEY_AGREEMENT_ALGO, MAIL_COMMANDS, type MailCommand, PASSWORD_COMMANDS, type PasskeyKeyPair, type PasswordCommand, type RegisterKeypairRequest, SIGNING_ALGO, SPACE_COMMANDS, type SealedData, type SignableRecord, SignedClaimPresentation, type SpaceCommand, type StorageConfig, type ErrorResponse as SyncServerErrorResponse, type ServerInfo as SyncServerInfo, type LoginRequest as SyncServerLoginRequest, type LoginResponse as SyncServerLoginResponse, type RefreshRequest as SyncServerRefreshRequest, TAURI_COMMANDS, type TauriCommand, type UserKeypair, type VerifyResult, type ZipFileEntry, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, decryptWithPrivateKeyAsync, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, encryptWithPublicKeyAsync, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generateIdentityAsync, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, hexToBytes, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, sortObjectKeysRecursively, unwrapKey, verifyClaimPresentationAsync, verifyExtensionSignature, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|
package/dist/index.js
CHANGED
|
@@ -1049,6 +1049,40 @@ var SHELL_COMMANDS = {
|
|
|
1049
1049
|
close: "extension_shell_close"
|
|
1050
1050
|
};
|
|
1051
1051
|
|
|
1052
|
+
// src/commands/passwords.ts
|
|
1053
|
+
var PASSWORD_COMMANDS = {
|
|
1054
|
+
/** List items (no secrets) within the extension's tag scope */
|
|
1055
|
+
list: "extension_password_list",
|
|
1056
|
+
/** Read full item including secrets, by id */
|
|
1057
|
+
read: "extension_password_read",
|
|
1058
|
+
/** Create item — must include >=1 tag in scope */
|
|
1059
|
+
create: "extension_password_create",
|
|
1060
|
+
/** Update item — keeps >=1 tag in scope */
|
|
1061
|
+
update: "extension_password_update",
|
|
1062
|
+
/** Delete item — must be in scope */
|
|
1063
|
+
delete: "extension_password_delete"
|
|
1064
|
+
};
|
|
1065
|
+
|
|
1066
|
+
// src/commands/mail.ts
|
|
1067
|
+
var MAIL_COMMANDS = {
|
|
1068
|
+
/** LIST mailboxes + optional STATUS counts */
|
|
1069
|
+
listMailboxes: "extension_mail_list_mailboxes",
|
|
1070
|
+
/** Lightweight envelope fetch for list views */
|
|
1071
|
+
fetchEnvelopes: "extension_mail_fetch_envelopes",
|
|
1072
|
+
/** Full message fetch (envelope + body + attachment metadata) */
|
|
1073
|
+
fetchMessage: "extension_mail_fetch_message",
|
|
1074
|
+
/** Set or unset IMAP flags on a UID set */
|
|
1075
|
+
setFlags: "extension_mail_set_flags",
|
|
1076
|
+
/** MOVE messages between mailboxes (COPY+EXPUNGE fallback) */
|
|
1077
|
+
moveMessages: "extension_mail_move_messages",
|
|
1078
|
+
/** APPEND a base64-encoded RFC822 message into a mailbox */
|
|
1079
|
+
appendMessage: "extension_mail_append_message",
|
|
1080
|
+
/** SMTP send. Returns the assigned Message-ID. */
|
|
1081
|
+
sendMessage: "extension_mail_send_message",
|
|
1082
|
+
/** Build RFC822 bytes without sending (for Drafts via APPEND) */
|
|
1083
|
+
buildRfc822: "extension_mail_build_rfc822"
|
|
1084
|
+
};
|
|
1085
|
+
|
|
1052
1086
|
// src/commands/index.ts
|
|
1053
1087
|
var TAURI_COMMANDS = {
|
|
1054
1088
|
database: DATABASE_COMMANDS,
|
|
@@ -1061,7 +1095,9 @@ var TAURI_COMMANDS = {
|
|
|
1061
1095
|
remoteStorage: REMOTE_STORAGE_COMMANDS,
|
|
1062
1096
|
localsend: LOCALSEND_COMMANDS,
|
|
1063
1097
|
spaces: SPACE_COMMANDS,
|
|
1064
|
-
shell: SHELL_COMMANDS
|
|
1098
|
+
shell: SHELL_COMMANDS,
|
|
1099
|
+
passwords: PASSWORD_COMMANDS,
|
|
1100
|
+
mail: MAIL_COMMANDS
|
|
1065
1101
|
};
|
|
1066
1102
|
|
|
1067
1103
|
// src/api/storage.ts
|
|
@@ -1087,6 +1123,12 @@ var StorageAPI = class {
|
|
|
1087
1123
|
};
|
|
1088
1124
|
|
|
1089
1125
|
// src/api/database.ts
|
|
1126
|
+
function quoteIdent(identifier) {
|
|
1127
|
+
if (identifier.startsWith('"') && identifier.endsWith('"')) {
|
|
1128
|
+
return identifier;
|
|
1129
|
+
}
|
|
1130
|
+
return `"${identifier.replace(/"/g, '""')}"`;
|
|
1131
|
+
}
|
|
1090
1132
|
var DatabaseAPI = class {
|
|
1091
1133
|
constructor(client) {
|
|
1092
1134
|
this.client = client;
|
|
@@ -1117,11 +1159,11 @@ var DatabaseAPI = class {
|
|
|
1117
1159
|
});
|
|
1118
1160
|
}
|
|
1119
1161
|
async createTable(tableName, columns) {
|
|
1120
|
-
const query = `CREATE TABLE IF NOT EXISTS ${tableName} (${columns})`;
|
|
1162
|
+
const query = `CREATE TABLE IF NOT EXISTS ${quoteIdent(tableName)} (${columns})`;
|
|
1121
1163
|
await this.execute(query);
|
|
1122
1164
|
}
|
|
1123
1165
|
async dropTable(tableName) {
|
|
1124
|
-
const query = `DROP TABLE IF EXISTS ${tableName}`;
|
|
1166
|
+
const query = `DROP TABLE IF EXISTS ${quoteIdent(tableName)}`;
|
|
1125
1167
|
await this.execute(query);
|
|
1126
1168
|
}
|
|
1127
1169
|
/**
|
|
@@ -1150,18 +1192,17 @@ var DatabaseAPI = class {
|
|
|
1150
1192
|
async insert(tableName, data) {
|
|
1151
1193
|
const keys = Object.keys(data);
|
|
1152
1194
|
const values = Object.values(data);
|
|
1195
|
+
const quotedCols = keys.map(quoteIdent).join(", ");
|
|
1153
1196
|
const placeholders = keys.map(() => "?").join(", ");
|
|
1154
|
-
const query = `INSERT INTO ${tableName} (${
|
|
1155
|
-
", "
|
|
1156
|
-
)}) VALUES (${placeholders})`;
|
|
1197
|
+
const query = `INSERT INTO ${quoteIdent(tableName)} (${quotedCols}) VALUES (${placeholders})`;
|
|
1157
1198
|
const result = await this.execute(query, values);
|
|
1158
1199
|
return result.lastInsertId ?? -1;
|
|
1159
1200
|
}
|
|
1160
1201
|
async update(tableName, data, where, whereParams) {
|
|
1161
1202
|
const keys = Object.keys(data);
|
|
1162
1203
|
const values = Object.values(data);
|
|
1163
|
-
const setClause = keys.map((key) => `${key} = ?`).join(", ");
|
|
1164
|
-
const query = `UPDATE ${tableName} SET ${setClause} WHERE ${where}`;
|
|
1204
|
+
const setClause = keys.map((key) => `${quoteIdent(key)} = ?`).join(", ");
|
|
1205
|
+
const query = `UPDATE ${quoteIdent(tableName)} SET ${setClause} WHERE ${where}`;
|
|
1165
1206
|
const result = await this.execute(query, [
|
|
1166
1207
|
...values,
|
|
1167
1208
|
...whereParams || []
|
|
@@ -1169,12 +1210,12 @@ var DatabaseAPI = class {
|
|
|
1169
1210
|
return result.rowsAffected;
|
|
1170
1211
|
}
|
|
1171
1212
|
async delete(tableName, where, whereParams) {
|
|
1172
|
-
const query = `DELETE FROM ${tableName} WHERE ${where}`;
|
|
1213
|
+
const query = `DELETE FROM ${quoteIdent(tableName)} WHERE ${where}`;
|
|
1173
1214
|
const result = await this.execute(query, whereParams);
|
|
1174
1215
|
return result.rowsAffected;
|
|
1175
1216
|
}
|
|
1176
1217
|
async count(tableName, where, whereParams) {
|
|
1177
|
-
const query = where ? `SELECT COUNT(*) as count FROM ${tableName} WHERE ${where}` : `SELECT COUNT(*) as count FROM ${tableName}`;
|
|
1218
|
+
const query = where ? `SELECT COUNT(*) as count FROM ${quoteIdent(tableName)} WHERE ${where}` : `SELECT COUNT(*) as count FROM ${quoteIdent(tableName)}`;
|
|
1178
1219
|
const result = await this.queryOne(query, whereParams);
|
|
1179
1220
|
return result?.count ?? 0;
|
|
1180
1221
|
}
|
|
@@ -2005,6 +2046,140 @@ var ShellAPI = class {
|
|
|
2005
2046
|
}
|
|
2006
2047
|
};
|
|
2007
2048
|
|
|
2049
|
+
// src/api/passwords.ts
|
|
2050
|
+
var PasswordsAPI = class {
|
|
2051
|
+
constructor(client) {
|
|
2052
|
+
this.client = client;
|
|
2053
|
+
}
|
|
2054
|
+
/** List items in scope — summaries only, no secrets. */
|
|
2055
|
+
async listAsync() {
|
|
2056
|
+
return this.client.request(
|
|
2057
|
+
PASSWORD_COMMANDS.list,
|
|
2058
|
+
{}
|
|
2059
|
+
);
|
|
2060
|
+
}
|
|
2061
|
+
/** Read a single item by id with full secrets. */
|
|
2062
|
+
async readAsync(itemId) {
|
|
2063
|
+
return this.client.request(PASSWORD_COMMANDS.read, {
|
|
2064
|
+
itemId
|
|
2065
|
+
});
|
|
2066
|
+
}
|
|
2067
|
+
/**
|
|
2068
|
+
* Create a new password item. `input.tags` must contain at least one
|
|
2069
|
+
* tag within the extension's permission scope, otherwise the write
|
|
2070
|
+
* is rejected as a security violation.
|
|
2071
|
+
*
|
|
2072
|
+
* Returns the new item id.
|
|
2073
|
+
*/
|
|
2074
|
+
async createAsync(input) {
|
|
2075
|
+
return this.client.request(PASSWORD_COMMANDS.create, { input });
|
|
2076
|
+
}
|
|
2077
|
+
/**
|
|
2078
|
+
* Update an existing item. The item must already be in scope, and
|
|
2079
|
+
* the new tag set must keep at least one tag in scope (extensions
|
|
2080
|
+
* cannot orphan an item out of their own reach).
|
|
2081
|
+
*/
|
|
2082
|
+
async updateAsync(itemId, input) {
|
|
2083
|
+
return this.client.request(PASSWORD_COMMANDS.update, {
|
|
2084
|
+
itemId,
|
|
2085
|
+
input
|
|
2086
|
+
});
|
|
2087
|
+
}
|
|
2088
|
+
/** Delete an item by id. Item must be in scope. */
|
|
2089
|
+
async deleteAsync(itemId) {
|
|
2090
|
+
return this.client.request(PASSWORD_COMMANDS.delete, { itemId });
|
|
2091
|
+
}
|
|
2092
|
+
};
|
|
2093
|
+
|
|
2094
|
+
// src/api/mail.ts
|
|
2095
|
+
var MailAPI = class {
|
|
2096
|
+
constructor(client) {
|
|
2097
|
+
this.client = client;
|
|
2098
|
+
}
|
|
2099
|
+
/**
|
|
2100
|
+
* LIST mailboxes for an IMAP account. Pass `includeStatus=true` for
|
|
2101
|
+
* EXISTS/UNSEEN/UIDVALIDITY/UIDNEXT per box (one extra round-trip
|
|
2102
|
+
* per mailbox — fine for typical accounts, expensive for large
|
|
2103
|
+
* trees).
|
|
2104
|
+
*/
|
|
2105
|
+
async listMailboxesAsync(imap, options = {}) {
|
|
2106
|
+
return this.client.request(MAIL_COMMANDS.listMailboxes, {
|
|
2107
|
+
imap,
|
|
2108
|
+
reference: options.reference,
|
|
2109
|
+
pattern: options.pattern,
|
|
2110
|
+
includeStatus: options.includeStatus
|
|
2111
|
+
});
|
|
2112
|
+
}
|
|
2113
|
+
/** Fetch lightweight envelopes for a mailbox + range (for list views). */
|
|
2114
|
+
async fetchEnvelopesAsync(imap, mailbox, range) {
|
|
2115
|
+
return this.client.request(
|
|
2116
|
+
MAIL_COMMANDS.fetchEnvelopes,
|
|
2117
|
+
{ imap, mailbox, range }
|
|
2118
|
+
);
|
|
2119
|
+
}
|
|
2120
|
+
/** Fetch a full message (envelope + body + attachment metadata) by UID. */
|
|
2121
|
+
async fetchMessageAsync(imap, mailbox, uid) {
|
|
2122
|
+
return this.client.request(MAIL_COMMANDS.fetchMessage, {
|
|
2123
|
+
imap,
|
|
2124
|
+
mailbox,
|
|
2125
|
+
uid
|
|
2126
|
+
});
|
|
2127
|
+
}
|
|
2128
|
+
/**
|
|
2129
|
+
* Set or unset IMAP flags. Use `flags=["\\Seen"]` + `add=true` to
|
|
2130
|
+
* mark messages as read; `add=false` removes the flag(s).
|
|
2131
|
+
*/
|
|
2132
|
+
async setFlagsAsync(imap, mailbox, uids, flags, add) {
|
|
2133
|
+
return this.client.request(MAIL_COMMANDS.setFlags, {
|
|
2134
|
+
imap,
|
|
2135
|
+
mailbox,
|
|
2136
|
+
uids,
|
|
2137
|
+
flags,
|
|
2138
|
+
add
|
|
2139
|
+
});
|
|
2140
|
+
}
|
|
2141
|
+
/** Move messages between mailboxes. Falls back to COPY+EXPUNGE on servers without MOVE. */
|
|
2142
|
+
async moveMessagesAsync(imap, sourceMailbox, destinationMailbox, uids) {
|
|
2143
|
+
return this.client.request(MAIL_COMMANDS.moveMessages, {
|
|
2144
|
+
imap,
|
|
2145
|
+
sourceMailbox,
|
|
2146
|
+
destinationMailbox,
|
|
2147
|
+
uids
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
/**
|
|
2151
|
+
* APPEND a base64-encoded RFC822 message into a mailbox. Combine
|
|
2152
|
+
* with `buildRfc822Async` to save drafts, or with the bytes returned
|
|
2153
|
+
* after `sendMessageAsync` to mirror the sent copy into "Sent".
|
|
2154
|
+
*/
|
|
2155
|
+
async appendMessageAsync(imap, mailbox, rfc822Base64, flags) {
|
|
2156
|
+
return this.client.request(MAIL_COMMANDS.appendMessage, {
|
|
2157
|
+
imap,
|
|
2158
|
+
mailbox,
|
|
2159
|
+
rfc822Base64,
|
|
2160
|
+
flags
|
|
2161
|
+
});
|
|
2162
|
+
}
|
|
2163
|
+
/** Send a message via SMTP. Returns the assigned Message-ID (no angle brackets). */
|
|
2164
|
+
async sendMessageAsync(smtp, message) {
|
|
2165
|
+
return this.client.request(MAIL_COMMANDS.sendMessage, {
|
|
2166
|
+
smtp,
|
|
2167
|
+
message
|
|
2168
|
+
});
|
|
2169
|
+
}
|
|
2170
|
+
/**
|
|
2171
|
+
* Build RFC822 bytes for a message without sending — useful for
|
|
2172
|
+
* drafts that get APPENDed to a "Drafts" folder. Permission-wise
|
|
2173
|
+
* this is a fetch operation (no SMTP host involved).
|
|
2174
|
+
*/
|
|
2175
|
+
async buildRfc822Async(imapHost, message) {
|
|
2176
|
+
return this.client.request(MAIL_COMMANDS.buildRfc822, {
|
|
2177
|
+
imapHost,
|
|
2178
|
+
message
|
|
2179
|
+
});
|
|
2180
|
+
}
|
|
2181
|
+
};
|
|
2182
|
+
|
|
2008
2183
|
// src/client/tableName.ts
|
|
2009
2184
|
function validatePublicKey(publicKey) {
|
|
2010
2185
|
if (!publicKey || typeof publicKey !== "string" || publicKey.trim() === "") {
|
|
@@ -2361,7 +2536,7 @@ async function initIframeMode(ctx, log, messageHandler, request) {
|
|
|
2361
2536
|
publicKey: ctx.config.manifest.publicKey,
|
|
2362
2537
|
name: ctx.config.manifest.name,
|
|
2363
2538
|
version: ctx.config.manifest.version,
|
|
2364
|
-
displayName: ctx.config.manifest.name
|
|
2539
|
+
displayName: ctx.config.manifest.displayName ?? ctx.config.manifest.name
|
|
2365
2540
|
};
|
|
2366
2541
|
log("Extension info loaded from manifest:", ctx.state.extensionInfo);
|
|
2367
2542
|
}
|
|
@@ -2552,11 +2727,10 @@ function processEvent(event, log, eventListeners, onContextChanged, onExternalRe
|
|
|
2552
2727
|
emitEvent(event, log, eventListeners);
|
|
2553
2728
|
}
|
|
2554
2729
|
function emitEvent(event, log, eventListeners) {
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
log("Event received:", event);
|
|
2730
|
+
log("emitEvent called with:", event.type, event);
|
|
2731
|
+
log("Registered event types:", Array.from(eventListeners.keys()));
|
|
2558
2732
|
const listeners = eventListeners.get(event.type);
|
|
2559
|
-
|
|
2733
|
+
log("Listeners for", event.type, ":", listeners?.size ?? 0);
|
|
2560
2734
|
if (listeners) {
|
|
2561
2735
|
listeners.forEach((callback) => callback(event));
|
|
2562
2736
|
}
|
|
@@ -2653,9 +2827,9 @@ function registerExternalHandler(action, handler, handlers, log) {
|
|
|
2653
2827
|
};
|
|
2654
2828
|
}
|
|
2655
2829
|
async function handleExternalRequest(request, handlers, respond, log) {
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2830
|
+
log("handleExternalRequest called");
|
|
2831
|
+
log("Request:", request);
|
|
2832
|
+
log("Available handlers:", Array.from(handlers.keys()));
|
|
2659
2833
|
log(`[ExternalRequest] Received request: ${request.action} from ${request.publicKey.substring(0, 20)}...`);
|
|
2660
2834
|
const handler = handlers.get(request.action);
|
|
2661
2835
|
if (!handler) {
|
|
@@ -2681,7 +2855,6 @@ async function handleExternalRequest(request, handlers, respond, log) {
|
|
|
2681
2855
|
}
|
|
2682
2856
|
}
|
|
2683
2857
|
async function respondToExternalRequest(response, request) {
|
|
2684
|
-
console.log("[SDK Debug] respondToExternalRequest called with:", JSON.stringify(response, null, 2));
|
|
2685
2858
|
await request(EXTERNAL_BRIDGE_COMMANDS.respond, response);
|
|
2686
2859
|
}
|
|
2687
2860
|
|
|
@@ -2739,11 +2912,17 @@ var HaexVaultSdk = class {
|
|
|
2739
2912
|
this.localsend = new LocalSendAPI(this);
|
|
2740
2913
|
this.spaces = new SpacesAPI(this);
|
|
2741
2914
|
this.shell = new ShellAPI(this);
|
|
2915
|
+
this.passwords = new PasswordsAPI(this);
|
|
2916
|
+
this.mail = new MailAPI(this);
|
|
2742
2917
|
installConsoleForwarding(this.config.debug);
|
|
2743
|
-
this.readyPromise = new Promise((resolve) => {
|
|
2918
|
+
this.readyPromise = new Promise((resolve, reject) => {
|
|
2744
2919
|
this.resolveReady = resolve;
|
|
2920
|
+
this.rejectReady = reject;
|
|
2921
|
+
});
|
|
2922
|
+
this.init().catch((error) => {
|
|
2923
|
+
this.log("Init failed:", error);
|
|
2924
|
+
this.rejectReady(error);
|
|
2745
2925
|
});
|
|
2746
|
-
this.init();
|
|
2747
2926
|
}
|
|
2748
2927
|
// ==========================================================================
|
|
2749
2928
|
// Lifecycle
|
|
@@ -2771,9 +2950,14 @@ var HaexVaultSdk = class {
|
|
|
2771
2950
|
return this.setupPromise;
|
|
2772
2951
|
}
|
|
2773
2952
|
destroy() {
|
|
2774
|
-
if (this.messageHandler) {
|
|
2775
|
-
|
|
2953
|
+
if (this.messageHandler && this.hostPort) {
|
|
2954
|
+
this.hostPort.removeEventListener("message", this.messageHandler);
|
|
2955
|
+
}
|
|
2956
|
+
if (this.hostPort) {
|
|
2957
|
+
this.hostPort.close();
|
|
2958
|
+
this.hostPort = null;
|
|
2776
2959
|
}
|
|
2960
|
+
this.messageHandler = null;
|
|
2777
2961
|
this.pendingRequests.forEach(({ timeout }) => clearTimeout(timeout));
|
|
2778
2962
|
this.pendingRequests.clear();
|
|
2779
2963
|
this.eventListeners.clear();
|
|
@@ -3001,7 +3185,7 @@ var HaexVaultSdk = class {
|
|
|
3001
3185
|
publicKey: this.config.manifest.publicKey,
|
|
3002
3186
|
name: this.config.manifest.name,
|
|
3003
3187
|
version: this.config.manifest.version,
|
|
3004
|
-
displayName: this.config.manifest.name
|
|
3188
|
+
displayName: this.config.manifest.displayName ?? this.config.manifest.name
|
|
3005
3189
|
};
|
|
3006
3190
|
this.notifySubscribersInternal();
|
|
3007
3191
|
}
|
|
@@ -3671,6 +3855,10 @@ exports.HaexVaultSdkError = HaexVaultSdkError;
|
|
|
3671
3855
|
exports.KnownPath = KnownPath;
|
|
3672
3856
|
exports.LOCALSEND_EVENTS = LOCALSEND_EVENTS;
|
|
3673
3857
|
exports.LocalSendAPI = LocalSendAPI;
|
|
3858
|
+
exports.MAIL_COMMANDS = MAIL_COMMANDS;
|
|
3859
|
+
exports.MailAPI = MailAPI;
|
|
3860
|
+
exports.PASSWORD_COMMANDS = PASSWORD_COMMANDS;
|
|
3861
|
+
exports.PasswordsAPI = PasswordsAPI;
|
|
3674
3862
|
exports.PermissionErrorCode = PermissionErrorCode;
|
|
3675
3863
|
exports.PermissionStatus = PermissionStatus;
|
|
3676
3864
|
exports.PermissionsAPI = PermissionsAPI;
|