@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
package/dist/svelte.mjs CHANGED
@@ -354,7 +354,37 @@ var HAEXTENSION_METHODS = {
354
354
  filesystem: {
355
355
  saveFile: "haextension:filesystem:save-file",
356
356
  openFile: "haextension:filesystem:open-file",
357
- showImage: "haextension:filesystem:show-image"
357
+ showImage: "haextension:filesystem:show-image",
358
+ sync: {
359
+ // Spaces
360
+ listSpaces: "haextension:filesystem:sync:list-spaces",
361
+ createSpace: "haextension:filesystem:sync:create-space",
362
+ deleteSpace: "haextension:filesystem:sync:delete-space",
363
+ // Files
364
+ listFiles: "haextension:filesystem:sync:list-files",
365
+ getFile: "haextension:filesystem:sync:get-file",
366
+ uploadFile: "haextension:filesystem:sync:upload-file",
367
+ downloadFile: "haextension:filesystem:sync:download-file",
368
+ deleteFile: "haextension:filesystem:sync:delete-file",
369
+ // Backends
370
+ listBackends: "haextension:filesystem:sync:list-backends",
371
+ addBackend: "haextension:filesystem:sync:add-backend",
372
+ removeBackend: "haextension:filesystem:sync:remove-backend",
373
+ testBackend: "haextension:filesystem:sync:test-backend",
374
+ // Sync Rules
375
+ listSyncRules: "haextension:filesystem:sync:list-sync-rules",
376
+ addSyncRule: "haextension:filesystem:sync:add-sync-rule",
377
+ removeSyncRule: "haextension:filesystem:sync:remove-sync-rule",
378
+ // Sync Operations
379
+ getSyncStatus: "haextension:filesystem:sync:get-sync-status",
380
+ triggerSync: "haextension:filesystem:sync:trigger-sync",
381
+ pauseSync: "haextension:filesystem:sync:pause-sync",
382
+ resumeSync: "haextension:filesystem:sync:resume-sync",
383
+ // Conflict Resolution
384
+ resolveConflict: "haextension:filesystem:sync:resolve-conflict",
385
+ // UI Helpers
386
+ selectFolder: "haextension:filesystem:sync:select-folder"
387
+ }
358
388
  },
359
389
  storage: {
360
390
  getItem: "haextension:storage:get-item",
@@ -527,10 +557,210 @@ var DatabaseAPI = class {
527
557
  }
528
558
  };
529
559
 
560
+ // src/api/filesync.ts
561
+ var FileSyncAPI = class {
562
+ constructor(client) {
563
+ this.client = client;
564
+ }
565
+ // --------------------------------------------------------------------------
566
+ // Spaces
567
+ // --------------------------------------------------------------------------
568
+ /**
569
+ * List all file spaces
570
+ */
571
+ async listSpacesAsync() {
572
+ return this.client.request(
573
+ HAEXTENSION_METHODS.filesystem.sync.listSpaces
574
+ );
575
+ }
576
+ /**
577
+ * Create a new file space
578
+ */
579
+ async createSpaceAsync(options) {
580
+ return this.client.request(
581
+ HAEXTENSION_METHODS.filesystem.sync.createSpace,
582
+ options
583
+ );
584
+ }
585
+ /**
586
+ * Delete a file space
587
+ */
588
+ async deleteSpaceAsync(spaceId) {
589
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.deleteSpace, {
590
+ spaceId
591
+ });
592
+ }
593
+ // --------------------------------------------------------------------------
594
+ // Files
595
+ // --------------------------------------------------------------------------
596
+ /**
597
+ * List files in a space
598
+ */
599
+ async listFilesAsync(options) {
600
+ return this.client.request(
601
+ HAEXTENSION_METHODS.filesystem.sync.listFiles,
602
+ options
603
+ );
604
+ }
605
+ /**
606
+ * Get file info by ID
607
+ */
608
+ async getFileAsync(fileId) {
609
+ return this.client.request(
610
+ HAEXTENSION_METHODS.filesystem.sync.getFile,
611
+ { fileId }
612
+ );
613
+ }
614
+ /**
615
+ * Upload a file to the sync system
616
+ */
617
+ async uploadFileAsync(options) {
618
+ return this.client.request(
619
+ HAEXTENSION_METHODS.filesystem.sync.uploadFile,
620
+ options
621
+ );
622
+ }
623
+ /**
624
+ * Download a file to local storage
625
+ */
626
+ async downloadFileAsync(options) {
627
+ await this.client.request(
628
+ HAEXTENSION_METHODS.filesystem.sync.downloadFile,
629
+ options
630
+ );
631
+ }
632
+ /**
633
+ * Delete a file from the sync system
634
+ */
635
+ async deleteFileAsync(fileId) {
636
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.deleteFile, {
637
+ fileId
638
+ });
639
+ }
640
+ // --------------------------------------------------------------------------
641
+ // Storage Backends
642
+ // --------------------------------------------------------------------------
643
+ /**
644
+ * List configured storage backends
645
+ */
646
+ async listBackendsAsync() {
647
+ return this.client.request(
648
+ HAEXTENSION_METHODS.filesystem.sync.listBackends
649
+ );
650
+ }
651
+ /**
652
+ * Add a new storage backend
653
+ */
654
+ async addBackendAsync(options) {
655
+ return this.client.request(
656
+ HAEXTENSION_METHODS.filesystem.sync.addBackend,
657
+ options
658
+ );
659
+ }
660
+ /**
661
+ * Remove a storage backend
662
+ */
663
+ async removeBackendAsync(backendId) {
664
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.removeBackend, {
665
+ backendId
666
+ });
667
+ }
668
+ /**
669
+ * Test backend connection
670
+ */
671
+ async testBackendAsync(backendId) {
672
+ return this.client.request(
673
+ HAEXTENSION_METHODS.filesystem.sync.testBackend,
674
+ { backendId }
675
+ );
676
+ }
677
+ // --------------------------------------------------------------------------
678
+ // Sync Rules
679
+ // --------------------------------------------------------------------------
680
+ /**
681
+ * List sync rules
682
+ */
683
+ async listSyncRulesAsync() {
684
+ return this.client.request(
685
+ HAEXTENSION_METHODS.filesystem.sync.listSyncRules
686
+ );
687
+ }
688
+ /**
689
+ * Add a sync rule
690
+ */
691
+ async addSyncRuleAsync(options) {
692
+ return this.client.request(
693
+ HAEXTENSION_METHODS.filesystem.sync.addSyncRule,
694
+ options
695
+ );
696
+ }
697
+ /**
698
+ * Remove a sync rule
699
+ */
700
+ async removeSyncRuleAsync(ruleId) {
701
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.removeSyncRule, {
702
+ ruleId
703
+ });
704
+ }
705
+ // --------------------------------------------------------------------------
706
+ // Sync Operations
707
+ // --------------------------------------------------------------------------
708
+ /**
709
+ * Get current sync status
710
+ */
711
+ async getSyncStatusAsync() {
712
+ return this.client.request(
713
+ HAEXTENSION_METHODS.filesystem.sync.getSyncStatus
714
+ );
715
+ }
716
+ /**
717
+ * Trigger a manual sync
718
+ */
719
+ async triggerSyncAsync() {
720
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.triggerSync);
721
+ }
722
+ /**
723
+ * Pause syncing
724
+ */
725
+ async pauseSyncAsync() {
726
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.pauseSync);
727
+ }
728
+ /**
729
+ * Resume syncing
730
+ */
731
+ async resumeSyncAsync() {
732
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.resumeSync);
733
+ }
734
+ // --------------------------------------------------------------------------
735
+ // Conflict Resolution
736
+ // --------------------------------------------------------------------------
737
+ /**
738
+ * Resolve a file conflict
739
+ */
740
+ async resolveConflictAsync(fileId, resolution) {
741
+ await this.client.request(HAEXTENSION_METHODS.filesystem.sync.resolveConflict, {
742
+ fileId,
743
+ resolution
744
+ });
745
+ }
746
+ // --------------------------------------------------------------------------
747
+ // Folder Selection (Native Dialog)
748
+ // --------------------------------------------------------------------------
749
+ /**
750
+ * Open a folder selection dialog
751
+ */
752
+ async selectFolderAsync() {
753
+ return this.client.request(
754
+ HAEXTENSION_METHODS.filesystem.sync.selectFolder
755
+ );
756
+ }
757
+ };
758
+
530
759
  // src/api/filesystem.ts
531
760
  var FilesystemAPI = class {
532
761
  constructor(client) {
533
762
  this.client = client;
763
+ this.sync = new FileSyncAPI(client);
534
764
  }
535
765
  /**
536
766
  * Opens a save file dialog and saves the provided data to the selected location
@@ -1054,11 +1284,12 @@ var HaexVaultClient = class {
1054
1284
  async respondToExternalRequest(response) {
1055
1285
  await this.request("external.respond", response);
1056
1286
  }
1057
- async request(method, params = {}) {
1287
+ async request(method, params) {
1288
+ const resolvedParams = params ?? {};
1058
1289
  if (this.isNativeWindow && typeof window.__TAURI__ !== "undefined") {
1059
- return this.invoke(method, params);
1290
+ return this.invoke(method, resolvedParams);
1060
1291
  }
1061
- return this.postMessage(method, params);
1292
+ return this.postMessage(method, resolvedParams);
1062
1293
  }
1063
1294
  async postMessage(method, params) {
1064
1295
  const requestId = this.generateRequestId();