@haex-space/vault-sdk 5.5.0 → 5.6.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/dist/autofill.js +1 -1
- package/dist/autofill.js.map +1 -1
- package/dist/autofill.mjs +1 -1
- package/dist/autofill.mjs.map +1 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{client-CtUpYUH7.d.ts → client-5T310pDa.d.mts} +142 -3
- package/dist/{client-BFDgj2tC.d.mts → client-r56Io3Ns.d.ts} +142 -3
- package/dist/haex_bundle_bg.wasm +0 -0
- package/dist/index.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +47 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -2
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.mjs +1 -1
- package/dist/node.mjs.map +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/nuxt.js.map +1 -1
- package/dist/passgen.js +1 -1
- package/dist/passgen.js.map +1 -1
- package/dist/passgen.mjs +1 -1
- package/dist/passgen.mjs.map +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +56 -2
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +55 -1
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.js +53 -0
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +53 -0
- 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 +56 -2
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +55 -1
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-CNxDNQgb.d.mts → types-keveJwPq.d.mts} +3 -0
- package/dist/{types-CNxDNQgb.d.ts → types-keveJwPq.d.ts} +3 -0
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +56 -2
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +55 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ var __export = (target, all) => {
|
|
|
17
17
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
18
|
};
|
|
19
19
|
var init_esm_shims = __esm({
|
|
20
|
-
"node_modules/.pnpm/tsup@9.0.0_jiti@2.7.0_postcss@8.5.
|
|
20
|
+
"node_modules/.pnpm/tsup@9.0.0_jiti@2.7.0_postcss@8.5.33_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/esm_shims.js"() {
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
|
|
@@ -752,6 +752,9 @@ var HAEXTENSION_EVENTS = {
|
|
|
752
752
|
FILE_CHANGED: "filesync:file-changed",
|
|
753
753
|
/** Tables have been updated via sync (CRDT pull from server) */
|
|
754
754
|
SYNC_TABLES_UPDATED: "haextension:sync:tables-updated",
|
|
755
|
+
/** The user used a control of this extension's header (holzi spec 090): `{ id, kind, value? }`.
|
|
756
|
+
* Subscribe through `client.header.onEvent`. */
|
|
757
|
+
HEADER_EVENT: "haextension:header:event",
|
|
755
758
|
/** A runtime permission prompt was resolved (granted/denied) by the user.
|
|
756
759
|
* The SDK uses this to auto-retry the original request; extensions may also
|
|
757
760
|
* subscribe via `client.on(HAEXTENSION_EVENTS.PERMISSION_RESOLVED, ...)`. */
|
|
@@ -1056,6 +1059,8 @@ var EXTENSION_COMMANDS = {
|
|
|
1056
1059
|
emitSyncTables: "extension_emit_sync_tables",
|
|
1057
1060
|
/** Ask the host to mark (or unmark) this extension's own tab as wanting attention */
|
|
1058
1061
|
tabAttention: "extension_tab_attention",
|
|
1062
|
+
/** Replace the header of this extension's own tab (holzi spec 090): `null` */
|
|
1063
|
+
headerSet: "extension_header_set",
|
|
1059
1064
|
/** Ask the user to confirm, in a dialog the host draws over this extension's tab */
|
|
1060
1065
|
dialogConfirm: "extension_dialog_confirm",
|
|
1061
1066
|
/** Take the request the user gave this extension (holzi spec 063): `null` or `{ action, mail }` */
|
|
@@ -3002,6 +3007,44 @@ var TabAPI = class {
|
|
|
3002
3007
|
}
|
|
3003
3008
|
};
|
|
3004
3009
|
|
|
3010
|
+
// src/api/header.ts
|
|
3011
|
+
init_esm_shims();
|
|
3012
|
+
var NOT_SUPPORTED2 = 8e3;
|
|
3013
|
+
function isUnknownMethod(error) {
|
|
3014
|
+
if (error?.code === NOT_SUPPORTED2) return true;
|
|
3015
|
+
const text = typeof error === "string" ? error : error?.message;
|
|
3016
|
+
return typeof text === "string" && /^Unknown method\b/.test(text);
|
|
3017
|
+
}
|
|
3018
|
+
var HeaderAPI = class {
|
|
3019
|
+
constructor(client) {
|
|
3020
|
+
this.client = client;
|
|
3021
|
+
}
|
|
3022
|
+
/**
|
|
3023
|
+
* Replace the header with `description`. Resolves `true` when the host applied it, and `false`
|
|
3024
|
+
* when the host has no header (haex-vault 2.x); the extension keeps running either way. Every
|
|
3025
|
+
* other error rejects, such as `3001` for a description the host refuses (the previous header
|
|
3026
|
+
* stays).
|
|
3027
|
+
*/
|
|
3028
|
+
async set(description) {
|
|
3029
|
+
try {
|
|
3030
|
+
await this.client.request(EXTENSION_COMMANDS.headerSet, { ...description });
|
|
3031
|
+
return true;
|
|
3032
|
+
} catch (error) {
|
|
3033
|
+
if (isUnknownMethod(error)) return false;
|
|
3034
|
+
throw error;
|
|
3035
|
+
}
|
|
3036
|
+
}
|
|
3037
|
+
/** Listen for the user using a control of this extension's header. Returns an unsubscribe function. */
|
|
3038
|
+
onEvent(handler) {
|
|
3039
|
+
const wrapped = (event) => {
|
|
3040
|
+
const data = event.data;
|
|
3041
|
+
if (data) handler(data);
|
|
3042
|
+
};
|
|
3043
|
+
this.client.on(HAEXTENSION_EVENTS.HEADER_EVENT, wrapped);
|
|
3044
|
+
return () => this.client.off(HAEXTENSION_EVENTS.HEADER_EVENT, wrapped);
|
|
3045
|
+
}
|
|
3046
|
+
};
|
|
3047
|
+
|
|
3005
3048
|
// src/api/dialog.ts
|
|
3006
3049
|
init_esm_shims();
|
|
3007
3050
|
var DialogAPI = class {
|
|
@@ -3952,6 +3995,7 @@ var HaexVaultSdk = class {
|
|
|
3952
3995
|
this.mail = new MailAPI(this);
|
|
3953
3996
|
this.notifications = new NotificationsAPI(this);
|
|
3954
3997
|
this.tab = new TabAPI(this);
|
|
3998
|
+
this.header = new HeaderAPI(this);
|
|
3955
3999
|
this.dialog = new DialogAPI(this);
|
|
3956
4000
|
this.openers = new OpenersAPI(this);
|
|
3957
4001
|
this.tools = new ToolsAPI({
|
|
@@ -4819,6 +4863,6 @@ function createHaexVaultSdk(config = {}) {
|
|
|
4819
4863
|
return new HaexVaultSdk(config);
|
|
4820
4864
|
}
|
|
4821
4865
|
|
|
4822
|
-
export { CONTACT_COMMANDS, COSE_ALGORITHM, ContactsAPI, DEFAULT_TIMEOUT, DatabaseAPI, DialogAPI, ENCRYPTED_FOLDER_COMMANDS, EXTERNAL_EVENTS, EncryptedFoldersAPI, ErrorCode, ExternalConnectionErrorCode, ExternalConnectionState, FilesystemAPI, HAEXSPACE_MESSAGE_TYPES, HAEXTENSION_EVENTS, HaexVaultSdk, HaexVaultSdkError, HostErrorCode, KEY_AGREEMENT_ALGO, KnownPath, LOCALSEND_EVENTS, LocalSendAPI, MAIL_COMMANDS, MAIL_EVENTS, MODEL_COMMANDS, MODEL_JOB_EVENTS, MailAPI, ModelsAPI, NOTIFICATION_COMMANDS, NOTIFICATION_EVENTS, NotificationsAPI, OPENER_EVENTS, OpenersAPI, PASSWORD_COMMANDS, PEERS_EVENTS, PEER_COMMANDS, PEER_ERROR_KINDS, PasswordsAPI, PeerError, PeersAPI, PermissionErrorCode, PermissionStatus, PermissionsAPI, RemoteStorageAPI, SHELL_EVENTS, SIGNING_ALGO, SPACE_COMMANDS, ShellAPI, SpacesAPI, TABLE_SEPARATOR, TAURI_COMMANDS, TabAPI, ToolsAPI, WebAPI, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, canExternalClientSendRequests, 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, getTableName, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, isExternalClientConnected, isPermissionDeniedError, isPermissionError, isPermissionPromptError, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, unwrapKey, verifyClaimPresentationAsync, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|
|
4866
|
+
export { CONTACT_COMMANDS, COSE_ALGORITHM, ContactsAPI, DEFAULT_TIMEOUT, DatabaseAPI, DialogAPI, ENCRYPTED_FOLDER_COMMANDS, EXTERNAL_EVENTS, EncryptedFoldersAPI, ErrorCode, ExternalConnectionErrorCode, ExternalConnectionState, FilesystemAPI, HAEXSPACE_MESSAGE_TYPES, HAEXTENSION_EVENTS, HaexVaultSdk, HaexVaultSdkError, HeaderAPI, HostErrorCode, KEY_AGREEMENT_ALGO, KnownPath, LOCALSEND_EVENTS, LocalSendAPI, MAIL_COMMANDS, MAIL_EVENTS, MODEL_COMMANDS, MODEL_JOB_EVENTS, MailAPI, ModelsAPI, NOTIFICATION_COMMANDS, NOTIFICATION_EVENTS, NotificationsAPI, OPENER_EVENTS, OpenersAPI, PASSWORD_COMMANDS, PEERS_EVENTS, PEER_COMMANDS, PEER_ERROR_KINDS, PasswordsAPI, PeerError, PeersAPI, PermissionErrorCode, PermissionStatus, PermissionsAPI, RemoteStorageAPI, SHELL_EVENTS, SIGNING_ALGO, SPACE_COMMANDS, ShellAPI, SpacesAPI, TABLE_SEPARATOR, TAURI_COMMANDS, TabAPI, ToolsAPI, WebAPI, arrayBufferToBase64, base58btcDecode, base58btcEncode, base64ToArrayBuffer, canExternalClientSendRequests, 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, getTableName, importPrivateKeyAsync, importPrivateKeyForKeyAgreementAsync, importPublicKeyAsync, importPublicKeyForKeyAgreementAsync, importUserPrivateKeyAsync, importUserPublicKeyAsync, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, isExternalClientConnected, isPermissionDeniedError, isPermissionError, isPermissionPromptError, publicKeyToDidKeyAsync, signClaimPresentationAsync, signRecordAsync, signSpaceChallengeAsync, signWithPasskeyAsync, unwrapKey, verifyClaimPresentationAsync, verifyRecordSignatureAsync, verifySpaceChallengeAsync, verifyWithPasskeyAsync, wrapKey };
|
|
4823
4867
|
//# sourceMappingURL=index.mjs.map
|
|
4824
4868
|
//# sourceMappingURL=index.mjs.map
|