@haex-space/vault-sdk 2.3.12 → 2.3.15

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.
Files changed (42) hide show
  1. package/dist/cli/index.mjs +0 -0
  2. package/dist/{client-BdeVsDdi.d.mts → client-8eGxojZ1.d.mts} +197 -2
  3. package/dist/{client-Ctv_qXuk.d.ts → client-ChH7wiuU.d.ts} +197 -2
  4. package/dist/index.d.mts +25 -2
  5. package/dist/index.d.ts +25 -2
  6. package/dist/index.js +236 -4
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +236 -5
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/nuxt.js +7 -1
  11. package/dist/nuxt.js.map +1 -1
  12. package/dist/nuxt.mjs +7 -1
  13. package/dist/nuxt.mjs.map +1 -1
  14. package/dist/react.d.mts +1 -1
  15. package/dist/react.d.ts +1 -1
  16. package/dist/react.js +235 -4
  17. package/dist/react.js.map +1 -1
  18. package/dist/react.mjs +235 -4
  19. package/dist/react.mjs.map +1 -1
  20. package/dist/runtime/nuxt.plugin.client.d.mts +1 -1
  21. package/dist/runtime/nuxt.plugin.client.d.ts +1 -1
  22. package/dist/runtime/nuxt.plugin.client.js +235 -4
  23. package/dist/runtime/nuxt.plugin.client.js.map +1 -1
  24. package/dist/runtime/nuxt.plugin.client.mjs +235 -4
  25. package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
  26. package/dist/svelte.d.mts +1 -1
  27. package/dist/svelte.d.ts +1 -1
  28. package/dist/svelte.js +235 -4
  29. package/dist/svelte.js.map +1 -1
  30. package/dist/svelte.mjs +235 -4
  31. package/dist/svelte.mjs.map +1 -1
  32. package/dist/vite.js +7 -1
  33. package/dist/vite.js.map +1 -1
  34. package/dist/vite.mjs +7 -1
  35. package/dist/vite.mjs.map +1 -1
  36. package/dist/vue.d.mts +1 -1
  37. package/dist/vue.d.ts +1 -1
  38. package/dist/vue.js +235 -4
  39. package/dist/vue.js.map +1 -1
  40. package/dist/vue.mjs +235 -4
  41. package/dist/vue.mjs.map +1 -1
  42. package/package.json +14 -15
@@ -1,6 +1,6 @@
1
1
  import * as nuxt_app from 'nuxt/app';
2
2
  import { ShallowRef } from 'vue';
3
- import { H as HaexVaultClient } from '../client-BdeVsDdi.mjs';
3
+ import { H as HaexVaultClient } from '../client-8eGxojZ1.mjs';
4
4
  import { A as ApplicationContext } from '../types-DBF83o_W.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 HaexVaultClient } from '../client-Ctv_qXuk.js';
3
+ import { H as HaexVaultClient } from '../client-ChH7wiuU.js';
4
4
  import { A as ApplicationContext } from '../types-DBF83o_W.js';
5
5
  import 'drizzle-orm/sqlite-proxy';
6
6
 
