@haex-space/vault-sdk 3.7.0 → 4.0.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.
Files changed (51) hide show
  1. package/README.md +51 -19
  2. package/dist/cli/index.js +437 -355
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/cli/index.mjs +428 -339
  5. package/dist/cli/index.mjs.map +1 -1
  6. package/dist/{client-DH4Km77u.d.ts → client-C6pEREPM.d.ts} +48 -3
  7. package/dist/{client-Dn4AbXbT.d.mts → client-GdCi-m2s.d.mts} +48 -3
  8. package/dist/haex_bundle_bg.wasm +0 -0
  9. package/dist/index.d.mts +11 -59
  10. package/dist/index.d.ts +11 -59
  11. package/dist/index.js +130 -105
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +149 -123
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/node.d.mts +53 -2
  16. package/dist/node.d.ts +53 -2
  17. package/dist/node.js +319 -2
  18. package/dist/node.js.map +1 -1
  19. package/dist/node.mjs +320 -5
  20. package/dist/node.mjs.map +1 -1
  21. package/dist/nuxt.js +7 -5
  22. package/dist/nuxt.js.map +1 -1
  23. package/dist/nuxt.mjs +3 -2
  24. package/dist/nuxt.mjs.map +1 -1
  25. package/dist/react.d.mts +2 -2
  26. package/dist/react.d.ts +2 -2
  27. package/dist/react.js +137 -7
  28. package/dist/react.js.map +1 -1
  29. package/dist/react.mjs +157 -27
  30. package/dist/react.mjs.map +1 -1
  31. package/dist/runtime/nuxt.plugin.client.d.mts +2 -2
  32. package/dist/runtime/nuxt.plugin.client.d.ts +2 -2
  33. package/dist/runtime/nuxt.plugin.client.js +45 -7
  34. package/dist/runtime/nuxt.plugin.client.js.map +1 -1
  35. package/dist/runtime/nuxt.plugin.client.mjs +45 -7
  36. package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
  37. package/dist/svelte.d.mts +2 -2
  38. package/dist/svelte.d.ts +2 -2
  39. package/dist/svelte.js +137 -7
  40. package/dist/svelte.js.map +1 -1
  41. package/dist/svelte.mjs +157 -27
  42. package/dist/svelte.mjs.map +1 -1
  43. package/dist/{types-DQZCRfC-.d.mts → types-Ba4G6ZpC.d.mts} +10 -2
  44. package/dist/{types-DQZCRfC-.d.ts → types-Ba4G6ZpC.d.ts} +10 -2
  45. package/dist/vue.d.mts +2 -2
  46. package/dist/vue.d.ts +2 -2
  47. package/dist/vue.js +137 -7
  48. package/dist/vue.js.map +1 -1
  49. package/dist/vue.mjs +157 -27
  50. package/dist/vue.mjs.map +1 -1
  51. package/package.json +8 -6
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultSdk } from './client-DH4Km77u.js';
2
- export { A as AuthorizedClient, B as BlockedClient, C as ConnectionSecurity, D as DatabaseAPI, a as DecryptedSpace, b as DeepLink, c as Device, d as DeviceInfo, e as DeviceType, f as DirEntry, E as ExternalAuthDecision, g as ExternalConnection, h as ExternalConnectionErrorCode, i as ExternalConnectionState, j as ExternalRequest, k as ExternalRequestEvent, l as ExternalRequestHandler, m as ExternalRequestPayload, n as ExternalResponse, F as FileStat, o as FilesystemAPI, I as ImapConfig, K as KnownPath, p as KnownPaths, L as LOCALSEND_EVENTS, q as LocalSendAPI, r as LocalSendEvent, s as LocalSendFileInfo, t as LocalSendSettings, M as MailAPI, u as MailAccount, v as MailAddress, w as MailAttachment, x as MailFetchRange, y as MailMessage, z as MailNewMessagesEvent, G as MailboxInfo, J as MessageEnvelope, N as NotificationAction, O as NotificationClickEvent, P as NotificationOptions, Q as NotificationsAPI, R as OutgoingAttachment, T as OutgoingMessage, U as PasswordInput, V as PasswordItemFull, W as PasswordItemSummary, X as PasswordKeyValue, Y as PasswordKeyValueInput, Z as PasswordsAPI, _ as PendingAuthorization, $ as PendingTransfer, a0 as PermissionsAPI, a1 as RemoteAddBackendRequest, a2 as RemoteS3Config, a3 as RemoteS3PublicConfig, a4 as RemoteStorageAPI, a5 as RemoteStorageBackendInfo, a6 as RemoteStorageObjectInfo, a7 as RemoteUpdateBackendRequest, a8 as RequestedExtension, a9 as SelectFileOptions, aa as SelectFolderOptions, ab as ServerInfo, ac as ServerStatus, ad as SessionAuthorization, ae as SharedSpace, af as ShellAPI, ag as ShellCreateOptions, ah as ShellCreateResponse, ai as ShellExitEvent, aj as ShellOutputEvent, ak as SmtpConfig, al as SpaceAccessTokenInfo, am as SpaceAssignment, an as SpaceInvite, ao as SpaceKeyGrantInfo, ap as SpaceMember, aq as SpaceMemberInfo, ar as SpacesAPI, as as SyncBackendInfo, at as TransferDirection, au as TransferProgress, av as TransferState, aw as WebAPI, ax as canExternalClientSendRequests, ay as isExternalClientConnected } from './client-DH4Km77u.js';
3
- import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-DQZCRfC-.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 MAIL_EVENTS, G as MailEvent, J as ManifestI18nEntry, N as NOTIFICATION_EVENTS, K as NotificationEvent, L as PermissionDeniedError, O as PermissionErrorBase, Q as PermissionErrorCode, R as PermissionPromptError, P as PermissionResponse, T as PermissionStatus, U as SHELL_EVENTS, V as SearchQuery, X as SearchRequestEvent, S as SearchResult, Y as ShellEvent, Z as SyncTablesUpdatedEvent, _ as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, $ as getTableName, a0 as isPermissionDeniedError, a1 as isPermissionError, a2 as isPermissionPromptError } from './types-DQZCRfC-.js';
1
+ import { H as HaexVaultSdk } from './client-C6pEREPM.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-C6pEREPM.js';
3
+ import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-Ba4G6ZpC.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-Ba4G6ZpC.js';
5
5
  export { H as HaextensionConfig } from './config-D_HXjsEV.js';
6
6
  import 'drizzle-orm/sqlite-proxy';
7
7
 
@@ -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
  /**
@@ -736,6 +740,8 @@ declare const TAURI_COMMANDS: {
736
740
  readonly webviewEmit: "extension_webview_emit";
737
741
  readonly filterSyncTables: "extension_filter_sync_tables";
738
742
  readonly emitSyncTables: "extension_emit_sync_tables";
743
+ readonly tabAttention: "extension_tab_attention";
744
+ readonly dialogConfirm: "extension_dialog_confirm";
739
745
  };
740
746
  readonly remoteStorage: {
741
747
  readonly listBackends: "extension_remote_storage_list_backends";
@@ -811,60 +817,6 @@ declare const TAURI_COMMANDS: {
811
817
  };
812
818
  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
819
 
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
820
  /**
869
821
  * Crypto utilities for Vault Key Management
870
822
  * Implements PBKDF2 + AES-GCM encryption/decryption
@@ -1130,4 +1082,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
1130
1082
 
1131
1083
  declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
1132
1084
 
1133
- 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, 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, 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 };
1085
+ 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 };