@haex-space/vault-sdk 3.7.0 → 4.0.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 +51 -19
- package/dist/cli/index.js +437 -355
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +428 -339
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{client-DH4Km77u.d.ts → client-C6pEREPM.d.ts} +48 -3
- package/dist/{client-Dn4AbXbT.d.mts → client-GdCi-m2s.d.mts} +48 -3
- package/dist/haex_bundle_bg.wasm +0 -0
- package/dist/index.d.mts +11 -59
- package/dist/index.d.ts +11 -59
- package/dist/index.js +130 -105
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +149 -123
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +53 -2
- package/dist/node.d.ts +53 -2
- package/dist/node.js +319 -2
- package/dist/node.js.map +1 -1
- package/dist/node.mjs +320 -5
- package/dist/node.mjs.map +1 -1
- package/dist/nuxt.js +7 -5
- package/dist/nuxt.js.map +1 -1
- package/dist/nuxt.mjs +3 -2
- package/dist/nuxt.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +137 -7
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +157 -27
- 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 +45 -7
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +45 -7
- 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 +137 -7
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +157 -27
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-DQZCRfC-.d.mts → types-Ba4G6ZpC.d.mts} +10 -2
- package/dist/{types-DQZCRfC-.d.ts → types-Ba4G6ZpC.d.ts} +10 -2
- package/dist/vue.d.mts +2 -2
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +137 -7
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +157 -27
- package/dist/vue.mjs.map +1 -1
- package/package.json +8 -6
package/dist/svelte.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { H as HaexVaultSdk, S as StorageAPI } from './client-
|
|
1
|
+
import { H as HaexVaultSdk, S as StorageAPI } from './client-GdCi-m2s.mjs';
|
|
2
2
|
import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
|
|
3
3
|
import { Readable } from 'svelte/store';
|
|
4
|
-
import { A as ApplicationContext,
|
|
4
|
+
import { A as ApplicationContext, E as ExtensionInfo, H as HaexHubConfig } from './types-Ba4G6ZpC.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Initialize the HaexVault SDK for Svelte
|
package/dist/svelte.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { H as HaexVaultSdk, S as StorageAPI } from './client-
|
|
1
|
+
import { H as HaexVaultSdk, S as StorageAPI } from './client-C6pEREPM.js';
|
|
2
2
|
import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
|
|
3
3
|
import { Readable } from 'svelte/store';
|
|
4
|
-
import { A as ApplicationContext,
|
|
4
|
+
import { A as ApplicationContext, E as ExtensionInfo, H as HaexHubConfig } from './types-Ba4G6ZpC.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Initialize the HaexVault SDK for Svelte
|
package/dist/svelte.js
CHANGED
|
@@ -8,6 +8,12 @@ var __esm = (fn, res) => function __init() {
|
|
|
8
8
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
// node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.28_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
|
|
12
|
+
var init_cjs_shims = __esm({
|
|
13
|
+
"node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.28_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js"() {
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
11
17
|
// src/crypto/vaultKey.ts
|
|
12
18
|
function arrayBufferToBase64(buffer) {
|
|
13
19
|
const bytes = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
|
|
@@ -36,17 +42,29 @@ function base64ToArrayBuffer(base64) {
|
|
|
36
42
|
}
|
|
37
43
|
var init_vaultKey = __esm({
|
|
38
44
|
"src/crypto/vaultKey.ts"() {
|
|
45
|
+
init_cjs_shims();
|
|
39
46
|
}
|
|
40
47
|
});
|
|
41
48
|
|
|
42
49
|
// src/crypto/userKeypair.ts
|
|
43
50
|
var init_userKeypair = __esm({
|
|
44
51
|
"src/crypto/userKeypair.ts"() {
|
|
52
|
+
init_cjs_shims();
|
|
45
53
|
init_vaultKey();
|
|
46
54
|
}
|
|
47
55
|
});
|
|
48
56
|
|
|
57
|
+
// src/svelte.ts
|
|
58
|
+
init_cjs_shims();
|
|
59
|
+
|
|
60
|
+
// src/index.ts
|
|
61
|
+
init_cjs_shims();
|
|
62
|
+
|
|
63
|
+
// src/polyfills/index.ts
|
|
64
|
+
init_cjs_shims();
|
|
65
|
+
|
|
49
66
|
// src/polyfills/localStorage.ts
|
|
67
|
+
init_cjs_shims();
|
|
50
68
|
function installLocalStoragePolyfill() {
|
|
51
69
|
if (typeof window === "undefined") {
|
|
52
70
|
return;
|
|
@@ -141,6 +159,7 @@ function installSessionStoragePolyfill() {
|
|
|
141
159
|
}
|
|
142
160
|
|
|
143
161
|
// src/polyfills/cookies.ts
|
|
162
|
+
init_cjs_shims();
|
|
144
163
|
function installCookiePolyfill() {
|
|
145
164
|
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
146
165
|
return;
|
|
@@ -201,6 +220,7 @@ function installCookiePolyfill() {
|
|
|
201
220
|
}
|
|
202
221
|
|
|
203
222
|
// src/polyfills/history.ts
|
|
223
|
+
init_cjs_shims();
|
|
204
224
|
function installHistoryPolyfill() {
|
|
205
225
|
if (typeof window === "undefined" || typeof history === "undefined") {
|
|
206
226
|
return;
|
|
@@ -264,7 +284,11 @@ function installHistoryPolyfill() {
|
|
|
264
284
|
}
|
|
265
285
|
}
|
|
266
286
|
|
|
287
|
+
// src/polyfills/debug.ts
|
|
288
|
+
init_cjs_shims();
|
|
289
|
+
|
|
267
290
|
// src/messages.ts
|
|
291
|
+
init_cjs_shims();
|
|
268
292
|
var HAEXSPACE_MESSAGE_TYPES = {
|
|
269
293
|
/** Debug message for development/troubleshooting */
|
|
270
294
|
DEBUG: "haexspace:debug",
|
|
@@ -308,7 +332,11 @@ function installDebugDiagnostics() {
|
|
|
308
332
|
}
|
|
309
333
|
}
|
|
310
334
|
|
|
335
|
+
// src/polyfills/baseTag.ts
|
|
336
|
+
init_cjs_shims();
|
|
337
|
+
|
|
311
338
|
// src/polyfills/consoleForwarding.ts
|
|
339
|
+
init_cjs_shims();
|
|
312
340
|
var originalConsole = {
|
|
313
341
|
log: console.log,
|
|
314
342
|
info: console.info,
|
|
@@ -389,7 +417,14 @@ if (typeof window !== "undefined") {
|
|
|
389
417
|
installPolyfills();
|
|
390
418
|
}
|
|
391
419
|
|
|
420
|
+
// src/client.ts
|
|
421
|
+
init_cjs_shims();
|
|
422
|
+
|
|
423
|
+
// src/types.ts
|
|
424
|
+
init_cjs_shims();
|
|
425
|
+
|
|
392
426
|
// src/events.ts
|
|
427
|
+
init_cjs_shims();
|
|
393
428
|
var HAEXTENSION_EVENTS = {
|
|
394
429
|
/** Context (theme, locale, platform) has changed */
|
|
395
430
|
CONTEXT_CHANGED: "haextension:context:changed",
|
|
@@ -467,7 +502,17 @@ var HaexVaultSdkError = class extends Error {
|
|
|
467
502
|
}
|
|
468
503
|
};
|
|
469
504
|
|
|
505
|
+
// src/api/storage.ts
|
|
506
|
+
init_cjs_shims();
|
|
507
|
+
|
|
508
|
+
// src/commands.ts
|
|
509
|
+
init_cjs_shims();
|
|
510
|
+
|
|
511
|
+
// src/commands/index.ts
|
|
512
|
+
init_cjs_shims();
|
|
513
|
+
|
|
470
514
|
// src/commands/database.ts
|
|
515
|
+
init_cjs_shims();
|
|
471
516
|
var DATABASE_COMMANDS = {
|
|
472
517
|
/** Execute a SELECT query */
|
|
473
518
|
query: "extension_database_query",
|
|
@@ -480,6 +525,7 @@ var DATABASE_COMMANDS = {
|
|
|
480
525
|
};
|
|
481
526
|
|
|
482
527
|
// src/commands/permissions.ts
|
|
528
|
+
init_cjs_shims();
|
|
483
529
|
var PERMISSIONS_COMMANDS = {
|
|
484
530
|
/** Check web/fetch permission */
|
|
485
531
|
checkWeb: "extension_permissions_check_web",
|
|
@@ -490,6 +536,7 @@ var PERMISSIONS_COMMANDS = {
|
|
|
490
536
|
};
|
|
491
537
|
|
|
492
538
|
// src/commands/web.ts
|
|
539
|
+
init_cjs_shims();
|
|
493
540
|
var WEB_COMMANDS = {
|
|
494
541
|
/** Open URL in external browser */
|
|
495
542
|
open: "extension_web_open",
|
|
@@ -498,6 +545,7 @@ var WEB_COMMANDS = {
|
|
|
498
545
|
};
|
|
499
546
|
|
|
500
547
|
// src/commands/webStorage.ts
|
|
548
|
+
init_cjs_shims();
|
|
501
549
|
var WEB_STORAGE_COMMANDS = {
|
|
502
550
|
/** Get item from storage */
|
|
503
551
|
getItem: "extension_web_storage_get_item",
|
|
@@ -512,6 +560,7 @@ var WEB_STORAGE_COMMANDS = {
|
|
|
512
560
|
};
|
|
513
561
|
|
|
514
562
|
// src/commands/filesystem.ts
|
|
563
|
+
init_cjs_shims();
|
|
515
564
|
var FILESYSTEM_COMMANDS = {
|
|
516
565
|
// Dialog commands
|
|
517
566
|
/** Show save file dialog */
|
|
@@ -555,19 +604,27 @@ var FILESYSTEM_COMMANDS = {
|
|
|
555
604
|
};
|
|
556
605
|
|
|
557
606
|
// src/commands/externalBridge.ts
|
|
607
|
+
init_cjs_shims();
|
|
558
608
|
var EXTERNAL_BRIDGE_COMMANDS = {
|
|
559
609
|
// Response handling (called by extensions)
|
|
560
610
|
/** Respond to an external request */
|
|
561
611
|
respond: "external_bridge_respond"};
|
|
562
612
|
|
|
563
613
|
// src/commands/extension.ts
|
|
614
|
+
init_cjs_shims();
|
|
564
615
|
var EXTENSION_COMMANDS = {
|
|
565
616
|
/** Get extension info (manifest, id, etc.) */
|
|
566
617
|
getInfo: "extension_get_info",
|
|
567
618
|
/** Get application context (theme, locale, etc.) */
|
|
568
|
-
getContext: "extension_context_get"
|
|
619
|
+
getContext: "extension_context_get",
|
|
620
|
+
/** Ask the host to mark (or unmark) this extension's own tab as wanting attention */
|
|
621
|
+
tabAttention: "extension_tab_attention",
|
|
622
|
+
/** Ask the user to confirm, in a dialog the host draws over this extension's tab */
|
|
623
|
+
dialogConfirm: "extension_dialog_confirm"
|
|
624
|
+
};
|
|
569
625
|
|
|
570
626
|
// src/commands/remoteStorage.ts
|
|
627
|
+
init_cjs_shims();
|
|
571
628
|
var REMOTE_STORAGE_COMMANDS = {
|
|
572
629
|
// Backend Management
|
|
573
630
|
/** List all storage backends */
|
|
@@ -592,6 +649,7 @@ var REMOTE_STORAGE_COMMANDS = {
|
|
|
592
649
|
};
|
|
593
650
|
|
|
594
651
|
// src/commands/localsend.ts
|
|
652
|
+
init_cjs_shims();
|
|
595
653
|
var LOCALSEND_COMMANDS = {
|
|
596
654
|
// Initialization
|
|
597
655
|
/** Initialize LocalSend (generate identity, etc.) */
|
|
@@ -638,6 +696,7 @@ var LOCALSEND_COMMANDS = {
|
|
|
638
696
|
};
|
|
639
697
|
|
|
640
698
|
// src/commands/spaces.ts
|
|
699
|
+
init_cjs_shims();
|
|
641
700
|
var SPACE_COMMANDS = {
|
|
642
701
|
/** Bulk assign rows to spaces */
|
|
643
702
|
assign: "extension_space_assign",
|
|
@@ -651,6 +710,7 @@ var SPACE_COMMANDS = {
|
|
|
651
710
|
list: "extension_space_list"};
|
|
652
711
|
|
|
653
712
|
// src/commands/shell.ts
|
|
713
|
+
init_cjs_shims();
|
|
654
714
|
var SHELL_COMMANDS = {
|
|
655
715
|
/** List available shell environments (no permission required) */
|
|
656
716
|
listAvailable: "extension_shell_list_available",
|
|
@@ -665,6 +725,7 @@ var SHELL_COMMANDS = {
|
|
|
665
725
|
};
|
|
666
726
|
|
|
667
727
|
// src/commands/passwords.ts
|
|
728
|
+
init_cjs_shims();
|
|
668
729
|
var PASSWORD_COMMANDS = {
|
|
669
730
|
/** List items (no secrets) within the extension's tag scope */
|
|
670
731
|
list: "extension_password_list",
|
|
@@ -679,6 +740,7 @@ var PASSWORD_COMMANDS = {
|
|
|
679
740
|
};
|
|
680
741
|
|
|
681
742
|
// src/commands/mail.ts
|
|
743
|
+
init_cjs_shims();
|
|
682
744
|
var MAIL_COMMANDS = {
|
|
683
745
|
/** LIST mailboxes + optional STATUS counts */
|
|
684
746
|
listMailboxes: "extension_mail_list_mailboxes",
|
|
@@ -705,6 +767,7 @@ var MAIL_COMMANDS = {
|
|
|
705
767
|
};
|
|
706
768
|
|
|
707
769
|
// src/commands/notifications.ts
|
|
770
|
+
init_cjs_shims();
|
|
708
771
|
var NOTIFICATION_COMMANDS = {
|
|
709
772
|
/** Show an OS notification. Returns the assigned notification id. */
|
|
710
773
|
show: "extension_notifications_show",
|
|
@@ -735,6 +798,7 @@ var StorageAPI = class {
|
|
|
735
798
|
};
|
|
736
799
|
|
|
737
800
|
// src/api/database.ts
|
|
801
|
+
init_cjs_shims();
|
|
738
802
|
function quoteIdent(identifier) {
|
|
739
803
|
if (identifier.startsWith('"') && identifier.endsWith('"')) {
|
|
740
804
|
return identifier;
|
|
@@ -834,6 +898,7 @@ var DatabaseAPI = class {
|
|
|
834
898
|
};
|
|
835
899
|
|
|
836
900
|
// src/api/filesystem.ts
|
|
901
|
+
init_cjs_shims();
|
|
837
902
|
init_vaultKey();
|
|
838
903
|
var FilesystemAPI = class {
|
|
839
904
|
constructor(client) {
|
|
@@ -1069,6 +1134,7 @@ var FilesystemAPI = class {
|
|
|
1069
1134
|
};
|
|
1070
1135
|
|
|
1071
1136
|
// src/api/web.ts
|
|
1137
|
+
init_cjs_shims();
|
|
1072
1138
|
var WebAPI = class {
|
|
1073
1139
|
constructor(client) {
|
|
1074
1140
|
this.client = client;
|
|
@@ -1182,6 +1248,7 @@ var WebAPI = class {
|
|
|
1182
1248
|
};
|
|
1183
1249
|
|
|
1184
1250
|
// src/api/permissions.ts
|
|
1251
|
+
init_cjs_shims();
|
|
1185
1252
|
var PermissionsAPI = class {
|
|
1186
1253
|
constructor(client) {
|
|
1187
1254
|
this.client = client;
|
|
@@ -1236,6 +1303,7 @@ var PermissionsAPI = class {
|
|
|
1236
1303
|
};
|
|
1237
1304
|
|
|
1238
1305
|
// src/api/remoteStorage.ts
|
|
1306
|
+
init_cjs_shims();
|
|
1239
1307
|
init_vaultKey();
|
|
1240
1308
|
var RemoteStorageAPI = class {
|
|
1241
1309
|
constructor(client) {
|
|
@@ -1346,6 +1414,7 @@ var BackendManagement = class {
|
|
|
1346
1414
|
};
|
|
1347
1415
|
|
|
1348
1416
|
// src/api/localsend.ts
|
|
1417
|
+
init_cjs_shims();
|
|
1349
1418
|
var LOCALSEND_EVENTS = {
|
|
1350
1419
|
/** New device discovered */
|
|
1351
1420
|
deviceDiscovered: "localsend:device-discovered",
|
|
@@ -1517,6 +1586,7 @@ var LocalSendAPI = class {
|
|
|
1517
1586
|
};
|
|
1518
1587
|
|
|
1519
1588
|
// src/api/spaces.ts
|
|
1589
|
+
init_cjs_shims();
|
|
1520
1590
|
var SpacesAPI = class {
|
|
1521
1591
|
constructor(client) {
|
|
1522
1592
|
this.client = client;
|
|
@@ -1589,6 +1659,7 @@ var SpacesAPI = class {
|
|
|
1589
1659
|
};
|
|
1590
1660
|
|
|
1591
1661
|
// src/api/shell.ts
|
|
1662
|
+
init_cjs_shims();
|
|
1592
1663
|
var ShellAPI = class {
|
|
1593
1664
|
constructor(sdk) {
|
|
1594
1665
|
this.sdk = sdk;
|
|
@@ -1660,6 +1731,7 @@ var ShellAPI = class {
|
|
|
1660
1731
|
};
|
|
1661
1732
|
|
|
1662
1733
|
// src/api/passwords.ts
|
|
1734
|
+
init_cjs_shims();
|
|
1663
1735
|
var PasswordsAPI = class {
|
|
1664
1736
|
constructor(client) {
|
|
1665
1737
|
this.client = client;
|
|
@@ -1705,6 +1777,7 @@ var PasswordsAPI = class {
|
|
|
1705
1777
|
};
|
|
1706
1778
|
|
|
1707
1779
|
// src/api/mail.ts
|
|
1780
|
+
init_cjs_shims();
|
|
1708
1781
|
var MailAPI = class {
|
|
1709
1782
|
constructor(client) {
|
|
1710
1783
|
this.client = client;
|
|
@@ -1844,6 +1917,7 @@ var MailAPI = class {
|
|
|
1844
1917
|
};
|
|
1845
1918
|
|
|
1846
1919
|
// src/api/notifications.ts
|
|
1920
|
+
init_cjs_shims();
|
|
1847
1921
|
var NotificationsAPI = class {
|
|
1848
1922
|
constructor(client) {
|
|
1849
1923
|
this.client = client;
|
|
@@ -1875,7 +1949,36 @@ var NotificationsAPI = class {
|
|
|
1875
1949
|
}
|
|
1876
1950
|
};
|
|
1877
1951
|
|
|
1952
|
+
// src/api/tab.ts
|
|
1953
|
+
init_cjs_shims();
|
|
1954
|
+
var TabAPI = class {
|
|
1955
|
+
constructor(client) {
|
|
1956
|
+
this.client = client;
|
|
1957
|
+
}
|
|
1958
|
+
/**
|
|
1959
|
+
* Mark the tab as wanting the user's attention (`true`), e.g. for unread
|
|
1960
|
+
* content, or clear the mark (`false`).
|
|
1961
|
+
*/
|
|
1962
|
+
async requestAttention(active) {
|
|
1963
|
+
await this.client.request(EXTENSION_COMMANDS.tabAttention, { active });
|
|
1964
|
+
}
|
|
1965
|
+
};
|
|
1966
|
+
|
|
1967
|
+
// src/api/dialog.ts
|
|
1968
|
+
init_cjs_shims();
|
|
1969
|
+
var DialogAPI = class {
|
|
1970
|
+
constructor(client) {
|
|
1971
|
+
this.client = client;
|
|
1972
|
+
}
|
|
1973
|
+
/** Asks the user; resolves `true` for confirm, `false` for cancel or when the dialog is closed. */
|
|
1974
|
+
async confirm(options) {
|
|
1975
|
+
const answer = await this.client.request(EXTENSION_COMMANDS.dialogConfirm, { ...options }, { timeout: null });
|
|
1976
|
+
return answer === true;
|
|
1977
|
+
}
|
|
1978
|
+
};
|
|
1979
|
+
|
|
1878
1980
|
// src/client/tableName.ts
|
|
1981
|
+
init_cjs_shims();
|
|
1879
1982
|
function validatePublicKey(publicKey) {
|
|
1880
1983
|
if (!publicKey || typeof publicKey !== "string" || publicKey.trim() === "") {
|
|
1881
1984
|
throw new HaexVaultSdkError(
|
|
@@ -1961,6 +2064,7 @@ function parseTableName(fullTableName) {
|
|
|
1961
2064
|
}
|
|
1962
2065
|
|
|
1963
2066
|
// src/client/init.ts
|
|
2067
|
+
init_cjs_shims();
|
|
1964
2068
|
var PORT_HANDSHAKE_TIMEOUT_MS = 1e4;
|
|
1965
2069
|
function getCurrentWebviewLabel() {
|
|
1966
2070
|
const internals = window.__TAURI_INTERNALS__;
|
|
@@ -2109,6 +2213,10 @@ function waitForHostPortAsync(log) {
|
|
|
2109
2213
|
const handler = (event) => {
|
|
2110
2214
|
const type = event.data?.type;
|
|
2111
2215
|
if (type !== HAEXSPACE_MESSAGE_TYPES.PORT_INIT) return;
|
|
2216
|
+
if (event.source !== window.parent) {
|
|
2217
|
+
log("PORT_INIT from a window other than the parent \u2014 ignoring");
|
|
2218
|
+
return;
|
|
2219
|
+
}
|
|
2112
2220
|
const port = event.ports[0];
|
|
2113
2221
|
if (!port) {
|
|
2114
2222
|
log("PORT_INIT received but event.ports is empty \u2014 ignoring");
|
|
@@ -2142,10 +2250,11 @@ postMessage error: ${e}`);
|
|
|
2142
2250
|
}
|
|
2143
2251
|
|
|
2144
2252
|
// src/client/transport.ts
|
|
2253
|
+
init_cjs_shims();
|
|
2145
2254
|
function generateRequestId(counter) {
|
|
2146
2255
|
return `req_${counter}`;
|
|
2147
2256
|
}
|
|
2148
|
-
function sendPostMessage(method, params, requestId, config, extensionInfo2, pendingRequests, port) {
|
|
2257
|
+
function sendPostMessage(method, params, requestId, config, extensionInfo2, pendingRequests, port, timeoutMs = config.timeout) {
|
|
2149
2258
|
if (!port) {
|
|
2150
2259
|
return Promise.reject(
|
|
2151
2260
|
new HaexVaultSdkError(
|
|
@@ -2160,14 +2269,14 @@ function sendPostMessage(method, params, requestId, config, extensionInfo2, pend
|
|
|
2160
2269
|
timestamp: Date.now()
|
|
2161
2270
|
};
|
|
2162
2271
|
return new Promise((resolve, reject) => {
|
|
2163
|
-
const timeout = setTimeout(() => {
|
|
2272
|
+
const timeout = timeoutMs === null ? void 0 : setTimeout(() => {
|
|
2164
2273
|
pendingRequests.delete(requestId);
|
|
2165
2274
|
reject(
|
|
2166
2275
|
new HaexVaultSdkError("TIMEOUT" /* TIMEOUT */, "errors.timeout", {
|
|
2167
|
-
timeout:
|
|
2276
|
+
timeout: timeoutMs
|
|
2168
2277
|
})
|
|
2169
2278
|
);
|
|
2170
|
-
},
|
|
2279
|
+
}, timeoutMs);
|
|
2171
2280
|
pendingRequests.set(requestId, { resolve, reject, timeout });
|
|
2172
2281
|
if (config.debug) {
|
|
2173
2282
|
console.log("[SDK Debug] ========== Sending Request ==========");
|
|
@@ -2193,6 +2302,7 @@ async function sendInvoke(method, params, config, _log) {
|
|
|
2193
2302
|
}
|
|
2194
2303
|
|
|
2195
2304
|
// src/client/events.ts
|
|
2305
|
+
init_cjs_shims();
|
|
2196
2306
|
function createMessageHandler(config, pendingRequests, extensionInfo2, onEvent) {
|
|
2197
2307
|
return (event) => {
|
|
2198
2308
|
if (config.debug) {
|
|
@@ -2292,6 +2402,9 @@ function removeEventListener(eventType, callback, eventListeners) {
|
|
|
2292
2402
|
function notifySubscribers(subscribers) {
|
|
2293
2403
|
subscribers.forEach((callback) => callback());
|
|
2294
2404
|
}
|
|
2405
|
+
|
|
2406
|
+
// src/client/database.ts
|
|
2407
|
+
init_cjs_shims();
|
|
2295
2408
|
function createDrizzleInstance(schema, extensionInfo2, request, log) {
|
|
2296
2409
|
if (!extensionInfo2) {
|
|
2297
2410
|
throw new HaexVaultSdkError(
|
|
@@ -2360,6 +2473,7 @@ async function executeRaw(sql, params, request) {
|
|
|
2360
2473
|
}
|
|
2361
2474
|
|
|
2362
2475
|
// src/client/external.ts
|
|
2476
|
+
init_cjs_shims();
|
|
2363
2477
|
function registerExternalHandler(action, handler, handlers, log) {
|
|
2364
2478
|
handlers.set(action, handler);
|
|
2365
2479
|
log(`[ExternalRequest] Registered handler for action: ${action}`);
|
|
@@ -2401,12 +2515,14 @@ async function respondToExternalRequest(response, request) {
|
|
|
2401
2515
|
}
|
|
2402
2516
|
|
|
2403
2517
|
// src/commands/ai.ts
|
|
2518
|
+
init_cjs_shims();
|
|
2404
2519
|
var AI_COMMANDS = {
|
|
2405
2520
|
/** Respond to an AI action request */
|
|
2406
2521
|
actionRespond: "ai_action_respond"
|
|
2407
2522
|
};
|
|
2408
2523
|
|
|
2409
2524
|
// src/client/permissionRetry.ts
|
|
2525
|
+
init_cjs_shims();
|
|
2410
2526
|
var PERMISSION_DECISION_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
2411
2527
|
var MAX_PERMISSION_RETRIES = 3;
|
|
2412
2528
|
function permissionKey(resourceType, action, target) {
|
|
@@ -2520,6 +2636,8 @@ var HaexVaultSdk = class {
|
|
|
2520
2636
|
this.passwords = new PasswordsAPI(this);
|
|
2521
2637
|
this.mail = new MailAPI(this);
|
|
2522
2638
|
this.notifications = new NotificationsAPI(this);
|
|
2639
|
+
this.tab = new TabAPI(this);
|
|
2640
|
+
this.dialog = new DialogAPI(this);
|
|
2523
2641
|
installConsoleForwarding(this.config.debug);
|
|
2524
2642
|
this.on(HAEXTENSION_EVENTS.PERMISSION_RESOLVED, (event) => {
|
|
2525
2643
|
const data = event.data;
|
|
@@ -2675,7 +2793,7 @@ var HaexVaultSdk = class {
|
|
|
2675
2793
|
// ==========================================================================
|
|
2676
2794
|
// Communication
|
|
2677
2795
|
// ==========================================================================
|
|
2678
|
-
async request(method, params) {
|
|
2796
|
+
async request(method, params, options) {
|
|
2679
2797
|
const resolvedParams = params ?? {};
|
|
2680
2798
|
const send = () => {
|
|
2681
2799
|
if (this.isNativeWindow && hasTauri()) {
|
|
@@ -2694,7 +2812,8 @@ var HaexVaultSdk = class {
|
|
|
2694
2812
|
this.config,
|
|
2695
2813
|
this._extensionInfo,
|
|
2696
2814
|
this.pendingRequests,
|
|
2697
|
-
this.hostPort
|
|
2815
|
+
this.hostPort,
|
|
2816
|
+
options?.timeout
|
|
2698
2817
|
);
|
|
2699
2818
|
};
|
|
2700
2819
|
return withPermissionRetry(send, this.permissionWaiters, this.log.bind(this));
|
|
@@ -2871,26 +2990,37 @@ var HaexVaultSdk = class {
|
|
|
2871
2990
|
}
|
|
2872
2991
|
};
|
|
2873
2992
|
|
|
2993
|
+
// src/types/external.ts
|
|
2994
|
+
init_cjs_shims();
|
|
2995
|
+
|
|
2996
|
+
// src/types/spaces.ts
|
|
2997
|
+
init_cjs_shims();
|
|
2998
|
+
|
|
2874
2999
|
// src/index.ts
|
|
2875
3000
|
init_vaultKey();
|
|
2876
3001
|
init_userKeypair();
|
|
2877
3002
|
|
|
2878
3003
|
// src/crypto/didKey.ts
|
|
3004
|
+
init_cjs_shims();
|
|
2879
3005
|
init_userKeypair();
|
|
2880
3006
|
init_vaultKey();
|
|
2881
3007
|
|
|
2882
3008
|
// src/crypto/spaceKey.ts
|
|
3009
|
+
init_cjs_shims();
|
|
2883
3010
|
init_userKeypair();
|
|
2884
3011
|
init_vaultKey();
|
|
2885
3012
|
|
|
2886
3013
|
// src/crypto/claims.ts
|
|
3014
|
+
init_cjs_shims();
|
|
2887
3015
|
init_userKeypair();
|
|
2888
3016
|
|
|
2889
3017
|
// src/crypto/recordSigning.ts
|
|
3018
|
+
init_cjs_shims();
|
|
2890
3019
|
init_userKeypair();
|
|
2891
3020
|
init_vaultKey();
|
|
2892
3021
|
|
|
2893
3022
|
// src/crypto/passkey.ts
|
|
3023
|
+
init_cjs_shims();
|
|
2894
3024
|
init_vaultKey();
|
|
2895
3025
|
|
|
2896
3026
|
// src/index.ts
|