@haex-space/vault-sdk 2.5.73 → 2.5.76

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/react.mjs CHANGED
@@ -335,7 +335,9 @@ var HAEXTENSION_EVENTS = {
335
335
  /** Context (theme, locale, platform) has changed */
336
336
  CONTEXT_CHANGED: "haextension:context:changed",
337
337
  /** Search request from HaexHub */
338
- SEARCH_REQUEST: "haextension:search:request"
338
+ SEARCH_REQUEST: "haextension:search:request",
339
+ /** File system change detected (from native file watcher) */
340
+ FILE_CHANGED: "filesync:file-changed"
339
341
  };
340
342
  var EXTERNAL_EVENTS = {
341
343
  /** External request from authorized client */
@@ -459,7 +461,14 @@ var FILESYSTEM_COMMANDS = {
459
461
  /** Rename file or directory */
460
462
  rename: "extension_filesystem_rename",
461
463
  /** Copy file or directory */
462
- copy: "extension_filesystem_copy"
464
+ copy: "extension_filesystem_copy",
465
+ // File watcher operations
466
+ /** Start watching a directory for changes */
467
+ watch: "extension_filesystem_watch",
468
+ /** Stop watching a directory */
469
+ unwatch: "extension_filesystem_unwatch",
470
+ /** Check if a directory is being watched */
471
+ isWatching: "extension_filesystem_is_watching"
463
472
  };
464
473
 
465
474
  // src/commands/externalBridge.ts
@@ -826,6 +835,42 @@ var FilesystemAPI = class {
826
835
  { from, to }
827
836
  );
828
837
  }
838
+ // ==========================================================================
839
+ // File Watcher Operations
840
+ // ==========================================================================
841
+ /**
842
+ * Start watching a directory for file changes
843
+ * When files change, the "filesync:file-changed" event is emitted
844
+ * @param ruleId Unique identifier for this watch (e.g., sync rule ID)
845
+ * @param path Absolute path to the directory to watch
846
+ */
847
+ async watch(ruleId, path) {
848
+ await this.client.request(
849
+ FILESYSTEM_COMMANDS.watch,
850
+ { ruleId, path }
851
+ );
852
+ }
853
+ /**
854
+ * Stop watching a directory
855
+ * @param ruleId The rule ID that was used when starting the watch
856
+ */
857
+ async unwatch(ruleId) {
858
+ await this.client.request(
859
+ FILESYSTEM_COMMANDS.unwatch,
860
+ { ruleId }
861
+ );
862
+ }
863
+ /**
864
+ * Check if a directory is currently being watched
865
+ * @param ruleId The rule ID to check
866
+ * @returns True if the directory is being watched
867
+ */
868
+ async isWatching(ruleId) {
869
+ return this.client.request(
870
+ FILESYSTEM_COMMANDS.isWatching,
871
+ { ruleId }
872
+ );
873
+ }
829
874
  };
830
875
 
831
876
  // src/api/web.ts
@@ -1007,9 +1052,7 @@ var RemoteStorageAPI = class {
1007
1052
  async upload(backendId, key, data) {
1008
1053
  const base64 = arrayBufferToBase64(data);
1009
1054
  await this.client.request(REMOTE_STORAGE_COMMANDS.upload, {
1010
- backendId,
1011
- key,
1012
- data: base64
1055
+ request: { backendId, key, data: base64 }
1013
1056
  });
1014
1057
  }
1015
1058
  /**
@@ -1021,7 +1064,7 @@ var RemoteStorageAPI = class {
1021
1064
  async download(backendId, key) {
1022
1065
  const base64 = await this.client.request(
1023
1066
  REMOTE_STORAGE_COMMANDS.download,
1024
- { backendId, key }
1067
+ { request: { backendId, key } }
1025
1068
  );
1026
1069
  return base64ToArrayBuffer(base64);
1027
1070
  }
@@ -1032,8 +1075,7 @@ var RemoteStorageAPI = class {
1032
1075
  */
1033
1076
  async delete(backendId, key) {
1034
1077
  await this.client.request(REMOTE_STORAGE_COMMANDS.delete, {
1035
- backendId,
1036
- key
1078
+ request: { backendId, key }
1037
1079
  });
1038
1080
  }
1039
1081
  /**