@haex-space/vault-sdk 2.5.40 → 2.5.42
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/{client-BEWYbywm.d.mts → client-BAu3VPE3.d.mts} +134 -4
- package/dist/{client-CYgMbZKT.d.ts → client-CF0wJxT2.d.ts} +134 -4
- package/dist/index.d.mts +23 -3
- package/dist/index.d.ts +23 -3
- package/dist/index.js +134 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +134 -1
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +119 -0
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +119 -0
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.d.mts +1 -1
- package/dist/runtime/nuxt.plugin.client.d.ts +1 -1
- package/dist/runtime/nuxt.plugin.client.js +119 -0
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +119 -0
- package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
- package/dist/svelte.d.mts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/svelte.js +119 -0
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +119 -0
- package/dist/svelte.mjs.map +1 -1
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +119 -0
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +119 -0
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -107,7 +107,7 @@ interface LocalFileInfo {
|
|
|
107
107
|
modifiedAt: string | null;
|
|
108
108
|
}
|
|
109
109
|
type FileSyncState = "synced" | "syncing" | "localOnly" | "remoteOnly" | "conflict" | "error";
|
|
110
|
-
interface StorageBackendInfo {
|
|
110
|
+
interface StorageBackendInfo$1 {
|
|
111
111
|
id: string;
|
|
112
112
|
type: StorageBackendType;
|
|
113
113
|
name: string;
|
|
@@ -352,11 +352,11 @@ declare class FileSyncAPI {
|
|
|
352
352
|
/**
|
|
353
353
|
* List configured storage backends
|
|
354
354
|
*/
|
|
355
|
-
listBackendsAsync(): Promise<StorageBackendInfo[]>;
|
|
355
|
+
listBackendsAsync(): Promise<StorageBackendInfo$1[]>;
|
|
356
356
|
/**
|
|
357
357
|
* Add a new storage backend
|
|
358
358
|
*/
|
|
359
|
-
addBackendAsync(options: AddBackendOptions): Promise<StorageBackendInfo>;
|
|
359
|
+
addBackendAsync(options: AddBackendOptions): Promise<StorageBackendInfo$1>;
|
|
360
360
|
/**
|
|
361
361
|
* Remove a storage backend
|
|
362
362
|
*/
|
|
@@ -588,6 +588,135 @@ declare class PermissionsAPI {
|
|
|
588
588
|
checkFilesystemAsync(path: string, operation: "read" | "write"): Promise<boolean>;
|
|
589
589
|
}
|
|
590
590
|
|
|
591
|
+
/**
|
|
592
|
+
* Storage backend info (public, without credentials)
|
|
593
|
+
*/
|
|
594
|
+
interface StorageBackendInfo {
|
|
595
|
+
id: string;
|
|
596
|
+
/** Backend type (e.g., "s3") */
|
|
597
|
+
type: string;
|
|
598
|
+
name: string;
|
|
599
|
+
enabled: boolean;
|
|
600
|
+
createdAt: string;
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* S3-compatible backend configuration
|
|
604
|
+
*/
|
|
605
|
+
interface S3Config {
|
|
606
|
+
/** Custom endpoint URL (for non-AWS S3-compatible services) */
|
|
607
|
+
endpoint?: string;
|
|
608
|
+
/** AWS region or custom region name */
|
|
609
|
+
region: string;
|
|
610
|
+
/** Bucket name */
|
|
611
|
+
bucket: string;
|
|
612
|
+
/** Access key ID */
|
|
613
|
+
accessKeyId: string;
|
|
614
|
+
/** Secret access key */
|
|
615
|
+
secretAccessKey: string;
|
|
616
|
+
/** Use path-style URLs instead of virtual-hosted-style */
|
|
617
|
+
pathStyle?: boolean;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Request to add a new storage backend
|
|
621
|
+
*/
|
|
622
|
+
interface AddBackendRequest {
|
|
623
|
+
/** Display name for the backend */
|
|
624
|
+
name: string;
|
|
625
|
+
/** Backend type (currently only "s3") */
|
|
626
|
+
type: "s3";
|
|
627
|
+
/** Configuration (structure depends on type) */
|
|
628
|
+
config: S3Config | Record<string, unknown>;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Object info from list operation
|
|
632
|
+
*/
|
|
633
|
+
interface StorageObjectInfo {
|
|
634
|
+
/** Object key */
|
|
635
|
+
key: string;
|
|
636
|
+
/** Size in bytes */
|
|
637
|
+
size: number;
|
|
638
|
+
/** Last modified timestamp (ISO 8601) */
|
|
639
|
+
lastModified?: string;
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Remote Storage API for S3-compatible (and future WebDAV, FTP) backends.
|
|
643
|
+
*
|
|
644
|
+
* This API provides access to external storage backends configured centrally
|
|
645
|
+
* in haex-vault. Extensions can upload/download files without CORS issues.
|
|
646
|
+
*
|
|
647
|
+
* @example
|
|
648
|
+
* ```typescript
|
|
649
|
+
* // List available backends
|
|
650
|
+
* const backends = await sdk.remoteStorage.backends.list();
|
|
651
|
+
*
|
|
652
|
+
* // Upload data
|
|
653
|
+
* const data = new TextEncoder().encode("Hello World");
|
|
654
|
+
* await sdk.remoteStorage.upload(backendId, "path/to/file.txt", data);
|
|
655
|
+
*
|
|
656
|
+
* // Download data
|
|
657
|
+
* const downloaded = await sdk.remoteStorage.download(backendId, "path/to/file.txt");
|
|
658
|
+
* ```
|
|
659
|
+
*/
|
|
660
|
+
declare class RemoteStorageAPI {
|
|
661
|
+
private client;
|
|
662
|
+
readonly backends: BackendManagement;
|
|
663
|
+
constructor(client: HaexVaultSdk);
|
|
664
|
+
/**
|
|
665
|
+
* Upload data to a storage backend
|
|
666
|
+
* @param backendId - Backend ID to upload to
|
|
667
|
+
* @param key - Object key (path in the bucket)
|
|
668
|
+
* @param data - Data to upload
|
|
669
|
+
*/
|
|
670
|
+
upload(backendId: string, key: string, data: Uint8Array): Promise<void>;
|
|
671
|
+
/**
|
|
672
|
+
* Download data from a storage backend
|
|
673
|
+
* @param backendId - Backend ID to download from
|
|
674
|
+
* @param key - Object key (path in the bucket)
|
|
675
|
+
* @returns Downloaded data as Uint8Array
|
|
676
|
+
*/
|
|
677
|
+
download(backendId: string, key: string): Promise<Uint8Array>;
|
|
678
|
+
/**
|
|
679
|
+
* Delete an object from a storage backend
|
|
680
|
+
* @param backendId - Backend ID
|
|
681
|
+
* @param key - Object key to delete
|
|
682
|
+
*/
|
|
683
|
+
delete(backendId: string, key: string): Promise<void>;
|
|
684
|
+
/**
|
|
685
|
+
* List objects in a storage backend
|
|
686
|
+
* @param backendId - Backend ID
|
|
687
|
+
* @param prefix - Optional prefix to filter objects
|
|
688
|
+
* @returns List of objects
|
|
689
|
+
*/
|
|
690
|
+
list(backendId: string, prefix?: string): Promise<StorageObjectInfo[]>;
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Backend management operations
|
|
694
|
+
*/
|
|
695
|
+
declare class BackendManagement {
|
|
696
|
+
private client;
|
|
697
|
+
constructor(client: HaexVaultSdk);
|
|
698
|
+
/**
|
|
699
|
+
* List all available storage backends
|
|
700
|
+
*/
|
|
701
|
+
list(): Promise<StorageBackendInfo[]>;
|
|
702
|
+
/**
|
|
703
|
+
* Add a new storage backend
|
|
704
|
+
* @param request - Backend configuration
|
|
705
|
+
* @returns Created backend info
|
|
706
|
+
*/
|
|
707
|
+
add(request: AddBackendRequest): Promise<StorageBackendInfo>;
|
|
708
|
+
/**
|
|
709
|
+
* Remove a storage backend
|
|
710
|
+
* @param backendId - Backend ID to remove
|
|
711
|
+
*/
|
|
712
|
+
remove(backendId: string): Promise<void>;
|
|
713
|
+
/**
|
|
714
|
+
* Test connection to a storage backend
|
|
715
|
+
* @param backendId - Backend ID to test
|
|
716
|
+
*/
|
|
717
|
+
test(backendId: string): Promise<void>;
|
|
718
|
+
}
|
|
719
|
+
|
|
591
720
|
/**
|
|
592
721
|
* HaexVault Client
|
|
593
722
|
*
|
|
@@ -618,6 +747,7 @@ declare class HaexVaultSdk {
|
|
|
618
747
|
readonly filesystem: FilesystemAPI;
|
|
619
748
|
readonly web: WebAPI;
|
|
620
749
|
readonly permissions: PermissionsAPI;
|
|
750
|
+
readonly remoteStorage: RemoteStorageAPI;
|
|
621
751
|
constructor(config?: HaexHubConfig);
|
|
622
752
|
ready(): Promise<void>;
|
|
623
753
|
get setupCompleted(): boolean;
|
|
@@ -661,4 +791,4 @@ declare class HaexVaultSdk {
|
|
|
661
791
|
private log;
|
|
662
792
|
}
|
|
663
793
|
|
|
664
|
-
export { type
|
|
794
|
+
export { type AddBackendRequest as A, type BackendConfig as B, type ConflictStrategy as C, DatabaseAPI as D, type QueueSummary as E, FilesystemAPI as F, type GetQueueOptions as G, HaexVaultSdk as H, FILE_SYNC_STATE as I, SYNC_DIRECTION as J, STORAGE_BACKEND_TYPE as K, type ListFilesOptions as L, CONFLICT_STRATEGY as M, QUEUE_OPERATION as N, QUEUE_STATUS as O, PermissionsAPI as P, type QueueOperation as Q, RemoteStorageAPI as R, StorageAPI as S, type UpdateSyncRuleOptions as U, WebAPI as W, FileSyncAPI as a, type StorageBackendInfo as b, type S3Config as c, type StorageObjectInfo as d, type FileSpace as e, type FileInfo as f, type FileSyncState as g, type StorageBackendInfo$1 as h, type StorageBackendType as i, type S3BackendConfig as j, type SyncRule as k, type SyncDirection as l, type SyncStatus as m, type SyncError as n, type SyncProgress as o, type CreateSpaceOptions as p, type AddBackendOptions as q, type AddSyncRuleOptions as r, type ScanLocalOptions as s, type UploadFileOptions as t, type DownloadFileOptions as u, type LocalFileInfo as v, type QueueStatus as w, type SyncQueueEntry as x, type AddToQueueOptions as y, type QueueFileEntry as z };
|
|
@@ -107,7 +107,7 @@ interface LocalFileInfo {
|
|
|
107
107
|
modifiedAt: string | null;
|
|
108
108
|
}
|
|
109
109
|
type FileSyncState = "synced" | "syncing" | "localOnly" | "remoteOnly" | "conflict" | "error";
|
|
110
|
-
interface StorageBackendInfo {
|
|
110
|
+
interface StorageBackendInfo$1 {
|
|
111
111
|
id: string;
|
|
112
112
|
type: StorageBackendType;
|
|
113
113
|
name: string;
|
|
@@ -352,11 +352,11 @@ declare class FileSyncAPI {
|
|
|
352
352
|
/**
|
|
353
353
|
* List configured storage backends
|
|
354
354
|
*/
|
|
355
|
-
listBackendsAsync(): Promise<StorageBackendInfo[]>;
|
|
355
|
+
listBackendsAsync(): Promise<StorageBackendInfo$1[]>;
|
|
356
356
|
/**
|
|
357
357
|
* Add a new storage backend
|
|
358
358
|
*/
|
|
359
|
-
addBackendAsync(options: AddBackendOptions): Promise<StorageBackendInfo>;
|
|
359
|
+
addBackendAsync(options: AddBackendOptions): Promise<StorageBackendInfo$1>;
|
|
360
360
|
/**
|
|
361
361
|
* Remove a storage backend
|
|
362
362
|
*/
|
|
@@ -588,6 +588,135 @@ declare class PermissionsAPI {
|
|
|
588
588
|
checkFilesystemAsync(path: string, operation: "read" | "write"): Promise<boolean>;
|
|
589
589
|
}
|
|
590
590
|
|
|
591
|
+
/**
|
|
592
|
+
* Storage backend info (public, without credentials)
|
|
593
|
+
*/
|
|
594
|
+
interface StorageBackendInfo {
|
|
595
|
+
id: string;
|
|
596
|
+
/** Backend type (e.g., "s3") */
|
|
597
|
+
type: string;
|
|
598
|
+
name: string;
|
|
599
|
+
enabled: boolean;
|
|
600
|
+
createdAt: string;
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* S3-compatible backend configuration
|
|
604
|
+
*/
|
|
605
|
+
interface S3Config {
|
|
606
|
+
/** Custom endpoint URL (for non-AWS S3-compatible services) */
|
|
607
|
+
endpoint?: string;
|
|
608
|
+
/** AWS region or custom region name */
|
|
609
|
+
region: string;
|
|
610
|
+
/** Bucket name */
|
|
611
|
+
bucket: string;
|
|
612
|
+
/** Access key ID */
|
|
613
|
+
accessKeyId: string;
|
|
614
|
+
/** Secret access key */
|
|
615
|
+
secretAccessKey: string;
|
|
616
|
+
/** Use path-style URLs instead of virtual-hosted-style */
|
|
617
|
+
pathStyle?: boolean;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Request to add a new storage backend
|
|
621
|
+
*/
|
|
622
|
+
interface AddBackendRequest {
|
|
623
|
+
/** Display name for the backend */
|
|
624
|
+
name: string;
|
|
625
|
+
/** Backend type (currently only "s3") */
|
|
626
|
+
type: "s3";
|
|
627
|
+
/** Configuration (structure depends on type) */
|
|
628
|
+
config: S3Config | Record<string, unknown>;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Object info from list operation
|
|
632
|
+
*/
|
|
633
|
+
interface StorageObjectInfo {
|
|
634
|
+
/** Object key */
|
|
635
|
+
key: string;
|
|
636
|
+
/** Size in bytes */
|
|
637
|
+
size: number;
|
|
638
|
+
/** Last modified timestamp (ISO 8601) */
|
|
639
|
+
lastModified?: string;
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Remote Storage API for S3-compatible (and future WebDAV, FTP) backends.
|
|
643
|
+
*
|
|
644
|
+
* This API provides access to external storage backends configured centrally
|
|
645
|
+
* in haex-vault. Extensions can upload/download files without CORS issues.
|
|
646
|
+
*
|
|
647
|
+
* @example
|
|
648
|
+
* ```typescript
|
|
649
|
+
* // List available backends
|
|
650
|
+
* const backends = await sdk.remoteStorage.backends.list();
|
|
651
|
+
*
|
|
652
|
+
* // Upload data
|
|
653
|
+
* const data = new TextEncoder().encode("Hello World");
|
|
654
|
+
* await sdk.remoteStorage.upload(backendId, "path/to/file.txt", data);
|
|
655
|
+
*
|
|
656
|
+
* // Download data
|
|
657
|
+
* const downloaded = await sdk.remoteStorage.download(backendId, "path/to/file.txt");
|
|
658
|
+
* ```
|
|
659
|
+
*/
|
|
660
|
+
declare class RemoteStorageAPI {
|
|
661
|
+
private client;
|
|
662
|
+
readonly backends: BackendManagement;
|
|
663
|
+
constructor(client: HaexVaultSdk);
|
|
664
|
+
/**
|
|
665
|
+
* Upload data to a storage backend
|
|
666
|
+
* @param backendId - Backend ID to upload to
|
|
667
|
+
* @param key - Object key (path in the bucket)
|
|
668
|
+
* @param data - Data to upload
|
|
669
|
+
*/
|
|
670
|
+
upload(backendId: string, key: string, data: Uint8Array): Promise<void>;
|
|
671
|
+
/**
|
|
672
|
+
* Download data from a storage backend
|
|
673
|
+
* @param backendId - Backend ID to download from
|
|
674
|
+
* @param key - Object key (path in the bucket)
|
|
675
|
+
* @returns Downloaded data as Uint8Array
|
|
676
|
+
*/
|
|
677
|
+
download(backendId: string, key: string): Promise<Uint8Array>;
|
|
678
|
+
/**
|
|
679
|
+
* Delete an object from a storage backend
|
|
680
|
+
* @param backendId - Backend ID
|
|
681
|
+
* @param key - Object key to delete
|
|
682
|
+
*/
|
|
683
|
+
delete(backendId: string, key: string): Promise<void>;
|
|
684
|
+
/**
|
|
685
|
+
* List objects in a storage backend
|
|
686
|
+
* @param backendId - Backend ID
|
|
687
|
+
* @param prefix - Optional prefix to filter objects
|
|
688
|
+
* @returns List of objects
|
|
689
|
+
*/
|
|
690
|
+
list(backendId: string, prefix?: string): Promise<StorageObjectInfo[]>;
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Backend management operations
|
|
694
|
+
*/
|
|
695
|
+
declare class BackendManagement {
|
|
696
|
+
private client;
|
|
697
|
+
constructor(client: HaexVaultSdk);
|
|
698
|
+
/**
|
|
699
|
+
* List all available storage backends
|
|
700
|
+
*/
|
|
701
|
+
list(): Promise<StorageBackendInfo[]>;
|
|
702
|
+
/**
|
|
703
|
+
* Add a new storage backend
|
|
704
|
+
* @param request - Backend configuration
|
|
705
|
+
* @returns Created backend info
|
|
706
|
+
*/
|
|
707
|
+
add(request: AddBackendRequest): Promise<StorageBackendInfo>;
|
|
708
|
+
/**
|
|
709
|
+
* Remove a storage backend
|
|
710
|
+
* @param backendId - Backend ID to remove
|
|
711
|
+
*/
|
|
712
|
+
remove(backendId: string): Promise<void>;
|
|
713
|
+
/**
|
|
714
|
+
* Test connection to a storage backend
|
|
715
|
+
* @param backendId - Backend ID to test
|
|
716
|
+
*/
|
|
717
|
+
test(backendId: string): Promise<void>;
|
|
718
|
+
}
|
|
719
|
+
|
|
591
720
|
/**
|
|
592
721
|
* HaexVault Client
|
|
593
722
|
*
|
|
@@ -618,6 +747,7 @@ declare class HaexVaultSdk {
|
|
|
618
747
|
readonly filesystem: FilesystemAPI;
|
|
619
748
|
readonly web: WebAPI;
|
|
620
749
|
readonly permissions: PermissionsAPI;
|
|
750
|
+
readonly remoteStorage: RemoteStorageAPI;
|
|
621
751
|
constructor(config?: HaexHubConfig);
|
|
622
752
|
ready(): Promise<void>;
|
|
623
753
|
get setupCompleted(): boolean;
|
|
@@ -661,4 +791,4 @@ declare class HaexVaultSdk {
|
|
|
661
791
|
private log;
|
|
662
792
|
}
|
|
663
793
|
|
|
664
|
-
export { type
|
|
794
|
+
export { type AddBackendRequest as A, type BackendConfig as B, type ConflictStrategy as C, DatabaseAPI as D, type QueueSummary as E, FilesystemAPI as F, type GetQueueOptions as G, HaexVaultSdk as H, FILE_SYNC_STATE as I, SYNC_DIRECTION as J, STORAGE_BACKEND_TYPE as K, type ListFilesOptions as L, CONFLICT_STRATEGY as M, QUEUE_OPERATION as N, QUEUE_STATUS as O, PermissionsAPI as P, type QueueOperation as Q, RemoteStorageAPI as R, StorageAPI as S, type UpdateSyncRuleOptions as U, WebAPI as W, FileSyncAPI as a, type StorageBackendInfo as b, type S3Config as c, type StorageObjectInfo as d, type FileSpace as e, type FileInfo as f, type FileSyncState as g, type StorageBackendInfo$1 as h, type StorageBackendType as i, type S3BackendConfig as j, type SyncRule as k, type SyncDirection as l, type SyncStatus as m, type SyncError as n, type SyncProgress as o, type CreateSpaceOptions as p, type AddBackendOptions as q, type AddSyncRuleOptions as r, type ScanLocalOptions as s, type UploadFileOptions as t, type DownloadFileOptions as u, type LocalFileInfo as v, type QueueStatus as w, type SyncQueueEntry as x, type AddToQueueOptions as y, type QueueFileEntry as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HaexVaultSdk } from './client-
|
|
2
|
-
export {
|
|
1
|
+
import { H as HaexVaultSdk } from './client-BAu3VPE3.mjs';
|
|
2
|
+
export { q as AddBackendOptions, r as AddSyncRuleOptions, y as AddToQueueOptions, B as BackendConfig, M as CONFLICT_STRATEGY, C as ConflictStrategy, p as CreateSpaceOptions, D as DatabaseAPI, u as DownloadFileOptions, I as FILE_SYNC_STATE, f as FileInfo, e as FileSpace, a as FileSyncAPI, g as FileSyncState, F as FilesystemAPI, G as GetQueueOptions, L as ListFilesOptions, v as LocalFileInfo, P as PermissionsAPI, N as QUEUE_OPERATION, O as QUEUE_STATUS, z as QueueFileEntry, Q as QueueOperation, w as QueueStatus, E as QueueSummary, A as RemoteAddBackendRequest, c as RemoteS3Config, R as RemoteStorageAPI, b as RemoteStorageBackendInfo, d as RemoteStorageObjectInfo, j as S3BackendConfig, K as STORAGE_BACKEND_TYPE, J as SYNC_DIRECTION, s as ScanLocalOptions, h as StorageBackendInfo, i as StorageBackendType, l as SyncDirection, n as SyncError, o as SyncProgress, x as SyncQueueEntry, k as SyncRule, m as SyncStatus, U as UpdateSyncRuleOptions, t as UploadFileOptions, W as WebAPI } from './client-BAu3VPE3.mjs';
|
|
3
3
|
import { E as ExtensionManifest, H as HaexHubConfig } from './types-DiXJ5SF6.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-DiXJ5SF6.mjs';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
|
|
@@ -146,6 +146,16 @@ declare const HAEXTENSION_METHODS: {
|
|
|
146
146
|
readonly clear: "haextension:storage:clear";
|
|
147
147
|
readonly keys: "haextension:storage:keys";
|
|
148
148
|
};
|
|
149
|
+
readonly remoteStorage: {
|
|
150
|
+
readonly listBackends: "haextension:remote-storage:list-backends";
|
|
151
|
+
readonly addBackend: "haextension:remote-storage:add-backend";
|
|
152
|
+
readonly removeBackend: "haextension:remote-storage:remove-backend";
|
|
153
|
+
readonly testBackend: "haextension:remote-storage:test-backend";
|
|
154
|
+
readonly upload: "haextension:remote-storage:upload";
|
|
155
|
+
readonly download: "haextension:remote-storage:download";
|
|
156
|
+
readonly delete: "haextension:remote-storage:delete";
|
|
157
|
+
readonly list: "haextension:remote-storage:list";
|
|
158
|
+
};
|
|
149
159
|
readonly web: {
|
|
150
160
|
readonly fetch: "haextension:web:fetch";
|
|
151
161
|
};
|
|
@@ -217,6 +227,16 @@ declare const TAURI_COMMANDS: {
|
|
|
217
227
|
readonly getInfo: "webview_extension_get_info";
|
|
218
228
|
readonly getContext: "webview_extension_context_get";
|
|
219
229
|
};
|
|
230
|
+
readonly storage: {
|
|
231
|
+
readonly listBackends: "storage_list_backends";
|
|
232
|
+
readonly addBackend: "storage_add_backend";
|
|
233
|
+
readonly removeBackend: "storage_remove_backend";
|
|
234
|
+
readonly testBackend: "storage_test_backend";
|
|
235
|
+
readonly upload: "storage_upload";
|
|
236
|
+
readonly download: "storage_download";
|
|
237
|
+
readonly delete: "storage_delete";
|
|
238
|
+
readonly list: "storage_list";
|
|
239
|
+
};
|
|
220
240
|
readonly filesync: {
|
|
221
241
|
readonly listSpaces: "webview_filesync_list_spaces";
|
|
222
242
|
readonly createSpace: "webview_filesync_create_space";
|
|
@@ -253,7 +273,7 @@ declare const TAURI_COMMANDS: {
|
|
|
253
273
|
readonly recoverQueue: "webview_filesync_recover_queue";
|
|
254
274
|
};
|
|
255
275
|
};
|
|
256
|
-
type TauriCommand = (typeof TAURI_COMMANDS.database)[keyof typeof TAURI_COMMANDS.database] | (typeof TAURI_COMMANDS.permissions)[keyof typeof TAURI_COMMANDS.permissions] | (typeof TAURI_COMMANDS.web)[keyof typeof TAURI_COMMANDS.web] | (typeof TAURI_COMMANDS.filesystem)[keyof typeof TAURI_COMMANDS.filesystem] | (typeof TAURI_COMMANDS.external)[keyof typeof TAURI_COMMANDS.external] | (typeof TAURI_COMMANDS.extension)[keyof typeof TAURI_COMMANDS.extension] | (typeof TAURI_COMMANDS.filesync)[keyof typeof TAURI_COMMANDS.filesync];
|
|
276
|
+
type TauriCommand = (typeof TAURI_COMMANDS.database)[keyof typeof TAURI_COMMANDS.database] | (typeof TAURI_COMMANDS.permissions)[keyof typeof TAURI_COMMANDS.permissions] | (typeof TAURI_COMMANDS.web)[keyof typeof TAURI_COMMANDS.web] | (typeof TAURI_COMMANDS.filesystem)[keyof typeof TAURI_COMMANDS.filesystem] | (typeof TAURI_COMMANDS.external)[keyof typeof TAURI_COMMANDS.external] | (typeof TAURI_COMMANDS.extension)[keyof typeof TAURI_COMMANDS.extension] | (typeof TAURI_COMMANDS.storage)[keyof typeof TAURI_COMMANDS.storage] | (typeof TAURI_COMMANDS.filesync)[keyof typeof TAURI_COMMANDS.filesync];
|
|
257
277
|
|
|
258
278
|
interface VerifyResult {
|
|
259
279
|
valid: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HaexVaultSdk } from './client-
|
|
2
|
-
export {
|
|
1
|
+
import { H as HaexVaultSdk } from './client-CF0wJxT2.js';
|
|
2
|
+
export { q as AddBackendOptions, r as AddSyncRuleOptions, y as AddToQueueOptions, B as BackendConfig, M as CONFLICT_STRATEGY, C as ConflictStrategy, p as CreateSpaceOptions, D as DatabaseAPI, u as DownloadFileOptions, I as FILE_SYNC_STATE, f as FileInfo, e as FileSpace, a as FileSyncAPI, g as FileSyncState, F as FilesystemAPI, G as GetQueueOptions, L as ListFilesOptions, v as LocalFileInfo, P as PermissionsAPI, N as QUEUE_OPERATION, O as QUEUE_STATUS, z as QueueFileEntry, Q as QueueOperation, w as QueueStatus, E as QueueSummary, A as RemoteAddBackendRequest, c as RemoteS3Config, R as RemoteStorageAPI, b as RemoteStorageBackendInfo, d as RemoteStorageObjectInfo, j as S3BackendConfig, K as STORAGE_BACKEND_TYPE, J as SYNC_DIRECTION, s as ScanLocalOptions, h as StorageBackendInfo, i as StorageBackendType, l as SyncDirection, n as SyncError, o as SyncProgress, x as SyncQueueEntry, k as SyncRule, m as SyncStatus, U as UpdateSyncRuleOptions, t as UploadFileOptions, W as WebAPI } from './client-CF0wJxT2.js';
|
|
3
3
|
import { E as ExtensionManifest, H as HaexHubConfig } from './types-DiXJ5SF6.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-DiXJ5SF6.js';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.js';
|
|
@@ -146,6 +146,16 @@ declare const HAEXTENSION_METHODS: {
|
|
|
146
146
|
readonly clear: "haextension:storage:clear";
|
|
147
147
|
readonly keys: "haextension:storage:keys";
|
|
148
148
|
};
|
|
149
|
+
readonly remoteStorage: {
|
|
150
|
+
readonly listBackends: "haextension:remote-storage:list-backends";
|
|
151
|
+
readonly addBackend: "haextension:remote-storage:add-backend";
|
|
152
|
+
readonly removeBackend: "haextension:remote-storage:remove-backend";
|
|
153
|
+
readonly testBackend: "haextension:remote-storage:test-backend";
|
|
154
|
+
readonly upload: "haextension:remote-storage:upload";
|
|
155
|
+
readonly download: "haextension:remote-storage:download";
|
|
156
|
+
readonly delete: "haextension:remote-storage:delete";
|
|
157
|
+
readonly list: "haextension:remote-storage:list";
|
|
158
|
+
};
|
|
149
159
|
readonly web: {
|
|
150
160
|
readonly fetch: "haextension:web:fetch";
|
|
151
161
|
};
|
|
@@ -217,6 +227,16 @@ declare const TAURI_COMMANDS: {
|
|
|
217
227
|
readonly getInfo: "webview_extension_get_info";
|
|
218
228
|
readonly getContext: "webview_extension_context_get";
|
|
219
229
|
};
|
|
230
|
+
readonly storage: {
|
|
231
|
+
readonly listBackends: "storage_list_backends";
|
|
232
|
+
readonly addBackend: "storage_add_backend";
|
|
233
|
+
readonly removeBackend: "storage_remove_backend";
|
|
234
|
+
readonly testBackend: "storage_test_backend";
|
|
235
|
+
readonly upload: "storage_upload";
|
|
236
|
+
readonly download: "storage_download";
|
|
237
|
+
readonly delete: "storage_delete";
|
|
238
|
+
readonly list: "storage_list";
|
|
239
|
+
};
|
|
220
240
|
readonly filesync: {
|
|
221
241
|
readonly listSpaces: "webview_filesync_list_spaces";
|
|
222
242
|
readonly createSpace: "webview_filesync_create_space";
|
|
@@ -253,7 +273,7 @@ declare const TAURI_COMMANDS: {
|
|
|
253
273
|
readonly recoverQueue: "webview_filesync_recover_queue";
|
|
254
274
|
};
|
|
255
275
|
};
|
|
256
|
-
type TauriCommand = (typeof TAURI_COMMANDS.database)[keyof typeof TAURI_COMMANDS.database] | (typeof TAURI_COMMANDS.permissions)[keyof typeof TAURI_COMMANDS.permissions] | (typeof TAURI_COMMANDS.web)[keyof typeof TAURI_COMMANDS.web] | (typeof TAURI_COMMANDS.filesystem)[keyof typeof TAURI_COMMANDS.filesystem] | (typeof TAURI_COMMANDS.external)[keyof typeof TAURI_COMMANDS.external] | (typeof TAURI_COMMANDS.extension)[keyof typeof TAURI_COMMANDS.extension] | (typeof TAURI_COMMANDS.filesync)[keyof typeof TAURI_COMMANDS.filesync];
|
|
276
|
+
type TauriCommand = (typeof TAURI_COMMANDS.database)[keyof typeof TAURI_COMMANDS.database] | (typeof TAURI_COMMANDS.permissions)[keyof typeof TAURI_COMMANDS.permissions] | (typeof TAURI_COMMANDS.web)[keyof typeof TAURI_COMMANDS.web] | (typeof TAURI_COMMANDS.filesystem)[keyof typeof TAURI_COMMANDS.filesystem] | (typeof TAURI_COMMANDS.external)[keyof typeof TAURI_COMMANDS.external] | (typeof TAURI_COMMANDS.extension)[keyof typeof TAURI_COMMANDS.extension] | (typeof TAURI_COMMANDS.storage)[keyof typeof TAURI_COMMANDS.storage] | (typeof TAURI_COMMANDS.filesync)[keyof typeof TAURI_COMMANDS.filesync];
|
|
257
277
|
|
|
258
278
|
interface VerifyResult {
|
|
259
279
|
valid: boolean;
|
package/dist/index.js
CHANGED
|
@@ -539,6 +539,19 @@ var HAEXTENSION_METHODS = {
|
|
|
539
539
|
clear: "haextension:storage:clear",
|
|
540
540
|
keys: "haextension:storage:keys"
|
|
541
541
|
},
|
|
542
|
+
// Remote Storage API (S3, WebDAV, FTP, etc.)
|
|
543
|
+
remoteStorage: {
|
|
544
|
+
// Backend Management
|
|
545
|
+
listBackends: "haextension:remote-storage:list-backends",
|
|
546
|
+
addBackend: "haextension:remote-storage:add-backend",
|
|
547
|
+
removeBackend: "haextension:remote-storage:remove-backend",
|
|
548
|
+
testBackend: "haextension:remote-storage:test-backend",
|
|
549
|
+
// Storage Operations
|
|
550
|
+
upload: "haextension:remote-storage:upload",
|
|
551
|
+
download: "haextension:remote-storage:download",
|
|
552
|
+
delete: "haextension:remote-storage:delete",
|
|
553
|
+
list: "haextension:remote-storage:list"
|
|
554
|
+
},
|
|
542
555
|
web: {
|
|
543
556
|
fetch: "haextension:web:fetch"
|
|
544
557
|
},
|
|
@@ -1233,6 +1246,111 @@ var PermissionsAPI = class {
|
|
|
1233
1246
|
}
|
|
1234
1247
|
};
|
|
1235
1248
|
|
|
1249
|
+
// src/api/remoteStorage.ts
|
|
1250
|
+
var RemoteStorageAPI = class {
|
|
1251
|
+
constructor(client) {
|
|
1252
|
+
this.client = client;
|
|
1253
|
+
this.backends = new BackendManagement(client);
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* Upload data to a storage backend
|
|
1257
|
+
* @param backendId - Backend ID to upload to
|
|
1258
|
+
* @param key - Object key (path in the bucket)
|
|
1259
|
+
* @param data - Data to upload
|
|
1260
|
+
*/
|
|
1261
|
+
async upload(backendId, key, data) {
|
|
1262
|
+
const base64 = btoa(String.fromCharCode(...data));
|
|
1263
|
+
await this.client.request(HAEXTENSION_METHODS.remoteStorage.upload, {
|
|
1264
|
+
backendId,
|
|
1265
|
+
key,
|
|
1266
|
+
data: base64
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
/**
|
|
1270
|
+
* Download data from a storage backend
|
|
1271
|
+
* @param backendId - Backend ID to download from
|
|
1272
|
+
* @param key - Object key (path in the bucket)
|
|
1273
|
+
* @returns Downloaded data as Uint8Array
|
|
1274
|
+
*/
|
|
1275
|
+
async download(backendId, key) {
|
|
1276
|
+
const base64 = await this.client.request(
|
|
1277
|
+
HAEXTENSION_METHODS.remoteStorage.download,
|
|
1278
|
+
{ backendId, key }
|
|
1279
|
+
);
|
|
1280
|
+
const binary = atob(base64);
|
|
1281
|
+
const bytes = new Uint8Array(binary.length);
|
|
1282
|
+
for (let i = 0; i < binary.length; i++) {
|
|
1283
|
+
bytes[i] = binary.charCodeAt(i);
|
|
1284
|
+
}
|
|
1285
|
+
return bytes;
|
|
1286
|
+
}
|
|
1287
|
+
/**
|
|
1288
|
+
* Delete an object from a storage backend
|
|
1289
|
+
* @param backendId - Backend ID
|
|
1290
|
+
* @param key - Object key to delete
|
|
1291
|
+
*/
|
|
1292
|
+
async delete(backendId, key) {
|
|
1293
|
+
await this.client.request(HAEXTENSION_METHODS.remoteStorage.delete, {
|
|
1294
|
+
backendId,
|
|
1295
|
+
key
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* List objects in a storage backend
|
|
1300
|
+
* @param backendId - Backend ID
|
|
1301
|
+
* @param prefix - Optional prefix to filter objects
|
|
1302
|
+
* @returns List of objects
|
|
1303
|
+
*/
|
|
1304
|
+
async list(backendId, prefix) {
|
|
1305
|
+
return this.client.request(
|
|
1306
|
+
HAEXTENSION_METHODS.remoteStorage.list,
|
|
1307
|
+
{ backendId, prefix }
|
|
1308
|
+
);
|
|
1309
|
+
}
|
|
1310
|
+
};
|
|
1311
|
+
var BackendManagement = class {
|
|
1312
|
+
constructor(client) {
|
|
1313
|
+
this.client = client;
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* List all available storage backends
|
|
1317
|
+
*/
|
|
1318
|
+
async list() {
|
|
1319
|
+
return this.client.request(
|
|
1320
|
+
HAEXTENSION_METHODS.remoteStorage.listBackends
|
|
1321
|
+
);
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* Add a new storage backend
|
|
1325
|
+
* @param request - Backend configuration
|
|
1326
|
+
* @returns Created backend info
|
|
1327
|
+
*/
|
|
1328
|
+
async add(request) {
|
|
1329
|
+
return this.client.request(
|
|
1330
|
+
HAEXTENSION_METHODS.remoteStorage.addBackend,
|
|
1331
|
+
request
|
|
1332
|
+
);
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* Remove a storage backend
|
|
1336
|
+
* @param backendId - Backend ID to remove
|
|
1337
|
+
*/
|
|
1338
|
+
async remove(backendId) {
|
|
1339
|
+
await this.client.request(HAEXTENSION_METHODS.remoteStorage.removeBackend, {
|
|
1340
|
+
backendId
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
/**
|
|
1344
|
+
* Test connection to a storage backend
|
|
1345
|
+
* @param backendId - Backend ID to test
|
|
1346
|
+
*/
|
|
1347
|
+
async test(backendId) {
|
|
1348
|
+
await this.client.request(HAEXTENSION_METHODS.remoteStorage.testBackend, {
|
|
1349
|
+
backendId
|
|
1350
|
+
});
|
|
1351
|
+
}
|
|
1352
|
+
};
|
|
1353
|
+
|
|
1236
1354
|
// src/client/tableName.ts
|
|
1237
1355
|
function validatePublicKey(publicKey) {
|
|
1238
1356
|
if (!publicKey || typeof publicKey !== "string" || publicKey.trim() === "") {
|
|
@@ -1482,6 +1600,20 @@ var TAURI_COMMANDS = {
|
|
|
1482
1600
|
getInfo: "webview_extension_get_info",
|
|
1483
1601
|
getContext: "webview_extension_context_get"
|
|
1484
1602
|
},
|
|
1603
|
+
storage: {
|
|
1604
|
+
// Backend Management (generic, shared by all extensions)
|
|
1605
|
+
// These commands don't use webview_ prefix because storage backends are global,
|
|
1606
|
+
// not extension-specific. All extensions share the same storage backends.
|
|
1607
|
+
listBackends: "storage_list_backends",
|
|
1608
|
+
addBackend: "storage_add_backend",
|
|
1609
|
+
removeBackend: "storage_remove_backend",
|
|
1610
|
+
testBackend: "storage_test_backend",
|
|
1611
|
+
// Storage Operations
|
|
1612
|
+
upload: "storage_upload",
|
|
1613
|
+
download: "storage_download",
|
|
1614
|
+
delete: "storage_delete",
|
|
1615
|
+
list: "storage_list"
|
|
1616
|
+
},
|
|
1485
1617
|
filesync: {
|
|
1486
1618
|
// Spaces (webview_* commands extract extension info from WebviewWindow)
|
|
1487
1619
|
listSpaces: "webview_filesync_list_spaces",
|
|
@@ -2102,6 +2234,7 @@ var HaexVaultSdk = class {
|
|
|
2102
2234
|
this.filesystem = new FilesystemAPI(this);
|
|
2103
2235
|
this.web = new WebAPI(this);
|
|
2104
2236
|
this.permissions = new PermissionsAPI(this);
|
|
2237
|
+
this.remoteStorage = new RemoteStorageAPI(this);
|
|
2105
2238
|
installConsoleForwarding(this.config.debug);
|
|
2106
2239
|
this.readyPromise = new Promise((resolve) => {
|
|
2107
2240
|
this.resolveReady = resolve;
|
|
@@ -2745,6 +2878,7 @@ exports.PermissionStatus = PermissionStatus;
|
|
|
2745
2878
|
exports.PermissionsAPI = PermissionsAPI;
|
|
2746
2879
|
exports.QUEUE_OPERATION = QUEUE_OPERATION;
|
|
2747
2880
|
exports.QUEUE_STATUS = QUEUE_STATUS;
|
|
2881
|
+
exports.RemoteStorageAPI = RemoteStorageAPI;
|
|
2748
2882
|
exports.STORAGE_BACKEND_TYPE = STORAGE_BACKEND_TYPE;
|
|
2749
2883
|
exports.SYNC_DIRECTION = SYNC_DIRECTION;
|
|
2750
2884
|
exports.TABLE_SEPARATOR = TABLE_SEPARATOR;
|