@haex-space/vault-sdk 3.6.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.
- 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-DnCZ3KyI.d.mts → client-C6pEREPM.d.ts} +63 -3
- package/dist/{client-uuhuCPDu.d.ts → client-GdCi-m2s.d.mts} +63 -3
- package/dist/haex_bundle_bg.wasm +0 -0
- package/dist/index.d.mts +14 -59
- package/dist/index.d.ts +14 -59
- package/dist/index.js +139 -105
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +158 -123
- 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 +146 -7
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +166 -27
- 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 +54 -7
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +54 -7
- 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 +146 -7
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +166 -27
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-DQZCRfC-.d.mts → types-Ba4G6ZpC.d.mts} +10 -2
- package/dist/{types-DQZCRfC-.d.ts → types-Ba4G6ZpC.d.ts} +10 -2
- package/dist/vue.d.mts +2 -2
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +146 -7
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +166 -27
- package/dist/vue.mjs.map +1 -1
- package/package.json +8 -6
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-GdCi-m2s.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-GdCi-m2s.mjs';
|
|
3
|
+
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-Ba4G6ZpC.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-Ba4G6ZpC.mjs';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
|
|
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
|
/**
|
|
@@ -619,6 +623,8 @@ declare const SPACE_COMMANDS: {
|
|
|
619
623
|
readonly unassign: "extension_space_unassign";
|
|
620
624
|
/** Get space assignments for a table */
|
|
621
625
|
readonly getAssignments: "extension_space_get_assignments";
|
|
626
|
+
/** Get members of a shared space */
|
|
627
|
+
readonly getMembers: "extension_space_get_members";
|
|
622
628
|
/** List all spaces the user is a member of (with decrypted names) */
|
|
623
629
|
readonly list: "extension_space_list";
|
|
624
630
|
/** Create a new shared space */
|
|
@@ -734,6 +740,8 @@ declare const TAURI_COMMANDS: {
|
|
|
734
740
|
readonly webviewEmit: "extension_webview_emit";
|
|
735
741
|
readonly filterSyncTables: "extension_filter_sync_tables";
|
|
736
742
|
readonly emitSyncTables: "extension_emit_sync_tables";
|
|
743
|
+
readonly tabAttention: "extension_tab_attention";
|
|
744
|
+
readonly dialogConfirm: "extension_dialog_confirm";
|
|
737
745
|
};
|
|
738
746
|
readonly remoteStorage: {
|
|
739
747
|
readonly listBackends: "extension_remote_storage_list_backends";
|
|
@@ -770,6 +778,7 @@ declare const TAURI_COMMANDS: {
|
|
|
770
778
|
readonly assign: "extension_space_assign";
|
|
771
779
|
readonly unassign: "extension_space_unassign";
|
|
772
780
|
readonly getAssignments: "extension_space_get_assignments";
|
|
781
|
+
readonly getMembers: "extension_space_get_members";
|
|
773
782
|
readonly list: "extension_space_list";
|
|
774
783
|
readonly create: "extension_space_create";
|
|
775
784
|
readonly listBackends: "extension_space_list_backends";
|
|
@@ -808,60 +817,6 @@ declare const TAURI_COMMANDS: {
|
|
|
808
817
|
};
|
|
809
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];
|
|
810
819
|
|
|
811
|
-
interface VerifyResult {
|
|
812
|
-
valid: boolean;
|
|
813
|
-
error?: string;
|
|
814
|
-
}
|
|
815
|
-
interface ZipFileEntry {
|
|
816
|
-
path: string;
|
|
817
|
-
content: Uint8Array;
|
|
818
|
-
}
|
|
819
|
-
/**
|
|
820
|
-
* Sort object keys recursively for canonical JSON representation.
|
|
821
|
-
* Must match the signing implementation exactly.
|
|
822
|
-
*/
|
|
823
|
-
declare function sortObjectKeysRecursively(obj: unknown): unknown;
|
|
824
|
-
/**
|
|
825
|
-
* Convert hex string to ArrayBuffer
|
|
826
|
-
* Returns ArrayBuffer directly to avoid type issues with Uint8Array.buffer
|
|
827
|
-
*/
|
|
828
|
-
declare function hexToBytes(hex: string): ArrayBuffer;
|
|
829
|
-
/**
|
|
830
|
-
* Verify Ed25519 signature of an extension bundle.
|
|
831
|
-
*
|
|
832
|
-
* This function is browser-compatible and uses the Web Crypto API.
|
|
833
|
-
* It verifies that the extension bundle was signed with the private key
|
|
834
|
-
* corresponding to the public key in the manifest.
|
|
835
|
-
*
|
|
836
|
-
* @param files - Array of file entries from the ZIP archive
|
|
837
|
-
* @param manifest - The extension manifest (parsed from manifest.json)
|
|
838
|
-
* @returns Promise resolving to verification result
|
|
839
|
-
*
|
|
840
|
-
* @example
|
|
841
|
-
* ```typescript
|
|
842
|
-
* import JSZip from 'jszip';
|
|
843
|
-
* import { verifyExtensionSignature } from '@haex-space/vault-sdk';
|
|
844
|
-
*
|
|
845
|
-
* const zip = await JSZip.loadAsync(bundleFile);
|
|
846
|
-
* const manifestContent = await zip.file('haextension/manifest.json')?.async('string');
|
|
847
|
-
* const manifest = JSON.parse(manifestContent);
|
|
848
|
-
*
|
|
849
|
-
* // Collect all files from the ZIP
|
|
850
|
-
* const files = [];
|
|
851
|
-
* for (const [path, entry] of Object.entries(zip.files)) {
|
|
852
|
-
* if (!entry.dir) {
|
|
853
|
-
* files.push({ path, content: await entry.async('uint8array') });
|
|
854
|
-
* }
|
|
855
|
-
* }
|
|
856
|
-
*
|
|
857
|
-
* const result = await verifyExtensionSignature(files, manifest);
|
|
858
|
-
* if (!result.valid) {
|
|
859
|
-
* console.error('Signature verification failed:', result.error);
|
|
860
|
-
* }
|
|
861
|
-
* ```
|
|
862
|
-
*/
|
|
863
|
-
declare function verifyExtensionSignature(files: ZipFileEntry[], manifest: ExtensionManifest): Promise<VerifyResult>;
|
|
864
|
-
|
|
865
820
|
/**
|
|
866
821
|
* Crypto utilities for Vault Key Management
|
|
867
822
|
* Implements PBKDF2 + AES-GCM encryption/decryption
|
|
@@ -1127,4 +1082,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
|
|
|
1127
1082
|
|
|
1128
1083
|
declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
|
|
1129
1084
|
|
|
1130
|
-
export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type CreateSpaceRequest, type ExportedPasskeyKeyPair, type ExportedUserKeypair,
|
|
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 };
|
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-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
|
/**
|
|
@@ -619,6 +623,8 @@ declare const SPACE_COMMANDS: {
|
|
|
619
623
|
readonly unassign: "extension_space_unassign";
|
|
620
624
|
/** Get space assignments for a table */
|
|
621
625
|
readonly getAssignments: "extension_space_get_assignments";
|
|
626
|
+
/** Get members of a shared space */
|
|
627
|
+
readonly getMembers: "extension_space_get_members";
|
|
622
628
|
/** List all spaces the user is a member of (with decrypted names) */
|
|
623
629
|
readonly list: "extension_space_list";
|
|
624
630
|
/** Create a new shared space */
|
|
@@ -734,6 +740,8 @@ declare const TAURI_COMMANDS: {
|
|
|
734
740
|
readonly webviewEmit: "extension_webview_emit";
|
|
735
741
|
readonly filterSyncTables: "extension_filter_sync_tables";
|
|
736
742
|
readonly emitSyncTables: "extension_emit_sync_tables";
|
|
743
|
+
readonly tabAttention: "extension_tab_attention";
|
|
744
|
+
readonly dialogConfirm: "extension_dialog_confirm";
|
|
737
745
|
};
|
|
738
746
|
readonly remoteStorage: {
|
|
739
747
|
readonly listBackends: "extension_remote_storage_list_backends";
|
|
@@ -770,6 +778,7 @@ declare const TAURI_COMMANDS: {
|
|
|
770
778
|
readonly assign: "extension_space_assign";
|
|
771
779
|
readonly unassign: "extension_space_unassign";
|
|
772
780
|
readonly getAssignments: "extension_space_get_assignments";
|
|
781
|
+
readonly getMembers: "extension_space_get_members";
|
|
773
782
|
readonly list: "extension_space_list";
|
|
774
783
|
readonly create: "extension_space_create";
|
|
775
784
|
readonly listBackends: "extension_space_list_backends";
|
|
@@ -808,60 +817,6 @@ declare const TAURI_COMMANDS: {
|
|
|
808
817
|
};
|
|
809
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];
|
|
810
819
|
|
|
811
|
-
interface VerifyResult {
|
|
812
|
-
valid: boolean;
|
|
813
|
-
error?: string;
|
|
814
|
-
}
|
|
815
|
-
interface ZipFileEntry {
|
|
816
|
-
path: string;
|
|
817
|
-
content: Uint8Array;
|
|
818
|
-
}
|
|
819
|
-
/**
|
|
820
|
-
* Sort object keys recursively for canonical JSON representation.
|
|
821
|
-
* Must match the signing implementation exactly.
|
|
822
|
-
*/
|
|
823
|
-
declare function sortObjectKeysRecursively(obj: unknown): unknown;
|
|
824
|
-
/**
|
|
825
|
-
* Convert hex string to ArrayBuffer
|
|
826
|
-
* Returns ArrayBuffer directly to avoid type issues with Uint8Array.buffer
|
|
827
|
-
*/
|
|
828
|
-
declare function hexToBytes(hex: string): ArrayBuffer;
|
|
829
|
-
/**
|
|
830
|
-
* Verify Ed25519 signature of an extension bundle.
|
|
831
|
-
*
|
|
832
|
-
* This function is browser-compatible and uses the Web Crypto API.
|
|
833
|
-
* It verifies that the extension bundle was signed with the private key
|
|
834
|
-
* corresponding to the public key in the manifest.
|
|
835
|
-
*
|
|
836
|
-
* @param files - Array of file entries from the ZIP archive
|
|
837
|
-
* @param manifest - The extension manifest (parsed from manifest.json)
|
|
838
|
-
* @returns Promise resolving to verification result
|
|
839
|
-
*
|
|
840
|
-
* @example
|
|
841
|
-
* ```typescript
|
|
842
|
-
* import JSZip from 'jszip';
|
|
843
|
-
* import { verifyExtensionSignature } from '@haex-space/vault-sdk';
|
|
844
|
-
*
|
|
845
|
-
* const zip = await JSZip.loadAsync(bundleFile);
|
|
846
|
-
* const manifestContent = await zip.file('haextension/manifest.json')?.async('string');
|
|
847
|
-
* const manifest = JSON.parse(manifestContent);
|
|
848
|
-
*
|
|
849
|
-
* // Collect all files from the ZIP
|
|
850
|
-
* const files = [];
|
|
851
|
-
* for (const [path, entry] of Object.entries(zip.files)) {
|
|
852
|
-
* if (!entry.dir) {
|
|
853
|
-
* files.push({ path, content: await entry.async('uint8array') });
|
|
854
|
-
* }
|
|
855
|
-
* }
|
|
856
|
-
*
|
|
857
|
-
* const result = await verifyExtensionSignature(files, manifest);
|
|
858
|
-
* if (!result.valid) {
|
|
859
|
-
* console.error('Signature verification failed:', result.error);
|
|
860
|
-
* }
|
|
861
|
-
* ```
|
|
862
|
-
*/
|
|
863
|
-
declare function verifyExtensionSignature(files: ZipFileEntry[], manifest: ExtensionManifest): Promise<VerifyResult>;
|
|
864
|
-
|
|
865
820
|
/**
|
|
866
821
|
* Crypto utilities for Vault Key Management
|
|
867
822
|
* Implements PBKDF2 + AES-GCM encryption/decryption
|
|
@@ -1127,4 +1082,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
|
|
|
1127
1082
|
|
|
1128
1083
|
declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
|
|
1129
1084
|
|
|
1130
|
-
export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type CreateSpaceRequest, type ExportedPasskeyKeyPair, type ExportedUserKeypair,
|
|
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 };
|