@haex-space/vault-sdk 2.5.106 → 2.5.108

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.
@@ -1,4 +1,4 @@
1
- import { D as DatabaseQueryResult, M as Migration, b as MigrationResult, W as WebRequestOptions, c as WebResponse, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, d as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, e as ExternalRequestHandler, f as ExternalResponse, g as EventCallback } from './types-CORIMooS.mjs';
1
+ import { D as DatabaseQueryResult, M as Migration, b as MigrationResult, W as WebRequestOptions, c as WebResponse, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, d as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, e as ExternalRequestHandler, f as ExternalResponse, g as EventCallback } from './types-NWYbdRXr.mjs';
2
2
  import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
3
3
 
4
4
  declare class StorageAPI {
@@ -1,4 +1,4 @@
1
- import { D as DatabaseQueryResult, M as Migration, b as MigrationResult, W as WebRequestOptions, c as WebResponse, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, d as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, e as ExternalRequestHandler, f as ExternalResponse, g as EventCallback } from './types-CORIMooS.js';
1
+ import { D as DatabaseQueryResult, M as Migration, b as MigrationResult, W as WebRequestOptions, c as WebResponse, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, d as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, e as ExternalRequestHandler, f as ExternalResponse, g as EventCallback } from './types-NWYbdRXr.js';
2
2
  import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
3
3
 
4
4
  declare class StorageAPI {
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultSdk } from './client-CbYg_Bl8.mjs';
2
- export { D as DatabaseAPI, a as Device, b as DeviceInfo, c as DeviceType, d as DirEntry, F as FileStat, e as FilesystemAPI, L as LOCALSEND_EVENTS, f as LocalSendAPI, g as LocalSendEvent, h as LocalSendFileInfo, i as LocalSendSettings, P as PendingTransfer, j as PermissionsAPI, A as RemoteAddBackendRequest, k as RemoteS3Config, l as RemoteS3PublicConfig, R as RemoteStorageAPI, m as RemoteStorageBackendInfo, n as RemoteStorageObjectInfo, U as RemoteUpdateBackendRequest, o as SelectFileOptions, p as SelectFolderOptions, q as ServerInfo, r as ServerStatus, T as TransferDirection, s as TransferProgress, t as TransferState, W as WebAPI } from './client-CbYg_Bl8.mjs';
3
- import { E as ExtensionManifest, H as HaexHubConfig } from './types-CORIMooS.mjs';
4
- export { A as ApplicationContext, h as AuthorizedClient, B as BlockedClient, C as ContextChangedEvent, i as DEFAULT_TIMEOUT, j as DatabaseColumnInfo, k as DatabaseExecuteParams, l as DatabasePermission, d as DatabasePermissionRequest, m as DatabaseQueryParams, D as DatabaseQueryResult, n as DatabaseTableInfo, o as EXTERNAL_EVENTS, p as ErrorCode, g as EventCallback, a as ExtensionInfo, q as ExtensionRuntimeMode, r as ExternalAuthDecision, s as ExternalConnection, t as ExternalConnectionErrorCode, u as ExternalConnectionState, v as ExternalEvent, w as ExternalRequest, x as ExternalRequestEvent, e as ExternalRequestHandler, y as ExternalRequestPayload, f as ExternalResponse, F as FileChangeEvent, z as FileChangePayload, G as FileChangeType, I as FilteredSyncTablesResult, J as HAEXTENSION_EVENTS, K as HaexHubEvent, L as HaexHubRequest, N as HaexHubResponse, O as HaexVaultSdkError, Q as HaextensionEvent, R as PendingAuthorization, T as PermissionDeniedError, U as PermissionErrorBase, V as PermissionErrorCode, X as PermissionPromptError, P as PermissionResponse, Y as PermissionStatus, Z as RequestedExtension, _ as SearchQuery, $ as SearchRequestEvent, S as SearchResult, a0 as SessionAuthorization, a1 as SyncTablesUpdatedEvent, a2 as TABLE_SEPARATOR, W as WebRequestOptions, c as WebResponse, a3 as canExternalClientSendRequests, a4 as getTableName, a5 as isExternalClientConnected, a6 as isPermissionDeniedError, a7 as isPermissionError, a8 as isPermissionPromptError } from './types-CORIMooS.mjs';
1
+ import { H as HaexVaultSdk } from './client-CBCjziWo.mjs';
2
+ export { D as DatabaseAPI, a as Device, b as DeviceInfo, c as DeviceType, d as DirEntry, F as FileStat, e as FilesystemAPI, L as LOCALSEND_EVENTS, f as LocalSendAPI, g as LocalSendEvent, h as LocalSendFileInfo, i as LocalSendSettings, P as PendingTransfer, j as PermissionsAPI, A as RemoteAddBackendRequest, k as RemoteS3Config, l as RemoteS3PublicConfig, R as RemoteStorageAPI, m as RemoteStorageBackendInfo, n as RemoteStorageObjectInfo, U as RemoteUpdateBackendRequest, o as SelectFileOptions, p as SelectFolderOptions, q as ServerInfo, r as ServerStatus, T as TransferDirection, s as TransferProgress, t as TransferState, W as WebAPI } from './client-CBCjziWo.mjs';
3
+ import { h as SpaceRole, E as ExtensionManifest, H as HaexHubConfig } from './types-NWYbdRXr.mjs';
4
+ export { A as ApplicationContext, i as AuthorizedClient, B as BlockedClient, C as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, d as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, p as EXTERNAL_EVENTS, q as ErrorCode, g as EventCallback, a as ExtensionInfo, r as ExtensionRuntimeMode, s as ExternalAuthDecision, t as ExternalConnection, u as ExternalConnectionErrorCode, v as ExternalConnectionState, w as ExternalEvent, x as ExternalRequest, y as ExternalRequestEvent, e as ExternalRequestHandler, z as ExternalRequestPayload, f as ExternalResponse, F as FileChangeEvent, G as FileChangePayload, I as FileChangeType, J as FilteredSyncTablesResult, K as HAEXTENSION_EVENTS, L as HaexHubEvent, N as HaexHubRequest, O as HaexHubResponse, Q as HaexVaultSdkError, R as HaextensionEvent, T as PendingAuthorization, U as PermissionDeniedError, V as PermissionErrorBase, X as PermissionErrorCode, Y as PermissionPromptError, P as PermissionResponse, Z as PermissionStatus, _ as RequestedExtension, $ as SearchQuery, a0 as SearchRequestEvent, S as SearchResult, a1 as SessionAuthorization, a2 as SharedSpace, a3 as SpaceAccessTokenInfo, a4 as SpaceInvite, a5 as SpaceKeyGrantInfo, a6 as SpaceMemberInfo, a7 as SyncTablesUpdatedEvent, a8 as TABLE_SEPARATOR, W as WebRequestOptions, c as WebResponse, a9 as canExternalClientSendRequests, aa as getTableName, ab as isExternalClientConnected, ac as isPermissionDeniedError, ad as isPermissionError, ae as isPermissionPromptError } from './types-NWYbdRXr.mjs';
5
5
  export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
6
6
  import 'drizzle-orm/sqlite-proxy';
7
7
 
@@ -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
  *
@@ -187,6 +188,32 @@ interface ErrorResponse {
187
188
  /** Error message */
188
189
  error: string;
189
190
  }
191
+ interface CreateSpaceRequest {
192
+ id: string;
193
+ encryptedName: string;
194
+ nameNonce: string;
195
+ keyGrant: {
196
+ encryptedSpaceKey: string;
197
+ keyNonce: string;
198
+ ephemeralPublicKey: string;
199
+ };
200
+ }
201
+ interface InviteMemberRequest {
202
+ userId: string;
203
+ role: SpaceRole;
204
+ keyGrant: {
205
+ encryptedSpaceKey: string;
206
+ keyNonce: string;
207
+ ephemeralPublicKey: string;
208
+ generation: number;
209
+ };
210
+ }
211
+ interface RegisterKeypairRequest {
212
+ publicKey: string;
213
+ encryptedPrivateKey: string;
214
+ privateKeyNonce: string;
215
+ privateKeySalt: string;
216
+ }
190
217
 
191
218
  /**
192
219
  * Central message type definitions for HaexSpace SDK
@@ -666,7 +693,7 @@ declare function deriveKeyFromPassword(password: string, salt: Uint8Array): Prom
666
693
  /**
667
694
  * Generates a random vault key (32 bytes)
668
695
  */
669
- declare function generateVaultKey(): Uint8Array;
696
+ declare function generateVaultKey(): Uint8Array<ArrayBuffer>;
670
697
  /**
671
698
  * Encrypts a string (like vault name) with a password-derived key
672
699
  * Returns: { encryptedData, nonce } as Base64 strings
@@ -720,7 +747,74 @@ declare function unwrapKey(wrappedKey: Uint8Array, wrappingKey: Uint8Array): Pro
720
747
  */
721
748
  declare function decryptCrdtData<T = object>(encryptedData: string, nonce: string, vaultKey: Uint8Array): Promise<T>;
722
749
  declare function arrayBufferToBase64(buffer: ArrayBuffer | Uint8Array): string;
723
- declare function base64ToArrayBuffer(base64: string): Uint8Array;
750
+ declare function base64ToArrayBuffer(base64: string): Uint8Array<ArrayBuffer>;
751
+
752
+ declare const SIGNING_ALGO: {
753
+ name: string;
754
+ namedCurve: string;
755
+ };
756
+ declare const KEY_AGREEMENT_ALGO: {
757
+ name: string;
758
+ namedCurve: string;
759
+ };
760
+ interface UserKeypair {
761
+ publicKey: CryptoKey;
762
+ privateKey: CryptoKey;
763
+ }
764
+ interface ExportedUserKeypair {
765
+ publicKey: string;
766
+ privateKey: string;
767
+ }
768
+ declare function generateUserKeypairAsync(): Promise<UserKeypair>;
769
+ declare function exportUserKeypairAsync(keypair: UserKeypair): Promise<ExportedUserKeypair>;
770
+ declare function importUserPublicKeyAsync(base64: string): Promise<CryptoKey>;
771
+ declare function importUserPrivateKeyAsync(base64: string): Promise<CryptoKey>;
772
+ declare function importPublicKeyForKeyAgreementAsync(base64: string): Promise<CryptoKey>;
773
+ declare function importPrivateKeyForKeyAgreementAsync(base64: string): Promise<CryptoKey>;
774
+ declare function encryptPrivateKeyAsync(privateKeyBase64: string, password: string): Promise<{
775
+ encryptedPrivateKey: string;
776
+ nonce: string;
777
+ salt: string;
778
+ }>;
779
+ declare function decryptPrivateKeyAsync(encryptedPrivateKey: string, nonce: string, salt: string, password: string): Promise<string>;
780
+
781
+ interface EncryptedSpaceKey {
782
+ encryptedSpaceKey: string;
783
+ keyNonce: string;
784
+ ephemeralPublicKey: string;
785
+ }
786
+ declare function generateSpaceKey(): Uint8Array<ArrayBuffer>;
787
+ declare function encryptSpaceKeyForRecipientAsync(spaceKey: Uint8Array<ArrayBuffer>, recipientPublicKeyBase64: string): Promise<EncryptedSpaceKey>;
788
+ declare function decryptSpaceKeyAsync(encrypted: EncryptedSpaceKey, ownPrivateKeyBase64: string): Promise<Uint8Array>;
789
+
790
+ interface SignableRecord {
791
+ tableName: string;
792
+ rowPks: string;
793
+ columnName: string | null;
794
+ encryptedValue: string | null;
795
+ hlcTimestamp: string;
796
+ }
797
+ declare function signRecordAsync(record: SignableRecord, privateKeyBase64: string): Promise<string>;
798
+ declare function verifyRecordSignatureAsync(record: SignableRecord, signatureBase64: string, publicKeyBase64: string): Promise<boolean>;
799
+ /**
800
+ * Sign a space challenge to prove private key possession.
801
+ * Generates a fresh timestamp internally to prevent misuse.
802
+ *
803
+ * @returns signature (Base64) + timestamp (ISO 8601) to send as
804
+ * X-Space-Signature / X-Space-Timestamp headers.
805
+ */
806
+ declare function signSpaceChallengeAsync(spaceId: string, privateKeyBase64: string): Promise<{
807
+ signature: string;
808
+ timestamp: string;
809
+ }>;
810
+ /**
811
+ * Verify a space challenge signature (server-side).
812
+ * Checks both cryptographic validity and timestamp freshness (max 30s).
813
+ */
814
+ declare function verifySpaceChallengeAsync(spaceId: string, timestamp: string, signatureBase64: string, publicKeyBase64: string): Promise<{
815
+ valid: boolean;
816
+ error?: string;
817
+ }>;
724
818
 
725
819
  /**
726
820
  * Crypto utilities for WebAuthn/Passkey operations
@@ -796,4 +890,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
796
890
 
797
891
  declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
798
892
 
799
- export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type ExportedPasskeyKeyPair, ExtensionManifest, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, type HaexspaceMessageType, type PasskeyKeyPair, 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 VerifyResult, type ZipFileEntry, arrayBufferToBase64, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptString, decryptVaultKey, decryptVaultName, deriveKeyFromPassword, encryptCrdtData, encryptString, encryptVaultKey, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, generateCredentialId, generatePasskeyPairAsync, generateVaultKey, hexToBytes, importPrivateKeyAsync, importPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, signWithPasskeyAsync, sortObjectKeysRecursively, unwrapKey, verifyExtensionSignature, verifyWithPasskeyAsync, wrapKey };
893
+ 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, type SignableRecord, 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, decryptSpaceKeyAsync, decryptString, decryptVaultKey, decryptVaultName, deriveKeyFromPassword, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceKeyForRecipientAsync, encryptString, encryptVaultKey, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, hexToBytes, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, sortObjectKeysRecursively, unwrapKey, verifyExtensionSignature, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultSdk } from './client-0DvgO2Jf.js';
2
- export { D as DatabaseAPI, a as Device, b as DeviceInfo, c as DeviceType, d as DirEntry, F as FileStat, e as FilesystemAPI, L as LOCALSEND_EVENTS, f as LocalSendAPI, g as LocalSendEvent, h as LocalSendFileInfo, i as LocalSendSettings, P as PendingTransfer, j as PermissionsAPI, A as RemoteAddBackendRequest, k as RemoteS3Config, l as RemoteS3PublicConfig, R as RemoteStorageAPI, m as RemoteStorageBackendInfo, n as RemoteStorageObjectInfo, U as RemoteUpdateBackendRequest, o as SelectFileOptions, p as SelectFolderOptions, q as ServerInfo, r as ServerStatus, T as TransferDirection, s as TransferProgress, t as TransferState, W as WebAPI } from './client-0DvgO2Jf.js';
3
- import { E as ExtensionManifest, H as HaexHubConfig } from './types-CORIMooS.js';
4
- export { A as ApplicationContext, h as AuthorizedClient, B as BlockedClient, C as ContextChangedEvent, i as DEFAULT_TIMEOUT, j as DatabaseColumnInfo, k as DatabaseExecuteParams, l as DatabasePermission, d as DatabasePermissionRequest, m as DatabaseQueryParams, D as DatabaseQueryResult, n as DatabaseTableInfo, o as EXTERNAL_EVENTS, p as ErrorCode, g as EventCallback, a as ExtensionInfo, q as ExtensionRuntimeMode, r as ExternalAuthDecision, s as ExternalConnection, t as ExternalConnectionErrorCode, u as ExternalConnectionState, v as ExternalEvent, w as ExternalRequest, x as ExternalRequestEvent, e as ExternalRequestHandler, y as ExternalRequestPayload, f as ExternalResponse, F as FileChangeEvent, z as FileChangePayload, G as FileChangeType, I as FilteredSyncTablesResult, J as HAEXTENSION_EVENTS, K as HaexHubEvent, L as HaexHubRequest, N as HaexHubResponse, O as HaexVaultSdkError, Q as HaextensionEvent, R as PendingAuthorization, T as PermissionDeniedError, U as PermissionErrorBase, V as PermissionErrorCode, X as PermissionPromptError, P as PermissionResponse, Y as PermissionStatus, Z as RequestedExtension, _ as SearchQuery, $ as SearchRequestEvent, S as SearchResult, a0 as SessionAuthorization, a1 as SyncTablesUpdatedEvent, a2 as TABLE_SEPARATOR, W as WebRequestOptions, c as WebResponse, a3 as canExternalClientSendRequests, a4 as getTableName, a5 as isExternalClientConnected, a6 as isPermissionDeniedError, a7 as isPermissionError, a8 as isPermissionPromptError } from './types-CORIMooS.js';
1
+ import { H as HaexVaultSdk } from './client-_FhZZse3.js';
2
+ export { D as DatabaseAPI, a as Device, b as DeviceInfo, c as DeviceType, d as DirEntry, F as FileStat, e as FilesystemAPI, L as LOCALSEND_EVENTS, f as LocalSendAPI, g as LocalSendEvent, h as LocalSendFileInfo, i as LocalSendSettings, P as PendingTransfer, j as PermissionsAPI, A as RemoteAddBackendRequest, k as RemoteS3Config, l as RemoteS3PublicConfig, R as RemoteStorageAPI, m as RemoteStorageBackendInfo, n as RemoteStorageObjectInfo, U as RemoteUpdateBackendRequest, o as SelectFileOptions, p as SelectFolderOptions, q as ServerInfo, r as ServerStatus, T as TransferDirection, s as TransferProgress, t as TransferState, W as WebAPI } from './client-_FhZZse3.js';
3
+ import { h as SpaceRole, E as ExtensionManifest, H as HaexHubConfig } from './types-NWYbdRXr.js';
4
+ export { A as ApplicationContext, i as AuthorizedClient, B as BlockedClient, C as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, d as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, p as EXTERNAL_EVENTS, q as ErrorCode, g as EventCallback, a as ExtensionInfo, r as ExtensionRuntimeMode, s as ExternalAuthDecision, t as ExternalConnection, u as ExternalConnectionErrorCode, v as ExternalConnectionState, w as ExternalEvent, x as ExternalRequest, y as ExternalRequestEvent, e as ExternalRequestHandler, z as ExternalRequestPayload, f as ExternalResponse, F as FileChangeEvent, G as FileChangePayload, I as FileChangeType, J as FilteredSyncTablesResult, K as HAEXTENSION_EVENTS, L as HaexHubEvent, N as HaexHubRequest, O as HaexHubResponse, Q as HaexVaultSdkError, R as HaextensionEvent, T as PendingAuthorization, U as PermissionDeniedError, V as PermissionErrorBase, X as PermissionErrorCode, Y as PermissionPromptError, P as PermissionResponse, Z as PermissionStatus, _ as RequestedExtension, $ as SearchQuery, a0 as SearchRequestEvent, S as SearchResult, a1 as SessionAuthorization, a2 as SharedSpace, a3 as SpaceAccessTokenInfo, a4 as SpaceInvite, a5 as SpaceKeyGrantInfo, a6 as SpaceMemberInfo, a7 as SyncTablesUpdatedEvent, a8 as TABLE_SEPARATOR, W as WebRequestOptions, c as WebResponse, a9 as canExternalClientSendRequests, aa as getTableName, ab as isExternalClientConnected, ac as isPermissionDeniedError, ad as isPermissionError, ae as isPermissionPromptError } from './types-NWYbdRXr.js';
5
5
  export { H as HaextensionConfig } from './config-D_HXjsEV.js';
6
6
  import 'drizzle-orm/sqlite-proxy';
7
7
 
@@ -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
  *
@@ -187,6 +188,32 @@ interface ErrorResponse {
187
188
  /** Error message */
188
189
  error: string;
189
190
  }
