@haex-space/vault-sdk 2.5.118 → 2.5.120
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/dist/{client-CA59HZfa.d.ts → client-CrXV__Zx.d.mts} +3 -6
- package/dist/{client-DSvkG_lC.d.mts → client-DzQv-YCD.d.ts} +3 -6
- package/dist/index.d.mts +20 -7
- package/dist/index.d.ts +20 -7
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -1
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +3 -0
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +3 -0
- 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.map +1 -1
- 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 +3 -0
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +3 -0
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-neLTvZJ_.d.mts → types-TFcm6hpl.d.mts} +19 -1
- package/dist/{types-neLTvZJ_.d.ts → types-TFcm6hpl.d.ts} +19 -1
- package/dist/vue.d.mts +2 -2
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +3 -0
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +3 -0
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as HaexHubEvent, c as EXTERNAL_EVENTS, D as DatabaseQueryResult, M as Migration, d as MigrationResult, W as WebRequestOptions, e as WebResponse, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, f as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, g as EventCallback } from './types-
|
|
1
|
+
import { b as HaexHubEvent, c as EXTERNAL_EVENTS, D as DatabaseQueryResult, M as Migration, d as MigrationResult, W as WebRequestOptions, e as WebResponse, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, f as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, g as EventCallback } from './types-TFcm6hpl.mjs';
|
|
2
2
|
import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -939,7 +939,7 @@ declare class LocalSendAPI {
|
|
|
939
939
|
cancelSend(sessionId: string): Promise<void>;
|
|
940
940
|
}
|
|
941
941
|
|
|
942
|
-
type SpaceRole = 'admin' | 'member' | '
|
|
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
|
|
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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as HaexHubEvent, c as EXTERNAL_EVENTS, D as DatabaseQueryResult, M as Migration, d as MigrationResult, W as WebRequestOptions, e as WebResponse, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, f as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, g as EventCallback } from './types-
|
|
1
|
+
import { b as HaexHubEvent, c as EXTERNAL_EVENTS, D as DatabaseQueryResult, M as Migration, d as MigrationResult, W as WebRequestOptions, e as WebResponse, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, f as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, g as EventCallback } from './types-TFcm6hpl.js';
|
|
2
2
|
import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -939,7 +939,7 @@ declare class LocalSendAPI {
|
|
|
939
939
|
cancelSend(sessionId: string): Promise<void>;
|
|
940
940
|
}
|
|
941
941
|
|
|
942
|
-
type SpaceRole = 'admin' | 'member' | '
|
|
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
|
|
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,7 +1,7 @@
|
|
|
1
|
-
import { H as HaexVaultSdk } from './client-
|
|
2
|
-
export { A as AuthorizedClient, B as BlockedClient, D as DatabaseAPI,
|
|
3
|
-
import { E as ExtensionManifest, H as HaexHubConfig } from './types-
|
|
4
|
-
export { A as ApplicationContext, C as ContextChangedEvent,
|
|
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
|
+
import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-TFcm6hpl.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, 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';
|
|
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
|
*
|
|
@@ -201,8 +202,7 @@ interface CreateSpaceRequest {
|
|
|
201
202
|
interface InviteMemberRequest {
|
|
202
203
|
publicKey: string;
|
|
203
204
|
label: string;
|
|
204
|
-
role:
|
|
205
|
-
canInvite?: boolean;
|
|
205
|
+
role: SpaceRole;
|
|
206
206
|
keyGrant: {
|
|
207
207
|
encryptedSpaceKey: string;
|
|
208
208
|
keyNonce: string;
|
|
@@ -860,6 +860,19 @@ declare function encryptSpaceNameAsync(spaceKey: Uint8Array, spaceName: string):
|
|
|
860
860
|
*/
|
|
861
861
|
declare function decryptSpaceNameAsync(spaceKey: Uint8Array, encryptedName: string, nameNonce: string): Promise<string>;
|
|
862
862
|
|
|
863
|
+
/**
|
|
864
|
+
* Creates a signed claim presentation for selective disclosure.
|
|
865
|
+
* The server can verify that the claims come from the identity holder.
|
|
866
|
+
*
|
|
867
|
+
* Canonical form for signing: did\0timestamp\0type1=value1\0type2=value2\0...
|
|
868
|
+
* (claims sorted alphabetically by type)
|
|
869
|
+
*/
|
|
870
|
+
declare function signClaimPresentationAsync(did: string, publicKeyBase64: string, claims: Record<string, string>, privateKeyBase64: string): Promise<SignedClaimPresentation>;
|
|
871
|
+
/**
|
|
872
|
+
* Verifies a signed claim presentation.
|
|
873
|
+
*/
|
|
874
|
+
declare function verifyClaimPresentationAsync(presentation: SignedClaimPresentation): Promise<boolean>;
|
|
875
|
+
|
|
863
876
|
interface SignableRecord {
|
|
864
877
|
tableName: string;
|
|
865
878
|
rowPks: string;
|
|
@@ -963,4 +976,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
|
|
|
963
976
|
|
|
964
977
|
declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
|
|
965
978
|
|
|
966
|
-
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, 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, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, sortObjectKeysRecursively, unwrapKey, verifyExtensionSignature, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|
|
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, 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, 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 };
|
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, D as DatabaseAPI,
|
|
3
|
-
import { E as ExtensionManifest, H as HaexHubConfig } from './types-
|
|
4
|
-
export { A as ApplicationContext, C as ContextChangedEvent,
|
|
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
|
+
import { E as ExtensionManifest, h as SignedClaimPresentation, H as HaexHubConfig } from './types-TFcm6hpl.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, 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';
|
|
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
|
*
|
|
@@ -201,8 +202,7 @@ interface CreateSpaceRequest {
|
|
|
201
202
|
interface InviteMemberRequest {
|
|
202
203
|
publicKey: string;
|
|
203
204
|
label: string;
|
|
204
|
-
role:
|
|
205
|
-
canInvite?: boolean;
|
|
205
|
+
role: SpaceRole;
|
|
206
206
|
keyGrant: {
|
|
207
207
|
encryptedSpaceKey: string;
|
|
208
208
|
keyNonce: string;
|
|
@@ -860,6 +860,19 @@ declare function encryptSpaceNameAsync(spaceKey: Uint8Array, spaceName: string):
|
|
|
860
860
|
*/
|
|
861
861
|
declare function decryptSpaceNameAsync(spaceKey: Uint8Array, encryptedName: string, nameNonce: string): Promise<string>;
|
|
862
862
|
|
|
863
|
+
/**
|
|
864
|
+
* Creates a signed claim presentation for selective disclosure.
|
|
865
|
+
* The server can verify that the claims come from the identity holder.
|
|
866
|
+
*
|
|
867
|
+
* Canonical form for signing: did\0timestamp\0type1=value1\0type2=value2\0...
|
|
868
|
+
* (claims sorted alphabetically by type)
|
|
869
|
+
*/
|
|
870
|
+
declare function signClaimPresentationAsync(did: string, publicKeyBase64: string, claims: Record<string, string>, privateKeyBase64: string): Promise<SignedClaimPresentation>;
|
|
871
|
+
/**
|
|
872
|
+
* Verifies a signed claim presentation.
|
|
873
|
+
*/
|
|
874
|
+
declare function verifyClaimPresentationAsync(presentation: SignedClaimPresentation): Promise<boolean>;
|
|
875
|
+
|
|
863
876
|
interface SignableRecord {
|
|
864
877
|
tableName: string;
|
|
865
878
|
rowPks: string;
|
|
@@ -963,4 +976,4 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
|
|
|
963
976
|
|
|
964
977
|
declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
|
|
965
978
|
|
|
966
|
-
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, 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, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, sortObjectKeysRecursively, unwrapKey, verifyExtensionSignature, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|
|
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, 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, 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 };
|
package/dist/index.js
CHANGED
|
@@ -3183,6 +3183,42 @@ async function decryptSpaceNameAsync(spaceKey, encryptedName, nameNonce) {
|
|
|
3183
3183
|
return decryptString(encryptedName, nameNonce, cryptoKey);
|
|
3184
3184
|
}
|
|
3185
3185
|
|
|
3186
|
+
// src/crypto/claims.ts
|
|
3187
|
+
init_userKeypair();
|
|
3188
|
+
async function signClaimPresentationAsync(did, publicKeyBase64, claims, privateKeyBase64) {
|
|
3189
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
3190
|
+
const sortedEntries = Object.entries(claims).sort(([a], [b]) => a.localeCompare(b));
|
|
3191
|
+
const canonical = [did, timestamp, ...sortedEntries.map(([k, v]) => `${k}=${v}`)].join("\0");
|
|
3192
|
+
const privateKey = await importUserPrivateKeyAsync(privateKeyBase64);
|
|
3193
|
+
const data = new TextEncoder().encode(canonical);
|
|
3194
|
+
const sig = await crypto.subtle.sign(
|
|
3195
|
+
{ name: "ECDSA", hash: "SHA-256" },
|
|
3196
|
+
privateKey,
|
|
3197
|
+
data
|
|
3198
|
+
);
|
|
3199
|
+
return {
|
|
3200
|
+
did,
|
|
3201
|
+
publicKey: publicKeyBase64,
|
|
3202
|
+
claims,
|
|
3203
|
+
timestamp,
|
|
3204
|
+
signature: btoa(String.fromCharCode(...new Uint8Array(sig)))
|
|
3205
|
+
};
|
|
3206
|
+
}
|
|
3207
|
+
async function verifyClaimPresentationAsync(presentation) {
|
|
3208
|
+
const { did, publicKey, claims, timestamp, signature } = presentation;
|
|
3209
|
+
const sortedEntries = Object.entries(claims).sort(([a], [b]) => a.localeCompare(b));
|
|
3210
|
+
const canonical = [did, timestamp, ...sortedEntries.map(([k, v]) => `${k}=${v}`)].join("\0");
|
|
3211
|
+
const pubKey = await importUserPublicKeyAsync(publicKey);
|
|
3212
|
+
const data = new TextEncoder().encode(canonical);
|
|
3213
|
+
const sigBytes = Uint8Array.from(atob(signature), (c) => c.charCodeAt(0));
|
|
3214
|
+
return crypto.subtle.verify(
|
|
3215
|
+
{ name: "ECDSA", hash: "SHA-256" },
|
|
3216
|
+
pubKey,
|
|
3217
|
+
sigBytes,
|
|
3218
|
+
data
|
|
3219
|
+
);
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3186
3222
|
// src/crypto/recordSigning.ts
|
|
3187
3223
|
init_userKeypair();
|
|
3188
3224
|
init_vaultKey();
|
|
@@ -3490,11 +3526,13 @@ exports.isPermissionDeniedError = isPermissionDeniedError;
|
|
|
3490
3526
|
exports.isPermissionError = isPermissionError;
|
|
3491
3527
|
exports.isPermissionPromptError = isPermissionPromptError;
|
|
3492
3528
|
exports.publicKeyToDidKeyAsync = publicKeyToDidKeyAsync;
|
|
3529
|
+
exports.signClaimPresentationAsync = signClaimPresentationAsync;
|
|
3493
3530
|
exports.signRecordAsync = signRecordAsync;
|
|
3494
3531
|
exports.signSpaceChallengeAsync = signSpaceChallengeAsync;
|
|
3495
3532
|
exports.signWithPasskeyAsync = signWithPasskeyAsync;
|
|
3496
3533
|
exports.sortObjectKeysRecursively = sortObjectKeysRecursively;
|
|
3497
3534
|
exports.unwrapKey = unwrapKey;
|
|
3535
|
+
exports.verifyClaimPresentationAsync = verifyClaimPresentationAsync;
|
|
3498
3536
|
exports.verifyExtensionSignature = verifyExtensionSignature;
|
|
3499
3537
|
exports.verifyRecordSignatureAsync = verifyRecordSignatureAsync;
|
|
3500
3538
|
exports.verifySpaceChallengeAsync = verifySpaceChallengeAsync;
|