@haex-space/vault-sdk 4.8.1 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/dist/{client-CNbwFQjB.d.ts → client-DTxLSJrk.d.mts} +194 -4
- package/dist/{client-DOAj36ga.d.mts → client-s0eCQoWA.d.ts} +194 -4
- package/dist/index.d.mts +54 -7
- package/dist/index.d.ts +54 -7
- package/dist/index.js +215 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +211 -2
- 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 +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +209 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +209 -1
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.js +206 -1
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +206 -1
- package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
- package/dist/svelte.d.mts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/svelte.js +209 -1
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +209 -1
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-3iifP-Q1.d.mts → types-BZVkX0Wf.d.mts} +24 -2
- package/dist/{types-3iifP-Q1.d.ts → types-BZVkX0Wf.d.ts} +24 -2
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +209 -1
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +209 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { H as HaexVaultSdk } from './client-
|
|
2
|
-
export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, b as ContactDetail, c as ContactHolziAddresses, d as ContactHolziDevice, e as ContactList, f as ContactListOptions, g as ContactSummary, h as ContactValue, i as ContactsAPI, D as DatabaseAPI, j as DecryptedSpace, k as DeepLink, l as Device, m as DeviceInfo, n as DeviceType, o as DialogAPI, p as DirEntry, E as EncryptedFolderAccess, q as EncryptedFolderChoice, r as EncryptedFolderEntry, s as EncryptedFolderProviderErrorKind, t as EncryptedFoldersAPI, u as ExtensionModel, v as ExternalAuthDecision, w as ExternalConnection, x as ExternalConnectionErrorCode, y as ExternalConnectionState, z as ExternalRequest, F as ExternalRequestEvent, G as ExternalRequestHandler, I as ExternalRequestPayload, J as ExternalResponse, K as FileStat, L as FilesystemAPI, M as ImapConfig, N as KnownPath, O as KnownPaths, P as LOCALSEND_EVENTS, Q as LocalSendAPI, R as LocalSendEvent, T as LocalSendFileInfo, U as LocalSendSettings, V as MailAPI, W as MailAccount, X as MailAddress, Y as MailAttachment, Z as MailFetchRange, _ as MailMessage, $ as MailNewMessagesEvent, a0 as MailSearchCriteria, a1 as MailSearchResult, a2 as MailboxInfo, a3 as MessageEnvelope, a4 as
|
|
3
|
-
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-
|
|
4
|
-
export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, E as ExtensionInfo, a as ExtensionManifest, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, B as HostErrorCode, I as IdentityClaim, G as MAIL_EVENTS, J as MODEL_JOB_EVENTS, K as MailEvent, L as ManifestI18nEntry, N as ManifestTool, O as ManifestToolEffect, Q as ModelJobEvent, T as NOTIFICATION_EVENTS, U as NotificationEvent, V as
|
|
1
|
+
import { H as HaexVaultSdk } from './client-DTxLSJrk.mjs';
|
|
2
|
+
export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, b as ContactDetail, c as ContactHolziAddresses, d as ContactHolziDevice, e as ContactList, f as ContactListOptions, g as ContactSummary, h as ContactValue, i as ContactsAPI, D as DatabaseAPI, j as DecryptedSpace, k as DeepLink, l as Device, m as DeviceInfo, n as DeviceType, o as DialogAPI, p as DirEntry, E as EncryptedFolderAccess, q as EncryptedFolderChoice, r as EncryptedFolderEntry, s as EncryptedFolderProviderErrorKind, t as EncryptedFoldersAPI, u as ExtensionModel, v as ExternalAuthDecision, w as ExternalConnection, x as ExternalConnectionErrorCode, y as ExternalConnectionState, z as ExternalRequest, F as ExternalRequestEvent, G as ExternalRequestHandler, I as ExternalRequestPayload, J as ExternalResponse, K as FileStat, L as FilesystemAPI, M as ImapConfig, N as KnownPath, O as KnownPaths, P as LOCALSEND_EVENTS, Q as LocalSendAPI, R as LocalSendEvent, T as LocalSendFileInfo, U as LocalSendSettings, V as MailAPI, W as MailAccount, X as MailAddress, Y as MailAttachment, Z as MailFetchRange, _ as MailMessage, $ as MailNewMessagesEvent, a0 as MailSearchCriteria, a1 as MailSearchResult, a2 as MailboxInfo, a3 as MessageEnvelope, a4 as ModelAccessRequest, a5 as ModelEffort, a6 as ModelJob, a7 as ModelJobAttempt, a8 as ModelJobCompletion, a9 as ModelJobErrorCode, aa as ModelJobFormat, ab as ModelJobImage, ac as ModelJobProvenance, ad as ModelJobStep, ae as ModelPlace, af as ModelsAPI, ag as NotificationAction, ah as NotificationClickEvent, ai as NotificationOptions, aj as NotificationsAPI, ak as OutgoingAttachment, al as OutgoingMessage, am as PEER_ERROR_KINDS, an as PasswordInput, ao as PasswordItemFull, ap as PasswordItemSummary, aq as PasswordKeyValue, ar as PasswordKeyValueInput, as as PasswordsAPI, at as PeerChannelClosed, au as PeerChannelOpened, av as PeerError, aw as PeerErrorKind, ax as PeerErrorReason, ay as PeerEventMap, az as PeerEventType, aA as PeerInviteStatus, aB as PeerJoined, aC as PeerMessage, aD as PeerVisibility, aE as PeersAPI, aF as PendingAuthorization, aG as PendingTransfer, aH as PermissionsAPI, aI as RemoteAddBackendRequest, aJ as RemoteFolderBackendInfo, aK as RemoteS3BackendInfo, aL as RemoteS3Config, aM as RemoteS3Proposal, aN as RemoteS3PublicConfig, aO as RemoteSftpProposal, aP as RemoteStorageAPI, aQ as RemoteStorageBackendInfo, aR as RemoteStorageBackendType, aS as RemoteStorageObjectInfo, aT as RemoteUpdateBackendRequest, aU as RemoteWebDavProposal, aV as RequestedExtension, aW as SelectFileOptions, aX as SelectFolderOptions, aY as ServerInfo, aZ as ServerStatus, a_ as SessionAuthorization, a$ as SharedSpace, b0 as ShellAPI, b1 as ShellCreateOptions, b2 as ShellCreateResponse, b3 as ShellExitEvent, b4 as ShellOutputEvent, b5 as SmtpConfig, b6 as SpaceAccessTokenInfo, b7 as SpaceAssignment, b8 as SpaceInvite, b9 as SpaceKeyGrantInfo, ba as SpaceMember, bb as SpaceMemberInfo, bc as SpacesAPI, bd as SyncBackendInfo, be as TabAPI, bf as ToolContext, bg as ToolHandler, bh as ToolsAPI, bi as TransferDirection, bj as TransferProgress, bk as TransferState, bl as WebAPI, bm as canExternalClientSendRequests, bn as isExternalClientConnected } from './client-DTxLSJrk.mjs';
|
|
3
|
+
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-BZVkX0Wf.mjs';
|
|
4
|
+
export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, E as ExtensionInfo, a as ExtensionManifest, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, B as HostErrorCode, I as IdentityClaim, G as MAIL_EVENTS, J as MODEL_JOB_EVENTS, K as MailEvent, L as ManifestI18nEntry, N as ManifestTool, O as ManifestToolEffect, Q as ModelJobEvent, T as NOTIFICATION_EVENTS, U as NotificationEvent, V as PEERS_EVENTS, X as PeersEvent, Y as PermissionDeniedError, Z as PermissionErrorBase, _ as PermissionErrorCode, $ as PermissionPromptError, P as PermissionResponse, a0 as PermissionStatus, R as RequestOptions, a1 as SHELL_EVENTS, a2 as SearchQuery, a3 as SearchRequestEvent, S as SearchResult, a4 as ShellEvent, a5 as SyncTablesUpdatedEvent, a6 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a7 as getTableName, a8 as isPermissionDeniedError, a9 as isPermissionError, aa as isPermissionPromptError } from './types-BZVkX0Wf.mjs';
|
|
5
5
|
export { H as HaextensionConfig } from './config-P_6DqTHl.mjs';
|
|
6
6
|
import 'drizzle-orm/sqlite-proxy';
|
|
7
7
|
|
|
@@ -166,9 +166,44 @@ declare const MODEL_COMMANDS: {
|
|
|
166
166
|
readonly start: "extension_model_job_start";
|
|
167
167
|
/** Cancels a running job of this frame */
|
|
168
168
|
readonly cancel: "extension_model_job_cancel";
|
|
169
|
+
/** Asks for a grant before the first job; nothing goes to a model */
|
|
170
|
+
readonly requestAccess: "extension_model_access_request";
|
|
171
|
+
/** Opens the host's page of this extension's models */
|
|
172
|
+
readonly openSettings: "extension_model_settings_open";
|
|
169
173
|
};
|
|
170
174
|
type ModelCommand = (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS];
|
|
171
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Peer Commands
|
|
178
|
+
*
|
|
179
|
+
* Commands for channels between frames of the same extension on devices of
|
|
180
|
+
* different vaults (holzi spec 057, `contracts/bridge.md`). Every method needs
|
|
181
|
+
* the `peers` permission (`action` = `connect`, `target` = "*"). There is no
|
|
182
|
+
* command to accept or decline an invitation: that happens only in holzi's
|
|
183
|
+
* own prompt.
|
|
184
|
+
*
|
|
185
|
+
* Naming convention: `extension_peers_<action>`
|
|
186
|
+
*/
|
|
187
|
+
declare const PEER_COMMANDS: {
|
|
188
|
+
/** Invites a contact; the outcome follows as `peers:invite-status` */
|
|
189
|
+
readonly invite: "extension_peers_invite";
|
|
190
|
+
/** Withdraws an open invitation on all devices of the contact */
|
|
191
|
+
readonly inviteCancel: "extension_peers_invite_cancel";
|
|
192
|
+
/** Opens a lobby and returns its join code */
|
|
193
|
+
readonly lobbyOpen: "extension_peers_lobby_open";
|
|
194
|
+
/** Closes a lobby; its code stops working, its channels stay open */
|
|
195
|
+
readonly lobbyClose: "extension_peers_lobby_close";
|
|
196
|
+
/** Joins a lobby by its code; waits at most 15 s for the host */
|
|
197
|
+
readonly join: "extension_peers_join";
|
|
198
|
+
/** Closes a channel of an own lobby and keeps the device out of that lobby */
|
|
199
|
+
readonly remove: "extension_peers_remove";
|
|
200
|
+
/** Sends a fast or a reliable message over a channel */
|
|
201
|
+
readonly send: "extension_peers_send";
|
|
202
|
+
/** Closes a channel on both sides */
|
|
203
|
+
readonly close: "extension_peers_close";
|
|
204
|
+
};
|
|
205
|
+
type PeerCommand = (typeof PEER_COMMANDS)[keyof typeof PEER_COMMANDS];
|
|
206
|
+
|
|
172
207
|
/**
|
|
173
208
|
* Mail Commands (IMAP fetch + SMTP send).
|
|
174
209
|
*
|
|
@@ -895,6 +930,18 @@ declare const TAURI_COMMANDS: {
|
|
|
895
930
|
readonly list: "extension_model_list";
|
|
896
931
|
readonly start: "extension_model_job_start";
|
|
897
932
|
readonly cancel: "extension_model_job_cancel";
|
|
933
|
+
readonly requestAccess: "extension_model_access_request";
|
|
934
|
+
readonly openSettings: "extension_model_settings_open";
|
|
935
|
+
};
|
|
936
|
+
readonly peers: {
|
|
937
|
+
readonly invite: "extension_peers_invite";
|
|
938
|
+
readonly inviteCancel: "extension_peers_invite_cancel";
|
|
939
|
+
readonly lobbyOpen: "extension_peers_lobby_open";
|
|
940
|
+
readonly lobbyClose: "extension_peers_lobby_close";
|
|
941
|
+
readonly join: "extension_peers_join";
|
|
942
|
+
readonly remove: "extension_peers_remove";
|
|
943
|
+
readonly send: "extension_peers_send";
|
|
944
|
+
readonly close: "extension_peers_close";
|
|
898
945
|
};
|
|
899
946
|
readonly mail: {
|
|
900
947
|
readonly listMailboxes: "extension_mail_list_mailboxes";
|
|
@@ -917,7 +964,7 @@ declare const TAURI_COMMANDS: {
|
|
|
917
964
|
readonly dismiss: "extension_notifications_dismiss";
|
|
918
965
|
};
|
|
919
966
|
};
|
|
920
|
-
type TauriCommand = (typeof DATABASE_COMMANDS)[keyof typeof DATABASE_COMMANDS] | (typeof PERMISSIONS_COMMANDS)[keyof typeof PERMISSIONS_COMMANDS] | (typeof WEB_COMMANDS)[keyof typeof WEB_COMMANDS] | (typeof WEB_STORAGE_COMMANDS)[keyof typeof WEB_STORAGE_COMMANDS] | (typeof FILESYSTEM_COMMANDS)[keyof typeof FILESYSTEM_COMMANDS] | (typeof EXTERNAL_BRIDGE_COMMANDS)[keyof typeof EXTERNAL_BRIDGE_COMMANDS] | (typeof EXTENSION_COMMANDS)[keyof typeof EXTENSION_COMMANDS] | (typeof REMOTE_STORAGE_COMMANDS)[keyof typeof REMOTE_STORAGE_COMMANDS] | (typeof ENCRYPTED_FOLDER_COMMANDS)[keyof typeof ENCRYPTED_FOLDER_COMMANDS] | (typeof LOCALSEND_COMMANDS)[keyof typeof LOCALSEND_COMMANDS] | (typeof SPACE_COMMANDS)[keyof typeof SPACE_COMMANDS] | (typeof SHELL_COMMANDS)[keyof typeof SHELL_COMMANDS] | (typeof PASSWORD_COMMANDS)[keyof typeof PASSWORD_COMMANDS] | (typeof CONTACT_COMMANDS)[keyof typeof CONTACT_COMMANDS] | (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS] | (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS] | (typeof NOTIFICATION_COMMANDS)[keyof typeof NOTIFICATION_COMMANDS];
|
|
967
|
+
type TauriCommand = (typeof DATABASE_COMMANDS)[keyof typeof DATABASE_COMMANDS] | (typeof PERMISSIONS_COMMANDS)[keyof typeof PERMISSIONS_COMMANDS] | (typeof WEB_COMMANDS)[keyof typeof WEB_COMMANDS] | (typeof WEB_STORAGE_COMMANDS)[keyof typeof WEB_STORAGE_COMMANDS] | (typeof FILESYSTEM_COMMANDS)[keyof typeof FILESYSTEM_COMMANDS] | (typeof EXTERNAL_BRIDGE_COMMANDS)[keyof typeof EXTERNAL_BRIDGE_COMMANDS] | (typeof EXTENSION_COMMANDS)[keyof typeof EXTENSION_COMMANDS] | (typeof REMOTE_STORAGE_COMMANDS)[keyof typeof REMOTE_STORAGE_COMMANDS] | (typeof ENCRYPTED_FOLDER_COMMANDS)[keyof typeof ENCRYPTED_FOLDER_COMMANDS] | (typeof LOCALSEND_COMMANDS)[keyof typeof LOCALSEND_COMMANDS] | (typeof SPACE_COMMANDS)[keyof typeof SPACE_COMMANDS] | (typeof SHELL_COMMANDS)[keyof typeof SHELL_COMMANDS] | (typeof PASSWORD_COMMANDS)[keyof typeof PASSWORD_COMMANDS] | (typeof CONTACT_COMMANDS)[keyof typeof CONTACT_COMMANDS] | (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS] | (typeof PEER_COMMANDS)[keyof typeof PEER_COMMANDS] | (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS] | (typeof NOTIFICATION_COMMANDS)[keyof typeof NOTIFICATION_COMMANDS];
|
|
921
968
|
|
|
922
969
|
/**
|
|
923
970
|
* Crypto utilities for Vault Key Management
|
|
@@ -1184,5 +1231,5 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
|
|
|
1184
1231
|
|
|
1185
1232
|
declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
|
|
1186
1233
|
|
|
1187
|
-
export { CONTACT_COMMANDS, COSE_ALGORITHM, ENCRYPTED_FOLDER_COMMANDS, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, KEY_AGREEMENT_ALGO, MAIL_COMMANDS, MODEL_COMMANDS, NOTIFICATION_COMMANDS, PASSWORD_COMMANDS, SIGNING_ALGO, SPACE_COMMANDS, SignedClaimPresentation, TAURI_COMMANDS, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, decryptWithPrivateKeyAsync, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, encryptWithPublicKeyAsync, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generateIdentityAsync, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, unwrapKey, verifyClaimPresentationAsync, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|
|
1188
|
-
export type { AuthUser, ContactCommand, CoseAlgorithm, CreateSpaceRequest, EncryptedFolderCommand, ExportedPasskeyKeyPair, ExportedUserKeypair, HaexspaceMessageType, InviteMemberRequest, MailCommand, ModelCommand, NotificationCommand, PasskeyKeyPair, PasswordCommand, RegisterKeypairRequest, SealedData, SignableRecord, SpaceCommand, StorageConfig, ErrorResponse as SyncServerErrorResponse, ServerInfo as SyncServerInfo, LoginRequest as SyncServerLoginRequest, LoginResponse as SyncServerLoginResponse, RefreshRequest as SyncServerRefreshRequest, TauriCommand, UserKeypair };
|
|
1234
|
+
export { CONTACT_COMMANDS, COSE_ALGORITHM, ENCRYPTED_FOLDER_COMMANDS, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, KEY_AGREEMENT_ALGO, MAIL_COMMANDS, MODEL_COMMANDS, NOTIFICATION_COMMANDS, PASSWORD_COMMANDS, PEER_COMMANDS, SIGNING_ALGO, SPACE_COMMANDS, SignedClaimPresentation, TAURI_COMMANDS, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, decryptWithPrivateKeyAsync, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, encryptWithPublicKeyAsync, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generateIdentityAsync, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, unwrapKey, verifyClaimPresentationAsync, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|
|
1235
|
+
export type { AuthUser, ContactCommand, CoseAlgorithm, CreateSpaceRequest, EncryptedFolderCommand, ExportedPasskeyKeyPair, ExportedUserKeypair, HaexspaceMessageType, InviteMemberRequest, MailCommand, ModelCommand, NotificationCommand, PasskeyKeyPair, PasswordCommand, PeerCommand, RegisterKeypairRequest, SealedData, SignableRecord, SpaceCommand, StorageConfig, ErrorResponse as SyncServerErrorResponse, ServerInfo as SyncServerInfo, LoginRequest as SyncServerLoginRequest, LoginResponse as SyncServerLoginResponse, RefreshRequest as SyncServerRefreshRequest, TauriCommand, UserKeypair };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { H as HaexVaultSdk } from './client-
|
|
2
|
-
export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, b as ContactDetail, c as ContactHolziAddresses, d as ContactHolziDevice, e as ContactList, f as ContactListOptions, g as ContactSummary, h as ContactValue, i as ContactsAPI, D as DatabaseAPI, j as DecryptedSpace, k as DeepLink, l as Device, m as DeviceInfo, n as DeviceType, o as DialogAPI, p as DirEntry, E as EncryptedFolderAccess, q as EncryptedFolderChoice, r as EncryptedFolderEntry, s as EncryptedFolderProviderErrorKind, t as EncryptedFoldersAPI, u as ExtensionModel, v as ExternalAuthDecision, w as ExternalConnection, x as ExternalConnectionErrorCode, y as ExternalConnectionState, z as ExternalRequest, F as ExternalRequestEvent, G as ExternalRequestHandler, I as ExternalRequestPayload, J as ExternalResponse, K as FileStat, L as FilesystemAPI, M as ImapConfig, N as KnownPath, O as KnownPaths, P as LOCALSEND_EVENTS, Q as LocalSendAPI, R as LocalSendEvent, T as LocalSendFileInfo, U as LocalSendSettings, V as MailAPI, W as MailAccount, X as MailAddress, Y as MailAttachment, Z as MailFetchRange, _ as MailMessage, $ as MailNewMessagesEvent, a0 as MailSearchCriteria, a1 as MailSearchResult, a2 as MailboxInfo, a3 as MessageEnvelope, a4 as
|
|
3
|
-
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-
|
|
4
|
-
export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, E as ExtensionInfo, a as ExtensionManifest, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, B as HostErrorCode, I as IdentityClaim, G as MAIL_EVENTS, J as MODEL_JOB_EVENTS, K as MailEvent, L as ManifestI18nEntry, N as ManifestTool, O as ManifestToolEffect, Q as ModelJobEvent, T as NOTIFICATION_EVENTS, U as NotificationEvent, V as
|
|
1
|
+
import { H as HaexVaultSdk } from './client-s0eCQoWA.js';
|
|
2
|
+
export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, b as ContactDetail, c as ContactHolziAddresses, d as ContactHolziDevice, e as ContactList, f as ContactListOptions, g as ContactSummary, h as ContactValue, i as ContactsAPI, D as DatabaseAPI, j as DecryptedSpace, k as DeepLink, l as Device, m as DeviceInfo, n as DeviceType, o as DialogAPI, p as DirEntry, E as EncryptedFolderAccess, q as EncryptedFolderChoice, r as EncryptedFolderEntry, s as EncryptedFolderProviderErrorKind, t as EncryptedFoldersAPI, u as ExtensionModel, v as ExternalAuthDecision, w as ExternalConnection, x as ExternalConnectionErrorCode, y as ExternalConnectionState, z as ExternalRequest, F as ExternalRequestEvent, G as ExternalRequestHandler, I as ExternalRequestPayload, J as ExternalResponse, K as FileStat, L as FilesystemAPI, M as ImapConfig, N as KnownPath, O as KnownPaths, P as LOCALSEND_EVENTS, Q as LocalSendAPI, R as LocalSendEvent, T as LocalSendFileInfo, U as LocalSendSettings, V as MailAPI, W as MailAccount, X as MailAddress, Y as MailAttachment, Z as MailFetchRange, _ as MailMessage, $ as MailNewMessagesEvent, a0 as MailSearchCriteria, a1 as MailSearchResult, a2 as MailboxInfo, a3 as MessageEnvelope, a4 as ModelAccessRequest, a5 as ModelEffort, a6 as ModelJob, a7 as ModelJobAttempt, a8 as ModelJobCompletion, a9 as ModelJobErrorCode, aa as ModelJobFormat, ab as ModelJobImage, ac as ModelJobProvenance, ad as ModelJobStep, ae as ModelPlace, af as ModelsAPI, ag as NotificationAction, ah as NotificationClickEvent, ai as NotificationOptions, aj as NotificationsAPI, ak as OutgoingAttachment, al as OutgoingMessage, am as PEER_ERROR_KINDS, an as PasswordInput, ao as PasswordItemFull, ap as PasswordItemSummary, aq as PasswordKeyValue, ar as PasswordKeyValueInput, as as PasswordsAPI, at as PeerChannelClosed, au as PeerChannelOpened, av as PeerError, aw as PeerErrorKind, ax as PeerErrorReason, ay as PeerEventMap, az as PeerEventType, aA as PeerInviteStatus, aB as PeerJoined, aC as PeerMessage, aD as PeerVisibility, aE as PeersAPI, aF as PendingAuthorization, aG as PendingTransfer, aH as PermissionsAPI, aI as RemoteAddBackendRequest, aJ as RemoteFolderBackendInfo, aK as RemoteS3BackendInfo, aL as RemoteS3Config, aM as RemoteS3Proposal, aN as RemoteS3PublicConfig, aO as RemoteSftpProposal, aP as RemoteStorageAPI, aQ as RemoteStorageBackendInfo, aR as RemoteStorageBackendType, aS as RemoteStorageObjectInfo, aT as RemoteUpdateBackendRequest, aU as RemoteWebDavProposal, aV as RequestedExtension, aW as SelectFileOptions, aX as SelectFolderOptions, aY as ServerInfo, aZ as ServerStatus, a_ as SessionAuthorization, a$ as SharedSpace, b0 as ShellAPI, b1 as ShellCreateOptions, b2 as ShellCreateResponse, b3 as ShellExitEvent, b4 as ShellOutputEvent, b5 as SmtpConfig, b6 as SpaceAccessTokenInfo, b7 as SpaceAssignment, b8 as SpaceInvite, b9 as SpaceKeyGrantInfo, ba as SpaceMember, bb as SpaceMemberInfo, bc as SpacesAPI, bd as SyncBackendInfo, be as TabAPI, bf as ToolContext, bg as ToolHandler, bh as ToolsAPI, bi as TransferDirection, bj as TransferProgress, bk as TransferState, bl as WebAPI, bm as canExternalClientSendRequests, bn as isExternalClientConnected } from './client-s0eCQoWA.js';
|
|
3
|
+
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-BZVkX0Wf.js';
|
|
4
|
+
export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, E as ExtensionInfo, a as ExtensionManifest, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, B as HostErrorCode, I as IdentityClaim, G as MAIL_EVENTS, J as MODEL_JOB_EVENTS, K as MailEvent, L as ManifestI18nEntry, N as ManifestTool, O as ManifestToolEffect, Q as ModelJobEvent, T as NOTIFICATION_EVENTS, U as NotificationEvent, V as PEERS_EVENTS, X as PeersEvent, Y as PermissionDeniedError, Z as PermissionErrorBase, _ as PermissionErrorCode, $ as PermissionPromptError, P as PermissionResponse, a0 as PermissionStatus, R as RequestOptions, a1 as SHELL_EVENTS, a2 as SearchQuery, a3 as SearchRequestEvent, S as SearchResult, a4 as ShellEvent, a5 as SyncTablesUpdatedEvent, a6 as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a7 as getTableName, a8 as isPermissionDeniedError, a9 as isPermissionError, aa as isPermissionPromptError } from './types-BZVkX0Wf.js';
|
|
5
5
|
export { H as HaextensionConfig } from './config-P_6DqTHl.js';
|
|
6
6
|
import 'drizzle-orm/sqlite-proxy';
|
|
7
7
|
|
|
@@ -166,9 +166,44 @@ declare const MODEL_COMMANDS: {
|
|
|
166
166
|
readonly start: "extension_model_job_start";
|
|
167
167
|
/** Cancels a running job of this frame */
|
|
168
168
|
readonly cancel: "extension_model_job_cancel";
|
|
169
|
+
/** Asks for a grant before the first job; nothing goes to a model */
|
|
170
|
+
readonly requestAccess: "extension_model_access_request";
|
|
171
|
+
/** Opens the host's page of this extension's models */
|
|
172
|
+
readonly openSettings: "extension_model_settings_open";
|
|
169
173
|
};
|
|
170
174
|
type ModelCommand = (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS];
|
|
171
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Peer Commands
|
|
178
|
+
*
|
|
179
|
+
* Commands for channels between frames of the same extension on devices of
|
|
180
|
+
* different vaults (holzi spec 057, `contracts/bridge.md`). Every method needs
|
|
181
|
+
* the `peers` permission (`action` = `connect`, `target` = "*"). There is no
|
|
182
|
+
* command to accept or decline an invitation: that happens only in holzi's
|
|
183
|
+
* own prompt.
|
|
184
|
+
*
|
|
185
|
+
* Naming convention: `extension_peers_<action>`
|
|
186
|
+
*/
|
|
187
|
+
declare const PEER_COMMANDS: {
|
|
188
|
+
/** Invites a contact; the outcome follows as `peers:invite-status` */
|
|
189
|
+
readonly invite: "extension_peers_invite";
|
|
190
|
+
/** Withdraws an open invitation on all devices of the contact */
|
|
191
|
+
readonly inviteCancel: "extension_peers_invite_cancel";
|
|
192
|
+
/** Opens a lobby and returns its join code */
|
|
193
|
+
readonly lobbyOpen: "extension_peers_lobby_open";
|
|
194
|
+
/** Closes a lobby; its code stops working, its channels stay open */
|
|
195
|
+
readonly lobbyClose: "extension_peers_lobby_close";
|
|
196
|
+
/** Joins a lobby by its code; waits at most 15 s for the host */
|
|
197
|
+
readonly join: "extension_peers_join";
|
|
198
|
+
/** Closes a channel of an own lobby and keeps the device out of that lobby */
|
|
199
|
+
readonly remove: "extension_peers_remove";
|
|
200
|
+
/** Sends a fast or a reliable message over a channel */
|
|
201
|
+
readonly send: "extension_peers_send";
|
|
202
|
+
/** Closes a channel on both sides */
|
|
203
|
+
readonly close: "extension_peers_close";
|
|
204
|
+
};
|
|
205
|
+
type PeerCommand = (typeof PEER_COMMANDS)[keyof typeof PEER_COMMANDS];
|
|
206
|
+
|
|
172
207
|
/**
|
|
173
208
|
* Mail Commands (IMAP fetch + SMTP send).
|
|
174
209
|
*
|
|
@@ -895,6 +930,18 @@ declare const TAURI_COMMANDS: {
|
|
|
895
930
|
readonly list: "extension_model_list";
|
|
896
931
|
readonly start: "extension_model_job_start";
|
|
897
932
|
readonly cancel: "extension_model_job_cancel";
|
|
933
|
+
readonly requestAccess: "extension_model_access_request";
|
|
934
|
+
readonly openSettings: "extension_model_settings_open";
|
|
935
|
+
};
|
|
936
|
+
readonly peers: {
|
|
937
|
+
readonly invite: "extension_peers_invite";
|
|
938
|
+
readonly inviteCancel: "extension_peers_invite_cancel";
|
|
939
|
+
readonly lobbyOpen: "extension_peers_lobby_open";
|
|
940
|
+
readonly lobbyClose: "extension_peers_lobby_close";
|
|
941
|
+
readonly join: "extension_peers_join";
|
|
942
|
+
readonly remove: "extension_peers_remove";
|
|
943
|
+
readonly send: "extension_peers_send";
|
|
944
|
+
readonly close: "extension_peers_close";
|
|
898
945
|
};
|
|
899
946
|
readonly mail: {
|
|
900
947
|
readonly listMailboxes: "extension_mail_list_mailboxes";
|
|
@@ -917,7 +964,7 @@ declare const TAURI_COMMANDS: {
|
|
|
917
964
|
readonly dismiss: "extension_notifications_dismiss";
|
|
918
965
|
};
|
|
919
966
|
};
|
|
920
|
-
type TauriCommand = (typeof DATABASE_COMMANDS)[keyof typeof DATABASE_COMMANDS] | (typeof PERMISSIONS_COMMANDS)[keyof typeof PERMISSIONS_COMMANDS] | (typeof WEB_COMMANDS)[keyof typeof WEB_COMMANDS] | (typeof WEB_STORAGE_COMMANDS)[keyof typeof WEB_STORAGE_COMMANDS] | (typeof FILESYSTEM_COMMANDS)[keyof typeof FILESYSTEM_COMMANDS] | (typeof EXTERNAL_BRIDGE_COMMANDS)[keyof typeof EXTERNAL_BRIDGE_COMMANDS] | (typeof EXTENSION_COMMANDS)[keyof typeof EXTENSION_COMMANDS] | (typeof REMOTE_STORAGE_COMMANDS)[keyof typeof REMOTE_STORAGE_COMMANDS] | (typeof ENCRYPTED_FOLDER_COMMANDS)[keyof typeof ENCRYPTED_FOLDER_COMMANDS] | (typeof LOCALSEND_COMMANDS)[keyof typeof LOCALSEND_COMMANDS] | (typeof SPACE_COMMANDS)[keyof typeof SPACE_COMMANDS] | (typeof SHELL_COMMANDS)[keyof typeof SHELL_COMMANDS] | (typeof PASSWORD_COMMANDS)[keyof typeof PASSWORD_COMMANDS] | (typeof CONTACT_COMMANDS)[keyof typeof CONTACT_COMMANDS] | (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS] | (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS] | (typeof NOTIFICATION_COMMANDS)[keyof typeof NOTIFICATION_COMMANDS];
|
|
967
|
+
type TauriCommand = (typeof DATABASE_COMMANDS)[keyof typeof DATABASE_COMMANDS] | (typeof PERMISSIONS_COMMANDS)[keyof typeof PERMISSIONS_COMMANDS] | (typeof WEB_COMMANDS)[keyof typeof WEB_COMMANDS] | (typeof WEB_STORAGE_COMMANDS)[keyof typeof WEB_STORAGE_COMMANDS] | (typeof FILESYSTEM_COMMANDS)[keyof typeof FILESYSTEM_COMMANDS] | (typeof EXTERNAL_BRIDGE_COMMANDS)[keyof typeof EXTERNAL_BRIDGE_COMMANDS] | (typeof EXTENSION_COMMANDS)[keyof typeof EXTENSION_COMMANDS] | (typeof REMOTE_STORAGE_COMMANDS)[keyof typeof REMOTE_STORAGE_COMMANDS] | (typeof ENCRYPTED_FOLDER_COMMANDS)[keyof typeof ENCRYPTED_FOLDER_COMMANDS] | (typeof LOCALSEND_COMMANDS)[keyof typeof LOCALSEND_COMMANDS] | (typeof SPACE_COMMANDS)[keyof typeof SPACE_COMMANDS] | (typeof SHELL_COMMANDS)[keyof typeof SHELL_COMMANDS] | (typeof PASSWORD_COMMANDS)[keyof typeof PASSWORD_COMMANDS] | (typeof CONTACT_COMMANDS)[keyof typeof CONTACT_COMMANDS] | (typeof MODEL_COMMANDS)[keyof typeof MODEL_COMMANDS] | (typeof PEER_COMMANDS)[keyof typeof PEER_COMMANDS] | (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS] | (typeof NOTIFICATION_COMMANDS)[keyof typeof NOTIFICATION_COMMANDS];
|
|
921
968
|
|
|
922
969
|
/**
|
|
923
970
|
* Crypto utilities for Vault Key Management
|
|
@@ -1184,5 +1231,5 @@ declare function exportKeyPairAsync(keyPair: PasskeyKeyPair): Promise<ExportedPa
|
|
|
1184
1231
|
|
|
1185
1232
|
declare function createHaexVaultSdk(config?: HaexHubConfig): HaexVaultSdk;
|
|
1186
1233
|
|
|
1187
|
-
export { CONTACT_COMMANDS, COSE_ALGORITHM, ENCRYPTED_FOLDER_COMMANDS, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, KEY_AGREEMENT_ALGO, MAIL_COMMANDS, MODEL_COMMANDS, NOTIFICATION_COMMANDS, PASSWORD_COMMANDS, SIGNING_ALGO, SPACE_COMMANDS, SignedClaimPresentation, TAURI_COMMANDS, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, decryptWithPrivateKeyAsync, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, encryptWithPublicKeyAsync, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generateIdentityAsync, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, unwrapKey, verifyClaimPresentationAsync, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|
|
1188
|
-
export type { AuthUser, ContactCommand, CoseAlgorithm, CreateSpaceRequest, EncryptedFolderCommand, ExportedPasskeyKeyPair, ExportedUserKeypair, HaexspaceMessageType, InviteMemberRequest, MailCommand, ModelCommand, NotificationCommand, PasskeyKeyPair, PasswordCommand, RegisterKeypairRequest, SealedData, SignableRecord, SpaceCommand, StorageConfig, ErrorResponse as SyncServerErrorResponse, ServerInfo as SyncServerInfo, LoginRequest as SyncServerLoginRequest, LoginResponse as SyncServerLoginResponse, RefreshRequest as SyncServerRefreshRequest, TauriCommand, UserKeypair };
|
|
1234
|
+
export { CONTACT_COMMANDS, COSE_ALGORITHM, ENCRYPTED_FOLDER_COMMANDS, HAEXSPACE_MESSAGE_TYPES, HaexHubConfig, HaexVaultSdk, KEY_AGREEMENT_ALGO, MAIL_COMMANDS, MODEL_COMMANDS, NOTIFICATION_COMMANDS, PASSWORD_COMMANDS, PEER_COMMANDS, SIGNING_ALGO, SPACE_COMMANDS, SignedClaimPresentation, TAURI_COMMANDS, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, createHaexVaultSdk, decryptCrdtData, decryptPrivateKeyAsync, decryptSpaceNameAsync, decryptString, decryptVaultKey, decryptVaultName, decryptWithPrivateKeyAsync, deriveKeyFromPassword, didKeyToPublicKeyAsync, encryptCrdtData, encryptPrivateKeyAsync, encryptSpaceNameAsync, encryptString, encryptVaultKey, encryptWithPublicKeyAsync, exportKeyPairAsync, exportPrivateKeyAsync, exportPublicKeyAsync, exportPublicKeyCoseAsync, exportUserKeypairAsync, generateCredentialId, generateIdentityAsync, generatePasskeyPairAsync, generateSpaceKey, generateUserKeypairAsync, generateVaultKey, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, unwrapKey, verifyClaimPresentationAsync, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|
|
1235
|
+
export type { AuthUser, ContactCommand, CoseAlgorithm, CreateSpaceRequest, EncryptedFolderCommand, ExportedPasskeyKeyPair, ExportedUserKeypair, HaexspaceMessageType, InviteMemberRequest, MailCommand, ModelCommand, NotificationCommand, PasskeyKeyPair, PasswordCommand, PeerCommand, RegisterKeypairRequest, SealedData, SignableRecord, SpaceCommand, StorageConfig, ErrorResponse as SyncServerErrorResponse, ServerInfo as SyncServerInfo, LoginRequest as SyncServerLoginRequest, LoginResponse as SyncServerLoginResponse, RefreshRequest as SyncServerRefreshRequest, TauriCommand, UserKeypair };
|
package/dist/index.js
CHANGED
|
@@ -767,6 +767,18 @@ var MODEL_JOB_EVENTS = {
|
|
|
767
767
|
/** A job of this frame ended: completed, failed or cancelled. */
|
|
768
768
|
COMPLETED: "haextension:model-job:completed"
|
|
769
769
|
};
|
|
770
|
+
var PEERS_EVENTS = {
|
|
771
|
+
/** The outcome of an invitation, once per invitation (inviting side). */
|
|
772
|
+
INVITE_STATUS: "peers:invite-status",
|
|
773
|
+
/** A channel opened after the user accepted an invitation in holzi's prompt (invited side). */
|
|
774
|
+
CHANNEL_OPENED: "peers:channel-opened",
|
|
775
|
+
/** A device joined one of this device's lobbies by code (host). */
|
|
776
|
+
JOINED: "peers:joined",
|
|
777
|
+
/** A message on a channel; `data` is Base64 on the bridge. */
|
|
778
|
+
MESSAGE: "peers:message",
|
|
779
|
+
/** A channel ended: closed, lost or timed out. */
|
|
780
|
+
CHANNEL_CLOSED: "peers:channel-closed"
|
|
781
|
+
};
|
|
770
782
|
var EXTERNAL_EVENTS = {
|
|
771
783
|
/** External request from authorized client */
|
|
772
784
|
REQUEST: "haextension:external:request",
|
|
@@ -1205,7 +1217,32 @@ var MODEL_COMMANDS = {
|
|
|
1205
1217
|
/** Starts a job; the result follows as an event */
|
|
1206
1218
|
start: "extension_model_job_start",
|
|
1207
1219
|
/** Cancels a running job of this frame */
|
|
1208
|
-
cancel: "extension_model_job_cancel"
|
|
1220
|
+
cancel: "extension_model_job_cancel",
|
|
1221
|
+
/** Asks for a grant before the first job; nothing goes to a model */
|
|
1222
|
+
requestAccess: "extension_model_access_request",
|
|
1223
|
+
/** Opens the host's page of this extension's models */
|
|
1224
|
+
openSettings: "extension_model_settings_open"
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1227
|
+
// src/commands/peers.ts
|
|
1228
|
+
init_cjs_shims();
|
|
1229
|
+
var PEER_COMMANDS = {
|
|
1230
|
+
/** Invites a contact; the outcome follows as `peers:invite-status` */
|
|
1231
|
+
invite: "extension_peers_invite",
|
|
1232
|
+
/** Withdraws an open invitation on all devices of the contact */
|
|
1233
|
+
inviteCancel: "extension_peers_invite_cancel",
|
|
1234
|
+
/** Opens a lobby and returns its join code */
|
|
1235
|
+
lobbyOpen: "extension_peers_lobby_open",
|
|
1236
|
+
/** Closes a lobby; its code stops working, its channels stay open */
|
|
1237
|
+
lobbyClose: "extension_peers_lobby_close",
|
|
1238
|
+
/** Joins a lobby by its code; waits at most 15 s for the host */
|
|
1239
|
+
join: "extension_peers_join",
|
|
1240
|
+
/** Closes a channel of an own lobby and keeps the device out of that lobby */
|
|
1241
|
+
remove: "extension_peers_remove",
|
|
1242
|
+
/** Sends a fast or a reliable message over a channel */
|
|
1243
|
+
send: "extension_peers_send",
|
|
1244
|
+
/** Closes a channel on both sides */
|
|
1245
|
+
close: "extension_peers_close"
|
|
1209
1246
|
};
|
|
1210
1247
|
|
|
1211
1248
|
// src/commands/mail.ts
|
|
@@ -1267,6 +1304,7 @@ var TAURI_COMMANDS = {
|
|
|
1267
1304
|
passwords: PASSWORD_COMMANDS,
|
|
1268
1305
|
contacts: CONTACT_COMMANDS,
|
|
1269
1306
|
models: MODEL_COMMANDS,
|
|
1307
|
+
peers: PEER_COMMANDS,
|
|
1270
1308
|
mail: MAIL_COMMANDS,
|
|
1271
1309
|
notifications: NOTIFICATION_COMMANDS
|
|
1272
1310
|
};
|
|
@@ -2461,6 +2499,24 @@ var ModelsAPI = class {
|
|
|
2461
2499
|
);
|
|
2462
2500
|
return answer.models;
|
|
2463
2501
|
}
|
|
2502
|
+
/**
|
|
2503
|
+
* Asks for a grant before the first job (holzi spec 055 US9) and resolves with the allowed
|
|
2504
|
+
* models that fit `needs`. Without one, the host asks the user as it would for a job, and the
|
|
2505
|
+
* SDK waits for the answer. Rejects with `no_capable_model` (8001) when no model of the host
|
|
2506
|
+
* fits and with a denial (1002) when the user refused. Nothing is sent to a model, and consent
|
|
2507
|
+
* for a destination outside this device is asked with the first job that sends data.
|
|
2508
|
+
*/
|
|
2509
|
+
async requestAccessAsync(request) {
|
|
2510
|
+
const answer = await this.client.request(
|
|
2511
|
+
MODEL_COMMANDS.requestAccess,
|
|
2512
|
+
{ ...request }
|
|
2513
|
+
);
|
|
2514
|
+
return answer.models;
|
|
2515
|
+
}
|
|
2516
|
+
/** Opens the host's page of this extension's models, where the user chooses models and effort. */
|
|
2517
|
+
async openSettingsAsync() {
|
|
2518
|
+
await this.client.request(MODEL_COMMANDS.openSettings, {});
|
|
2519
|
+
}
|
|
2464
2520
|
/** Starts a job; its end comes as {@link onCompleted}. Use {@link runAsync} to await it. */
|
|
2465
2521
|
async startAsync(job) {
|
|
2466
2522
|
const answer = await this.client.request(MODEL_COMMANDS.start, {
|
|
@@ -2533,6 +2589,158 @@ var ModelsAPI = class {
|
|
|
2533
2589
|
}
|
|
2534
2590
|
};
|
|
2535
2591
|
|
|
2592
|
+
// src/api/peers.ts
|
|
2593
|
+
init_cjs_shims();
|
|
2594
|
+
init_vaultKey();
|
|
2595
|
+
var PEER_ERROR_KINDS = {
|
|
2596
|
+
contact_unknown: "PEER_CONTACT_UNKNOWN",
|
|
2597
|
+
invite_not_open: "PEER_INVITE_UNKNOWN",
|
|
2598
|
+
channel_unknown: "PEER_CHANNEL_CLOSED",
|
|
2599
|
+
channel_closed: "PEER_CHANNEL_CLOSED",
|
|
2600
|
+
too_large: "PEER_PAYLOAD_TOO_LARGE",
|
|
2601
|
+
lobby_closed: "PEER_LOBBY_CLOSED",
|
|
2602
|
+
not_admitted: "PEER_NOT_ALLOWED",
|
|
2603
|
+
limit: "PEER_LIMIT",
|
|
2604
|
+
network_unavailable: "PEER_NETWORK_UNAVAILABLE",
|
|
2605
|
+
invalid_input: "PEER_INVALID_INPUT"
|
|
2606
|
+
};
|
|
2607
|
+
var PeerError = class extends Error {
|
|
2608
|
+
constructor(code, reason, message, details = {}, options) {
|
|
2609
|
+
super(message, options);
|
|
2610
|
+
this.code = code;
|
|
2611
|
+
this.reason = reason;
|
|
2612
|
+
this.details = details;
|
|
2613
|
+
this.name = "PeerError";
|
|
2614
|
+
this.kind = PEER_ERROR_KINDS[reason];
|
|
2615
|
+
if (typeof details.limit === "number") this.limit = details.limit;
|
|
2616
|
+
}
|
|
2617
|
+
};
|
|
2618
|
+
function isPeerErrorReason(value) {
|
|
2619
|
+
return typeof value === "string" && Object.hasOwn(PEER_ERROR_KINDS, value);
|
|
2620
|
+
}
|
|
2621
|
+
function toPeerError(error) {
|
|
2622
|
+
if (typeof error !== "object" || error === null) return error;
|
|
2623
|
+
const { code, message, details } = error;
|
|
2624
|
+
if (typeof code !== "number" || typeof details !== "object" || details === null) return error;
|
|
2625
|
+
const reason = details.reason;
|
|
2626
|
+
if (!isPeerErrorReason(reason)) return error;
|
|
2627
|
+
return new PeerError(
|
|
2628
|
+
code,
|
|
2629
|
+
reason,
|
|
2630
|
+
typeof message === "string" ? message : reason,
|
|
2631
|
+
details,
|
|
2632
|
+
{ cause: error }
|
|
2633
|
+
);
|
|
2634
|
+
}
|
|
2635
|
+
var EVENT_NAMES = {
|
|
2636
|
+
"invite-status": PEERS_EVENTS.INVITE_STATUS,
|
|
2637
|
+
"channel-opened": PEERS_EVENTS.CHANNEL_OPENED,
|
|
2638
|
+
joined: PEERS_EVENTS.JOINED,
|
|
2639
|
+
message: PEERS_EVENTS.MESSAGE,
|
|
2640
|
+
"channel-closed": PEERS_EVENTS.CHANNEL_CLOSED
|
|
2641
|
+
};
|
|
2642
|
+
function decodeEvent(type, data) {
|
|
2643
|
+
if (typeof data !== "object" || data === null) return void 0;
|
|
2644
|
+
if (type !== "message") return data;
|
|
2645
|
+
const message = data;
|
|
2646
|
+
if (typeof message.channelId !== "string" || typeof message.data !== "string") return void 0;
|
|
2647
|
+
let decoded;
|
|
2648
|
+
try {
|
|
2649
|
+
decoded = base64ToArrayBuffer(message.data);
|
|
2650
|
+
} catch {
|
|
2651
|
+
return void 0;
|
|
2652
|
+
}
|
|
2653
|
+
if (arrayBufferToBase64(decoded) !== message.data) return void 0;
|
|
2654
|
+
return {
|
|
2655
|
+
channelId: message.channelId,
|
|
2656
|
+
data: decoded,
|
|
2657
|
+
reliable: message.reliable === true
|
|
2658
|
+
};
|
|
2659
|
+
}
|
|
2660
|
+
var PeersAPI = class {
|
|
2661
|
+
constructor(client) {
|
|
2662
|
+
this.client = client;
|
|
2663
|
+
/** Largest fast message (`reliable: false`) in bytes. */
|
|
2664
|
+
this.MAX_FAST_BYTES = 1024;
|
|
2665
|
+
/** Largest reliable message in bytes. */
|
|
2666
|
+
this.MAX_RELIABLE_BYTES = 65536;
|
|
2667
|
+
/** Largest `payload` of an invitation or a join, as JSON, in bytes. */
|
|
2668
|
+
this.MAX_PAYLOAD_BYTES = 4096;
|
|
2669
|
+
}
|
|
2670
|
+
async call(method, params) {
|
|
2671
|
+
try {
|
|
2672
|
+
return await this.client.request(method, params);
|
|
2673
|
+
} catch (error) {
|
|
2674
|
+
throw toPeerError(error);
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
/** Invites a contact; the outcome follows as `invite-status` with this `inviteId`. */
|
|
2678
|
+
async inviteAsync(contactId, payload) {
|
|
2679
|
+
const answer = await this.call(PEER_COMMANDS.invite, { contactId, payload });
|
|
2680
|
+
return { inviteId: answer.inviteId };
|
|
2681
|
+
}
|
|
2682
|
+
/** Withdraws an open invitation on all devices of the contact; no `invite-status` follows. */
|
|
2683
|
+
async cancelInviteAsync(inviteId) {
|
|
2684
|
+
await this.call(PEER_COMMANDS.inviteCancel, { inviteId });
|
|
2685
|
+
}
|
|
2686
|
+
/**
|
|
2687
|
+
* Opens a lobby; `lobbyId` is 1–64 characters of `[A-Za-z0-9._-]`. The join code is opaque:
|
|
2688
|
+
* hand it on as it is.
|
|
2689
|
+
*/
|
|
2690
|
+
async openLobbyAsync(lobbyId, visibility) {
|
|
2691
|
+
const answer = await this.call(PEER_COMMANDS.lobbyOpen, { lobbyId, visibility });
|
|
2692
|
+
return { joinCode: answer.joinCode };
|
|
2693
|
+
}
|
|
2694
|
+
/** Closes a lobby: its code stops working, its channels stay open. An unknown lobby is fine. */
|
|
2695
|
+
async closeLobbyAsync(lobbyId) {
|
|
2696
|
+
await this.call(PEER_COMMANDS.lobbyClose, { lobbyId });
|
|
2697
|
+
}
|
|
2698
|
+
/**
|
|
2699
|
+
* Joins a lobby by its code with a self-chosen `displayName` (1–64 characters). The host
|
|
2700
|
+
* answers within 15 s; a lobby that cannot be joined for any reason rejects as `lobby_closed`.
|
|
2701
|
+
*/
|
|
2702
|
+
async joinAsync(joinCode, displayName, payload) {
|
|
2703
|
+
const answer = await this.call(PEER_COMMANDS.join, {
|
|
2704
|
+
joinCode,
|
|
2705
|
+
displayName,
|
|
2706
|
+
payload
|
|
2707
|
+
});
|
|
2708
|
+
return { channelId: answer.channelId, lobbyId: answer.lobbyId };
|
|
2709
|
+
}
|
|
2710
|
+
/** Closes a channel of an own lobby and keeps that device (and vault) out of the lobby. */
|
|
2711
|
+
async removeAsync(channelId) {
|
|
2712
|
+
await this.call(PEER_COMMANDS.remove, { channelId });
|
|
2713
|
+
}
|
|
2714
|
+
/**
|
|
2715
|
+
* Sends bytes over a channel: fast (default, at most {@link MAX_FAST_BYTES}, may be lost) or
|
|
2716
|
+
* `reliable` (at most {@link MAX_RELIABLE_BYTES}, in order; 16 may wait per channel).
|
|
2717
|
+
*/
|
|
2718
|
+
async sendAsync(channelId, data, options = {}) {
|
|
2719
|
+
await this.call(PEER_COMMANDS.send, {
|
|
2720
|
+
channelId,
|
|
2721
|
+
data: { $bytes: arrayBufferToBase64(data) },
|
|
2722
|
+
reliable: options.reliable ?? false
|
|
2723
|
+
});
|
|
2724
|
+
}
|
|
2725
|
+
/** Closes a channel; both sides get `channel-closed` with `reason: "closed"`. */
|
|
2726
|
+
async closeAsync(channelId) {
|
|
2727
|
+
await this.call(PEER_COMMANDS.close, { channelId });
|
|
2728
|
+
}
|
|
2729
|
+
/**
|
|
2730
|
+
* Listens for one of the peers events (`invite-status`, `channel-opened`, `joined`, `message`,
|
|
2731
|
+
* `channel-closed`); `message.data` arrives as bytes. Returns an unsubscribe function.
|
|
2732
|
+
*/
|
|
2733
|
+
on(type, handler) {
|
|
2734
|
+
const name = EVENT_NAMES[type];
|
|
2735
|
+
const wrapped = (event) => {
|
|
2736
|
+
const decoded = decodeEvent(type, event.data);
|
|
2737
|
+
if (decoded) handler(decoded);
|
|
2738
|
+
};
|
|
2739
|
+
this.client.on(name, wrapped);
|
|
2740
|
+
return () => this.client.off(name, wrapped);
|
|
2741
|
+
}
|
|
2742
|
+
};
|
|
2743
|
+
|
|
2536
2744
|
// src/api/mail.ts
|
|
2537
2745
|
init_cjs_shims();
|
|
2538
2746
|
var MailAPI = class {
|
|
@@ -3650,6 +3858,7 @@ var HaexVaultSdk = class {
|
|
|
3650
3858
|
this.passwords = new PasswordsAPI(this);
|
|
3651
3859
|
this.contacts = new ContactsAPI(this);
|
|
3652
3860
|
this.models = new ModelsAPI(this);
|
|
3861
|
+
this.peers = new PeersAPI(this);
|
|
3653
3862
|
this.mail = new MailAPI(this);
|
|
3654
3863
|
this.notifications = new NotificationsAPI(this);
|
|
3655
3864
|
this.tab = new TabAPI(this);
|
|
@@ -4550,7 +4759,12 @@ exports.NOTIFICATION_COMMANDS = NOTIFICATION_COMMANDS;
|
|
|
4550
4759
|
exports.NOTIFICATION_EVENTS = NOTIFICATION_EVENTS;
|
|
4551
4760
|
exports.NotificationsAPI = NotificationsAPI;
|
|
4552
4761
|
exports.PASSWORD_COMMANDS = PASSWORD_COMMANDS;
|
|
4762
|
+
exports.PEERS_EVENTS = PEERS_EVENTS;
|
|
4763
|
+
exports.PEER_COMMANDS = PEER_COMMANDS;
|
|
4764
|
+
exports.PEER_ERROR_KINDS = PEER_ERROR_KINDS;
|
|
4553
4765
|
exports.PasswordsAPI = PasswordsAPI;
|
|
4766
|
+
exports.PeerError = PeerError;
|
|
4767
|
+
exports.PeersAPI = PeersAPI;
|
|
4554
4768
|
exports.PermissionErrorCode = PermissionErrorCode;
|
|
4555
4769
|
exports.PermissionStatus = PermissionStatus;
|
|
4556
4770
|
exports.PermissionsAPI = PermissionsAPI;
|