@haex-space/vault-sdk 2.5.119 → 2.5.122

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.
@@ -939,7 +939,7 @@ declare class LocalSendAPI {
939
939
  cancelSend(sessionId: string): Promise<void>;
940
940
  }
941
941
 
942
- type SpaceRole = 'admin' | 'member' | 'viewer';
942
+ type SpaceRole = 'admin' | 'owner' | 'member' | 'reader';
943
943
  interface SharedSpace {
944
944
  id: string;
945
945
  ownerId: string;
@@ -947,14 +947,12 @@ interface SharedSpace {
947
947
  nameNonce: string;
948
948
  currentKeyGeneration: number;
949
949
  role: SpaceRole;
950
- canInvite: boolean;
951
950
  createdAt: string;
952
951
  }
953
952
  interface SpaceMemberInfo {
954
953
  publicKey: string;
955
954
  label: string;
956
955
  role: SpaceRole;
957
- canInvite: boolean;
958
956
  invitedBy: string | null;
959
957
  joinedAt: string;
960
958
  }
@@ -993,7 +991,6 @@ interface DecryptedSpace {
993
991
  id: string;
994
992
  name: string;
995
993
  role: SpaceRole;
996
- canInvite: boolean;
997
994
  serverUrl: string;
998
995
  createdAt: string;
999
996
  }
@@ -1174,4 +1171,4 @@ declare class HaexVaultSdk {
1174
1171
  private log;
1175
1172
  }
1176
1173
 
1177
- export { type TransferState as $, type AuthorizedClient as A, type BlockedClient as B, type SelectFileOptions as C, DatabaseAPI as D, type ExternalAuthDecision as E, type FileStat as F, type SelectFolderOptions as G, HaexVaultSdk as H, type ServerInfo as I, type ServerStatus as J, type SessionAuthorization as K, LOCALSEND_EVENTS as L, type SharedSpace as M, type SpaceAccessTokenInfo as N, type SpaceAssignment as O, type PendingAuthorization as P, type SpaceInvite as Q, RemoteStorageAPI as R, StorageAPI as S, type SpaceKeyGrantInfo as T, type UpdateBackendRequest as U, type SpaceMemberInfo as V, type SpaceRole as W, SpacesAPI as X, type SyncBackendInfo as Y, type TransferDirection as Z, type TransferProgress as _, type DecryptedSpace as a, WebAPI as a0, canExternalClientSendRequests as a1, isExternalClientConnected as a2, type Device as b, type DeviceInfo as c, type DeviceType as d, type DirEntry as e, type ExternalConnection as f, ExternalConnectionErrorCode as g, ExternalConnectionState as h, type ExternalRequest as i, type ExternalRequestEvent as j, type ExternalRequestHandler as k, type ExternalRequestPayload as l, type ExternalResponse as m, FilesystemAPI as n, LocalSendAPI as o, type LocalSendEvent as p, type FileInfo as q, type LocalSendSettings as r, type PendingTransfer as s, PermissionsAPI as t, type AddBackendRequest as u, type S3Config as v, type S3PublicConfig as w, type StorageBackendInfo as x, type StorageObjectInfo as y, type RequestedExtension as z };
1174
+ export { type TransferState as $, type AuthorizedClient as A, type BlockedClient as B, type RequestedExtension as C, DatabaseAPI as D, type ExternalAuthDecision as E, type FileStat as F, type SelectFileOptions as G, HaexVaultSdk as H, type SelectFolderOptions as I, type ServerInfo as J, type ServerStatus as K, LOCALSEND_EVENTS as L, type SessionAuthorization as M, type SharedSpace as N, type SpaceAccessTokenInfo as O, type PendingAuthorization as P, type SpaceAssignment as Q, RemoteStorageAPI as R, StorageAPI as S, type SpaceInvite as T, type UpdateBackendRequest as U, type SpaceKeyGrantInfo as V, type SpaceMemberInfo as W, SpacesAPI as X, type SyncBackendInfo as Y, type TransferDirection as Z, type TransferProgress as _, type SpaceRole as a, WebAPI as a0, canExternalClientSendRequests as a1, isExternalClientConnected as a2, type DecryptedSpace as b, type Device as c, type DeviceInfo as d, type DeviceType as e, type DirEntry as f, type ExternalConnection as g, ExternalConnectionErrorCode as h, ExternalConnectionState as i, type ExternalRequest as j, type ExternalRequestEvent as k, type ExternalRequestHandler as l, type ExternalRequestPayload as m, type ExternalResponse as n, FilesystemAPI as o, LocalSendAPI as p, type LocalSendEvent as q, type FileInfo as r, type LocalSendSettings as s, type PendingTransfer as t, PermissionsAPI as u, type AddBackendRequest as v, type S3Config as w, type S3PublicConfig as x, type StorageBackendInfo as y, type StorageObjectInfo as z };
@@ -939,7 +939,7 @@ declare class LocalSendAPI {
939
939
  cancelSend(sessionId: string): Promise<void>;
940
940
  }
941
941
 
942
- type SpaceRole = 'admin' | 'member' | 'viewer';
942
+ type SpaceRole = 'admin' | 'owner' | 'member' | 'reader';
943
943
  interface SharedSpace {
944
944
  id: string;
945
945
  ownerId: string;
@@ -947,14 +947,12 @@ interface SharedSpace {
947
947
  nameNonce: string;
948
948
  currentKeyGeneration: number;
949
949
  role: SpaceRole;
950
- canInvite: boolean;
951
950
  createdAt: string;
952
951
  }
953
952
  interface SpaceMemberInfo {
954
953
  publicKey: string;
955
954
  label: string;
956
955
  role: SpaceRole;
957
- canInvite: boolean;
958
956
  invitedBy: string | null;
959
957
  joinedAt: string;
960
958
  }
@@ -993,7 +991,6 @@ interface DecryptedSpace {
993
991
  id: string;
994
992
  name: string;
995
993
  role: SpaceRole;
996
- canInvite: boolean;
997
994
  serverUrl: string;
998
995
  createdAt: string;
999
996
  }
@@ -1174,4 +1171,4 @@ declare class HaexVaultSdk {
1174
1171
  private log;
1175
1172
  }
1176
1173
 
1177
- export { type TransferState as $, type AuthorizedClient as A, type BlockedClient as B, type SelectFileOptions as C, DatabaseAPI as D, type ExternalAuthDecision as E, type FileStat as F, type SelectFolderOptions as G, HaexVaultSdk as H, type ServerInfo as I, type ServerStatus as J, type SessionAuthorization as K, LOCALSEND_EVENTS as L, type SharedSpace as M, type SpaceAccessTokenInfo as N, type SpaceAssignment as O, type PendingAuthorization as P, type SpaceInvite as Q, RemoteStorageAPI as R, StorageAPI as S, type SpaceKeyGrantInfo as T, type UpdateBackendRequest as U, type SpaceMemberInfo as V, type SpaceRole as W, SpacesAPI as X, type SyncBackendInfo as Y, type TransferDirection as Z, type TransferProgress as _, type DecryptedSpace as a, WebAPI as a0, canExternalClientSendRequests as a1, isExternalClientConnected as a2, type Device as b, type DeviceInfo as c, type DeviceType as d, type DirEntry as e, type ExternalConnection as f, ExternalConnectionErrorCode as g, ExternalConnectionState as h, type ExternalRequest as i, type ExternalRequestEvent as j, type ExternalRequestHandler as k, type ExternalRequestPayload as l, type ExternalResponse as m, FilesystemAPI as n, LocalSendAPI as o, type LocalSendEvent as p, type FileInfo as q, type LocalSendSettings as r, type PendingTransfer as s, PermissionsAPI as t, type AddBackendRequest as u, type S3Config as v, type S3PublicConfig as w, type StorageBackendInfo as x, type StorageObjectInfo as y, type RequestedExtension as z };
1174
+ export { type TransferState as $, type AuthorizedClient as A, type BlockedClient as B, type RequestedExtension as C, DatabaseAPI as D, type ExternalAuthDecision as E, type FileStat as F, type SelectFileOptions as G, HaexVaultSdk as H, type SelectFolderOptions as I, type ServerInfo as J, type ServerStatus as K, LOCALSEND_EVENTS as L, type SessionAuthorization as M, type SharedSpace as N, type SpaceAccessTokenInfo as O, type PendingAuthorization as P, type SpaceAssignment as Q, RemoteStorageAPI as R, StorageAPI as S, type SpaceInvite as T, type UpdateBackendRequest as U, type SpaceKeyGrantInfo as V, type SpaceMemberInfo as W, SpacesAPI as X, type SyncBackendInfo as Y, type TransferDirection as Z, type TransferProgress as _, type SpaceRole as a, WebAPI as a0, canExternalClientSendRequests as a1, isExternalClientConnected as a2, type DecryptedSpace as b, type Device as c, type DeviceInfo as d, type DeviceType as e, type DirEntry as f, type ExternalConnection as g, ExternalConnectionErrorCode as h, ExternalConnectionState as i, type ExternalRequest as j, type ExternalRequestEvent as k, type ExternalRequestHandler as l, type ExternalRequestPayload as m, type ExternalResponse as n, FilesystemAPI as o, LocalSendAPI as p, type LocalSendEvent as q, type FileInfo as r, type LocalSendSettings as s, type PendingTransfer as t, PermissionsAPI as u, type AddBackendRequest as v, type S3Config as w, type S3PublicConfig as x, type StorageBackendInfo as y, type StorageObjectInfo as z };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HaexVaultSdk } from './client-CJTSbNLI.mjs';
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, L as LOCALSEND_EVENTS, o as LocalSendAPI, p as LocalSendEvent, q as LocalSendFileInfo, r as LocalSendSettings, P as PendingAuthorization, s as PendingTransfer, t as PermissionsAPI, u as RemoteAddBackendRequest, v as RemoteS3Config, w as RemoteS3PublicConfig, R as RemoteStorageAPI, x as RemoteStorageBackendInfo, y as RemoteStorageObjectInfo, U as RemoteUpdateBackendRequest, z as RequestedExtension, C as SelectFileOptions, G as SelectFolderOptions, I as ServerInfo, J as ServerStatus, K as SessionAuthorization, M as SharedSpace, N as SpaceAccessTokenInfo, O as SpaceAssignment, Q as SpaceInvite, T as SpaceKeyGrantInfo, V as SpaceMemberInfo, W as SpaceRole, X as SpacesAPI, Y as SyncBackendInfo, Z as TransferDirection, _ as TransferProgress, $ as TransferState, a0 as WebAPI, a1 as canExternalClientSendRequests, a2 as isExternalClientConnected } from './client-CJTSbNLI.mjs';
1
+ import { a as SpaceRole, H as HaexVaultSdk } from './client-CrXV__Zx.mjs';
2
+ export { A as AuthorizedClient, B as BlockedClient, D as DatabaseAPI, b as DecryptedSpace, 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, L as LOCALSEND_EVENTS, p as LocalSendAPI, q as LocalSendEvent, r as LocalSendFileInfo, s as LocalSendSettings, P as PendingAuthorization, t as PendingTransfer, u as PermissionsAPI, v as RemoteAddBackendRequest, w as RemoteS3Config, x as RemoteS3PublicConfig, R as RemoteStorageAPI, y as RemoteStorageBackendInfo, z as RemoteStorageObjectInfo, U as RemoteUpdateBackendRequest, C as RequestedExtension, G as SelectFileOptions, I as SelectFolderOptions, J as ServerInfo, K as ServerStatus, M as SessionAuthorization, N as SharedSpace, O as SpaceAccessTokenInfo, Q as SpaceAssignment, T as SpaceInvite, V as SpaceKeyGrantInfo, W as SpaceMemberInfo, X as SpacesAPI, Y as SyncBackendInfo, Z as TransferDirection, _ as TransferProgress, $ as TransferState, a0 as WebAPI, a1 as canExternalClientSendRequests, a2 as isExternalClientConnected } from './client-CrXV__Zx.mjs';
3
3
  import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-TFcm6hpl.mjs';
