@haex-space/vault-sdk 2.5.42 → 2.5.43
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-BAu3VPE3.d.mts → client-9QruY0rX.d.mts} +124 -1
- package/dist/{client-CF0wJxT2.d.ts → client-Bp4IqvzW.d.ts} +124 -1
- package/dist/index.d.mts +24 -2
- package/dist/index.d.ts +24 -2
- package/dist/index.js +157 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +157 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +144 -3
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +144 -3
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.d.mts +1 -1
- package/dist/runtime/nuxt.plugin.client.d.ts +1 -1
- package/dist/runtime/nuxt.plugin.client.js +144 -3
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +144 -3
- 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 +144 -3
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +144 -3
- package/dist/svelte.mjs.map +1 -1
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +144 -3
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +144 -3
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as nuxt_app from 'nuxt/app';
|
|
2
2
|
import { ShallowRef } from 'vue';
|
|
3
|
-
import { H as HaexVaultSdk } from '../client-
|
|
3
|
+
import { H as HaexVaultSdk } from '../client-9QruY0rX.mjs';
|
|
4
4
|
import { A as ApplicationContext } from '../types-DiXJ5SF6.mjs';
|
|
5
5
|
import 'drizzle-orm/sqlite-proxy';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as nuxt_app from 'nuxt/app';
|
|
2
2
|
import { ShallowRef } from 'vue';
|
|
3
|
-
import { H as HaexVaultSdk } from '../client-
|
|
3
|
+
import { H as HaexVaultSdk } from '../client-Bp4IqvzW.js';
|
|
4
4
|
import { A as ApplicationContext } from '../types-DiXJ5SF6.js';
|
|
5
5
|
import 'drizzle-orm/sqlite-proxy';
|
|
6
6
|
|
|
@@ -74,7 +74,19 @@ var HAEXTENSION_METHODS = {
|
|
|
74
74
|
filesystem: {
|
|
75
75
|
saveFile: "haextension:filesystem:save-file",
|
|
76
76
|
openFile: "haextension:filesystem:open-file",
|
|
77
|
-
showImage: "haextension:filesystem:show-image"
|
|
77
|
+
showImage: "haextension:filesystem:show-image",
|
|
78
|
+
// Generic FS operations (Phase 2)
|
|
79
|
+
readFile: "haextension:filesystem:read-file",
|
|
80
|
+
writeFile: "haextension:filesystem:write-file",
|
|
81
|
+
readDir: "haextension:filesystem:read-dir",
|
|
82
|
+
mkdir: "haextension:filesystem:mkdir",
|
|
83
|
+
remove: "haextension:filesystem:remove",
|
|
84
|
+
exists: "haextension:filesystem:exists",
|
|
85
|
+
stat: "haextension:filesystem:stat",
|
|
86
|
+
selectFolder: "haextension:filesystem:select-folder",
|
|
87
|
+
selectFile: "haextension:filesystem:select-file",
|
|
88
|
+
rename: "haextension:filesystem:rename",
|
|
89
|
+
copy: "haextension:filesystem:copy"
|
|
78
90
|
},
|
|
79
91
|
filesync: {
|
|
80
92
|
// Spaces
|
|
@@ -622,6 +634,136 @@ var FilesystemAPI = class {
|
|
|
622
634
|
);
|
|
623
635
|
return result;
|
|
624
636
|
}
|
|
637
|
+
// ==========================================================================
|
|
638
|
+
// Generic Filesystem Operations (Phase 2)
|
|
639
|
+
// ==========================================================================
|
|
640
|
+
/**
|
|
641
|
+
* Read file contents
|
|
642
|
+
* @param path Absolute path to the file
|
|
643
|
+
* @returns File contents as Uint8Array
|
|
644
|
+
*/
|
|
645
|
+
async readFile(path) {
|
|
646
|
+
const base64 = await this.client.request(
|
|
647
|
+
HAEXTENSION_METHODS.filesystem.readFile,
|
|
648
|
+
{ path }
|
|
649
|
+
);
|
|
650
|
+
const binary = atob(base64);
|
|
651
|
+
const bytes = new Uint8Array(binary.length);
|
|
652
|
+
for (let i = 0; i < binary.length; i++) {
|
|
653
|
+
bytes[i] = binary.charCodeAt(i);
|
|
654
|
+
}
|
|
655
|
+
return bytes;
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Write file contents
|
|
659
|
+
* @param path Absolute path to the file
|
|
660
|
+
* @param data File contents as Uint8Array
|
|
661
|
+
*/
|
|
662
|
+
async writeFile(path, data) {
|
|
663
|
+
const base64 = btoa(String.fromCharCode(...data));
|
|
664
|
+
await this.client.request(
|
|
665
|
+
HAEXTENSION_METHODS.filesystem.writeFile,
|
|
666
|
+
{ path, data: base64 }
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Read directory contents
|
|
671
|
+
* @param path Absolute path to the directory
|
|
672
|
+
* @returns Array of directory entries
|
|
673
|
+
*/
|
|
674
|
+
async readDir(path) {
|
|
675
|
+
return this.client.request(
|
|
676
|
+
HAEXTENSION_METHODS.filesystem.readDir,
|
|
677
|
+
{ path }
|
|
678
|
+
);
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Create a directory (and parent directories if needed)
|
|
682
|
+
* @param path Absolute path to create
|
|
683
|
+
*/
|
|
684
|
+
async mkdir(path) {
|
|
685
|
+
await this.client.request(
|
|
686
|
+
HAEXTENSION_METHODS.filesystem.mkdir,
|
|
687
|
+
{ path }
|
|
688
|
+
);
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Remove a file or directory
|
|
692
|
+
* @param path Absolute path to remove
|
|
693
|
+
* @param recursive If true, remove directories recursively
|
|
694
|
+
*/
|
|
695
|
+
async remove(path, recursive = false) {
|
|
696
|
+
await this.client.request(
|
|
697
|
+
HAEXTENSION_METHODS.filesystem.remove,
|
|
698
|
+
{ path, recursive }
|
|
699
|
+
);
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Check if a path exists
|
|
703
|
+
* @param path Absolute path to check
|
|
704
|
+
* @returns True if the path exists
|
|
705
|
+
*/
|
|
706
|
+
async exists(path) {
|
|
707
|
+
return this.client.request(
|
|
708
|
+
HAEXTENSION_METHODS.filesystem.exists,
|
|
709
|
+
{ path }
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Get file/directory metadata
|
|
714
|
+
* @param path Absolute path
|
|
715
|
+
* @returns File metadata
|
|
716
|
+
*/
|
|
717
|
+
async stat(path) {
|
|
718
|
+
return this.client.request(
|
|
719
|
+
HAEXTENSION_METHODS.filesystem.stat,
|
|
720
|
+
{ path }
|
|
721
|
+
);
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Open a folder selection dialog
|
|
725
|
+
* @param options Dialog options
|
|
726
|
+
* @returns Selected folder path, or null if cancelled
|
|
727
|
+
*/
|
|
728
|
+
async selectFolder(options = {}) {
|
|
729
|
+
return this.client.request(
|
|
730
|
+
HAEXTENSION_METHODS.filesystem.selectFolder,
|
|
731
|
+
options
|
|
732
|
+
);
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Open a file selection dialog
|
|
736
|
+
* @param options Dialog options
|
|
737
|
+
* @returns Selected file paths, or null if cancelled
|
|
738
|
+
*/
|
|
739
|
+
async selectFile(options = {}) {
|
|
740
|
+
return this.client.request(
|
|
741
|
+
HAEXTENSION_METHODS.filesystem.selectFile,
|
|
742
|
+
options
|
|
743
|
+
);
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Rename/move a file or directory
|
|
747
|
+
* @param from Source path
|
|
748
|
+
* @param to Destination path
|
|
749
|
+
*/
|
|
750
|
+
async rename(from, to) {
|
|
751
|
+
await this.client.request(
|
|
752
|
+
HAEXTENSION_METHODS.filesystem.rename,
|
|
753
|
+
{ from, to }
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Copy a file
|
|
758
|
+
* @param from Source path
|
|
759
|
+
* @param to Destination path
|
|
760
|
+
*/
|
|
761
|
+
async copy(from, to) {
|
|
762
|
+
await this.client.request(
|
|
763
|
+
HAEXTENSION_METHODS.filesystem.copy,
|
|
764
|
+
{ from, to }
|
|
765
|
+
);
|
|
766
|
+
}
|
|
625
767
|
};
|
|
626
768
|
|
|
627
769
|
// src/api/web.ts
|
|
@@ -1190,8 +1332,7 @@ var TAURI_COMMANDS = {
|
|
|
1190
1332
|
filesystem: {
|
|
1191
1333
|
saveFile: "webview_extension_fs_save_file",
|
|
1192
1334
|
openFile: "webview_extension_fs_open_file",
|
|
1193
|
-
showImage: "webview_extension_fs_show_image"
|
|
1194
|
-
},
|
|
1335
|
+
showImage: "webview_extension_fs_show_image"},
|
|
1195
1336
|
external: {
|
|
1196
1337
|
// Response handling (called by extensions running in WebView)
|
|
1197
1338
|
respond: "webview_extension_external_respond"},
|