@haex-space/vault-sdk 3.7.0 → 4.1.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/README.md +51 -19
- package/dist/cli/index.js +437 -355
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +428 -339
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{client-DH4Km77u.d.ts → client-CD5QZi7F.d.ts} +76 -12
- package/dist/{client-Dn4AbXbT.d.mts → client-Cx4ZyQFL.d.mts} +76 -12
- package/dist/haex_bundle_bg.wasm +0 -0
- package/dist/index.d.mts +16 -61
- package/dist/index.d.ts +16 -61
- package/dist/index.js +185 -116
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +204 -134
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +53 -2
- package/dist/node.d.ts +53 -2
- package/dist/node.js +319 -2
- package/dist/node.js.map +1 -1
- package/dist/node.mjs +320 -5
- package/dist/node.mjs.map +1 -1
- package/dist/nuxt.js +7 -5
- package/dist/nuxt.js.map +1 -1
- package/dist/nuxt.mjs +3 -2
- 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 +192 -18
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +212 -38
- 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 +100 -18
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +100 -18
- 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 +192 -18
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +212 -38
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-DQZCRfC-.d.mts → types-BwFKGH70.d.mts} +11 -3
- package/dist/{types-DQZCRfC-.d.ts → types-BwFKGH70.d.ts} +11 -3
- package/dist/vue.d.mts +2 -2
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +192 -18
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +212 -38
- package/dist/vue.mjs.map +1 -1
- package/package.json +9 -7
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, C as ConnectionSecurity, D as DatabaseAPI,
|
|
3
|
-
import {
|
|
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,
|
|
1
|
+
import { H as HaexVaultSdk } from './client-Cx4ZyQFL.mjs';
|
|
2
|
+
export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, D as DatabaseAPI, b as DecryptedSpace, c as DeepLink, d as Device, e as DeviceInfo, f as DeviceType, g as DialogAPI, h as DirEntry, E as ExternalAuthDecision, i as ExternalConnection, j as ExternalConnectionErrorCode, k as ExternalConnectionState, l as ExternalRequest, m as ExternalRequestEvent, n as ExternalRequestHandler, o as ExternalRequestPayload, p as ExternalResponse, F as FileStat, q as FilesystemAPI, I as ImapConfig, K as KnownPath, r as KnownPaths, L as LOCALSEND_EVENTS, s as LocalSendAPI, t as LocalSendEvent, u as LocalSendFileInfo, v as LocalSendSettings, M as MailAPI, w as MailAccount, x as MailAddress, y as MailAttachment, z as MailFetchRange, G as MailMessage, J as MailNewMessagesEvent, N as MailboxInfo, O as MessageEnvelope, P as NotificationAction, Q as NotificationClickEvent, R as NotificationOptions, T as NotificationsAPI, U as OutgoingAttachment, V as OutgoingMessage, W as PasswordInput, X as PasswordItemFull, Y as PasswordItemSummary, Z as PasswordKeyValue, _ as PasswordKeyValueInput, $ as PasswordsAPI, a0 as PendingAuthorization, a1 as PendingTransfer, a2 as PermissionsAPI, a3 as RemoteAddBackendRequest, a4 as RemoteS3Config, a5 as RemoteS3PublicConfig, a6 as RemoteStorageAPI, a7 as RemoteStorageBackendInfo, a8 as RemoteStorageObjectInfo, a9 as RemoteUpdateBackendRequest, aa as RequestedExtension, ab as SelectFileOptions, ac as SelectFolderOptions, ad as ServerInfo, ae as ServerStatus, af as SessionAuthorization, ag as SharedSpace, ah as ShellAPI, ai as ShellCreateOptions, aj as ShellCreateResponse, ak as ShellExitEvent, al as ShellOutputEvent, am as SmtpConfig, an as SpaceAccessTokenInfo, ao as SpaceAssignment, ap as SpaceInvite, aq as SpaceKeyGrantInfo, ar as SpaceMember, as as SpaceMemberInfo, at as SpacesAPI, au as SyncBackendInfo, av as TabAPI, aw as TransferDirection, ax as TransferProgress, ay as TransferState, az as WebAPI, aA as canExternalClientSendRequests, aB as isExternalClientConnected } from './client-Cx4ZyQFL.mjs';
|
|
3
|
+
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-BwFKGH70.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, 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, I as IdentityClaim, B as MAIL_EVENTS, G as MailEvent, J as ManifestI18nEntry, N as NOTIFICATION_EVENTS, K as NotificationEvent, L as PermissionDeniedError, O as PermissionErrorBase, Q as PermissionErrorCode, T as PermissionPromptError, P as PermissionResponse, U as PermissionStatus, R as RequestOptions, V as SHELL_EVENTS, X as SearchQuery, Y as SearchRequestEvent, S as SearchResult, Z as ShellEvent, _ as SyncTablesUpdatedEvent, $ as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a0 as getTableName, a1 as isPermissionDeniedError, a2 as isPermissionError, a3 as isPermissionPromptError } from './types-BwFKGH70.mjs';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
|
|
6
6
|
import 'drizzle-orm/sqlite-proxy';
|
|
7
7
|
|
|
@@ -135,9 +135,9 @@ declare const MAIL_COMMANDS: {
|
|
|
135
135
|
readonly sendMessage: "extension_mail_send_message";
|
|
136
136
|
/** Build RFC822 bytes without sending (for Drafts via APPEND) */
|
|
137
137
|
readonly buildRfc822: "extension_mail_build_rfc822";
|
|
138
|
-
/** Start (or replace) a background
|
|
138
|
+
/** Start (or replace) a background new-mail watch for an account/mailbox */
|
|
139
139
|
readonly startWatch: "extension_mail_start_watch";
|
|
140
|
-
/** Stop a background
|
|
140
|
+
/** Stop a background new-mail watch */
|
|
141
141
|
readonly stopWatch: "extension_mail_stop_watch";
|
|
142
142
|
};
|
|
143
143
|
type MailCommand = (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS];
|
|
@@ -520,6 +520,10 @@ declare const EXTENSION_COMMANDS: {
|
|
|
520
520
|
readonly filterSyncTables: "extension_filter_sync_tables";
|
|
521
521
|
/** Emit sync tables to webviews (host-only, desktop only) */
|
|
522
522
|
readonly emitSyncTables: "extension_emit_sync_tables";
|
|
523
|
+
/** Ask the host to mark (or unmark) this extension's own tab as wanting attention */
|
|
524
|
+
readonly tabAttention: "extension_tab_attention";
|
|
525
|
+
/** Ask the user to confirm, in a dialog the host draws over this extension's tab */
|
|
526
|
+
readonly dialogConfirm: "extension_dialog_confirm";
|
|
523
527
|
};
|
|
524
528
|
|
|
525
529
|
/**
|
|
@@ -643,6 +647,8 @@ declare const SHELL_COMMANDS: {
|
|
|
643
647
|
readonly create: "extension_shell_create";
|
|
644
648
|
/** Write data to a shell session's stdin */
|
|
645
649
|
readonly write: "extension_shell_write";
|
|
650
|
+
/** Acknowledge `shell:output` events handed on (backpressure; sent by the SDK itself) */
|
|
651
|
+
readonly ack: "extension_shell_ack";
|
|
646
652
|
/** Resize a shell session's terminal */
|
|
647
653
|
readonly resize: "extension_shell_resize";
|
|
648
654
|
/** Close a shell session */
|
|
@@ -736,6 +742,8 @@ declare const TAURI_COMMANDS: {
|
|
|
736
742
|
readonly webviewEmit: "extension_webview_emit";
|
|
737
743
|
readonly filterSyncTables: "extension_filter_sync_tables";
|
|
738
744
|
readonly emitSyncTables: "extension_emit_sync_tables";
|
|
745
|
+
readonly tabAttention: "extension_tab_attention";
|
|
746
|
+
readonly dialogConfirm: "extension_dialog_confirm";
|
|
739
747
|
};
|
|
740
748
|
readonly remoteStorage: {
|
|
741
749
|
readonly listBackends: "extension_remote_storage_list_backends";
|
|
@@ -781,6 +789,7 @@ declare const TAURI_COMMANDS: {
|
|
|
781
789
|
readonly listAvailable: "extension_shell_list_available";
|
|
782
790
|
readonly create: "extension_shell_create";
|
|
783
791
|
readonly write: "extension_shell_write";
|
|
792
|
+
readonly ack: "extension_shell_ack";
|
|
784
793
|
readonly resize: "extension_shell_resize";
|
|
785
794
|
readonly close: "extension_shell_close";
|
|
786
795
|
};
|
|
@@ -811,60 +820,6 @@ declare const TAURI_COMMANDS: {
|
|
|
811
820
|
};
|
|
812
821
|
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] | (typeof NOTIFICATION_COMMANDS)[keyof typeof NOTIFICATION_COMMANDS];
|
|
813
822
|
|
|
814
|
-
interface VerifyResult {
|
|
815
|
-
valid: boolean;
|
|
816
|
-
error?: string;
|
|
817
|
-
}
|
|
818
|
-
interface ZipFileEntry {
|
|
819
|
-
path: string;
|
|
820
|
-
content: Uint8Array;
|
|
821
|
-
}
|
|
822
|
-
/**
|
|
823
|
-
* Sort object keys recursively for canonical JSON representation.
|
|
824
|
-
* Must match the signing implementation exactly.
|
|
825
|
-
*/
|
|
826
|
-
declare function sortObjectKeysRecursively(obj: unknown): unknown;
|
|
827
|
-
/**
|
|
828
|
-
* Convert hex string to ArrayBuffer
|
|
829
|
-
* Returns ArrayBuffer directly to avoid type issues with Uint8Array.buffer
|
|
830
|
-
*/
|
|
831
|
-
declare function hexToBytes(hex: string): ArrayBuffer;
|
|
832
|
-
/**
|
|
833
|
-
* Verify Ed25519 signature of an extension bundle.
|
|
834
|
-
*
|
|
835
|
-
* This function is browser-compatible and uses the Web Crypto API.
|
|
836
|
-
* It verifies that the extension bundle was signed with the private key
|
|
837
|
-
* corresponding to the public key in the manifest.
|
|
838
|
-
*
|
|
839
|
-
* @param files - Array of file entries from the ZIP archive
|
|
840
|
-
* @param manifest - The extension manifest (parsed from manifest.json)
|
|
841
|
-
* @returns Promise resolving to verification result
|
|
842
|
-
*
|
|
843
|
-
* @example
|
|
844
|
-
* ```typescript
|
|
845
|
-
* import JSZip from 'jszip';
|
|
846
|
-
* import { verifyExtensionSignature } from '@haex-space/vault-sdk';
|
|
847
|
-
*
|
|
848
|
-
* const zip = await JSZip.loadAsync(bundleFile);
|
|
849
|
-
* const manifestContent = await zip.file('haextension/manifest.json')?.async('string');
|
|
850
|
-
* const manifest = JSON.parse(manifestContent);
|
|
851
|
-
*
|
|
852
|
-
* // Collect all files from the ZIP
|
|
853
|
-
* const files = [];
|
|
854
|
-
* for (const [path, entry] of Object.entries(zip.files)) {
|
|
855
|
-
* if (!entry.dir) {
|
|
856
|
-
* files.push({ path, content: await entry.async('uint8array') });
|
|
857
|
-
* }
|
|
858
|
-
* }
|
|
859
|
-
*
|
|
860
|
-
* const result = await verifyExtensionSignature(files, manifest);
|
|
861
|
-
* if (!result.valid) {
|
|
862
|
-
* console.error('Signature verification failed:', result.error);
|
|
863
|
-
* }
|
|
864
|
-
* ```
|
|
865
|
-
*/
|
|
866
|
-
declare function verifyExtensionSignature(files: ZipFileEntry[], manifest: ExtensionManifest): Promise<VerifyResult>;
|
|
867
|
-
|
|
868
823
|
/**
|
|
869
824
|
* Crypto utilities for Vault Key Management
|
|
870
825
|
* Implements PBKDF2 + AES-GCM encryption/decryption
|
|
@@ -1130,4 +1085,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
|
|
|
1130
1085
|
|
|
1131
1086
|
declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
|
|
1132
1087
|
|
|
1133
|
-
export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type CreateSpaceRequest, type ExportedPasskeyKeyPair, type ExportedUserKeypair,
|
|
1088
|
+
export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type CreateSpaceRequest, type ExportedPasskeyKeyPair, type ExportedUserKeypair, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, type HaexspaceMessageType, type InviteMemberRequest, KEY_AGREEMENT_ALGO, MAIL_COMMANDS, type MailCommand, NOTIFICATION_COMMANDS, type NotificationCommand, 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, 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, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, unwrapKey, verifyClaimPresentationAsync, 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, C as ConnectionSecurity, D as DatabaseAPI,
|
|
3
|
-
import {
|
|
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,
|
|
1
|
+
import { H as HaexVaultSdk } from './client-CD5QZi7F.js';
|
|
2
|
+
export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, D as DatabaseAPI, b as DecryptedSpace, c as DeepLink, d as Device, e as DeviceInfo, f as DeviceType, g as DialogAPI, h as DirEntry, E as ExternalAuthDecision, i as ExternalConnection, j as ExternalConnectionErrorCode, k as ExternalConnectionState, l as ExternalRequest, m as ExternalRequestEvent, n as ExternalRequestHandler, o as ExternalRequestPayload, p as ExternalResponse, F as FileStat, q as FilesystemAPI, I as ImapConfig, K as KnownPath, r as KnownPaths, L as LOCALSEND_EVENTS, s as LocalSendAPI, t as LocalSendEvent, u as LocalSendFileInfo, v as LocalSendSettings, M as MailAPI, w as MailAccount, x as MailAddress, y as MailAttachment, z as MailFetchRange, G as MailMessage, J as MailNewMessagesEvent, N as MailboxInfo, O as MessageEnvelope, P as NotificationAction, Q as NotificationClickEvent, R as NotificationOptions, T as NotificationsAPI, U as OutgoingAttachment, V as OutgoingMessage, W as PasswordInput, X as PasswordItemFull, Y as PasswordItemSummary, Z as PasswordKeyValue, _ as PasswordKeyValueInput, $ as PasswordsAPI, a0 as PendingAuthorization, a1 as PendingTransfer, a2 as PermissionsAPI, a3 as RemoteAddBackendRequest, a4 as RemoteS3Config, a5 as RemoteS3PublicConfig, a6 as RemoteStorageAPI, a7 as RemoteStorageBackendInfo, a8 as RemoteStorageObjectInfo, a9 as RemoteUpdateBackendRequest, aa as RequestedExtension, ab as SelectFileOptions, ac as SelectFolderOptions, ad as ServerInfo, ae as ServerStatus, af as SessionAuthorization, ag as SharedSpace, ah as ShellAPI, ai as ShellCreateOptions, aj as ShellCreateResponse, ak as ShellExitEvent, al as ShellOutputEvent, am as SmtpConfig, an as SpaceAccessTokenInfo, ao as SpaceAssignment, ap as SpaceInvite, aq as SpaceKeyGrantInfo, ar as SpaceMember, as as SpaceMemberInfo, at as SpacesAPI, au as SyncBackendInfo, av as TabAPI, aw as TransferDirection, ax as TransferProgress, ay as TransferState, az as WebAPI, aA as canExternalClientSendRequests, aB as isExternalClientConnected } from './client-CD5QZi7F.js';
|
|
3
|
+
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-BwFKGH70.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, 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, I as IdentityClaim, B as MAIL_EVENTS, G as MailEvent, J as ManifestI18nEntry, N as NOTIFICATION_EVENTS, K as NotificationEvent, L as PermissionDeniedError, O as PermissionErrorBase, Q as PermissionErrorCode, T as PermissionPromptError, P as PermissionResponse, U as PermissionStatus, R as RequestOptions, V as SHELL_EVENTS, X as SearchQuery, Y as SearchRequestEvent, S as SearchResult, Z as ShellEvent, _ as SyncTablesUpdatedEvent, $ as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a0 as getTableName, a1 as isPermissionDeniedError, a2 as isPermissionError, a3 as isPermissionPromptError } from './types-BwFKGH70.js';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.js';
|
|
6
6
|
import 'drizzle-orm/sqlite-proxy';
|
|
7
7
|
|
|
@@ -135,9 +135,9 @@ declare const MAIL_COMMANDS: {
|
|
|
135
135
|
readonly sendMessage: "extension_mail_send_message";
|
|
136
136
|
/** Build RFC822 bytes without sending (for Drafts via APPEND) */
|
|
137
137
|
readonly buildRfc822: "extension_mail_build_rfc822";
|
|
138
|
-
/** Start (or replace) a background
|
|
138
|
+
/** Start (or replace) a background new-mail watch for an account/mailbox */
|
|
139
139
|
readonly startWatch: "extension_mail_start_watch";
|
|
140
|
-
/** Stop a background
|
|
140
|
+
/** Stop a background new-mail watch */
|
|
141
141
|
readonly stopWatch: "extension_mail_stop_watch";
|
|
142
142
|
};
|
|
143
143
|
type MailCommand = (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS];
|
|
@@ -520,6 +520,10 @@ declare const EXTENSION_COMMANDS: {
|
|
|
520
520
|
readonly filterSyncTables: "extension_filter_sync_tables";
|
|
521
521
|
/** Emit sync tables to webviews (host-only, desktop only) */
|
|
522
522
|
readonly emitSyncTables: "extension_emit_sync_tables";
|
|
523
|
+
/** Ask the host to mark (or unmark) this extension's own tab as wanting attention */
|
|
524
|
+
readonly tabAttention: "extension_tab_attention";
|
|
525
|
+
/** Ask the user to confirm, in a dialog the host draws over this extension's tab */
|
|
526
|
+
readonly dialogConfirm: "extension_dialog_confirm";
|
|
523
527
|
};
|
|
524
528
|
|
|
525
529
|
/**
|
|
@@ -643,6 +647,8 @@ declare const SHELL_COMMANDS: {
|
|
|
643
647
|
readonly create: "extension_shell_create";
|
|
644
648
|
/** Write data to a shell session's stdin */
|
|
645
649
|
readonly write: "extension_shell_write";
|
|
650
|
+
/** Acknowledge `shell:output` events handed on (backpressure; sent by the SDK itself) */
|
|
651
|
+
readonly ack: "extension_shell_ack";
|
|
646
652
|
/** Resize a shell session's terminal */
|
|
647
653
|
readonly resize: "extension_shell_resize";
|
|
648
654
|
/** Close a shell session */
|
|
@@ -736,6 +742,8 @@ declare const TAURI_COMMANDS: {
|
|
|
736
742
|
readonly webviewEmit: "extension_webview_emit";
|
|
737
743
|
readonly filterSyncTables: "extension_filter_sync_tables";
|
|
738
744
|
readonly emitSyncTables: "extension_emit_sync_tables";
|
|
745
|
+
readonly tabAttention: "extension_tab_attention";
|
|
746
|
+
readonly dialogConfirm: "extension_dialog_confirm";
|
|
739
747
|
};
|
|
740
748
|
readonly remoteStorage: {
|
|
741
749
|
readonly listBackends: "extension_remote_storage_list_backends";
|
|
@@ -781,6 +789,7 @@ declare const TAURI_COMMANDS: {
|
|
|
781
789
|
readonly listAvailable: "extension_shell_list_available";
|
|
782
790
|
readonly create: "extension_shell_create";
|
|
783
791
|
readonly write: "extension_shell_write";
|
|
792
|
+
readonly ack: "extension_shell_ack";
|
|
784
793
|
readonly resize: "extension_shell_resize";
|
|
785
794
|
readonly close: "extension_shell_close";
|
|
786
795
|
};
|
|
@@ -811,60 +820,6 @@ declare const TAURI_COMMANDS: {
|
|
|
811
820
|
};
|
|
812
821
|
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] | (typeof NOTIFICATION_COMMANDS)[keyof typeof NOTIFICATION_COMMANDS];
|
|
813
822
|
|
|
814
|
-
interface VerifyResult {
|
|
815
|
-
valid: boolean;
|
|
816
|
-
error?: string;
|
|
817
|
-
}
|
|
818
|
-
interface ZipFileEntry {
|
|
819
|
-
path: string;
|
|
820
|
-
content: Uint8Array;
|
|
821
|
-
}
|
|
822
|
-
/**
|
|
823
|
-
* Sort object keys recursively for canonical JSON representation.
|
|
824
|
-
* Must match the signing implementation exactly.
|
|
825
|
-
*/
|
|
826
|
-
declare function sortObjectKeysRecursively(obj: unknown): unknown;
|
|
827
|
-
/**
|
|
828
|
-
* Convert hex string to ArrayBuffer
|
|
829
|
-
* Returns ArrayBuffer directly to avoid type issues with Uint8Array.buffer
|
|
830
|
-
*/
|
|
831
|
-
declare function hexToBytes(hex: string): ArrayBuffer;
|
|
832
|
-
/**
|
|
833
|
-
* Verify Ed25519 signature of an extension bundle.
|
|
834
|
-
*
|
|
835
|
-
* This function is browser-compatible and uses the Web Crypto API.
|
|
836
|
-
* It verifies that the extension bundle was signed with the private key
|
|
837
|
-
* corresponding to the public key in the manifest.
|
|
838
|
-
*
|
|
839
|
-
* @param files - Array of file entries from the ZIP archive
|
|
840
|
-
* @param manifest - The extension manifest (parsed from manifest.json)
|
|
841
|
-
* @returns Promise resolving to verification result
|
|
842
|
-
*
|
|
843
|
-
* @example
|
|
844
|
-
* ```typescript
|
|
845
|
-
* import JSZip from 'jszip';
|
|
846
|
-
* import { verifyExtensionSignature } from '@haex-space/vault-sdk';
|
|
847
|
-
*
|
|
848
|
-
* const zip = await JSZip.loadAsync(bundleFile);
|
|
849
|
-
* const manifestContent = await zip.file('haextension/manifest.json')?.async('string');
|
|
850
|
-
* const manifest = JSON.parse(manifestContent);
|
|
851
|
-
*
|
|
852
|
-
* // Collect all files from the ZIP
|
|
853
|
-
* const files = [];
|
|
854
|
-
* for (const [path, entry] of Object.entries(zip.files)) {
|
|
855
|
-
* if (!entry.dir) {
|
|
856
|
-
* files.push({ path, content: await entry.async('uint8array') });
|
|
857
|
-
* }
|
|
858
|
-
* }
|
|
859
|
-
*
|
|
860
|
-
* const result = await verifyExtensionSignature(files, manifest);
|
|
861
|
-
* if (!result.valid) {
|
|
862
|
-
* console.error('Signature verification failed:', result.error);
|
|
863
|
-
* }
|
|
864
|
-
* ```
|
|
865
|
-
*/
|
|
866
|
-
declare function verifyExtensionSignature(files: ZipFileEntry[], manifest: ExtensionManifest): Promise<VerifyResult>;
|
|
867
|
-
|
|
868
823
|
/**
|
|
869
824
|
* Crypto utilities for Vault Key Management
|
|
870
825
|
* Implements PBKDF2 + AES-GCM encryption/decryption
|
|
@@ -1130,4 +1085,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
|
|
|
1130
1085
|
|
|
1131
1086
|
declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
|
|
1132
1087
|
|
|
1133
|
-
export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type CreateSpaceRequest, type ExportedPasskeyKeyPair, type ExportedUserKeypair,
|
|
1088
|
+
export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type CreateSpaceRequest, type ExportedPasskeyKeyPair, type ExportedUserKeypair, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, type HaexspaceMessageType, type InviteMemberRequest, KEY_AGREEMENT_ALGO, MAIL_COMMANDS, type MailCommand, NOTIFICATION_COMMANDS, type NotificationCommand, 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, 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, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, unwrapKey, verifyClaimPresentationAsync, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|