4
4
  export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, f as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, g 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 PermissionDeniedError, G as PermissionErrorBase, J as PermissionErrorCode, K as PermissionPromptError, P as PermissionResponse, L as PermissionStatus, N as SearchQuery, O as SearchRequestEvent, S as SearchResult, Q as SyncTablesUpdatedEvent, T as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, R as getTableName, U as isPermissionDeniedError, V as isPermissionError, X as isPermissionPromptError } from './types-TFcm6hpl.mjs';
5
5
  export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
@@ -88,6 +88,7 @@ declare function installPolyfills(): void;
88
88
  * Types for communicating with the haex-sync-server authentication endpoints.
89
89
  * Used by haex-vault and extensions that need to interact with the sync server.
90
90
  */
91
+
91
92
  /**
92
93
  * S3-compatible storage configuration provided by the sync server.
93
94
  *
@@ -201,8 +202,7 @@ interface CreateSpaceRequest {
201
202
  interface InviteMemberRequest {
202
203
  publicKey: string;
203
204
  label: string;
204
- role: 'member' | 'viewer';
205
- canInvite?: boolean;
205
+ role: SpaceRole;
206
206
  keyGrant: {
207
207
  encryptedSpaceKey: string;
208
208
  keyNonce: string;
@@ -839,14 +839,14 @@ declare function generateIdentityAsync(): Promise<{
839
839
  privateKeyBase64: string;
840
840
  }>;
841
841
 
842
- interface EncryptedSpaceKey {
843
- encryptedSpaceKey: string;
844
- keyNonce: string;
842
+ interface SealedData {
843
+ encryptedData: string;
844
+ nonce: string;
845
845
  ephemeralPublicKey: string;
846
846
  }
847
847
  declare function generateSpaceKey(): Uint8Array<ArrayBuffer>;
848
- declare function encryptSpaceKeyForRecipientAsync(spaceKey: Uint8Array<ArrayBuffer>, recipientPublicKeyBase64: string): Promise<EncryptedSpaceKey>;
849
- declare function decryptSpaceKeyAsync(encrypted: EncryptedSpaceKey, ownPrivateKeyBase64: string): Promise<Uint8Array>;
848
+ declare function encryptWithPublicKeyAsync(data: Uint8Array<ArrayBuffer>, recipientPublicKeyBase64: string): Promise<SealedData>;
849
+ declare function decryptWithPrivateKeyAsync(sealed: SealedData, ownPrivateKeyBase64: string): Promise<Uint8Array>;
850
850
  /**
851
851
  * Encrypt a space name using the raw space key.
852
852
  * Returns the encrypted name and nonce as base64 strings.
@@ -976,4 +976,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
976
976
 
977
977
  declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
978
978
 
979
- export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type CreateSpaceRequest, type EncryptedSpaceKey, 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 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, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceKeyForRecipientAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, 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 };
979
+ 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, SpaceRole, 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, 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,5 +1,5 @@
1
- import { H as HaexVaultSdk } from './client-E86CS0KK.js';
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, L as LOCALSEND_EVENTS, o as LocalSendAPI, p as LocalSendEvent, q as LocalSendFileInfo, r as LocalSendSettings, P as PendingAuthorization, s as PendingTransfer, t as PermissionsAPI, u as RemoteAddBackendRequest, v as RemoteS3Config, w as RemoteS3PublicConfig, R as RemoteStorageAPI, x as RemoteStorageBackendInfo, y as RemoteStorageObjectInfo, U as RemoteUpdateBackendRequest, z as RequestedExtension, C as SelectFileOptions, G as SelectFolderOptions, I as ServerInfo, J as ServerStatus, K as SessionAuthorization, M as SharedSpace, N as SpaceAccessTokenInfo, O as SpaceAssignment, Q as SpaceInvite, T as SpaceKeyGrantInfo, V as SpaceMemberInfo, W as SpaceRole, X as SpacesAPI, Y as SyncBackendInfo, Z as TransferDirection, _ as TransferProgress, $ as TransferState, a0 as WebAPI, a1 as canExternalClientSendRequests, a2 as isExternalClientConnected } from './client-E86CS0KK.js';
1
+ import { a as SpaceRole, H as HaexVaultSdk } from './client-DzQv-YCD.js';
2
+ export { A as AuthorizedClient, B as BlockedClient, D as DatabaseAPI, b as DecryptedSpace, 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, L as LOCALSEND_EVENTS, p as LocalSendAPI, q as LocalSendEvent, r as LocalSendFileInfo, s as LocalSendSettings, P as PendingAuthorization, t as PendingTransfer, u as PermissionsAPI, v as RemoteAddBackendRequest, w as RemoteS3Config, x as RemoteS3PublicConfig, R as RemoteStorageAPI, y as RemoteStorageBackendInfo, z as RemoteStorageObjectInfo, U as RemoteUpdateBackendRequest, C as RequestedExtension, G as SelectFileOptions, I as SelectFolderOptions, J as ServerInfo, K as ServerStatus, M as SessionAuthorization, N as SharedSpace, O as SpaceAccessTokenInfo, Q as SpaceAssignment, T as SpaceInvite, V as SpaceKeyGrantInfo, W as SpaceMemberInfo, X as SpacesAPI, Y as SyncBackendInfo, Z as TransferDirection, _ as TransferProgress, $ as TransferState, a0 as WebAPI, a1 as canExternalClientSendRequests, a2 as isExternalClientConnected } from './client-DzQv-YCD.js';
3
3
  import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-TFcm6hpl.js';
4
4
  export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, f as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, g 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 PermissionDeniedError, G as PermissionErrorBase, J as PermissionErrorCode, K as PermissionPromptError, P as PermissionResponse, L as PermissionStatus, N as SearchQuery, O as SearchRequestEvent, S as SearchResult, Q as SyncTablesUpdatedEvent, T as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, R as getTableName, U as isPermissionDeniedError, V as isPermissionError, X as isPermissionPromptError } from './types-TFcm6hpl.js';
5
5
  export { H as HaextensionConfig } from './config-D_HXjsEV.js';
@@ -88,6 +88,7 @@ declare function installPolyfills(): void;
88
88
  * Types for communicating with the haex-sync-server authentication endpoints.
89
89
  * Used by haex-vault and extensions that need to interact with the sync server.
90
90
  */