191
+ interface CreateSpaceRequest {
192
+ id: string;
193
+ encryptedName: string;
194
+ nameNonce: string;
195
+ keyGrant: {
196
+ encryptedSpaceKey: string;
197
+ keyNonce: string;
198
+ ephemeralPublicKey: string;
199
+ };
200
+ }
201
+ interface InviteMemberRequest {
202
+ userId: string;
203
+ role: SpaceRole;
204
+ keyGrant: {
205
+ encryptedSpaceKey: string;
206
+ keyNonce: string;
207
+ ephemeralPublicKey: string;
208
+ generation: number;
209
+ };
210
+ }
211
+ interface RegisterKeypairRequest {
212
+ publicKey: string;
213
+ encryptedPrivateKey: string;
214
+ privateKeyNonce: string;
215
+ privateKeySalt: string;
216
+ }
190
217
 
191
218
  /**
192
219
  * Central message type definitions for HaexSpace SDK
@@ -666,7 +693,7 @@ declare function deriveKeyFromPassword(password: string, salt: Uint8Array): Prom
666
693
  /**
667
694
  * Generates a random vault key (32 bytes)
668
695
  */
669
- declare function generateVaultKey(): Uint8Array;
696
+ declare function generateVaultKey(): Uint8Array<ArrayBuffer>;
670
697
  /**
671
698
  * Encrypts a string (like vault name) with a password-derived key
672
699
  * Returns: { encryptedData, nonce } as Base64 strings
@@ -720,7 +747,74 @@ declare function unwrapKey(wrappedKey: Uint8Array, wrappingKey: Uint8Array): Pro
720
747
  */