@@ -30,7 +30,37 @@ var HAEXTENSION_METHODS = {
30
30
  filesystem: {
31
31
  saveFile: "haextension:filesystem:save-file",
32
32
  openFile: "haextension:filesystem:open-file",
33
- showImage: "haextension:filesystem:show-image"
33
+ showImage: "haextension:filesystem:show-image",
34
+ sync: {
35
+ // Spaces
36
+ listSpaces: "haextension:filesystem:sync:list-spaces",
37
+ createSpace: "haextension:filesystem:sync:create-space",
38
+ deleteSpace: "haextension:filesystem:sync:delete-space",
39
+ // Files
40
+ listFiles: "haextension:filesystem:sync:list-files",
41
+ getFile: "haextension:filesystem:sync:get-file",
42
+ uploadFile: "haextension:filesystem:sync:upload-file",
43
+ downloadFile: "haextension:filesystem:sync:download-file",
44
+ deleteFile: "haextension:filesystem:sync:delete-file",
45
+ // Backends
46
+ listBackends: "haextension:filesystem:sync:list-backends",
47
+ addBackend: "haextension:filesystem:sync:add-backend",
48
+ removeBackend: "haextension:filesystem:sync:remove-backend",
49
+ testBackend: "haextension:filesystem:sync:test-backend",
50
+ // Sync Rules
51
+ listSyncRules: "haextension:filesystem:sync:list-sync-rules",
52
+ addSyncRule: "haextension:filesystem:sync:add-sync-rule",
53
+ removeSyncRule: "haextension:filesystem:sync:remove-sync-rule",
54
+ // Sync Operations
55
+ getSyncStatus: "haextension:filesystem:sync:get-sync-status",
56
+ triggerSync: "haextension:filesystem:sync:trigger-sync",
57
+ pauseSync: "haextension:filesystem:sync:pause-sync",
58
+ resumeSync: "haextension:filesystem:sync:resume-sync",
59
+ // Conflict Resolution
60
+ resolveConflict: "haextension:filesystem:sync:resolve-conflict",
61
+ // UI Helpers
62
+ selectFolder: "haextension:filesystem:sync:select-folder"
63
+ }
34
64
  },
35
65
  storage: {
36
66
  getItem: "haextension:storage:get-item",
@@ -211,10 +241,210 @@ var DatabaseAPI = class {
211
241
  }
212
242
  };
213
243
 
244
+ // src/api/filesync.ts
245
+ var FileSyncAPI = class {
246
+ constructor(client) {
247
+ this.client = client;
248
+ }
249
+ // --------------------------------------------------------------------------
250
+ // Spaces
251
+ // --------------------------------------------------------------------------
252
+ /**
253
+ * List all file spaces
254
+ */
255
+ async listSpacesAsync() {
256
+ return this.client.request(
257
+ HAEXTENSION_METHODS.filesystem.sync.listSpaces
258
+ );
259
+ }
260
+ /**
261
+ * Create a new file space
262
+ */
263
+ async createSpaceAsync(options) {
264
+ return this.client.request(
265
+ HAEXTENSION_METHODS.filesystem.sync.createSpace,
266
+ options
267
+ );
268
+ }
269
+ /**
270
+ * Delete a file space
271
+ */
272
+ async deleteSpaceAsync(spaceId) {
273
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.deleteSpace, {
274
+ spaceId
275
+ });
276
+ }
277
+ // --------------------------------------------------------------------------
278
+ // Files
279
+ // --------------------------------------------------------------------------
280
+ /**
281
+ * List files in a space
282
+ */
283
+ async listFilesAsync(options) {
284
+ return this.client.request(
285
+ HAEXTENSION_METHODS.filesystem.sync.listFiles,
286
+ options
287
+ );
288
+ }
289
+ /**
290
+ * Get file info by ID
291
+ */
292
+ async getFileAsync(fileId) {
293
+ return this.client.request(
294
+ HAEXTENSION_METHODS.filesystem.sync.getFile,
295
+ { fileId }
296
+ );
297
+ }
298
+ /**
299
+ * Upload a file to the sync system
300
+ */
301
+ async uploadFileAsync(options) {
302
+ return this.client.request(
303
+ HAEXTENSION_METHODS.filesystem.sync.uploadFile,
304
+ options
305
+ );
306
+ }
307
+ /**
308
+ * Download a file to local storage
309
+ */
310
+ async downloadFileAsync(options) {
311
+ await this.client.request(
312
+ HAEXTENSION_METHODS.filesystem.sync.downloadFile,
313
+ options
314
+ );
315
+ }
316
+ /**
317
+ * Delete a file from the sync system
318
+ */
319
+ async deleteFileAsync(fileId) {
320
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.deleteFile, {
321
+ fileId
322
+ });
323
+ }
324
+ // --------------------------------------------------------------------------
325
+ // Storage Backends
326
+ // --------------------------------------------------------------------------
327
+ /**
328
+ * List configured storage backends
329
+ */
330
+ async listBackendsAsync() {
331
+ return this.client.request(
332
+ HAEXTENSION_METHODS.filesystem.sync.listBackends
333
+ );
334
+ }
335
+ /**
336
+ * Add a new storage backend
337
+ */
338
+ async addBackendAsync(options) {
339
+ return this.client.request(
340
+ HAEXTENSION_METHODS.filesystem.sync.addBackend,
341
+ options
342
+ );
343
+ }
344
+ /**
345
+ * Remove a storage backend
346
+ */
347
+ async removeBackendAsync(backendId) {
348
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.removeBackend, {
349
+ backendId
350
+ });
351
+ }
352
+ /**
353
+ * Test backend connection
354
+ */
355
+ async testBackendAsync(backendId) {
356
+ return this.client.request(
357
+ HAEXTENSION_METHODS.filesystem.sync.testBackend,
358
+ { backendId }
359
+ );
360
+ }
361
+ // --------------------------------------------------------------------------
362
+ // Sync Rules
363
+ // --------------------------------------------------------------------------
364
+ /**
365
+ * List sync rules
366
+ */
367
+ async listSyncRulesAsync() {
368
+ return this.client.request(
369
+ HAEXTENSION_METHODS.filesystem.sync.listSyncRules
370
+ );
371
+ }
372
+ /**
373
+ * Add a sync rule
374
+ */
375
+ async addSyncRuleAsync(options) {
376
+ return this.client.request(
377
+ HAEXTENSION_METHODS.filesystem.sync.addSyncRule,
378
+ options
379
+ );
380
+ }
381
+ /**
382
+ * Remove a sync rule
383
+ */
384
+ async removeSyncRuleAsync(ruleId) {
385
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.removeSyncRule, {
386
+ ruleId
387
+ });
388
+ }
389
+ // --------------------------------------------------------------------------
390
+ // Sync Operations
391
+ // --------------------------------------------------------------------------
392
+ /**
393
+ * Get current sync status
394
+ */
395
+ async getSyncStatusAsync() {
396
+ return this.client.request(
397
+ HAEXTENSION_METHODS.filesystem.sync.getSyncStatus
398
+ );
399
+ }
400
+ /**
401
+ * Trigger a manual sync
402
+ */
403
+ async triggerSyncAsync() {
404
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.triggerSync);
405
+ }
406
+ /**
407
+ * Pause syncing
408
+ */
409
+ async pauseSyncAsync() {
410
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.pauseSync);
411
+ }
412
+ /**
413
+ * Resume syncing
414
+ */
415
+ async resumeSyncAsync() {
416
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.resumeSync);
417
+ }
418
+ // --------------------------------------------------------------------------
419
+ // Conflict Resolution
420
+ // --------------------------------------------------------------------------
421
+ /**
422
+ * Resolve a file conflict
423
+ */
424
+ async resolveConflictAsync(fileId, resolution) {
425
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.resolveConflict, {
426
+ fileId,
427
+ resolution
428
+ });
429
+ }
430
+ // --------------------------------------------------------------------------
431
+ // Folder Selection (Native Dialog)
432
+ // --------------------------------------------------------------------------
433
+ /**
434
+ * Open a folder selection dialog
435
+ */
436
+ async selectFolderAsync() {
437
+ return this.client.request(
438
+ HAEXTENSION_METHODS.filesystem.sync.selectFolder
439
+ );
440
+ }
441
+ };
442
+
214
443
  // src/api/filesystem.ts
215
444
  var FilesystemAPI = class {
216
445
  constructor(client) {
217
446
  this.client = client;
447
+ this.sync = new FileSyncAPI(client);
218
448
  }
219
449
  /**
220
450
  * Opens a save file dialog and saves the provided data to the selected location
@@ -804,11 +1034,12 @@ var HaexVaultClient = class {
804
1034
  async respondToExternalRequest(response) {
805
1035
  await this.request("external.respond", response);
806
1036
  }
807
- async request(method, params = {}) {
1037
+ async request(method, params) {
1038
+ const resolvedParams = params ?? {};
808
1039
  if (this.isNativeWindow && typeof window.__TAURI__ !== "undefined") {
809
- return this.invoke(method, params);
1040
+ return this.invoke(method, resolvedParams);
810
1041
  }
811
- return this.postMessage(method, params);
1042
+ return this.postMessage(method, resolvedParams);
812
1043
  }
813
1044
  async postMessage(method, params) {
814
1045
  const requestId = this.generateRequestId();