@haex-space/vault-sdk 2.5.23 → 2.5.27

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.
@@ -41,6 +41,29 @@ declare class DatabaseAPI {
41
41
  count(tableName: string, where?: string, whereParams?: unknown[]): Promise<number>;
42
42
  }
43
43
 
44
+ /** File sync state constants */
45
+ declare const FILE_SYNC_STATE: {
46
+ readonly SYNCED: "synced";
47
+ readonly SYNCING: "syncing";
48
+ readonly LOCAL_ONLY: "localOnly";
49
+ readonly REMOTE_ONLY: "remoteOnly";
50
+ readonly CONFLICT: "conflict";
51
+ readonly ERROR: "error";
52
+ };
53
+ /** Sync direction constants */
54
+ declare const SYNC_DIRECTION: {
55
+ readonly UP: "up";
56
+ readonly DOWN: "down";
57
+ readonly BOTH: "both";
58
+ };
59
+ /** Storage backend type constants */
60
+ declare const STORAGE_BACKEND_TYPE: {
61
+ readonly S3: "s3";
62
+ readonly R2: "r2";
63
+ readonly MINIO: "minio";
64
+ readonly GDRIVE: "gdrive";
65
+ readonly DROPBOX: "dropbox";
66
+ };
44
67
  interface FileSpace {
45
68
  id: string;
46
69
  name: string;
@@ -72,7 +95,7 @@ interface StorageBackendInfo {
72
95
  enabled: boolean;
73
96
  createdAt: string;
74
97
  }
75
- type StorageBackendType = "s3" | "r2" | "minio" | "supabase" | "gdrive" | "dropbox";
98
+ type StorageBackendType = "s3" | "r2" | "minio" | "gdrive" | "dropbox";
76
99
  interface S3BackendConfig {
77
100
  type: "s3" | "r2" | "minio";
78
101
  endpoint?: string;
@@ -81,17 +104,8 @@ interface S3BackendConfig {
81
104
  accessKeyId: string;
82
105
  secretAccessKey: string;
83
106
  }
84
- interface SupabaseBackendConfig {
85
- type: "supabase";
86
- /** Supabase project URL (e.g., https://xxx.supabase.co) */
87
- projectUrl: string;
88
- /** Supabase service role key (for server-side access) */
89
- serviceRoleKey: string;
90
- /** Storage bucket name */
91
- bucket: string;
92
- }
93
- /** Backend configuration - can be S3-compatible or Supabase */
94
- type BackendConfig = S3BackendConfig | SupabaseBackendConfig;
107
+ /** Backend configuration for S3-compatible storage */
108
+ type BackendConfig = S3BackendConfig;
95
109
  interface SyncRule {
96
110
  id: string;
97
111
  spaceId: string;
@@ -136,6 +150,12 @@ interface AddSyncRuleOptions {
136
150
  backendIds: string[];
137
151
  direction?: SyncDirection;
138
152
  }
153
+ interface UpdateSyncRuleOptions {
154
+ ruleId: string;
155
+ backendIds?: string[];
156
+ direction?: SyncDirection;
157
+ enabled?: boolean;
158
+ }
139
159
  interface ListFilesOptions {
140
160
  spaceId: string;
141
161
  path?: string;
@@ -215,6 +235,10 @@ declare class FileSyncAPI {
215
235
  * Add a sync rule
216
236
  */
217
237
  addSyncRuleAsync(options: AddSyncRuleOptions): Promise<SyncRule>;
238
+ /**
239
+ * Update a sync rule
240
+ */
241
+ updateSyncRuleAsync(options: UpdateSyncRuleOptions): Promise<SyncRule>;
218
242
  /**
219
243
  * Remove a sync rule
220
244
  */
@@ -459,4 +483,4 @@ declare class HaexVaultSdk {
459
483
  private log;
460
484
  }
461
485
 
462
- export { type AddBackendOptions as A, type BackendConfig as B, type CreateSpaceOptions as C, DatabaseAPI as D, FilesystemAPI as F, HaexVaultSdk as H, type ListFilesOptions as L, PermissionsAPI as P, StorageAPI as S, type UploadFileOptions as U, WebAPI as W, FileSyncAPI as a, type FileSpace as b, type FileInfo as c, type FileSyncState as d, type StorageBackendInfo as e, type StorageBackendType as f, type S3BackendConfig as g, type SupabaseBackendConfig as h, type SyncRule as i, type SyncDirection as j, type SyncStatus as k, type SyncError as l, type SyncProgress as m, type AddSyncRuleOptions as n, type DownloadFileOptions as o };
486
+ export { type AddBackendOptions as A, type BackendConfig as B, type CreateSpaceOptions as C, DatabaseAPI as D, FilesystemAPI as F, HaexVaultSdk as H, type ListFilesOptions as L, PermissionsAPI as P, StorageAPI as S, type UpdateSyncRuleOptions as U, WebAPI as W, FileSyncAPI as a, type FileSpace as b, type FileInfo as c, type FileSyncState as d, type StorageBackendInfo as e, type StorageBackendType as f, type S3BackendConfig as g, type SyncRule as h, type SyncDirection as i, type SyncStatus as j, type SyncError as k, type SyncProgress as l, type AddSyncRuleOptions as m, type UploadFileOptions as n, type DownloadFileOptions as o, FILE_SYNC_STATE as p, SYNC_DIRECTION as q, STORAGE_BACKEND_TYPE as r };
@@ -41,6 +41,29 @@ declare class DatabaseAPI {
41
41
  count(tableName: string, where?: string, whereParams?: unknown[]): Promise<number>;
42
42
  }
43
43
 
44
+ /** File sync state constants */
45
+ declare const FILE_SYNC_STATE: {
46
+ readonly SYNCED: "synced";
47
+ readonly SYNCING: "syncing";
48
+ readonly LOCAL_ONLY: "localOnly";
49
+ readonly REMOTE_ONLY: "remoteOnly";
50
+ readonly CONFLICT: "conflict";
51
+ readonly ERROR: "error";
52
+ };
53
+ /** Sync direction constants */
54
+ declare const SYNC_DIRECTION: {
55
+ readonly UP: "up";
56
+ readonly DOWN: "down";
57
+ readonly BOTH: "both";
58
+ };
59
+ /** Storage backend type constants */
60
+ declare const STORAGE_BACKEND_TYPE: {
61
+ readonly S3: "s3";
62
+ readonly R2: "r2";
63
+ readonly MINIO: "minio";
64
+ readonly GDRIVE: "gdrive";
65
+ readonly DROPBOX: "dropbox";
66
+ };
44
67
  interface FileSpace {
45
68
  id: string;
46
69
  name: string;
@@ -72,7 +95,7 @@ interface StorageBackendInfo {
72
95
  enabled: boolean;
73
96
  createdAt: string;
74
97
  }
75
- type StorageBackendType = "s3" | "r2" | "minio" | "supabase" | "gdrive" | "dropbox";
98
+ type StorageBackendType = "s3" | "r2" | "minio" | "gdrive" | "dropbox";
76
99
  interface S3BackendConfig {
77
100
  type: "s3" | "r2" | "minio";
78
101
  endpoint?: string;
@@ -81,17 +104,8 @@ interface S3BackendConfig {
81
104
  accessKeyId: string;
82
105
  secretAccessKey: string;
83
106
  }
84
- interface SupabaseBackendConfig {
85
- type: "supabase";
86
- /** Supabase project URL (e.g., https://xxx.supabase.co) */
87
- projectUrl: string;
88
- /** Supabase service role key (for server-side access) */
89
- serviceRoleKey: string;
90
- /** Storage bucket name */
91
- bucket: string;
92
- }
93
- /** Backend configuration - can be S3-compatible or Supabase */
94
- type BackendConfig = S3BackendConfig | SupabaseBackendConfig;
107
+ /** Backend configuration for S3-compatible storage */
108
+ type BackendConfig = S3BackendConfig;
95
109
  interface SyncRule {
96
110
  id: string;
97
111
  spaceId: string;
@@ -136,6 +150,12 @@ interface AddSyncRuleOptions {
136
150
  backendIds: string[];
137
151
  direction?: SyncDirection;
138
152
  }
153
+ interface UpdateSyncRuleOptions {
154
+ ruleId: string;
155
+ backendIds?: string[];
156
+ direction?: SyncDirection;
157
+ enabled?: boolean;
158
+ }
139
159
  interface ListFilesOptions {
140
160
  spaceId: string;
141
161
  path?: string;
@@ -215,6 +235,10 @@ declare class FileSyncAPI {
215
235
  * Add a sync rule
216
236
  */
217
237
  addSyncRuleAsync(options: AddSyncRuleOptions): Promise<SyncRule>;
238
+ /**
239
+ * Update a sync rule
240
+ */
241
+ updateSyncRuleAsync(options: UpdateSyncRuleOptions): Promise<SyncRule>;
218
242
  /**
219
243
  * Remove a sync rule
220
244
  */
@@ -459,4 +483,4 @@ declare class HaexVaultSdk {
459
483
  private log;
460
484
  }
461
485
 
462
- export { type AddBackendOptions as A, type BackendConfig as B, type CreateSpaceOptions as C, DatabaseAPI as D, FilesystemAPI as F, HaexVaultSdk as H, type ListFilesOptions as L, PermissionsAPI as P, StorageAPI as S, type UploadFileOptions as U, WebAPI as W, FileSyncAPI as a, type FileSpace as b, type FileInfo as c, type FileSyncState as d, type StorageBackendInfo as e, type StorageBackendType as f, type S3BackendConfig as g, type SupabaseBackendConfig as h, type SyncRule as i, type SyncDirection as j, type SyncStatus as k, type SyncError as l, type SyncProgress as m, type AddSyncRuleOptions as n, type DownloadFileOptions as o };
486
+ export { type AddBackendOptions as A, type BackendConfig as B, type CreateSpaceOptions as C, DatabaseAPI as D, FilesystemAPI as F, HaexVaultSdk as H, type ListFilesOptions as L, PermissionsAPI as P, StorageAPI as S, type UpdateSyncRuleOptions as U, WebAPI as W, FileSyncAPI as a, type FileSpace as b, type FileInfo as c, type FileSyncState as d, type StorageBackendInfo as e, type StorageBackendType as f, type S3BackendConfig as g, type SyncRule as h, type SyncDirection as i, type SyncStatus as j, type SyncError as k, type SyncProgress as l, type AddSyncRuleOptions as m, type UploadFileOptions as n, type DownloadFileOptions as o, FILE_SYNC_STATE as p, SYNC_DIRECTION as q, STORAGE_BACKEND_TYPE as r };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HaexVaultSdk } from './client-DXhovPAD.mjs';
2
- export { A as AddBackendOptions, n as AddSyncRuleOptions, B as BackendConfig, C as CreateSpaceOptions, D as DatabaseAPI, o as DownloadFileOptions, c as FileInfo, b as FileSpace, a as FileSyncAPI, d as FileSyncState, F as FilesystemAPI, L as ListFilesOptions, P as PermissionsAPI, g as S3BackendConfig, e as StorageBackendInfo, f as StorageBackendType, h as SupabaseBackendConfig, j as SyncDirection, l as SyncError, m as SyncProgress, i as SyncRule, k as SyncStatus, U as UploadFileOptions, W as WebAPI } from './client-DXhovPAD.mjs';
1
+ import { H as HaexVaultSdk } from './client-Bva_JMEm.mjs';
2
+ export { A as AddBackendOptions, m as AddSyncRuleOptions, B as BackendConfig, C as CreateSpaceOptions, D as DatabaseAPI, o as DownloadFileOptions, p as FILE_SYNC_STATE, c as FileInfo, b as FileSpace, a as FileSyncAPI, d as FileSyncState, F as FilesystemAPI, L as ListFilesOptions, P as PermissionsAPI, g as S3BackendConfig, r as STORAGE_BACKEND_TYPE, q as SYNC_DIRECTION, e as StorageBackendInfo, f as StorageBackendType, i as SyncDirection, k as SyncError, l as SyncProgress, h as SyncRule, j as SyncStatus, U as UpdateSyncRuleOptions, n as UploadFileOptions, W as WebAPI } from './client-Bva_JMEm.mjs';
3
3
  import { E as ExtensionManifest, H as HaexHubConfig } from './types-C4BTOGe5.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-C4BTOGe5.mjs';
5
5
  export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
@@ -118,6 +118,7 @@ declare const HAEXTENSION_METHODS: {
118
118
  readonly testBackend: "haextension:filesystem:sync:test-backend";
119
119
  readonly listSyncRules: "haextension:filesystem:sync:list-sync-rules";
120
120
  readonly addSyncRule: "haextension:filesystem:sync:add-sync-rule";
121
+ readonly updateSyncRule: "haextension:filesystem:sync:update-sync-rule";
121
122
  readonly removeSyncRule: "haextension:filesystem:sync:remove-sync-rule";
122
123
  readonly getSyncStatus: "haextension:filesystem:sync:get-sync-status";
123
124
  readonly triggerSync: "haextension:filesystem:sync:trigger-sync";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HaexVaultSdk } from './client-CndFXN7L.js';
2
- export { A as AddBackendOptions, n as AddSyncRuleOptions, B as BackendConfig, C as CreateSpaceOptions, D as DatabaseAPI, o as DownloadFileOptions, c as FileInfo, b as FileSpace, a as FileSyncAPI, d as FileSyncState, F as FilesystemAPI, L as ListFilesOptions, P as PermissionsAPI, g as S3BackendConfig, e as StorageBackendInfo, f as StorageBackendType, h as SupabaseBackendConfig, j as SyncDirection, l as SyncError, m as SyncProgress, i as SyncRule, k as SyncStatus, U as UploadFileOptions, W as WebAPI } from './client-CndFXN7L.js';
1
+ import { H as HaexVaultSdk } from './client-BUp2_Bf1.js';
2
+ export { A as AddBackendOptions, m as AddSyncRuleOptions, B as BackendConfig, C as CreateSpaceOptions, D as DatabaseAPI, o as DownloadFileOptions, p as FILE_SYNC_STATE, c as FileInfo, b as FileSpace, a as FileSyncAPI, d as FileSyncState, F as FilesystemAPI, L as ListFilesOptions, P as PermissionsAPI, g as S3BackendConfig, r as STORAGE_BACKEND_TYPE, q as SYNC_DIRECTION, e as StorageBackendInfo, f as StorageBackendType, i as SyncDirection, k as SyncError, l as SyncProgress, h as SyncRule, j as SyncStatus, U as UpdateSyncRuleOptions, n as UploadFileOptions, W as WebAPI } from './client-BUp2_Bf1.js';
3
3
  import { E as ExtensionManifest, H as HaexHubConfig } from './types-C4BTOGe5.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-C4BTOGe5.js';
5
5
  export { H as HaextensionConfig } from './config-D_HXjsEV.js';
@@ -118,6 +118,7 @@ declare const HAEXTENSION_METHODS: {
118
118
  readonly testBackend: "haextension:filesystem:sync:test-backend";
119
119
  readonly listSyncRules: "haextension:filesystem:sync:list-sync-rules";
120
120
  readonly addSyncRule: "haextension:filesystem:sync:add-sync-rule";
121
+ readonly updateSyncRule: "haextension:filesystem:sync:update-sync-rule";
121
122
  readonly removeSyncRule: "haextension:filesystem:sync:remove-sync-rule";
122
123
  readonly getSyncStatus: "haextension:filesystem:sync:get-sync-status";
123
124
  readonly triggerSync: "haextension:filesystem:sync:trigger-sync";
package/dist/index.js CHANGED
@@ -507,6 +507,7 @@ var HAEXTENSION_METHODS = {
507
507
  // Sync Rules
508
508
  listSyncRules: "haextension:filesystem:sync:list-sync-rules",
509
509
  addSyncRule: "haextension:filesystem:sync:add-sync-rule",
510
+ updateSyncRule: "haextension:filesystem:sync:update-sync-rule",
510
511
  removeSyncRule: "haextension:filesystem:sync:remove-sync-rule",
511
512
  // Sync Operations
512
513
  getSyncStatus: "haextension:filesystem:sync:get-sync-status",
@@ -651,6 +652,26 @@ var DatabaseAPI = class {
651
652
  };
652
653
 
653
654
  // src/api/filesync.ts
655
+ var FILE_SYNC_STATE = {
656
+ SYNCED: "synced",
657
+ SYNCING: "syncing",
658
+ LOCAL_ONLY: "localOnly",
659
+ REMOTE_ONLY: "remoteOnly",
660
+ CONFLICT: "conflict",
661
+ ERROR: "error"
662
+ };
663
+ var SYNC_DIRECTION = {
664
+ UP: "up",
665
+ DOWN: "down",
666
+ BOTH: "both"
667
+ };
668
+ var STORAGE_BACKEND_TYPE = {
669
+ S3: "s3",
670
+ R2: "r2",
671
+ MINIO: "minio",
672
+ GDRIVE: "gdrive",
673
+ DROPBOX: "dropbox"
674
+ };
654
675
  var FileSyncAPI = class {
655
676
  constructor(client) {
656
677
  this.client = client;
@@ -787,6 +808,15 @@ var FileSyncAPI = class {
787
808
  options
788
809
  );
789
810
  }
811
+ /**
812
+ * Update a sync rule
813
+ */
814
+ async updateSyncRuleAsync(options) {
815
+ return this.client.request(
816
+ HAEXTENSION_METHODS.filesystem.sync.updateSyncRule,
817
+ options
818
+ );
819
+ }
790
820
  /**
791
821
  * Remove a sync rule
792
822
  */
@@ -2512,6 +2542,7 @@ exports.EXTERNAL_EVENTS = EXTERNAL_EVENTS;
2512
2542
  exports.ErrorCode = ErrorCode;
2513
2543
  exports.ExternalConnectionErrorCode = ExternalConnectionErrorCode;
2514
2544
  exports.ExternalConnectionState = ExternalConnectionState;
2545
+ exports.FILE_SYNC_STATE = FILE_SYNC_STATE;
2515
2546
  exports.FileSyncAPI = FileSyncAPI;
2516
2547
  exports.FilesystemAPI = FilesystemAPI;
2517
2548
  exports.HAEXSPACE_MESSAGE_TYPES = HAEXSPACE_MESSAGE_TYPES;
@@ -2521,6 +2552,8 @@ exports.HaexVaultSdk = HaexVaultSdk;
2521
2552
  exports.HaexVaultSdkError = HaexVaultSdkError;
2522
2553
  exports.PermissionStatus = PermissionStatus;
2523
2554
  exports.PermissionsAPI = PermissionsAPI;
2555
+ exports.STORAGE_BACKEND_TYPE = STORAGE_BACKEND_TYPE;
2556
+ exports.SYNC_DIRECTION = SYNC_DIRECTION;
2524
2557
  exports.TABLE_SEPARATOR = TABLE_SEPARATOR;
2525
2558
  exports.TAURI_COMMANDS = TAURI_COMMANDS;
2526
2559
  exports.WebAPI = WebAPI;