@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.
@@ -1,7 +1,7 @@
1
1
  import * as nuxt_app from 'nuxt/app';
2
2
  import { ShallowRef } from 'vue';
3
- import { H as HaexVaultSdk } from '../client-DTXGxFqD.mjs';
4
- import { A as ApplicationContext } from '../types-DiXJ5SF6.mjs';
3
+ import { H as HaexVaultSdk } from '../client-C0fkm4FE.mjs';
4
+ import { A as ApplicationContext } from '../types-CS-ggsXY.mjs';
5
5
  import 'drizzle-orm/sqlite-proxy';
6
6
 
7
7
  declare const _default: nuxt_app.Plugin<{
@@ -1,7 +1,7 @@
1
1
  import * as nuxt_app from 'nuxt/app';
2
2
  import { ShallowRef } from 'vue';
3
- import { H as HaexVaultSdk } from '../client-C_0ajqhQ.js';
4
- import { A as ApplicationContext } from '../types-DiXJ5SF6.js';
3
+ import { H as HaexVaultSdk } from '../client-C8JtjQzm.js';
4
+ import { A as ApplicationContext } from '../types-CS-ggsXY.js';
5
5
  import 'drizzle-orm/sqlite-proxy';
6
6
 
7
7
  declare const _default: nuxt_app.Plugin<{
@@ -11,7 +11,9 @@ var HAEXTENSION_EVENTS = {
11
11
  /** Context (theme, locale, platform) has changed */
12
12
  CONTEXT_CHANGED: "haextension:context:changed",
13
13
  /** Search request from HaexHub */
14
- SEARCH_REQUEST: "haextension:search:request"
14
+ SEARCH_REQUEST: "haextension:search:request",
15
+ /** File system change detected (from native file watcher) */
16
+ FILE_CHANGED: "filesync:file-changed"
15
17
  };
16
18
  var EXTERNAL_EVENTS = {
17
19
  /** External request from authorized client */
@@ -135,7 +137,14 @@ var FILESYSTEM_COMMANDS = {
135
137
  /** Rename file or directory */
136
138
  rename: "extension_filesystem_rename",
137
139
  /** Copy file or directory */
138
- copy: "extension_filesystem_copy"
140
+ copy: "extension_filesystem_copy",
141
+ // File watcher operations
142
+ /** Start watching a directory for changes */
143
+ watch: "extension_filesystem_watch",
144
+ /** Stop watching a directory */
145
+ unwatch: "extension_filesystem_unwatch",
146
+ /** Check if a directory is being watched */
147
+ isWatching: "extension_filesystem_is_watching"
139
148
  };
140
149
 
141
150
  // src/commands/externalBridge.ts
@@ -502,6 +511,42 @@ var FilesystemAPI = class {
502
511
  { from, to }
503
512
  );
504
513
  }
514
+ // ==========================================================================
515
+ // File Watcher Operations
516
+ // ==========================================================================
517
+ /**
518
+ * Start watching a directory for file changes
519
+ * When files change, the "filesync:file-changed" event is emitted
520
+ * @param ruleId Unique identifier for this watch (e.g., sync rule ID)
521
+ * @param path Absolute path to the directory to watch
522
+ */
523
+ async watch(ruleId, path) {
524
+ await this.client.request(
525
+ FILESYSTEM_COMMANDS.watch,
526
+ { ruleId, path }
527
+ );
528
+ }
529
+ /**
530
+ * Stop watching a directory
531
+ * @param ruleId The rule ID that was used when starting the watch
532
+ */
533
+ async unwatch(ruleId) {
534
+ await this.client.request(
535
+ FILESYSTEM_COMMANDS.unwatch,
536
+ { ruleId }
537
+ );
538
+ }
539
+ /**
540
+ * Check if a directory is currently being watched
541
+ * @param ruleId The rule ID to check
542
+ * @returns True if the directory is being watched
543
+ */
544
+ async isWatching(ruleId) {
545
+ return this.client.request(
546
+ FILESYSTEM_COMMANDS.isWatching,
547
+ { ruleId }
548
+ );
549
+ }
505
550
  };
506
551
 
507
552
  // src/api/web.ts
@@ -683,9 +728,7 @@ var RemoteStorageAPI = class {
683
728
  async upload(backendId, key, data) {
684
729
  const base64 = arrayBufferToBase64(data);
685
730
  await this.client.request(REMOTE_STORAGE_COMMANDS.upload, {
686
- backendId,
687
- key,
688
- data: base64
731
+ request: { backendId, key, data: base64 }
689
732
  });
690
733
  }
691
734
  /**
@@ -697,7 +740,7 @@ var RemoteStorageAPI = class {
697
740
  async download(backendId, key) {
698
741
  const base64 = await this.client.request(
699
742
  REMOTE_STORAGE_COMMANDS.download,
700
- { backendId, key }
743
+ { request: { backendId, key } }
701
744
  );
702
745
  return base64ToArrayBuffer(base64);
703
746
  }
@@ -708,8 +751,7 @@ var RemoteStorageAPI = class {
708
751
  */
709
752
  async delete(backendId, key) {
710
753
  await this.client.request(REMOTE_STORAGE_COMMANDS.delete, {
711
- backendId,
712
- key
754
+ request: { backendId, key }
713
755
  });
714
756
  }
715
757
  /**