721
748
  declare function decryptCrdtData<T = object>(encryptedData: string, nonce: string, vaultKey: Uint8Array): Promise<T>;
722
749
  declare function arrayBufferToBase64(buffer: ArrayBuffer | Uint8Array): string;
723
- declare function base64ToArrayBuffer(base64: string): Uint8Array;
750
+ declare function base64ToArrayBuffer(base64: string): Uint8Array<ArrayBuffer>;
751
+
752
+ declare const SIGNING_ALGO: {
753
+ name: string;
754
+ namedCurve: string;
755
+ };
756
+ declare const KEY_AGREEMENT_ALGO: {
757
+ name: string;
758
+ namedCurve: string;
759
+ };
760
+ interface UserKeypair {
761
+ publicKey: CryptoKey;
762
+ privateKey: CryptoKey;
763
+ }
764
+ interface ExportedUserKeypair {
765
+ publicKey: string;
766
+ privateKey: string;
767
+ }
768
+ declare function generateUserKeypairAsync(): Promise<UserKeypair>;
769
+ declare function exportUserKeypairAsync(keypair: UserKeypair): Promise<ExportedUserKeypair>;
770
+ declare function importUserPublicKeyAsync(base64: string): Promise<CryptoKey>;
771
+ declare function importUserPrivateKeyAsync(base64: string): Promise<CryptoKey>;
772
+ declare function importPublicKeyForKeyAgreementAsync(base64: string): Promise<CryptoKey>;
773
+ declare function importPrivateKeyForKeyAgreementAsync(base64: string): Promise<CryptoKey>;
774
+ declare function encryptPrivateKeyAsync(privateKeyBase64: string, password: string): Promise<{
775
+ encryptedPrivateKey: string;
776
+ nonce: string;
777
+ salt: string;
778
+ }>;
779
+ declare function decryptPrivateKeyAsync(encryptedPrivateKey: string, nonce: string, salt: string, password: string): Promise<string>;
780
+
781
+ interface EncryptedSpaceKey {
782
+ encryptedSpaceKey: string;
783
+ keyNonce: string;
784
+ ephemeralPublicKey: string;
785
+ }
786
+ declare function generateSpaceKey(): Uint8Array<ArrayBuffer>;
787
+ declare function encryptSpaceKeyForRecipientAsync(spaceKey: Uint8Array<ArrayBuffer>, recipientPublicKeyBase64: string): Promise<EncryptedSpaceKey>;
788
+ declare function decryptSpaceKeyAsync(encrypted: EncryptedSpaceKey, ownPrivateKeyBase64: string): Promise<Uint8Array>;
789
+
790
+ interface SignableRecord {
791
+ tableName: string;
792
+ rowPks: string;
793
+ columnName: string | null;
794
+ encryptedValue: string | null;
795
+ hlcTimestamp: string;
796
+ }
797
+ declare function signRecordAsync(record: SignableRecord, privateKeyBase64: string): Promise<string>;
798
+ declare function verifyRecordSignatureAsync(record: SignableRecord, signatureBase64: string, publicKeyBase64: string): Promise<boolean>;
799
+ /**
800
+ * Sign a space challenge to prove private key possession.
801
+ * Generates a fresh timestamp internally to prevent misuse.
802
+ *
803
+ * @returns signature (Base64) + timestamp (ISO 8601) to send as
804
+ * X-Space-Signature / X-Space-Timestamp headers.
805
+ */
806
+ declare function signSpaceChallengeAsync(spaceId: string, privateKeyBase64: string): Promise<{
807
+ signature: string;
808
+ timestamp: string;
809
+ }>;
810
+ /**
811
+ * Verify a space challenge signature (server-side).
812
+ * Checks both cryptographic validity and timestamp freshness (max 30s).
813
+ */
814
+ declare function verifySpaceChallengeAsync(spaceId: string, timestamp: string, signatureBase64: string, publicKeyBase64: string): Promise<{
815
+ valid: boolean;
816
+ error?: string;
817
+ }>;
724
818
 
