@haex-space/vault-sdk 2.3.14 → 2.3.16
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-BdeVsDdi.d.mts → client-8eGxojZ1.d.mts} +197 -2
- package/dist/{client-Ctv_qXuk.d.ts → client-ChH7wiuU.d.ts} +197 -2
- package/dist/index.d.mts +37 -3
- package/dist/index.d.ts +37 -3
- package/dist/index.js +274 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +272 -5
- 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 +235 -4
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +235 -4
- 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 +235 -4
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +235 -4
- 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 +235 -4
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +235 -4
- 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 +235 -4
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +235 -4
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -41,6 +41,200 @@ declare class DatabaseAPI {
|
|
|
41
41
|
count(tableName: string, where?: string, whereParams?: unknown[]): Promise<number>;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
interface FileSpace {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
isPersonal: boolean;
|
|
48
|
+
fileCount: number;
|
|
49
|
+
totalSize: number;
|
|
50
|
+
createdAt: string;
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
}
|
|
53
|
+
interface FileInfo {
|
|
54
|
+
id: string;
|
|
55
|
+
spaceId: string;
|
|
56
|
+
name: string;
|
|
57
|
+
path: string;
|
|
58
|
+
mimeType: string | null;
|
|
59
|
+
size: number;
|
|
60
|
+
contentHash: string;
|
|
61
|
+
isDirectory: boolean;
|
|
62
|
+
syncState: FileSyncState;
|
|
63
|
+
backends: string[];
|
|
64
|
+
createdAt: string;
|
|
65
|
+
updatedAt: string;
|
|
66
|
+
}
|
|
67
|
+
type FileSyncState = "synced" | "syncing" | "localOnly" | "remoteOnly" | "conflict" | "error";
|
|
68
|
+
interface StorageBackendInfo {
|
|
69
|
+
id: string;
|
|
70
|
+
type: StorageBackendType;
|
|
71
|
+
name: string;
|
|
72
|
+
enabled: boolean;
|
|
73
|
+
createdAt: string;
|
|
74
|
+
}
|
|
75
|
+
type StorageBackendType = "s3" | "r2" | "minio" | "gdrive" | "dropbox";
|
|
76
|
+
interface S3BackendConfig {
|
|
77
|
+
type: "s3" | "r2" | "minio";
|
|
78
|
+
endpoint?: string;
|
|
79
|
+
region: string;
|
|
80
|
+
bucket: string;
|
|
81
|
+
accessKeyId: string;
|
|
82
|
+
secretAccessKey: string;
|
|
83
|
+
}
|
|
84
|
+
interface SyncRule {
|
|
85
|
+
id: string;
|
|
86
|
+
spaceId: string;
|
|
87
|
+
localPath: string;
|
|
88
|
+
backendIds: string[];
|
|
89
|
+
direction: SyncDirection;
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
updatedAt: string;
|
|
93
|
+
}
|
|
94
|
+
type SyncDirection = "up" | "down" | "both";
|
|
95
|
+
interface SyncStatus {
|
|
96
|
+
isSyncing: boolean;
|
|
97
|
+
pendingUploads: number;
|
|
98
|
+
pendingDownloads: number;
|
|
99
|
+
lastSync: string | null;
|
|
100
|
+
errors: SyncError[];
|
|
101
|
+
}
|
|
102
|
+
interface SyncError {
|
|
103
|
+
fileId: string;
|
|
104
|
+
fileName: string;
|
|
105
|
+
error: string;
|
|
106
|
+
timestamp: string;
|
|
107
|
+
}
|
|
108
|
+
interface SyncProgress {
|
|
109
|
+
fileId: string;
|
|
110
|
+
fileName: string;
|
|
111
|
+
bytesTransferred: number;
|
|
112
|
+
totalBytes: number;
|
|
113
|
+
direction: "upload" | "download";
|
|
114
|
+
}
|
|
115
|
+
interface CreateSpaceOptions {
|
|
116
|
+
name: string;
|
|
117
|
+
}
|
|
118
|
+
interface AddBackendOptions {
|
|
119
|
+
type: StorageBackendType;
|
|
120
|
+
name: string;
|
|
121
|
+
config: S3BackendConfig;
|
|
122
|
+
}
|
|
123
|
+
interface AddSyncRuleOptions {
|
|
124
|
+
spaceId: string;
|
|
125
|
+
localPath: string;
|
|
126
|
+
backendIds: string[];
|
|
127
|
+
direction?: SyncDirection;
|
|
128
|
+
}
|
|
129
|
+
interface ListFilesOptions {
|
|
130
|
+
spaceId: string;
|
|
131
|
+
path?: string;
|
|
132
|
+
recursive?: boolean;
|
|
133
|
+
}
|
|
134
|
+
interface UploadFileOptions {
|
|
135
|
+
spaceId: string;
|
|
136
|
+
localPath: string;
|
|
137
|
+
remotePath?: string;
|
|
138
|
+
backendIds?: string[];
|
|
139
|
+
}
|
|
140
|
+
interface DownloadFileOptions {
|
|
141
|
+
fileId: string;
|
|
142
|
+
localPath: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* File Sync API for E2E encrypted file synchronization
|
|
146
|
+
*
|
|
147
|
+
* Access via: client.filesystem.sync.*
|
|
148
|
+
*/
|
|
149
|
+
declare class FileSyncAPI {
|
|
150
|
+
private client;
|
|
151
|
+
constructor(client: HaexVaultClient);
|
|
152
|
+
/**
|
|
153
|
+
* List all file spaces
|
|
154
|
+
*/
|
|
155
|
+
listSpacesAsync(): Promise<FileSpace[]>;
|
|
156
|
+
/**
|
|
157
|
+
* Create a new file space
|
|
158
|
+
*/
|
|
159
|
+
createSpaceAsync(options: CreateSpaceOptions): Promise<FileSpace>;
|
|
160
|
+
/**
|
|
161
|
+
* Delete a file space
|
|
162
|
+
*/
|
|
163
|
+
deleteSpaceAsync(spaceId: string): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* List files in a space
|
|
166
|
+
*/
|
|
167
|
+
listFilesAsync(options: ListFilesOptions): Promise<FileInfo[]>;
|
|
168
|
+
/**
|
|
169
|
+
* Get file info by ID
|
|
170
|
+
*/
|
|
171
|
+
getFileAsync(fileId: string): Promise<FileInfo | null>;
|
|
172
|
+
/**
|
|
173
|
+
* Upload a file to the sync system
|
|
174
|
+
*/
|
|
175
|
+
uploadFileAsync(options: UploadFileOptions): Promise<FileInfo>;
|
|
176
|
+
/**
|
|
177
|
+
* Download a file to local storage
|
|
178
|
+
*/
|
|
179
|
+
downloadFileAsync(options: DownloadFileOptions): Promise<void>;
|
|
180
|
+
/**
|
|
181
|
+
* Delete a file from the sync system
|
|
182
|
+
*/
|
|
183
|
+
deleteFileAsync(fileId: string): Promise<void>;
|
|
184
|
+
/**
|
|
185
|
+
* List configured storage backends
|
|
186
|
+
*/
|
|
187
|
+
listBackendsAsync(): Promise<StorageBackendInfo[]>;
|
|
188
|
+
/**
|
|
189
|
+
* Add a new storage backend
|
|
190
|
+
*/
|
|
191
|
+
addBackendAsync(options: AddBackendOptions): Promise<StorageBackendInfo>;
|
|
192
|
+
/**
|
|
193
|
+
* Remove a storage backend
|
|
194
|
+
*/
|
|
195
|
+
removeBackendAsync(backendId: string): Promise<void>;
|
|
196
|
+
/**
|
|
197
|
+
* Test backend connection
|
|
198
|
+
*/
|
|
199
|
+
testBackendAsync(backendId: string): Promise<boolean>;
|
|
200
|
+
/**
|
|
201
|
+
* List sync rules
|
|
202
|
+
*/
|
|
203
|
+
listSyncRulesAsync(): Promise<SyncRule[]>;
|
|
204
|
+
/**
|
|
205
|
+
* Add a sync rule
|
|
206
|
+
*/
|
|
207
|
+
addSyncRuleAsync(options: AddSyncRuleOptions): Promise<SyncRule>;
|
|
208
|
+
/**
|
|
209
|
+
* Remove a sync rule
|
|
210
|
+
*/
|
|
211
|
+
removeSyncRuleAsync(ruleId: string): Promise<void>;
|
|
212
|
+
/**
|
|
213
|
+
* Get current sync status
|
|
214
|
+
*/
|
|
215
|
+
getSyncStatusAsync(): Promise<SyncStatus>;
|
|
216
|
+
/**
|
|
217
|
+
* Trigger a manual sync
|
|
218
|
+
*/
|
|
219
|
+
triggerSyncAsync(): Promise<void>;
|
|
220
|
+
/**
|
|
221
|
+
* Pause syncing
|
|
222
|
+
*/
|
|
223
|
+
pauseSyncAsync(): Promise<void>;
|
|
224
|
+
/**
|
|
225
|
+
* Resume syncing
|
|
226
|
+
*/
|
|
227
|
+
resumeSyncAsync(): Promise<void>;
|
|
228
|
+
/**
|
|
229
|
+
* Resolve a file conflict
|
|
230
|
+
*/
|
|
231
|
+
resolveConflictAsync(fileId: string, resolution: "local" | "remote" | "keepBoth"): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Open a folder selection dialog
|
|
234
|
+
*/
|
|
235
|
+
selectFolderAsync(): Promise<string | null>;
|
|
236
|
+
}
|
|
237
|
+
|
|
44
238
|
interface SaveFileOptions {
|
|
45
239
|
/**
|
|
46
240
|
* The default filename to suggest
|
|
@@ -98,6 +292,7 @@ interface ShowImageResult {
|
|
|
98
292
|
}
|
|
99
293
|
declare class FilesystemAPI {
|
|
100
294
|
private client;
|
|
295
|
+
readonly sync: FileSyncAPI;
|
|
101
296
|
constructor(client: HaexVaultClient);
|
|
102
297
|
/**
|
|
103
298
|
* Opens a save file dialog and saves the provided data to the selected location
|
|
@@ -306,7 +501,7 @@ declare class HaexVaultClient {
|
|
|
306
501
|
* This is called internally after a handler processes a request
|
|
307
502
|
*/
|
|
308
503
|
respondToExternalRequest(response: ExternalResponse): Promise<void>;
|
|
309
|
-
request<T = unknown
|
|
504
|
+
request<T = unknown, P = Record<string, unknown>>(method: string, params?: P): Promise<T>;
|
|
310
505
|
private postMessage;
|
|
311
506
|
private invoke;
|
|
312
507
|
on(eventType: string, callback: EventCallback): void;
|
|
@@ -324,4 +519,4 @@ declare class HaexVaultClient {
|
|
|
324
519
|
private log;
|
|
325
520
|
}
|
|
326
521
|
|
|
327
|
-
export { DatabaseAPI as D, FilesystemAPI as F, HaexVaultClient as H, PermissionsAPI as P, StorageAPI as S, WebAPI as W };
|
|
522
|
+
export { type AddBackendOptions as A, type CreateSpaceOptions as C, DatabaseAPI as D, FilesystemAPI as F, HaexVaultClient 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 SyncRule as h, type SyncDirection as i, type SyncStatus as j, type SyncError as k, type SyncProgress as l, type AddSyncRuleOptions as m, type DownloadFileOptions as n };
|
|
@@ -41,6 +41,200 @@ declare class DatabaseAPI {
|
|
|
41
41
|
count(tableName: string, where?: string, whereParams?: unknown[]): Promise<number>;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
interface FileSpace {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
isPersonal: boolean;
|
|
48
|
+
fileCount: number;
|
|
49
|
+
totalSize: number;
|
|
50
|
+
createdAt: string;
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
}
|
|
53
|
+
interface FileInfo {
|
|
54
|
+
id: string;
|
|
55
|
+
spaceId: string;
|
|
56
|
+
name: string;
|
|
57
|
+
path: string;
|
|
58
|
+
mimeType: string | null;
|
|
59
|
+
size: number;
|
|
60
|
+
contentHash: string;
|
|
61
|
+
isDirectory: boolean;
|
|
62
|
+
syncState: FileSyncState;
|
|
63
|
+
backends: string[];
|
|
64
|
+
createdAt: string;
|
|
65
|
+
updatedAt: string;
|
|
66
|
+
}
|
|
67
|
+
type FileSyncState = "synced" | "syncing" | "localOnly" | "remoteOnly" | "conflict" | "error";
|
|
68
|
+
interface StorageBackendInfo {
|
|
69
|
+
id: string;
|
|
70
|
+
type: StorageBackendType;
|
|
71
|
+
name: string;
|
|
72
|
+
enabled: boolean;
|
|
73
|
+
createdAt: string;
|
|
74
|
+
}
|
|
75
|
+
type StorageBackendType = "s3" | "r2" | "minio" | "gdrive" | "dropbox";
|
|
76
|
+
interface S3BackendConfig {
|
|
77
|
+
type: "s3" | "r2" | "minio";
|
|
78
|
+
endpoint?: string;
|
|
79
|
+
region: string;
|
|
80
|
+
bucket: string;
|
|
81
|
+
accessKeyId: string;
|
|
82
|
+
secretAccessKey: string;
|
|
83
|
+
}
|
|
84
|
+
interface SyncRule {
|
|
85
|
+
id: string;
|
|
86
|
+
spaceId: string;
|
|
87
|
+
localPath: string;
|
|
88
|
+
backendIds: string[];
|
|
89
|
+
direction: SyncDirection;
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
updatedAt: string;
|
|
93
|
+
}
|
|
94
|
+
type SyncDirection = "up" | "down" | "both";
|
|
95
|
+
interface SyncStatus {
|
|
96
|
+
isSyncing: boolean;
|
|
97
|
+
pendingUploads: number;
|
|
98
|
+
pendingDownloads: number;
|
|
99
|
+
lastSync: string | null;
|
|
100
|
+
errors: SyncError[];
|
|
101
|
+
}
|
|
102
|
+
interface SyncError {
|
|
103
|
+
fileId: string;
|
|
104
|
+
fileName: string;
|
|
105
|
+
error: string;
|
|
106
|
+
timestamp: string;
|
|
107
|
+
}
|
|
108
|
+
interface SyncProgress {
|
|
109
|
+
fileId: string;
|
|
110
|
+
fileName: string;
|
|
111
|
+
bytesTransferred: number;
|
|
112
|
+
totalBytes: number;
|
|
113
|
+
direction: "upload" | "download";
|
|
114
|
+
}
|
|
115
|
+
interface CreateSpaceOptions {
|
|
116
|
+
name: string;
|
|
117
|
+
}
|
|
118
|
+
interface AddBackendOptions {
|
|
119
|
+
type: StorageBackendType;
|
|
120
|
+
name: string;
|
|
121
|
+
config: S3BackendConfig;
|
|
122
|
+
}
|
|
123
|
+
interface AddSyncRuleOptions {
|
|
124
|
+
spaceId: string;
|
|
125
|
+
localPath: string;
|
|
126
|
+
backendIds: string[];
|
|
127
|
+
direction?: SyncDirection;
|
|
128
|
+
}
|
|
129
|
+
interface ListFilesOptions {
|
|
130
|
+
spaceId: string;
|
|
131
|
+
path?: string;
|
|
132
|
+
recursive?: boolean;
|
|
133
|
+
}
|
|
134
|
+
interface UploadFileOptions {
|
|
135
|
+
spaceId: string;
|
|
136
|
+
localPath: string;
|
|
137
|
+
remotePath?: string;
|
|
138
|
+
backendIds?: string[];
|
|
139
|
+
}
|
|
140
|
+
interface DownloadFileOptions {
|
|
141
|
+
fileId: string;
|
|
142
|
+
localPath: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* File Sync API for E2E encrypted file synchronization
|
|
146
|
+
*
|
|
147
|
+
* Access via: client.filesystem.sync.*
|
|
148
|
+
*/
|
|
149
|
+
declare class FileSyncAPI {
|
|
150
|
+
private client;
|
|
151
|
+
constructor(client: HaexVaultClient);
|
|
152
|
+
/**
|
|
153
|
+
* List all file spaces
|
|
154
|
+
*/
|
|
155
|
+
listSpacesAsync(): Promise<FileSpace[]>;
|
|
156
|
+
/**
|
|
157
|
+
* Create a new file space
|
|
158
|
+
*/
|
|
159
|
+
createSpaceAsync(options: CreateSpaceOptions): Promise<FileSpace>;
|
|
160
|
+
/**
|
|
161
|
+
* Delete a file space
|
|
162
|
+
*/
|
|
163
|
+
deleteSpaceAsync(spaceId: string): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* List files in a space
|
|
166
|
+
*/
|
|
167
|
+
listFilesAsync(options: ListFilesOptions): Promise<FileInfo[]>;
|
|
168
|
+
/**
|
|
169
|
+
* Get file info by ID
|
|
170
|
+
*/
|
|
171
|
+
getFileAsync(fileId: string): Promise<FileInfo | null>;
|
|
172
|
+
/**
|
|
173
|
+
* Upload a file to the sync system
|
|
174
|
+
*/
|
|
175
|
+
uploadFileAsync(options: UploadFileOptions): Promise<FileInfo>;
|
|
176
|
+
/**
|
|
177
|
+
* Download a file to local storage
|
|
178
|
+
*/
|
|
179
|
+
downloadFileAsync(options: DownloadFileOptions): Promise<void>;
|
|
180
|
+
/**
|
|
181
|
+
* Delete a file from the sync system
|
|
182
|
+
*/
|
|
183
|
+
deleteFileAsync(fileId: string): Promise<void>;
|
|
184
|
+
/**
|
|
185
|
+
* List configured storage backends
|
|
186
|
+
*/
|
|
187
|
+
listBackendsAsync(): Promise<StorageBackendInfo[]>;
|
|
188
|
+
/**
|
|
189
|
+
* Add a new storage backend
|
|
190
|
+
*/
|
|
191
|
+
addBackendAsync(options: AddBackendOptions): Promise<StorageBackendInfo>;
|
|
192
|
+
/**
|
|
193
|
+
* Remove a storage backend
|
|
194
|
+
*/
|
|
195
|
+
removeBackendAsync(backendId: string): Promise<void>;
|
|
196
|
+
/**
|
|
197
|
+
* Test backend connection
|
|
198
|
+
*/
|
|
199
|
+
testBackendAsync(backendId: string): Promise<boolean>;
|
|
200
|
+
/**
|
|
201
|
+
* List sync rules
|
|
202
|
+
*/
|
|
203
|
+
listSyncRulesAsync(): Promise<SyncRule[]>;
|
|
204
|
+
/**
|
|
205
|
+
* Add a sync rule
|
|
206
|
+
*/
|
|
207
|
+
addSyncRuleAsync(options: AddSyncRuleOptions): Promise<SyncRule>;
|
|
208
|
+
/**
|
|
209
|
+
* Remove a sync rule
|
|
210
|
+
*/
|
|
211
|
+
removeSyncRuleAsync(ruleId: string): Promise<void>;
|
|
212
|
+
/**
|
|
213
|
+
* Get current sync status
|
|
214
|
+
*/
|
|
215
|
+
getSyncStatusAsync(): Promise<SyncStatus>;
|
|
216
|
+
/**
|
|
217
|
+
* Trigger a manual sync
|
|
218
|
+
*/
|
|
219
|
+
triggerSyncAsync(): Promise<void>;
|
|
220
|
+
/**
|
|
221
|
+
* Pause syncing
|
|
222
|
+
*/
|
|
223
|
+
pauseSyncAsync(): Promise<void>;
|
|
224
|
+
/**
|
|
225
|
+
* Resume syncing
|
|
226
|
+
*/
|
|
227
|
+
resumeSyncAsync(): Promise<void>;
|
|
228
|
+
/**
|
|
229
|
+
* Resolve a file conflict
|
|
230
|
+
*/
|
|
231
|
+
resolveConflictAsync(fileId: string, resolution: "local" | "remote" | "keepBoth"): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Open a folder selection dialog
|
|
234
|
+
*/
|
|
235
|
+
selectFolderAsync(): Promise<string | null>;
|
|
236
|
+
}
|
|
237
|
+
|
|
44
238
|
interface SaveFileOptions {
|
|
45
239
|
/**
|
|
46
240
|
* The default filename to suggest
|
|
@@ -98,6 +292,7 @@ interface ShowImageResult {
|
|
|
98
292
|
}
|
|
99
293
|
declare class FilesystemAPI {
|
|
100
294
|
private client;
|
|
295
|
+
readonly sync: FileSyncAPI;
|
|
101
296
|
constructor(client: HaexVaultClient);
|
|
102
297
|
/**
|
|
103
298
|
* Opens a save file dialog and saves the provided data to the selected location
|
|
@@ -306,7 +501,7 @@ declare class HaexVaultClient {
|
|
|
306
501
|
* This is called internally after a handler processes a request
|
|
307
502
|
*/
|
|
308
503
|
respondToExternalRequest(response: ExternalResponse): Promise<void>;
|
|
309
|
-
request<T = unknown
|
|
504
|
+
request<T = unknown, P = Record<string, unknown>>(method: string, params?: P): Promise<T>;
|
|
310
505
|
private postMessage;
|
|
311
506
|
private invoke;
|
|
312
507
|
on(eventType: string, callback: EventCallback): void;
|
|
@@ -324,4 +519,4 @@ declare class HaexVaultClient {
|
|
|
324
519
|
private log;
|
|
325
520
|
}
|
|
326
521
|
|
|
327
|
-
export { DatabaseAPI as D, FilesystemAPI as F, HaexVaultClient as H, PermissionsAPI as P, StorageAPI as S, WebAPI as W };
|
|
522
|
+
export { type AddBackendOptions as A, type CreateSpaceOptions as C, DatabaseAPI as D, FilesystemAPI as F, HaexVaultClient 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 SyncRule as h, type SyncDirection as i, type SyncStatus as j, type SyncError as k, type SyncProgress as l, type AddSyncRuleOptions as m, type DownloadFileOptions as n };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HaexVaultClient } from './client-
|
|
2
|
-
export { D as DatabaseAPI, F as FilesystemAPI, P as PermissionsAPI, W as WebAPI } from './client-
|
|
1
|
+
import { H as HaexVaultClient } from './client-8eGxojZ1.mjs';
|
|
2
|
+
export { A as AddBackendOptions, m as AddSyncRuleOptions, C as CreateSpaceOptions, D as DatabaseAPI, n 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, i as SyncDirection, k as SyncError, l as SyncProgress, h as SyncRule, j as SyncStatus, U as UploadFileOptions, W as WebAPI } from './client-8eGxojZ1.mjs';
|
|
3
3
|
import { E as ExtensionManifest, H as HaexHubConfig } from './types-DBF83o_W.mjs';
|
|
4
4
|
export { A as ApplicationContext, C as ContextChangedEvent, v 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 ErrorCode, g as EventCallback, a as ExtensionInfo, s as ExternalRequest, r as ExternalRequestEvent, e as ExternalRequestHandler, f as ExternalResponse, y as HAEXTENSION_EVENTS, x as HaexHubError, j as HaexHubEvent, h as HaexHubRequest, i as HaexHubResponse, z as HaextensionEvent, P as PermissionResponse, t as PermissionStatus, p as SearchQuery, q as SearchRequestEvent, S as SearchResult, T as TABLE_SEPARATOR, W as WebRequestOptions, c as WebResponse, w as getTableName } from './types-DBF83o_W.mjs';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
|
|
@@ -103,6 +103,29 @@ declare const HAEXTENSION_METHODS: {
|
|
|
103
103
|
readonly saveFile: "haextension:filesystem:save-file";
|
|
104
104
|
readonly openFile: "haextension:filesystem:open-file";
|
|
105
105
|
readonly showImage: "haextension:filesystem:show-image";
|
|
106
|
+
readonly sync: {
|
|
107
|
+
readonly listSpaces: "haextension:filesystem:sync:list-spaces";
|
|
108
|
+
readonly createSpace: "haextension:filesystem:sync:create-space";
|
|
109
|
+
readonly deleteSpace: "haextension:filesystem:sync:delete-space";
|
|
110
|
+
readonly listFiles: "haextension:filesystem:sync:list-files";
|
|
111
|
+
readonly getFile: "haextension:filesystem:sync:get-file";
|
|
112
|
+
readonly uploadFile: "haextension:filesystem:sync:upload-file";
|
|
113
|
+
readonly downloadFile: "haextension:filesystem:sync:download-file";
|
|
114
|
+
readonly deleteFile: "haextension:filesystem:sync:delete-file";
|
|
115
|
+
readonly listBackends: "haextension:filesystem:sync:list-backends";
|
|
116
|
+
readonly addBackend: "haextension:filesystem:sync:add-backend";
|
|
117
|
+
readonly removeBackend: "haextension:filesystem:sync:remove-backend";
|
|
118
|
+
readonly testBackend: "haextension:filesystem:sync:test-backend";
|
|
119
|
+
readonly listSyncRules: "haextension:filesystem:sync:list-sync-rules";
|
|
120
|
+
readonly addSyncRule: "haextension:filesystem:sync:add-sync-rule";
|
|
121
|
+
readonly removeSyncRule: "haextension:filesystem:sync:remove-sync-rule";
|
|
122
|
+
readonly getSyncStatus: "haextension:filesystem:sync:get-sync-status";
|
|
123
|
+
readonly triggerSync: "haextension:filesystem:sync:trigger-sync";
|
|
124
|
+
readonly pauseSync: "haextension:filesystem:sync:pause-sync";
|
|
125
|
+
readonly resumeSync: "haextension:filesystem:sync:resume-sync";
|
|
126
|
+
readonly resolveConflict: "haextension:filesystem:sync:resolve-conflict";
|
|
127
|
+
readonly selectFolder: "haextension:filesystem:sync:select-folder";
|
|
128
|
+
};
|
|
106
129
|
};
|
|
107
130
|
readonly storage: {
|
|
108
131
|
readonly getItem: "haextension:storage:get-item";
|
|
@@ -244,6 +267,17 @@ declare function encryptCrdtData(data: object, vaultKey: Uint8Array): Promise<{
|
|
|
244
267
|
encryptedData: string;
|
|
245
268
|
nonce: string;
|
|
246
269
|
}>;
|
|
270
|
+
/**
|
|
271
|
+
* Wraps (encrypts) a key with another key using AES-GCM
|
|
272
|
+
* Used for key hierarchies (e.g., master key -> space key -> file key)
|
|
273
|
+
* Returns: nonce (12 bytes) + ciphertext as Uint8Array
|
|
274
|
+
*/
|
|
275
|
+
declare function wrapKey(keyToWrap: Uint8Array, wrappingKey: Uint8Array): Promise<Uint8Array>;
|
|
276
|
+
/**
|
|
277
|
+
* Unwraps (decrypts) a key with another key using AES-GCM
|
|
278
|
+
* Expects: nonce (12 bytes) + ciphertext as Uint8Array
|
|
279
|
+
*/
|
|
280
|
+
declare function unwrapKey(wrappedKey: Uint8Array, wrappingKey: Uint8Array): Promise<Uint8Array>;
|
|
247
281
|
/**
|
|
248
282
|
* Decrypts CRDT log data with the vault key
|
|
249
283
|
*/
|
|
@@ -253,4 +287,4 @@ declare function base64ToArrayBuffer(base64: string): Uint8Array;
|
|
|
253
287
|
|
|
254
288
|
declare function createHaexVaultClient(config?: HaexHubConfig): HaexVaultClient;
|
|
255
289
|
|
|
256
|
-
export { ExtensionManifest, HAEXSPACE_MESSAGE_TYPES, HAEXTENSION_METHODS, HaexHubConfig, HaexVaultClient, type HaexspaceMessageType, type HaextensionMethod, type VerifyResult, type ZipFileEntry, arrayBufferToBase64, base64ToArrayBuffer, createHaexVaultClient, decryptCrdtData, decryptString, decryptVaultKey, decryptVaultName, deriveKeyFromPassword, encryptCrdtData, encryptString, encryptVaultKey, generateVaultKey, hexToBytes, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, sortObjectKeysRecursively, verifyExtensionSignature };
|
|
290
|
+
export { ExtensionManifest, HAEXSPACE_MESSAGE_TYPES, HAEXTENSION_METHODS, HaexHubConfig, HaexVaultClient, type HaexspaceMessageType, type HaextensionMethod, type VerifyResult, type ZipFileEntry, arrayBufferToBase64, base64ToArrayBuffer, createHaexVaultClient, decryptCrdtData, decryptString, decryptVaultKey, decryptVaultName, deriveKeyFromPassword, encryptCrdtData, encryptString, encryptVaultKey, generateVaultKey, hexToBytes, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, sortObjectKeysRecursively, unwrapKey, verifyExtensionSignature, wrapKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HaexVaultClient } from './client-
|
|
2
|
-
export { D as DatabaseAPI, F as FilesystemAPI, P as PermissionsAPI, W as WebAPI } from './client-
|
|
1
|
+
import { H as HaexVaultClient } from './client-ChH7wiuU.js';
|
|
2
|
+
export { A as AddBackendOptions, m as AddSyncRuleOptions, C as CreateSpaceOptions, D as DatabaseAPI, n 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, i as SyncDirection, k as SyncError, l as SyncProgress, h as SyncRule, j as SyncStatus, U as UploadFileOptions, W as WebAPI } from './client-ChH7wiuU.js';
|
|
3
3
|
import { E as ExtensionManifest, H as HaexHubConfig } from './types-DBF83o_W.js';
|
|
4
4
|
export { A as ApplicationContext, C as ContextChangedEvent, v 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 ErrorCode, g as EventCallback, a as ExtensionInfo, s as ExternalRequest, r as ExternalRequestEvent, e as ExternalRequestHandler, f as ExternalResponse, y as HAEXTENSION_EVENTS, x as HaexHubError, j as HaexHubEvent, h as HaexHubRequest, i as HaexHubResponse, z as HaextensionEvent, P as PermissionResponse, t as PermissionStatus, p as SearchQuery, q as SearchRequestEvent, S as SearchResult, T as TABLE_SEPARATOR, W as WebRequestOptions, c as WebResponse, w as getTableName } from './types-DBF83o_W.js';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.js';
|
|
@@ -103,6 +103,29 @@ declare const HAEXTENSION_METHODS: {
|
|
|
103
103
|
readonly saveFile: "haextension:filesystem:save-file";
|
|
104
104
|
readonly openFile: "haextension:filesystem:open-file";
|
|
105
105
|
readonly showImage: "haextension:filesystem:show-image";
|
|
106
|
+
readonly sync: {
|
|
107
|
+
readonly listSpaces: "haextension:filesystem:sync:list-spaces";
|
|
108
|
+
readonly createSpace: "haextension:filesystem:sync:create-space";
|
|
109
|
+
readonly deleteSpace: "haextension:filesystem:sync:delete-space";
|
|
110
|
+
readonly listFiles: "haextension:filesystem:sync:list-files";
|
|
111
|
+
readonly getFile: "haextension:filesystem:sync:get-file";
|
|
112
|
+
readonly uploadFile: "haextension:filesystem:sync:upload-file";
|
|
113
|
+
readonly downloadFile: "haextension:filesystem:sync:download-file";
|
|
114
|
+
readonly deleteFile: "haextension:filesystem:sync:delete-file";
|
|
115
|
+
readonly listBackends: "haextension:filesystem:sync:list-backends";
|
|
116
|
+
readonly addBackend: "haextension:filesystem:sync:add-backend";
|
|
117
|
+
readonly removeBackend: "haextension:filesystem:sync:remove-backend";
|
|
118
|
+
readonly testBackend: "haextension:filesystem:sync:test-backend";
|
|
119
|
+
readonly listSyncRules: "haextension:filesystem:sync:list-sync-rules";
|
|
120
|
+
readonly addSyncRule: "haextension:filesystem:sync:add-sync-rule";
|
|
121
|
+
readonly removeSyncRule: "haextension:filesystem:sync:remove-sync-rule";
|
|
122
|
+
readonly getSyncStatus: "haextension:filesystem:sync:get-sync-status";
|
|
123
|
+
readonly triggerSync: "haextension:filesystem:sync:trigger-sync";
|
|
124
|
+
readonly pauseSync: "haextension:filesystem:sync:pause-sync";
|
|
125
|
+
readonly resumeSync: "haextension:filesystem:sync:resume-sync";
|
|
126
|
+
readonly resolveConflict: "haextension:filesystem:sync:resolve-conflict";
|
|
127
|
+
readonly selectFolder: "haextension:filesystem:sync:select-folder";
|
|
128
|
+
};
|
|
106
129
|
};
|
|
107
130
|
readonly storage: {
|
|
108
131
|
readonly getItem: "haextension:storage:get-item";
|
|
@@ -244,6 +267,17 @@ declare function encryptCrdtData(data: object, vaultKey: Uint8Array): Promise<{
|
|
|
244
267
|
encryptedData: string;
|
|
245
268
|
nonce: string;
|
|
246
269
|
}>;
|
|
270
|
+
/**
|
|
271
|
+
* Wraps (encrypts) a key with another key using AES-GCM
|
|
272
|
+
* Used for key hierarchies (e.g., master key -> space key -> file key)
|
|
273
|
+
* Returns: nonce (12 bytes) + ciphertext as Uint8Array
|
|
274
|
+
*/
|
|
275
|
+
declare function wrapKey(keyToWrap: Uint8Array, wrappingKey: Uint8Array): Promise<Uint8Array>;
|
|
276
|
+
/**
|
|
277
|
+
* Unwraps (decrypts) a key with another key using AES-GCM
|
|
278
|
+
* Expects: nonce (12 bytes) + ciphertext as Uint8Array
|
|
279
|
+
*/
|
|
280
|
+
declare function unwrapKey(wrappedKey: Uint8Array, wrappingKey: Uint8Array): Promise<Uint8Array>;
|
|
247
281
|
/**
|
|
248
282
|
* Decrypts CRDT log data with the vault key
|
|
249
283
|
*/
|
|
@@ -253,4 +287,4 @@ declare function base64ToArrayBuffer(base64: string): Uint8Array;
|
|
|
253
287
|
|
|
254
288
|
declare function createHaexVaultClient(config?: HaexHubConfig): HaexVaultClient;
|
|
255
289
|
|
|
256
|
-
export { ExtensionManifest, HAEXSPACE_MESSAGE_TYPES, HAEXTENSION_METHODS, HaexHubConfig, HaexVaultClient, type HaexspaceMessageType, type HaextensionMethod, type VerifyResult, type ZipFileEntry, arrayBufferToBase64, base64ToArrayBuffer, createHaexVaultClient, decryptCrdtData, decryptString, decryptVaultKey, decryptVaultName, deriveKeyFromPassword, encryptCrdtData, encryptString, encryptVaultKey, generateVaultKey, hexToBytes, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, sortObjectKeysRecursively, verifyExtensionSignature };
|
|
290
|
+
export { ExtensionManifest, HAEXSPACE_MESSAGE_TYPES, HAEXTENSION_METHODS, HaexHubConfig, HaexVaultClient, type HaexspaceMessageType, type HaextensionMethod, type VerifyResult, type ZipFileEntry, arrayBufferToBase64, base64ToArrayBuffer, createHaexVaultClient, decryptCrdtData, decryptString, decryptVaultKey, decryptVaultName, deriveKeyFromPassword, encryptCrdtData, encryptString, encryptVaultKey, generateVaultKey, hexToBytes, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill, sortObjectKeysRecursively, unwrapKey, verifyExtensionSignature, wrapKey };
|