@haex-space/vault-sdk 2.5.40 → 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-BEWYbywm.d.mts → client-9QruY0rX.d.mts} +257 -4
- package/dist/{client-CYgMbZKT.d.ts → client-Bp4IqvzW.d.ts} +257 -4
- package/dist/index.d.mts +45 -3
- package/dist/index.d.ts +45 -3
- package/dist/index.js +291 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +291 -3
- 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 +263 -3
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +263 -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 +263 -3
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +263 -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 +263 -3
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +263 -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 +263 -3
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +263 -3
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HaexVaultSdk } from './client-
|
|
2
|
-
export {
|
|
1
|
+
import { H as HaexVaultSdk } from './client-9QruY0rX.mjs';
|
|
2
|
+
export { u as AddBackendOptions, v as AddSyncRuleOptions, I as AddToQueueOptions, B as BackendConfig, V as CONFLICT_STRATEGY, C as ConflictStrategy, t as CreateSpaceOptions, D as DatabaseAPI, b as DirEntry, y as DownloadFileOptions, N as FILE_SYNC_STATE, j as FileInfo, i as FileSpace, a as FileStat, e as FileSyncAPI, k as FileSyncState, F as FilesystemAPI, K as GetQueueOptions, L as ListFilesOptions, z as LocalFileInfo, P as PermissionsAPI, X as QUEUE_OPERATION, Y as QUEUE_STATUS, J as QueueFileEntry, Q as QueueOperation, E as QueueStatus, M as QueueSummary, A as RemoteAddBackendRequest, g as RemoteS3Config, R as RemoteStorageAPI, f as RemoteStorageBackendInfo, h as RemoteStorageObjectInfo, n as S3BackendConfig, T as STORAGE_BACKEND_TYPE, O as SYNC_DIRECTION, w as ScanLocalOptions, d as SelectFileOptions, c as SelectFolderOptions, l as StorageBackendInfo, m as StorageBackendType, p as SyncDirection, r as SyncError, s as SyncProgress, G as SyncQueueEntry, o as SyncRule, q as SyncStatus, U as UpdateSyncRuleOptions, x as UploadFileOptions, W as WebAPI } from './client-9QruY0rX.mjs';
|
|
3
3
|
import { E as ExtensionManifest, H as HaexHubConfig } from './types-DiXJ5SF6.mjs';
|
|
4
4
|
export { A as ApplicationContext, t as AuthorizedClient, B as BlockedClient, C as ContextChangedEvent, F as DEFAULT_TIMEOUT, o as DatabaseColumnInfo, m as DatabaseExecuteParams, k as DatabasePermission, d as DatabasePermissionRequest, l as DatabaseQueryParams, D as DatabaseQueryResult, n as DatabaseTableInfo, U as EXTERNAL_EVENTS, z as ErrorCode, g as EventCallback, a as ExtensionInfo, v as ExternalAuthDecision, x as ExternalConnection, J as ExternalConnectionErrorCode, I as ExternalConnectionState, V as ExternalEvent, s as ExternalRequest, r as ExternalRequestEvent, e as ExternalRequestHandler, f as ExternalResponse, O as HAEXTENSION_EVENTS, j as HaexHubEvent, h as HaexHubRequest, i as HaexHubResponse, N as HaexVaultSdkError, Q as HaextensionEvent, u as PendingAuthorization, P as PermissionResponse, y as PermissionStatus, R as RequestedExtension, p as SearchQuery, q as SearchRequestEvent, S as SearchResult, w as SessionAuthorization, T as TABLE_SEPARATOR, W as WebRequestOptions, c as WebResponse, L as canExternalClientSendRequests, G as getTableName, K as isExternalClientConnected } from './types-DiXJ5SF6.mjs';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
|
|
@@ -103,6 +103,17 @@ declare const HAEXTENSION_METHODS: {
|
|
|
103
103
|
readonly saveFile: "haextension:filesystem:save-file";
|
|
104
104
|
readonly openFile: "haextension:filesystem:open-file";
|
|
105
105
|
readonly showImage: "haextension:filesystem:show-image";
|
|
106
|
+
readonly readFile: "haextension:filesystem:read-file";
|
|
107
|
+
readonly writeFile: "haextension:filesystem:write-file";
|
|
108
|
+
readonly readDir: "haextension:filesystem:read-dir";
|
|
109
|
+
readonly mkdir: "haextension:filesystem:mkdir";
|
|
110
|
+
readonly remove: "haextension:filesystem:remove";
|
|
111
|
+
readonly exists: "haextension:filesystem:exists";
|
|
112
|
+
readonly stat: "haextension:filesystem:stat";
|
|
113
|
+
readonly selectFolder: "haextension:filesystem:select-folder";
|
|
114
|
+
readonly selectFile: "haextension:filesystem:select-file";
|
|
115
|
+
readonly rename: "haextension:filesystem:rename";
|
|
116
|
+
readonly copy: "haextension:filesystem:copy";
|
|
106
117
|
};
|
|
107
118
|
readonly filesync: {
|
|
108
119
|
readonly listSpaces: "haextension:filesync:list-spaces";
|
|
@@ -146,6 +157,16 @@ declare const HAEXTENSION_METHODS: {
|
|
|
146
157
|
readonly clear: "haextension:storage:clear";
|
|
147
158
|
readonly keys: "haextension:storage:keys";
|
|
148
159
|
};
|
|
160
|
+
readonly remoteStorage: {
|
|
161
|
+
readonly listBackends: "haextension:remote-storage:list-backends";
|
|
162
|
+
readonly addBackend: "haextension:remote-storage:add-backend";
|
|
163
|
+
readonly removeBackend: "haextension:remote-storage:remove-backend";
|
|
164
|
+
readonly testBackend: "haextension:remote-storage:test-backend";
|
|
165
|
+
readonly upload: "haextension:remote-storage:upload";
|
|
166
|
+
readonly download: "haextension:remote-storage:download";
|
|
167
|
+
readonly delete: "haextension:remote-storage:delete";
|
|
168
|
+
readonly list: "haextension:remote-storage:list";
|
|
169
|
+
};
|
|
149
170
|
readonly web: {
|
|
150
171
|
readonly fetch: "haextension:web:fetch";
|
|
151
172
|
};
|
|
@@ -196,6 +217,17 @@ declare const TAURI_COMMANDS: {
|
|
|
196
217
|
readonly saveFile: "webview_extension_fs_save_file";
|
|
197
218
|
readonly openFile: "webview_extension_fs_open_file";
|
|
198
219
|
readonly showImage: "webview_extension_fs_show_image";
|
|
220
|
+
readonly readFile: "filesystem_read_file";
|
|
221
|
+
readonly writeFile: "filesystem_write_file";
|
|
222
|
+
readonly readDir: "filesystem_read_dir";
|
|
223
|
+
readonly mkdir: "filesystem_mkdir";
|
|
224
|
+
readonly remove: "filesystem_remove";
|
|
225
|
+
readonly exists: "filesystem_exists";
|
|
226
|
+
readonly stat: "filesystem_stat";
|
|
227
|
+
readonly selectFolder: "filesystem_select_folder";
|
|
228
|
+
readonly selectFile: "filesystem_select_file";
|
|
229
|
+
readonly rename: "filesystem_rename";
|
|
230
|
+
readonly copy: "filesystem_copy";
|
|
199
231
|
};
|
|
200
232
|
readonly external: {
|
|
201
233
|
readonly respond: "webview_extension_external_respond";
|
|
@@ -217,6 +249,16 @@ declare const TAURI_COMMANDS: {
|
|
|
217
249
|
readonly getInfo: "webview_extension_get_info";
|
|
218
250
|
readonly getContext: "webview_extension_context_get";
|
|
219
251
|
};
|
|
252
|
+
readonly storage: {
|
|
253
|
+
readonly listBackends: "storage_list_backends";
|
|
254
|
+
readonly addBackend: "storage_add_backend";
|
|
255
|
+
readonly removeBackend: "storage_remove_backend";
|
|
256
|
+
readonly testBackend: "storage_test_backend";
|
|
257
|
+
readonly upload: "storage_upload";
|
|
258
|
+
readonly download: "storage_download";
|
|
259
|
+
readonly delete: "storage_delete";
|
|
260
|
+
readonly list: "storage_list";
|
|
261
|
+
};
|
|
220
262
|
readonly filesync: {
|
|
221
263
|
readonly listSpaces: "webview_filesync_list_spaces";
|
|
222
264
|
readonly createSpace: "webview_filesync_create_space";
|
|
@@ -253,7 +295,7 @@ declare const TAURI_COMMANDS: {
|
|
|
253
295
|
readonly recoverQueue: "webview_filesync_recover_queue";
|
|
254
296
|
};
|
|
255
297
|
};
|
|
256
|
-
type TauriCommand = (typeof TAURI_COMMANDS.database)[keyof typeof TAURI_COMMANDS.database] | (typeof TAURI_COMMANDS.permissions)[keyof typeof TAURI_COMMANDS.permissions] | (typeof TAURI_COMMANDS.web)[keyof typeof TAURI_COMMANDS.web] | (typeof TAURI_COMMANDS.filesystem)[keyof typeof TAURI_COMMANDS.filesystem] | (typeof TAURI_COMMANDS.external)[keyof typeof TAURI_COMMANDS.external] | (typeof TAURI_COMMANDS.extension)[keyof typeof TAURI_COMMANDS.extension] | (typeof TAURI_COMMANDS.filesync)[keyof typeof TAURI_COMMANDS.filesync];
|
|
298
|
+
type TauriCommand = (typeof TAURI_COMMANDS.database)[keyof typeof TAURI_COMMANDS.database] | (typeof TAURI_COMMANDS.permissions)[keyof typeof TAURI_COMMANDS.permissions] | (typeof TAURI_COMMANDS.web)[keyof typeof TAURI_COMMANDS.web] | (typeof TAURI_COMMANDS.filesystem)[keyof typeof TAURI_COMMANDS.filesystem] | (typeof TAURI_COMMANDS.external)[keyof typeof TAURI_COMMANDS.external] | (typeof TAURI_COMMANDS.extension)[keyof typeof TAURI_COMMANDS.extension] | (typeof TAURI_COMMANDS.storage)[keyof typeof TAURI_COMMANDS.storage] | (typeof TAURI_COMMANDS.filesync)[keyof typeof TAURI_COMMANDS.filesync];
|
|
257
299
|
|
|
258
300
|
interface VerifyResult {
|
|
259
301
|
valid: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HaexVaultSdk } from './client-
|
|
2
|
-
export {
|
|
1
|
+
import { H as HaexVaultSdk } from './client-Bp4IqvzW.js';
|
|
2
|
+
export { u as AddBackendOptions, v as AddSyncRuleOptions, I as AddToQueueOptions, B as BackendConfig, V as CONFLICT_STRATEGY, C as ConflictStrategy, t as CreateSpaceOptions, D as DatabaseAPI, b as DirEntry, y as DownloadFileOptions, N as FILE_SYNC_STATE, j as FileInfo, i as FileSpace, a as FileStat, e as FileSyncAPI, k as FileSyncState, F as FilesystemAPI, K as GetQueueOptions, L as ListFilesOptions, z as LocalFileInfo, P as PermissionsAPI, X as QUEUE_OPERATION, Y as QUEUE_STATUS, J as QueueFileEntry, Q as QueueOperation, E as QueueStatus, M as QueueSummary, A as RemoteAddBackendRequest, g as RemoteS3Config, R as RemoteStorageAPI, f as RemoteStorageBackendInfo, h as RemoteStorageObjectInfo, n as S3BackendConfig, T as STORAGE_BACKEND_TYPE, O as SYNC_DIRECTION, w as ScanLocalOptions, d as SelectFileOptions, c as SelectFolderOptions, l as StorageBackendInfo, m as StorageBackendType, p as SyncDirection, r as SyncError, s as SyncProgress, G as SyncQueueEntry, o as SyncRule, q as SyncStatus, U as UpdateSyncRuleOptions, x as UploadFileOptions, W as WebAPI } from './client-Bp4IqvzW.js';
|
|
3
3
|
import { E as ExtensionManifest, H as HaexHubConfig } from './types-DiXJ5SF6.js';
|
|
4
4
|
export { A as ApplicationContext, t as AuthorizedClient, B as BlockedClient, C as ContextChangedEvent, F as DEFAULT_TIMEOUT, o as DatabaseColumnInfo, m as DatabaseExecuteParams, k as DatabasePermission, d as DatabasePermissionRequest, l as DatabaseQueryParams, D as DatabaseQueryResult, n as DatabaseTableInfo, U as EXTERNAL_EVENTS, z as ErrorCode, g as EventCallback, a as ExtensionInfo, v as ExternalAuthDecision, x as ExternalConnection, J as ExternalConnectionErrorCode, I as ExternalConnectionState, V as ExternalEvent, s as ExternalRequest, r as ExternalRequestEvent, e as ExternalRequestHandler, f as ExternalResponse, O as HAEXTENSION_EVENTS, j as HaexHubEvent, h as HaexHubRequest, i as HaexHubResponse, N as HaexVaultSdkError, Q as HaextensionEvent, u as PendingAuthorization, P as PermissionResponse, y as PermissionStatus, R as RequestedExtension, p as SearchQuery, q as SearchRequestEvent, S as SearchResult, w as SessionAuthorization, T as TABLE_SEPARATOR, W as WebRequestOptions, c as WebResponse, L as canExternalClientSendRequests, G as getTableName, K as isExternalClientConnected } from './types-DiXJ5SF6.js';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.js';
|
|
@@ -103,6 +103,17 @@ declare const HAEXTENSION_METHODS: {
|
|
|
103
103
|
readonly saveFile: "haextension:filesystem:save-file";
|
|
104
104
|
readonly openFile: "haextension:filesystem:open-file";
|
|
105
105
|
readonly showImage: "haextension:filesystem:show-image";
|
|
106
|
+
readonly readFile: "haextension:filesystem:read-file";
|
|
107
|
+
readonly writeFile: "haextension:filesystem:write-file";
|
|
108
|
+
readonly readDir: "haextension:filesystem:read-dir";
|
|
109
|
+
readonly mkdir: "haextension:filesystem:mkdir";
|
|
110
|
+
readonly remove: "haextension:filesystem:remove";
|
|
111
|
+
readonly exists: "haextension:filesystem:exists";
|
|
112
|
+
readonly stat: "haextension:filesystem:stat";
|
|
113
|
+
readonly selectFolder: "haextension:filesystem:select-folder";
|
|
114
|
+
readonly selectFile: "haextension:filesystem:select-file";
|
|
115
|
+
readonly rename: "haextension:filesystem:rename";
|
|
116
|
+
readonly copy: "haextension:filesystem:copy";
|
|
106
117
|
};
|
|
107
118
|
readonly filesync: {
|
|
108
119
|
readonly listSpaces: "haextension:filesync:list-spaces";
|
|
@@ -146,6 +157,16 @@ declare const HAEXTENSION_METHODS: {
|
|
|
146
157
|
readonly clear: "haextension:storage:clear";
|
|
147
158
|
readonly keys: "haextension:storage:keys";
|
|
148
159
|
};
|
|
160
|
+
readonly remoteStorage: {
|
|
161
|
+
readonly listBackends: "haextension:remote-storage:list-backends";
|
|
162
|
+
readonly addBackend: "haextension:remote-storage:add-backend";
|
|
163
|
+
readonly removeBackend: "haextension:remote-storage:remove-backend";
|
|
164
|
+
readonly testBackend: "haextension:remote-storage:test-backend";
|
|
165
|
+
readonly upload: "haextension:remote-storage:upload";
|
|
166
|
+
readonly download: "haextension:remote-storage:download";
|
|
167
|
+
readonly delete: "haextension:remote-storage:delete";
|
|
168
|
+
readonly list: "haextension:remote-storage:list";
|
|
169
|
+
};
|
|
149
170
|
readonly web: {
|
|
150
171
|
readonly fetch: "haextension:web:fetch";
|
|
151
172
|
};
|
|
@@ -196,6 +217,17 @@ declare const TAURI_COMMANDS: {
|
|
|
196
217
|
readonly saveFile: "webview_extension_fs_save_file";
|
|
197
218
|
readonly openFile: "webview_extension_fs_open_file";
|
|
198
219
|
readonly showImage: "webview_extension_fs_show_image";
|
|
220
|
+
readonly readFile: "filesystem_read_file";
|
|
221
|
+
readonly writeFile: "filesystem_write_file";
|
|
222
|
+
readonly readDir: "filesystem_read_dir";
|
|
223
|
+
readonly mkdir: "filesystem_mkdir";
|
|
224
|
+
readonly remove: "filesystem_remove";
|
|
225
|
+
readonly exists: "filesystem_exists";
|
|
226
|
+
readonly stat: "filesystem_stat";
|
|
227
|
+
readonly selectFolder: "filesystem_select_folder";
|
|
228
|
+
readonly selectFile: "filesystem_select_file";
|
|
229
|
+
readonly rename: "filesystem_rename";
|
|
230
|
+
readonly copy: "filesystem_copy";
|
|
199
231
|
};
|
|
200
232
|
readonly external: {
|
|
201
233
|
readonly respond: "webview_extension_external_respond";
|
|
@@ -217,6 +249,16 @@ declare const TAURI_COMMANDS: {
|
|
|
217
249
|
readonly getInfo: "webview_extension_get_info";
|
|
218
250
|
readonly getContext: "webview_extension_context_get";
|
|
219
251
|
};
|
|
252
|
+
readonly storage: {
|
|
253
|
+
readonly listBackends: "storage_list_backends";
|
|
254
|
+
readonly addBackend: "storage_add_backend";
|
|
255
|
+
readonly removeBackend: "storage_remove_backend";
|
|
256
|
+
readonly testBackend: "storage_test_backend";
|
|
257
|
+
readonly upload: "storage_upload";
|
|
258
|
+
readonly download: "storage_download";
|
|
259
|
+
readonly delete: "storage_delete";
|
|
260
|
+
readonly list: "storage_list";
|
|
261
|
+
};
|
|
220
262
|
readonly filesync: {
|
|
221
263
|
readonly listSpaces: "webview_filesync_list_spaces";
|
|
222
264
|
readonly createSpace: "webview_filesync_create_space";
|
|
@@ -253,7 +295,7 @@ declare const TAURI_COMMANDS: {
|
|
|
253
295
|
readonly recoverQueue: "webview_filesync_recover_queue";
|
|
254
296
|
};
|
|
255
297
|
};
|
|
256
|
-
type TauriCommand = (typeof TAURI_COMMANDS.database)[keyof typeof TAURI_COMMANDS.database] | (typeof TAURI_COMMANDS.permissions)[keyof typeof TAURI_COMMANDS.permissions] | (typeof TAURI_COMMANDS.web)[keyof typeof TAURI_COMMANDS.web] | (typeof TAURI_COMMANDS.filesystem)[keyof typeof TAURI_COMMANDS.filesystem] | (typeof TAURI_COMMANDS.external)[keyof typeof TAURI_COMMANDS.external] | (typeof TAURI_COMMANDS.extension)[keyof typeof TAURI_COMMANDS.extension] | (typeof TAURI_COMMANDS.filesync)[keyof typeof TAURI_COMMANDS.filesync];
|
|
298
|
+
type TauriCommand = (typeof TAURI_COMMANDS.database)[keyof typeof TAURI_COMMANDS.database] | (typeof TAURI_COMMANDS.permissions)[keyof typeof TAURI_COMMANDS.permissions] | (typeof TAURI_COMMANDS.web)[keyof typeof TAURI_COMMANDS.web] | (typeof TAURI_COMMANDS.filesystem)[keyof typeof TAURI_COMMANDS.filesystem] | (typeof TAURI_COMMANDS.external)[keyof typeof TAURI_COMMANDS.external] | (typeof TAURI_COMMANDS.extension)[keyof typeof TAURI_COMMANDS.extension] | (typeof TAURI_COMMANDS.storage)[keyof typeof TAURI_COMMANDS.storage] | (typeof TAURI_COMMANDS.filesync)[keyof typeof TAURI_COMMANDS.filesync];
|
|
257
299
|
|
|
258
300
|
interface VerifyResult {
|
|
259
301
|
valid: boolean;
|
package/dist/index.js
CHANGED
|
@@ -487,7 +487,19 @@ var HAEXTENSION_METHODS = {
|
|
|
487
487
|
filesystem: {
|
|
488
488
|
saveFile: "haextension:filesystem:save-file",
|
|
489
489
|
openFile: "haextension:filesystem:open-file",
|
|
490
|
-
showImage: "haextension:filesystem:show-image"
|
|
490
|
+
showImage: "haextension:filesystem:show-image",
|
|
491
|
+
// Generic FS operations (Phase 2)
|
|
492
|
+
readFile: "haextension:filesystem:read-file",
|
|
493
|
+
writeFile: "haextension:filesystem:write-file",
|
|
494
|
+
readDir: "haextension:filesystem:read-dir",
|
|
495
|
+
mkdir: "haextension:filesystem:mkdir",
|
|
496
|
+
remove: "haextension:filesystem:remove",
|
|
497
|
+
exists: "haextension:filesystem:exists",
|
|
498
|
+
stat: "haextension:filesystem:stat",
|
|
499
|
+
selectFolder: "haextension:filesystem:select-folder",
|
|
500
|
+
selectFile: "haextension:filesystem:select-file",
|
|
501
|
+
rename: "haextension:filesystem:rename",
|
|
502
|
+
copy: "haextension:filesystem:copy"
|
|
491
503
|
},
|
|
492
504
|
filesync: {
|
|
493
505
|
// Spaces
|
|
@@ -539,6 +551,19 @@ var HAEXTENSION_METHODS = {
|
|
|
539
551
|
clear: "haextension:storage:clear",
|
|
540
552
|
keys: "haextension:storage:keys"
|
|
541
553
|
},
|
|
554
|
+
// Remote Storage API (S3, WebDAV, FTP, etc.)
|
|
555
|
+
remoteStorage: {
|
|
556
|
+
// Backend Management
|
|
557
|
+
listBackends: "haextension:remote-storage:list-backends",
|
|
558
|
+
addBackend: "haextension:remote-storage:add-backend",
|
|
559
|
+
removeBackend: "haextension:remote-storage:remove-backend",
|
|
560
|
+
testBackend: "haextension:remote-storage:test-backend",
|
|
561
|
+
// Storage Operations
|
|
562
|
+
upload: "haextension:remote-storage:upload",
|
|
563
|
+
download: "haextension:remote-storage:download",
|
|
564
|
+
delete: "haextension:remote-storage:delete",
|
|
565
|
+
list: "haextension:remote-storage:list"
|
|
566
|
+
},
|
|
542
567
|
web: {
|
|
543
568
|
fetch: "haextension:web:fetch"
|
|
544
569
|
},
|
|
@@ -1064,6 +1089,136 @@ var FilesystemAPI = class {
|
|
|
1064
1089
|
);
|
|
1065
1090
|
return result;
|
|
1066
1091
|
}
|
|
1092
|
+
// ==========================================================================
|
|
1093
|
+
// Generic Filesystem Operations (Phase 2)
|
|
1094
|
+
// ==========================================================================
|
|
1095
|
+
/**
|
|
1096
|
+
* Read file contents
|
|
1097
|
+
* @param path Absolute path to the file
|
|
1098
|
+
* @returns File contents as Uint8Array
|
|
1099
|
+
*/
|
|
1100
|
+
async readFile(path) {
|
|
1101
|
+
const base64 = await this.client.request(
|
|
1102
|
+
HAEXTENSION_METHODS.filesystem.readFile,
|
|
1103
|
+
{ path }
|
|
1104
|
+
);
|
|
1105
|
+
const binary = atob(base64);
|
|
1106
|
+
const bytes = new Uint8Array(binary.length);
|
|
1107
|
+
for (let i = 0; i < binary.length; i++) {
|
|
1108
|
+
bytes[i] = binary.charCodeAt(i);
|
|
1109
|
+
}
|
|
1110
|
+
return bytes;
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* Write file contents
|
|
1114
|
+
* @param path Absolute path to the file
|
|
1115
|
+
* @param data File contents as Uint8Array
|
|
1116
|
+
*/
|
|
1117
|
+
async writeFile(path, data) {
|
|
1118
|
+
const base64 = btoa(String.fromCharCode(...data));
|
|
1119
|
+
await this.client.request(
|
|
1120
|
+
HAEXTENSION_METHODS.filesystem.writeFile,
|
|
1121
|
+
{ path, data: base64 }
|
|
1122
|
+
);
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* Read directory contents
|
|
1126
|
+
* @param path Absolute path to the directory
|
|
1127
|
+
* @returns Array of directory entries
|
|
1128
|
+
*/
|
|
1129
|
+
async readDir(path) {
|
|
1130
|
+
return this.client.request(
|
|
1131
|
+
HAEXTENSION_METHODS.filesystem.readDir,
|
|
1132
|
+
{ path }
|
|
1133
|
+
);
|
|
1134
|
+
}
|
|
1135
|
+
/**
|
|
1136
|
+
* Create a directory (and parent directories if needed)
|
|
1137
|
+
* @param path Absolute path to create
|
|
1138
|
+
*/
|
|
1139
|
+
async mkdir(path) {
|
|
1140
|
+
await this.client.request(
|
|
1141
|
+
HAEXTENSION_METHODS.filesystem.mkdir,
|
|
1142
|
+
{ path }
|
|
1143
|
+
);
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* Remove a file or directory
|
|
1147
|
+
* @param path Absolute path to remove
|
|
1148
|
+
* @param recursive If true, remove directories recursively
|
|
1149
|
+
*/
|
|
1150
|
+
async remove(path, recursive = false) {
|
|
1151
|
+
await this.client.request(
|
|
1152
|
+
HAEXTENSION_METHODS.filesystem.remove,
|
|
1153
|
+
{ path, recursive }
|
|
1154
|
+
);
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* Check if a path exists
|
|
1158
|
+
* @param path Absolute path to check
|
|
1159
|
+
* @returns True if the path exists
|
|
1160
|
+
*/
|
|
1161
|
+
async exists(path) {
|
|
1162
|
+
return this.client.request(
|
|
1163
|
+
HAEXTENSION_METHODS.filesystem.exists,
|
|
1164
|
+
{ path }
|
|
1165
|
+
);
|
|
1166
|
+
}
|
|
1167
|
+
/**
|
|
1168
|
+
* Get file/directory metadata
|
|
1169
|
+
* @param path Absolute path
|
|
1170
|
+
* @returns File metadata
|
|
1171
|
+
*/
|
|
1172
|
+
async stat(path) {
|
|
1173
|
+
return this.client.request(
|
|
1174
|
+
HAEXTENSION_METHODS.filesystem.stat,
|
|
1175
|
+
{ path }
|
|
1176
|
+
);
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Open a folder selection dialog
|
|
1180
|
+
* @param options Dialog options
|
|
1181
|
+
* @returns Selected folder path, or null if cancelled
|
|
1182
|
+
*/
|
|
1183
|
+
async selectFolder(options = {}) {
|
|
1184
|
+
return this.client.request(
|
|
1185
|
+
HAEXTENSION_METHODS.filesystem.selectFolder,
|
|
1186
|
+
options
|
|
1187
|
+
);
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* Open a file selection dialog
|
|
1191
|
+
* @param options Dialog options
|
|
1192
|
+
* @returns Selected file paths, or null if cancelled
|
|
1193
|
+
*/
|
|
1194
|
+
async selectFile(options = {}) {
|
|
1195
|
+
return this.client.request(
|
|
1196
|
+
HAEXTENSION_METHODS.filesystem.selectFile,
|
|
1197
|
+
options
|
|
1198
|
+
);
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Rename/move a file or directory
|
|
1202
|
+
* @param from Source path
|
|
1203
|
+
* @param to Destination path
|
|
1204
|
+
*/
|
|
1205
|
+
async rename(from, to) {
|
|
1206
|
+
await this.client.request(
|
|
1207
|
+
HAEXTENSION_METHODS.filesystem.rename,
|
|
1208
|
+
{ from, to }
|
|
1209
|
+
);
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Copy a file
|
|
1213
|
+
* @param from Source path
|
|
1214
|
+
* @param to Destination path
|
|
1215
|
+
*/
|
|
1216
|
+
async copy(from, to) {
|
|
1217
|
+
await this.client.request(
|
|
1218
|
+
HAEXTENSION_METHODS.filesystem.copy,
|
|
1219
|
+
{ from, to }
|
|
1220
|
+
);
|
|
1221
|
+
}
|
|
1067
1222
|
};
|
|
1068
1223
|
|
|
1069
1224
|
// src/api/web.ts
|
|
@@ -1233,6 +1388,111 @@ var PermissionsAPI = class {
|
|
|
1233
1388
|
}
|
|
1234
1389
|
};
|
|
1235
1390
|
|
|
1391
|
+
// src/api/remoteStorage.ts
|
|
1392
|
+
var RemoteStorageAPI = class {
|
|
1393
|
+
constructor(client) {
|
|
1394
|
+
this.client = client;
|
|
1395
|
+
this.backends = new BackendManagement(client);
|
|
1396
|
+
}
|
|
1397
|
+
/**
|
|
1398
|
+
* Upload data to a storage backend
|
|
1399
|
+
* @param backendId - Backend ID to upload to
|
|
1400
|
+
* @param key - Object key (path in the bucket)
|
|
1401
|
+
* @param data - Data to upload
|
|
1402
|
+
*/
|
|
1403
|
+
async upload(backendId, key, data) {
|
|
1404
|
+
const base64 = btoa(String.fromCharCode(...data));
|
|
1405
|
+
await this.client.request(HAEXTENSION_METHODS.remoteStorage.upload, {
|
|
1406
|
+
backendId,
|
|
1407
|
+
key,
|
|
1408
|
+
data: base64
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Download data from a storage backend
|
|
1413
|
+
* @param backendId - Backend ID to download from
|
|
1414
|
+
* @param key - Object key (path in the bucket)
|
|
1415
|
+
* @returns Downloaded data as Uint8Array
|
|
1416
|
+
*/
|
|
1417
|
+
async download(backendId, key) {
|
|
1418
|
+
const base64 = await this.client.request(
|
|
1419
|
+
HAEXTENSION_METHODS.remoteStorage.download,
|
|
1420
|
+
{ backendId, key }
|
|
1421
|
+
);
|
|
1422
|
+
const binary = atob(base64);
|
|
1423
|
+
const bytes = new Uint8Array(binary.length);
|
|
1424
|
+
for (let i = 0; i < binary.length; i++) {
|
|
1425
|
+
bytes[i] = binary.charCodeAt(i);
|
|
1426
|
+
}
|
|
1427
|
+
return bytes;
|
|
1428
|
+
}
|
|
1429
|
+
/**
|
|
1430
|
+
* Delete an object from a storage backend
|
|
1431
|
+
* @param backendId - Backend ID
|
|
1432
|
+
* @param key - Object key to delete
|
|
1433
|
+
*/
|
|
1434
|
+
async delete(backendId, key) {
|
|
1435
|
+
await this.client.request(HAEXTENSION_METHODS.remoteStorage.delete, {
|
|
1436
|
+
backendId,
|
|
1437
|
+
key
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
/**
|
|
1441
|
+
* List objects in a storage backend
|
|
1442
|
+
* @param backendId - Backend ID
|
|
1443
|
+
* @param prefix - Optional prefix to filter objects
|
|
1444
|
+
* @returns List of objects
|
|
1445
|
+
*/
|
|
1446
|
+
async list(backendId, prefix) {
|
|
1447
|
+
return this.client.request(
|
|
1448
|
+
HAEXTENSION_METHODS.remoteStorage.list,
|
|
1449
|
+
{ backendId, prefix }
|
|
1450
|
+
);
|
|
1451
|
+
}
|
|
1452
|
+
};
|
|
1453
|
+
var BackendManagement = class {
|
|
1454
|
+
constructor(client) {
|
|
1455
|
+
this.client = client;
|
|
1456
|
+
}
|
|
1457
|
+
/**
|
|
1458
|
+
* List all available storage backends
|
|
1459
|
+
*/
|
|
1460
|
+
async list() {
|
|
1461
|
+
return this.client.request(
|
|
1462
|
+
HAEXTENSION_METHODS.remoteStorage.listBackends
|
|
1463
|
+
);
|
|
1464
|
+
}
|
|
1465
|
+
/**
|
|
1466
|
+
* Add a new storage backend
|
|
1467
|
+
* @param request - Backend configuration
|
|
1468
|
+
* @returns Created backend info
|
|
1469
|
+
*/
|
|
1470
|
+
async add(request) {
|
|
1471
|
+
return this.client.request(
|
|
1472
|
+
HAEXTENSION_METHODS.remoteStorage.addBackend,
|
|
1473
|
+
request
|
|
1474
|
+
);
|
|
1475
|
+
}
|
|
1476
|
+
/**
|
|
1477
|
+
* Remove a storage backend
|
|
1478
|
+
* @param backendId - Backend ID to remove
|
|
1479
|
+
*/
|
|
1480
|
+
async remove(backendId) {
|
|
1481
|
+
await this.client.request(HAEXTENSION_METHODS.remoteStorage.removeBackend, {
|
|
1482
|
+
backendId
|
|
1483
|
+
});
|
|
1484
|
+
}
|
|
1485
|
+
/**
|
|
1486
|
+
* Test connection to a storage backend
|
|
1487
|
+
* @param backendId - Backend ID to test
|
|
1488
|
+
*/
|
|
1489
|
+
async test(backendId) {
|
|
1490
|
+
await this.client.request(HAEXTENSION_METHODS.remoteStorage.testBackend, {
|
|
1491
|
+
backendId
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
};
|
|
1495
|
+
|
|
1236
1496
|
// src/client/tableName.ts
|
|
1237
1497
|
function validatePublicKey(publicKey) {
|
|
1238
1498
|
if (!publicKey || typeof publicKey !== "string" || publicKey.trim() === "") {
|
|
@@ -1453,7 +1713,20 @@ var TAURI_COMMANDS = {
|
|
|
1453
1713
|
filesystem: {
|
|
1454
1714
|
saveFile: "webview_extension_fs_save_file",
|
|
1455
1715
|
openFile: "webview_extension_fs_open_file",
|
|
1456
|
-
showImage: "webview_extension_fs_show_image"
|
|
1716
|
+
showImage: "webview_extension_fs_show_image",
|
|
1717
|
+
// Generic filesystem operations (no webview_ prefix because they're global)
|
|
1718
|
+
// Permission checks happen in the message handler layer
|
|
1719
|
+
readFile: "filesystem_read_file",
|
|
1720
|
+
writeFile: "filesystem_write_file",
|
|
1721
|
+
readDir: "filesystem_read_dir",
|
|
1722
|
+
mkdir: "filesystem_mkdir",
|
|
1723
|
+
remove: "filesystem_remove",
|
|
1724
|
+
exists: "filesystem_exists",
|
|
1725
|
+
stat: "filesystem_stat",
|
|
1726
|
+
selectFolder: "filesystem_select_folder",
|
|
1727
|
+
selectFile: "filesystem_select_file",
|
|
1728
|
+
rename: "filesystem_rename",
|
|
1729
|
+
copy: "filesystem_copy"
|
|
1457
1730
|
},
|
|
1458
1731
|
external: {
|
|
1459
1732
|
// Response handling (called by extensions running in WebView)
|
|
@@ -1482,6 +1755,20 @@ var TAURI_COMMANDS = {
|
|
|
1482
1755
|
getInfo: "webview_extension_get_info",
|
|
1483
1756
|
getContext: "webview_extension_context_get"
|
|
1484
1757
|
},
|
|
1758
|
+
storage: {
|
|
1759
|
+
// Backend Management (generic, shared by all extensions)
|
|
1760
|
+
// These commands don't use webview_ prefix because storage backends are global,
|
|
1761
|
+
// not extension-specific. All extensions share the same storage backends.
|
|
1762
|
+
listBackends: "storage_list_backends",
|
|
1763
|
+
addBackend: "storage_add_backend",
|
|
1764
|
+
removeBackend: "storage_remove_backend",
|
|
1765
|
+
testBackend: "storage_test_backend",
|
|
1766
|
+
// Storage Operations
|
|
1767
|
+
upload: "storage_upload",
|
|
1768
|
+
download: "storage_download",
|
|
1769
|
+
delete: "storage_delete",
|
|
1770
|
+
list: "storage_list"
|
|
1771
|
+
},
|
|
1485
1772
|
filesync: {
|
|
1486
1773
|
// Spaces (webview_* commands extract extension info from WebviewWindow)
|
|
1487
1774
|
listSpaces: "webview_filesync_list_spaces",
|
|
@@ -2102,6 +2389,7 @@ var HaexVaultSdk = class {
|
|
|
2102
2389
|
this.filesystem = new FilesystemAPI(this);
|
|
2103
2390
|
this.web = new WebAPI(this);
|
|
2104
2391
|
this.permissions = new PermissionsAPI(this);
|
|
2392
|
+
this.remoteStorage = new RemoteStorageAPI(this);
|
|
2105
2393
|
installConsoleForwarding(this.config.debug);
|
|
2106
2394
|
this.readyPromise = new Promise((resolve) => {
|
|
2107
2395
|
this.resolveReady = resolve;
|
|
@@ -2745,6 +3033,7 @@ exports.PermissionStatus = PermissionStatus;
|
|
|
2745
3033
|
exports.PermissionsAPI = PermissionsAPI;
|
|
2746
3034
|
exports.QUEUE_OPERATION = QUEUE_OPERATION;
|
|
2747
3035
|
exports.QUEUE_STATUS = QUEUE_STATUS;
|
|
3036
|
+
exports.RemoteStorageAPI = RemoteStorageAPI;
|
|
2748
3037
|
exports.STORAGE_BACKEND_TYPE = STORAGE_BACKEND_TYPE;
|
|
2749
3038
|
exports.SYNC_DIRECTION = SYNC_DIRECTION;
|
|
2750
3039
|
exports.TABLE_SEPARATOR = TABLE_SEPARATOR;
|