725
819
  /**
726
820
  * Crypto utilities for WebAuthn/Passkey operations
@@ -796,4 +890,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
796
890
 
797
891
  declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
798
892
 
799
- export { type AuthUser, COSE_ALGORITHM, type CoseAlgorithm, type ExportedPasskeyKeyPair, ExtensionManifest, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, type HaexspaceMessageType, type PasskeyKeyPair, 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 VerifyResult, type ZipFileEntry, arrayBufferToBase64, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptString, decryptVaultKey, decryptVaultName, deriveKeyFromPassword, encryptCrdtData, encryptString, encryptVaultKey, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, generateCredentialId, generatePasskeyPairAsync, generateVaultKey, hexToBytes, importPrivateKeyAsync, importPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, signWithPasskeyAsync, sortObjectKeysRecursively, unwrapKey, verifyExtensionSignature, verifyWithPasskeyAsync, wrapKey };
893
+ 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, type SignableRecord, 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, decryptSpaceKeyAsync, decryptString, decryptVaultKey, decryptVaultName, deriveKeyFromPassword, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceKeyForRecipientAsync, encryptString, encryptVaultKey, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, hexToBytes, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, sortObjectKeysRecursively, unwrapKey, verifyExtensionSignature, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
package/dist/index.js CHANGED
@@ -2744,6 +2744,184 @@ async function verifyExtensionSignature(files, manifest) {
2744
2744
  }
2745
2745
  }
2746
2746
 
2747
+ // src/crypto/userKeypair.ts
2748
+ var SIGNING_ALGO = { name: "ECDSA", namedCurve: "P-256" };
2749
+ var KEY_AGREEMENT_ALGO = { name: "ECDH", namedCurve: "P-256" };
2750
+ async function generateUserKeypairAsync() {
2751
+ const keypair = await crypto.subtle.generateKey(SIGNING_ALGO, true, ["sign", "verify"]);
2752
+ return { publicKey: keypair.publicKey, privateKey: keypair.privateKey };
2753
+ }
2754
+ async function exportUserKeypairAsync(keypair) {
2755
+ const pub = await crypto.subtle.exportKey("spki", keypair.publicKey);
2756
+ const priv = await crypto.subtle.exportKey("pkcs8", keypair.privateKey);
2757
+ return { publicKey: arrayBufferToBase64(pub), privateKey: arrayBufferToBase64(priv) };
2758
+ }
2759
+ async function importUserPublicKeyAsync(base64) {
2760
+ return crypto.subtle.importKey("spki", base64ToArrayBuffer(base64), SIGNING_ALGO, true, ["verify"]);
2761
+ }
2762
+ async function importUserPrivateKeyAsync(base64) {
2763
+ return crypto.subtle.importKey("pkcs8", base64ToArrayBuffer(base64), SIGNING_ALGO, true, ["sign"]);
2764
+ }
2765
+ async function importPublicKeyForKeyAgreementAsync(base64) {
2766
+ return crypto.subtle.importKey("spki", base64ToArrayBuffer(base64), KEY_AGREEMENT_ALGO, true, []);
2767
+ }
2768
+ async function importPrivateKeyForKeyAgreementAsync(base64) {
2769
+ return crypto.subtle.importKey("pkcs8", base64ToArrayBuffer(base64), KEY_AGREEMENT_ALGO, true, ["deriveBits"]);
2770
+ }
2771
+ async function encryptPrivateKeyAsync(privateKeyBase64, password) {
2772
+ const salt = crypto.getRandomValues(new Uint8Array(32));
2773
+ const derivedKey = await deriveKeyFromPassword(password, salt);
2774
+ const nonce = crypto.getRandomValues(new Uint8Array(12));
2775
+ const encrypted = await crypto.subtle.encrypt(
2776
+ { name: "AES-GCM", iv: nonce },
2777
+ derivedKey,
2778
+ new TextEncoder().encode(privateKeyBase64)
2779
+ );
2780
+ return {
2781
+ encryptedPrivateKey: arrayBufferToBase64(encrypted),
2782
+ nonce: arrayBufferToBase64(nonce),
2783
+ salt: arrayBufferToBase64(salt)
2784
+ };
2785
+ }
2786
+ async function decryptPrivateKeyAsync(encryptedPrivateKey, nonce, salt, password) {
2787
+ const derivedKey = await deriveKeyFromPassword(password, base64ToArrayBuffer(salt));
2788
+ const decrypted = await crypto.subtle.decrypt(
2789
+ { name: "AES-GCM", iv: base64ToArrayBuffer(nonce) },
2790
+ derivedKey,
2791
+ base64ToArrayBuffer(encryptedPrivateKey)
2792
+ );
2793
+ return new TextDecoder().decode(decrypted);
2794
+ }
2795
+
2796
+ // src/crypto/spaceKey.ts
2797
+ function generateSpaceKey() {
2798
+ return generateVaultKey();
2799
+ }
2800
+ async function encryptSpaceKeyForRecipientAsync(spaceKey, recipientPublicKeyBase64) {
2801
+ const ephemeral = await crypto.subtle.generateKey(KEY_AGREEMENT_ALGO, true, ["deriveBits"]);
2802
+ const recipientKey = await importPublicKeyForKeyAgreementAsync(recipientPublicKeyBase64);
2803
+ const sharedBits = await crypto.subtle.deriveBits(
2804
+ { name: "ECDH", public: recipientKey },
2805
+ ephemeral.privateKey,
2806
+ 256
2807
+ );
2808
+ const aesKey = await crypto.subtle.deriveKey(
2809
+ {
2810
+ name: "HKDF",
2811
+ hash: "SHA-256",
2812
+ salt: new Uint8Array(0),
2813
+ info: new TextEncoder().encode("haex-space-key")
2814
+ },
2815
+ await crypto.subtle.importKey("raw", sharedBits, "HKDF", false, ["deriveKey"]),
2816
+ { name: "AES-GCM", length: 256 },
2817
+ false,
2818
+ ["encrypt"]
2819
+ );
2820
+ const nonce = crypto.getRandomValues(new Uint8Array(12));
2821
+ const encrypted = await crypto.subtle.encrypt({ name: "AES-GCM", iv: nonce }, aesKey, spaceKey);
2822
+ const ephPub = await crypto.subtle.exportKey("spki", ephemeral.publicKey);
2823
+ return {
2824
+ encryptedSpaceKey: arrayBufferToBase64(encrypted),
2825
+ keyNonce: arrayBufferToBase64(nonce),
2826
+ ephemeralPublicKey: arrayBufferToBase64(ephPub)
2827
+ };
2828
+ }
2829
+ async function decryptSpaceKeyAsync(encrypted, ownPrivateKeyBase64) {
2830
+ const ephPubKey = await crypto.subtle.importKey(
2831
+ "spki",
2832
+ base64ToArrayBuffer(encrypted.ephemeralPublicKey),
2833
+ KEY_AGREEMENT_ALGO,
2834
+ true,
2835
+ []
2836
+ );
2837
+ const ownPrivKey = await importPrivateKeyForKeyAgreementAsync(ownPrivateKeyBase64);
2838
+ const sharedBits = await crypto.subtle.deriveBits(
2839
+ { name: "ECDH", public: ephPubKey },
2840
+ ownPrivKey,
2841
+ 256
2842
+ );
2843
+ const aesKey = await crypto.subtle.deriveKey(
2844
+ {
2845
+ name: "HKDF",
2846
+ hash: "SHA-256",
2847
+ salt: new Uint8Array(0),
2848
+ info: new TextEncoder().encode("haex-space-key")
2849
+ },
2850
+ await crypto.subtle.importKey("raw", sharedBits, "HKDF", false, ["deriveKey"]),
2851
+ { name: "AES-GCM", length: 256 },
2852
+ false,
2853
+ ["decrypt"]
2854
+ );
2855
+ const decrypted = await crypto.subtle.decrypt(
2856
+ { name: "AES-GCM", iv: base64ToArrayBuffer(encrypted.keyNonce) },
2857
+ aesKey,
2858
+ base64ToArrayBuffer(encrypted.encryptedSpaceKey)
2859
+ );
2860
+ return new Uint8Array(decrypted);
2861
+ }
2862
+
2863
+ // src/crypto/recordSigning.ts
2864
+ function canonicalize(record) {
2865
+ const parts = [
2866
+ record.tableName,
2867
+ record.rowPks,
2868
+ record.columnName === null ? "NULL" : record.columnName,
2869
+ record.encryptedValue === null ? "NULL" : record.encryptedValue,
2870
+ record.hlcTimestamp
2871
+ ].join("\0");
2872
+ return new TextEncoder().encode(parts);
2873
+ }
2874
+ async function signRecordAsync(record, privateKeyBase64) {
2875
+ const key = await importUserPrivateKeyAsync(privateKeyBase64);
2876
+ const sig = await crypto.subtle.sign({ name: "ECDSA", hash: "SHA-256" }, key, canonicalize(record));
2877
+ return arrayBufferToBase64(sig);
2878
+ }
2879
+ async function verifyRecordSignatureAsync(record, signatureBase64, publicKeyBase64) {
2880
+ const key = await importUserPublicKeyAsync(publicKeyBase64);
2881
+ return crypto.subtle.verify(
2882
+ { name: "ECDSA", hash: "SHA-256" },
2883
+ key,
2884
+ base64ToArrayBuffer(signatureBase64),
2885
+ canonicalize(record)
2886
+ );
2887
+ }
2888
+ var CHALLENGE_MAX_AGE_MS = 3e4;
2889
+ function canonicalizeChallenge(spaceId, timestamp) {
2890
+ return new TextEncoder().encode(`${spaceId}\0${timestamp}`).buffer;
2891
+ }
2892
+ async function signSpaceChallengeAsync(spaceId, privateKeyBase64) {
2893
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString();
2894
+ const key = await importUserPrivateKeyAsync(privateKeyBase64);
2895
+ const sig = await crypto.subtle.sign(
2896
+ { name: "ECDSA", hash: "SHA-256" },
2897
+ key,
2898
+ canonicalizeChallenge(spaceId, timestamp)
2899
+ );
2900
+ return { signature: arrayBufferToBase64(sig), timestamp };
2901
+ }
2902
+ async function verifySpaceChallengeAsync(spaceId, timestamp, signatureBase64, publicKeyBase64) {
2903
+ const tsMs = new Date(timestamp).getTime();
2904
+ if (Number.isNaN(tsMs)) {
2905
+ return { valid: false, error: "Invalid timestamp format" };
2906
+ }
2907
+ const age = Date.now() - tsMs;
2908
+ if (age < 0 || age > CHALLENGE_MAX_AGE_MS) {
2909
+ return { valid: false, error: "Challenge timestamp expired or in the future" };
2910
+ }
2911
+ try {
2912
+ const key = await importUserPublicKeyAsync(publicKeyBase64);
2913
+ const isValid = await crypto.subtle.verify(
2914
+ { name: "ECDSA", hash: "SHA-256" },
2915
+ key,
2916
+ base64ToArrayBuffer(signatureBase64),
2917
+ canonicalizeChallenge(spaceId, timestamp)
2918
+ );
2919
+ return isValid ? { valid: true } : { valid: false, error: "Invalid challenge signature" };
2920
+ } catch {
2921
+ return { valid: false, error: "Challenge verification failed" };
2922
+ }
2923
+ }
2924
+
2747
2925
  // src/crypto/passkey.ts
2748
2926
  function toArrayBuffer(data) {
2749
2927
  if (data instanceof ArrayBuffer) {
@@ -2926,12 +3104,14 @@ exports.HAEXSPACE_MESSAGE_TYPES = HAEXSPACE_MESSAGE_TYPES;
2926
3104
  exports.HAEXTENSION_EVENTS = HAEXTENSION_EVENTS;
2927
3105
  exports.HaexVaultSdk = HaexVaultSdk;
2928
3106
  exports.HaexVaultSdkError = HaexVaultSdkError;
3107
+ exports.KEY_AGREEMENT_ALGO = KEY_AGREEMENT_ALGO;
2929
3108
  exports.LOCALSEND_EVENTS = LOCALSEND_EVENTS;
2930
3109
  exports.LocalSendAPI = LocalSendAPI;
2931
3110
  exports.PermissionErrorCode = PermissionErrorCode;
2932
3111
  exports.PermissionStatus = PermissionStatus;
2933
3112
  exports.PermissionsAPI = PermissionsAPI;
2934
3113
  exports.RemoteStorageAPI = RemoteStorageAPI;
3114
+ exports.SIGNING_ALGO = SIGNING_ALGO;
2935
3115
  exports.TABLE_SEPARATOR = TABLE_SEPARATOR;
2936
3116
  exports.TAURI_COMMANDS = TAURI_COMMANDS;
2937
3117
  exports.WebAPI = WebAPI;
@@ -2940,24 +3120,35 @@ exports.base64ToArrayBuffer = base64ToArrayBuffer;
2940
3120
  exports.canExternalClientSendRequests = canExternalClientSendRequests;
2941
3121
  exports.createHaexVaultSdk = createHaexVaultSdk;
2942
3122
  exports.decryptCrdtData = decryptCrdtData;
3123
+ exports.decryptPrivateKeyAsync = decryptPrivateKeyAsync;
3124
+ exports.decryptSpaceKeyAsync = decryptSpaceKeyAsync;
2943
3125
  exports.decryptString = decryptString;
2944
3126
  exports.decryptVaultKey = decryptVaultKey;
2945
3127
  exports.decryptVaultName = decryptVaultName;
2946
3128
  exports.deriveKeyFromPassword = deriveKeyFromPassword;
2947
3129
  exports.encryptCrdtData = encryptCrdtData;
3130
+ exports.encryptPrivateKeyAsync = encryptPrivateKeyAsync;
3131
+ exports.encryptSpaceKeyForRecipientAsync = encryptSpaceKeyForRecipientAsync;
2948
3132
  exports.encryptString = encryptString;
2949
3133
  exports.encryptVaultKey = encryptVaultKey;
2950
3134
  exports.exportKeyPairAsync = exportKeyPairAsync;
2951
3135
  exports.exportPrivateKeyAsync = exportPrivateKeyAsync;
2952
3136
  exports.exportPublicKeyAsync = exportPublicKeyAsync;
2953
3137
  exports.exportPublicKeyCoseAsync = exportPublicKeyCoseAsync;
3138
+ exports.exportUserKeypairAsync = exportUserKeypairAsync;
2954
3139
  exports.generateCredentialId = generateCredentialId;
2955
3140
  exports.generatePasskeyPairAsync = generatePasskeyPairAsync;
3141
+ exports.generateSpaceKey = generateSpaceKey;
3142
+ exports.generateUserKeypairAsync = generateUserKeypairAsync;
2956
3143
  exports.generateVaultKey = generateVaultKey;
2957
3144
  exports.getTableName = getTableName;
2958
3145
  exports.hexToBytes = hexToBytes;
2959
3146
  exports.importPrivateKeyAsync = importPrivateKeyAsync;
3147
+ exports.importPrivateKeyForKeyAgreementAsync = importPrivateKeyForKeyAgreementAsync;
2960
3148
  exports.importPublicKeyAsync = importPublicKeyAsync;
3149
+ exports.importPublicKeyForKeyAgreementAsync = importPublicKeyForKeyAgreementAsync;
3150
+ exports.importUserPrivateKeyAsync = importUserPrivateKeyAsync;
3151
+ exports.importUserPublicKeyAsync = importUserPublicKeyAsync;
2961
3152
  exports.installBaseTag = installBaseTag;
2962
3153
  exports.installCookiePolyfill = installCookiePolyfill;
2963
3154
  exports.installHistoryPolyfill = installHistoryPolyfill;
@@ -2968,10 +3159,14 @@ exports.isExternalClientConnected = isExternalClientConnected;
2968
3159
  exports.isPermissionDeniedError = isPermissionDeniedError;
2969
3160
  exports.isPermissionError = isPermissionError;
2970
3161
  exports.isPermissionPromptError = isPermissionPromptError;
3162
+ exports.signRecordAsync = signRecordAsync;
3163
+ exports.signSpaceChallengeAsync = signSpaceChallengeAsync;
2971
3164
  exports.signWithPasskeyAsync = signWithPasskeyAsync;
2972
3165
  exports.sortObjectKeysRecursively = sortObjectKeysRecursively;
2973
3166
  exports.unwrapKey = unwrapKey;
2974
3167
  exports.verifyExtensionSignature = verifyExtensionSignature;
3168
+ exports.verifyRecordSignatureAsync = verifyRecordSignatureAsync;
3169
+ exports.verifySpaceChallengeAsync = verifySpaceChallengeAsync;
2975
3170
  exports.verifyWithPasskeyAsync = verifyWithPasskeyAsync;
2976
3171
  exports.wrapKey = wrapKey;
2977
3172
  //# sourceMappingURL=index.js.map