91
+
91
92
  /**
92
93
  * S3-compatible storage configuration provided by the sync server.
93
94
  *
@@ -201,8 +202,7 @@ interface CreateSpaceRequest {
201
202
  interface InviteMemberRequest {
202
203
  publicKey: string;
203
204
  label: string;
204
- role: 'member' | 'viewer';
205
- canInvite?: boolean;
205
+ role: SpaceRole;
206
206
  keyGrant: {
207
207
  encryptedSpaceKey: string;
208
208
  keyNonce: string;
@@ -839,14 +839,14 @@ declare function generateIdentityAsync(): Promise<{
839
839
  privateKeyBase64: string;
840
840
  }>;
841
841
 
842
- interface EncryptedSpaceKey {
843
- encryptedSpaceKey: string;
844
- keyNonce: string;
842
+ interface SealedData {
843
+ encryptedData: string;
844
+ nonce: string;
845
845
  ephemeralPublicKey: string;
846
846
  }
847
847
  declare function generateSpaceKey(): Uint8Array<ArrayBuffer>;
848
- declare function encryptSpaceKeyForRecipientAsync(spaceKey: Uint8Array<ArrayBuffer>, recipientPublicKeyBase64: string): Promise<EncryptedSpaceKey>;
849
- declare function decryptSpaceKeyAsync(encrypted: EncryptedSpaceKey, ownPrivateKeyBase64: string): Promise<Uint8Array>;
848
+ declare function encryptWithPublicKeyAsync(data: Uint8Array<ArrayBuffer>, recipientPublicKeyBase64: string): Promise<SealedData>;
849
+ declare function decryptWithPrivateKeyAsync(sealed: SealedData, ownPrivateKeyBase64: string): Promise<Uint8Array>;
850
850
  /**
851
851
  * Encrypt a space name using the raw space key.
852
852
  * Returns the encrypted name and nonce as base64 strings.
@@ -976,4 +976,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
976
976
 
977
977
  declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
978
978
 
979
- export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type CreateSpaceRequest, type EncryptedSpaceKey, 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 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, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceKeyForRecipientAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, 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 };
979
+ 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, SpaceRole, 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, 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
@@ -3099,7 +3099,7 @@ init_vaultKey();
3099
3099
  function generateSpaceKey() {
3100
3100
  return generateVaultKey();
3101
3101
  }
3102
- async function encryptSpaceKeyForRecipientAsync(spaceKey, recipientPublicKeyBase64) {
3102
+ async function encryptWithPublicKeyAsync(data, recipientPublicKeyBase64) {
3103
3103
  const ephemeral = await crypto.subtle.generateKey(exports.KEY_AGREEMENT_ALGO, true, ["deriveBits"]);
3104
3104
  const recipientKey = await importPublicKeyForKeyAgreementAsync(recipientPublicKeyBase64);
3105
3105
  const sharedBits = await crypto.subtle.deriveBits(
@@ -3120,18 +3120,18 @@ async function encryptSpaceKeyForRecipientAsync(spaceKey, recipientPublicKeyBase
3120
3120
  ["encrypt"]
3121
3121
  );
3122
3122
  const nonce = crypto.getRandomValues(new Uint8Array(12));
3123
- const encrypted = await crypto.subtle.encrypt({ name: "AES-GCM", iv: nonce }, aesKey, spaceKey);
3123
+ const encrypted = await crypto.subtle.encrypt({ name: "AES-GCM", iv: nonce }, aesKey, data);
3124
3124
  const ephPub = await crypto.subtle.exportKey("spki", ephemeral.publicKey);
3125
3125
  return {
3126
- encryptedSpaceKey: arrayBufferToBase64(encrypted),
3127
- keyNonce: arrayBufferToBase64(nonce),
3126
+ encryptedData: arrayBufferToBase64(encrypted),
3127
+ nonce: arrayBufferToBase64(nonce),
3128
3128
  ephemeralPublicKey: arrayBufferToBase64(ephPub)
3129
3129
  };
3130
3130
  }
3131
- async function decryptSpaceKeyAsync(encrypted, ownPrivateKeyBase64) {
3131
+ async function decryptWithPrivateKeyAsync(sealed, ownPrivateKeyBase64) {
3132
3132
  const ephPubKey = await crypto.subtle.importKey(
3133
3133
  "spki",
3134
- base64ToArrayBuffer(encrypted.ephemeralPublicKey),
3134
+ base64ToArrayBuffer(sealed.ephemeralPublicKey),
3135
3135
  exports.KEY_AGREEMENT_ALGO,
3136
3136
  true,
3137
3137
  []
@@ -3155,9 +3155,9 @@ async function decryptSpaceKeyAsync(encrypted, ownPrivateKeyBase64) {
3155
3155
  ["decrypt"]
3156
3156
  );
3157
3157
  const decrypted = await crypto.subtle.decrypt(
3158
- { name: "AES-GCM", iv: base64ToArrayBuffer(encrypted.keyNonce) },
3158
+ { name: "AES-GCM", iv: base64ToArrayBuffer(sealed.nonce) },
3159
3159
  aesKey,
3160
- base64ToArrayBuffer(encrypted.encryptedSpaceKey)
3160
+ base64ToArrayBuffer(sealed.encryptedData)
3161
3161
  );
3162
3162
  return new Uint8Array(decrypted);
3163
3163
  }
@@ -3483,19 +3483,19 @@ exports.canExternalClientSendRequests = canExternalClientSendRequests;
3483
3483
  exports.createHaexVaultSdk = createHaexVaultSdk;
3484
3484
  exports.decryptCrdtData = decryptCrdtData;
3485
3485
  exports.decryptPrivateKeyAsync = decryptPrivateKeyAsync;
3486
- exports.decryptSpaceKeyAsync = decryptSpaceKeyAsync;
3487
3486
  exports.decryptSpaceNameAsync = decryptSpaceNameAsync;
3488
3487
  exports.decryptString = decryptString;
3489
3488
  exports.decryptVaultKey = decryptVaultKey;
3490
3489
  exports.decryptVaultName = decryptVaultName;
3490
+ exports.decryptWithPrivateKeyAsync = decryptWithPrivateKeyAsync;
3491
3491
  exports.deriveKeyFromPassword = deriveKeyFromPassword;
3492
3492
  exports.didKeyToPublicKeyAsync = didKeyToPublicKeyAsync;
3493
3493
  exports.encryptCrdtData = encryptCrdtData;
3494
3494
  exports.encryptPrivateKeyAsync = encryptPrivateKeyAsync;
3495
- exports.encryptSpaceKeyForRecipientAsync = encryptSpaceKeyForRecipientAsync;
3496
3495
  exports.encryptSpaceNameAsync = encryptSpaceNameAsync;
3497
3496
  exports.encryptString = encryptString;
3498
3497
  exports.encryptVaultKey = encryptVaultKey;
3498
+ exports.encryptWithPublicKeyAsync = encryptWithPublicKeyAsync;
3499
3499
  exports.exportKeyPairAsync = exportKeyPairAsync;
3500
3500
  exports.exportPrivateKeyAsync = exportPrivateKeyAsync;
3501
3501
  exports.exportPublicKeyAsync = exportPublicKeyAsync;