@filen/sdk-rs 0.3.7 → 0.3.9
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/browser/sdk-rs.d.ts +231 -87
- package/browser/sdk-rs.js +313 -98
- package/browser/sdk-rs_bg.wasm +0 -0
- package/browser/sdk-rs_bg.wasm.d.ts +54 -30
- package/package.json +2 -1
package/browser/sdk-rs.d.ts
CHANGED
|
@@ -9,16 +9,70 @@ export function login(email: string, password: string, twoFactorCode?: string |
|
|
|
9
9
|
* *This API requires the following crate features to be activated: `ReadableStreamType`*
|
|
10
10
|
*/
|
|
11
11
|
type ReadableStreamType = "bytes";
|
|
12
|
-
export type
|
|
12
|
+
export type FileEnum = File | RootFile;
|
|
13
13
|
|
|
14
|
-
export interface
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
export interface RootFile {
|
|
15
|
+
uuid: UuidStr;
|
|
16
|
+
size: number;
|
|
17
|
+
chunks: number;
|
|
18
|
+
region: string;
|
|
19
|
+
bucket: string;
|
|
20
|
+
meta?: DecryptedDirMeta;
|
|
21
|
+
canMakeThumbnail: boolean;
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
export
|
|
24
|
+
export interface File {
|
|
25
|
+
uuid: UuidStr;
|
|
26
|
+
meta?: DecryptedFileMeta;
|
|
27
|
+
parent: ParentUuid;
|
|
28
|
+
size: bigint;
|
|
29
|
+
favorited: boolean;
|
|
30
|
+
region: string;
|
|
31
|
+
bucket: string;
|
|
32
|
+
chunks: bigint;
|
|
33
|
+
canMakeThumbnail: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface SharedFile {
|
|
37
|
+
file: RootFile;
|
|
38
|
+
sharingRole: SharingRole;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface DecryptedFileMeta {
|
|
42
|
+
name: string;
|
|
43
|
+
mime: string;
|
|
44
|
+
created?: bigint;
|
|
45
|
+
modified: bigint;
|
|
46
|
+
hash?: Uint8Array;
|
|
47
|
+
size: bigint;
|
|
48
|
+
key: string;
|
|
49
|
+
version: FileEncryptionVersion;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type Item = File | RootFile | Dir | RootWithMeta | Root;
|
|
53
|
+
|
|
54
|
+
export interface MakeThumbnailInMemoryResult {
|
|
55
|
+
imageData: Uint8Array;
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface MakeThumbnailInMemoryParams {
|
|
61
|
+
file: File;
|
|
62
|
+
maxWidth: number;
|
|
63
|
+
maxHeight: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface StringifiedClient {
|
|
67
|
+
email: string;
|
|
68
|
+
rootUuid: string;
|
|
69
|
+
authInfo: string;
|
|
70
|
+
privateKey: string;
|
|
71
|
+
apiKey: string;
|
|
72
|
+
authVersion: number;
|
|
73
|
+
maxParallelRequests?: number;
|
|
74
|
+
maxIoMemoryUsage?: number;
|
|
75
|
+
}
|
|
22
76
|
|
|
23
77
|
export interface UploadFileStreamParams extends UploadFileParams {
|
|
24
78
|
reader: ReadableStream<Uint8Array>;
|
|
@@ -26,22 +80,31 @@ export interface UploadFileStreamParams extends UploadFileParams {
|
|
|
26
80
|
progress?: (bytes: bigint) => void;
|
|
27
81
|
}
|
|
28
82
|
|
|
83
|
+
export interface DownloadFileToZipParams {
|
|
84
|
+
items: Item[];
|
|
85
|
+
writer: WritableStream<Uint8Array>;
|
|
86
|
+
progress?: (bytesWritten: bigint, totalBytes: bigint, itemsProcessed: bigint, totalItems: bigint) => void;
|
|
87
|
+
abortSignal?: AbortSignal;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type AbortSignal = AbortSignal;
|
|
91
|
+
|
|
29
92
|
export interface UploadFileParams {
|
|
30
93
|
parent: DirEnum;
|
|
31
94
|
name: string;
|
|
32
95
|
created?: bigint;
|
|
33
96
|
modified?: bigint;
|
|
34
|
-
mime?: string
|
|
97
|
+
mime?: string;
|
|
35
98
|
abortSignal?: AbortSignal;
|
|
36
99
|
}
|
|
37
100
|
|
|
38
101
|
export interface DownloadFileStreamParams {
|
|
39
|
-
file:
|
|
102
|
+
file: FileEnum;
|
|
40
103
|
writer: WritableStream<Uint8Array>;
|
|
41
104
|
progress?: (bytes: bigint) => void;
|
|
42
105
|
abortSignal?: AbortSignal;
|
|
43
|
-
start?: bigint
|
|
44
|
-
end?: bigint
|
|
106
|
+
start?: bigint;
|
|
107
|
+
end?: bigint;
|
|
45
108
|
}
|
|
46
109
|
|
|
47
110
|
export interface DecryptedDirMeta {
|
|
@@ -49,11 +112,13 @@ export interface DecryptedDirMeta {
|
|
|
49
112
|
created?: bigint;
|
|
50
113
|
}
|
|
51
114
|
|
|
52
|
-
export interface
|
|
53
|
-
|
|
115
|
+
export interface SharedDir {
|
|
116
|
+
dir: DirWithMetaEnum;
|
|
117
|
+
sharingRole: SharingRole;
|
|
118
|
+
writeAccess: boolean;
|
|
54
119
|
}
|
|
55
120
|
|
|
56
|
-
export type
|
|
121
|
+
export type DirWithMetaEnum = Dir | RootWithMeta;
|
|
57
122
|
|
|
58
123
|
export interface Dir {
|
|
59
124
|
uuid: UuidStr;
|
|
@@ -63,37 +128,18 @@ export interface Dir {
|
|
|
63
128
|
meta?: DecryptedDirMeta;
|
|
64
129
|
}
|
|
65
130
|
|
|
66
|
-
export interface
|
|
131
|
+
export interface Root {
|
|
67
132
|
uuid: UuidStr;
|
|
68
|
-
meta?: DecryptedFileMeta;
|
|
69
|
-
parent: ParentUuid;
|
|
70
|
-
size: bigint;
|
|
71
|
-
favorited: boolean;
|
|
72
|
-
region: string;
|
|
73
|
-
bucket: string;
|
|
74
|
-
chunks: bigint;
|
|
75
133
|
}
|
|
76
134
|
|
|
77
|
-
export
|
|
78
|
-
name: string;
|
|
79
|
-
mime: string;
|
|
80
|
-
created?: bigint;
|
|
81
|
-
modified: bigint;
|
|
82
|
-
hash?: Uint8Array;
|
|
83
|
-
size: bigint;
|
|
84
|
-
key: string;
|
|
85
|
-
version: FileEncryptionVersion;
|
|
86
|
-
}
|
|
135
|
+
export type DirEnum = Dir | Root;
|
|
87
136
|
|
|
88
|
-
export
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
authVersion: number;
|
|
95
|
-
maxParallelRequests?: number | undefined;
|
|
96
|
-
maxIoMemoryUsage?: number | undefined;
|
|
137
|
+
export type AnyDirEnum = Dir | RootWithMeta | Root;
|
|
138
|
+
|
|
139
|
+
export interface RootWithMeta {
|
|
140
|
+
uuid: UuidStr;
|
|
141
|
+
color?: string;
|
|
142
|
+
meta?: DecryptedDirMeta;
|
|
97
143
|
}
|
|
98
144
|
|
|
99
145
|
export interface DirSizeResponse {
|
|
@@ -104,50 +150,124 @@ export interface DirSizeResponse {
|
|
|
104
150
|
|
|
105
151
|
export type NonRootObject = ({ type: "dir" } & Dir) | ({ type: "file" } & File);
|
|
106
152
|
|
|
153
|
+
export interface User {
|
|
154
|
+
email: string;
|
|
155
|
+
publicKey: Uint8Array;
|
|
156
|
+
id: bigint;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface DirPublicLink {
|
|
160
|
+
linkUuid: UuidStr;
|
|
161
|
+
linkKey?: MetaKey;
|
|
162
|
+
password?: string | Uint8Array;
|
|
163
|
+
expiration: PublicLinkExpiration;
|
|
164
|
+
enableDownload: boolean;
|
|
165
|
+
salt?: Uint8Array;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface FilePublicLink {
|
|
169
|
+
linkUuid: UuidStr;
|
|
170
|
+
password?: string | Uint8Array;
|
|
171
|
+
expiration: PublicLinkExpiration;
|
|
172
|
+
downloadable: boolean;
|
|
173
|
+
salt: Uint8Array;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface ContactRequestOut {
|
|
177
|
+
uuid: UuidStr;
|
|
178
|
+
email: string;
|
|
179
|
+
avatar?: string;
|
|
180
|
+
nickName: string;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface ContactRequestIn {
|
|
184
|
+
uuid: UuidStr;
|
|
185
|
+
userId: bigint;
|
|
186
|
+
email: string;
|
|
187
|
+
avatar?: string;
|
|
188
|
+
nickName: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface Contact {
|
|
192
|
+
uuid: UuidStr;
|
|
193
|
+
userId: bigint;
|
|
194
|
+
email: string;
|
|
195
|
+
avatar?: string;
|
|
196
|
+
nickName: string;
|
|
197
|
+
lastActive: DateTime<Utc>;
|
|
198
|
+
timestamp: DateTime<Utc>;
|
|
199
|
+
}
|
|
200
|
+
|
|
107
201
|
export type ParentUuid = UuidStr | "trash" | "recents" | "favorites" | "links";
|
|
108
202
|
|
|
109
|
-
export type
|
|
203
|
+
export type PublicLinkExpiration = "never" | "1h" | "6h" | "1d" | "3d" | "7d" | "14d" | "30d";
|
|
110
204
|
|
|
111
205
|
export type UuidStr = string;
|
|
112
206
|
|
|
207
|
+
export type FileEncryptionVersion = 1 | 2 | 3;
|
|
208
|
+
|
|
113
209
|
export class Client {
|
|
114
210
|
private constructor();
|
|
115
211
|
free(): void;
|
|
116
|
-
|
|
117
|
-
toStringified(): StringifiedClient;
|
|
118
|
-
deleteFilePermanently(file: File): Promise<void>;
|
|
212
|
+
makeThumbnailInMemory(params: MakeThumbnailInMemoryParams): Promise<MakeThumbnailInMemoryResult | undefined>;
|
|
119
213
|
uploadFileFromReader(params: UploadFileStreamParams): Promise<File>;
|
|
120
|
-
downloadFile(file: File): Promise<Uint8Array>;
|
|
121
214
|
trashFile(file: File): Promise<File>;
|
|
215
|
+
deleteFilePermanently(file: File): Promise<void>;
|
|
122
216
|
downloadFileToWriter(params: DownloadFileStreamParams): Promise<void>;
|
|
123
217
|
uploadFile(data: Uint8Array, params: UploadFileParams): Promise<File>;
|
|
124
|
-
|
|
218
|
+
downloadFile(file: FileEnum): Promise<Uint8Array>;
|
|
219
|
+
toStringified(): StringifiedClient;
|
|
220
|
+
listFavorites(): Promise<[Dir[], File[]]>;
|
|
125
221
|
root(): Root;
|
|
126
|
-
createDir(parent: DirEnum, name: string): Promise<Dir>;
|
|
127
|
-
deleteDirPermanently(dir: Dir): Promise<void>;
|
|
128
|
-
dirExists(parent: DirEnum, name: string): Promise<void>;
|
|
129
222
|
trashDir(dir: Dir): Promise<Dir>;
|
|
130
|
-
|
|
131
|
-
findItemInDir(dir: DirEnum, nameOrUuid: string): Promise<NonRootObject | undefined>;
|
|
223
|
+
findItemInDir(dir: AnyDirEnum, nameOrUuid: string): Promise<NonRootObject | undefined>;
|
|
132
224
|
listDir(dir: DirEnum): Promise<[Dir[], File[]]>;
|
|
133
|
-
|
|
225
|
+
deleteDirPermanently(dir: Dir): Promise<void>;
|
|
226
|
+
listRecents(): Promise<[Dir[], File[]]>;
|
|
227
|
+
dirExists(parent: AnyDirEnum, name: string): Promise<void>;
|
|
228
|
+
getDirSize(dir: Dir): Promise<DirSizeResponse>;
|
|
134
229
|
listDirRecursive(dir: DirEnum): Promise<[Dir[], File[]]>;
|
|
230
|
+
createDir(parent: DirEnum, name: string): Promise<Dir>;
|
|
231
|
+
downloadItemsToZip(params: DownloadFileToZipParams): Promise<void>;
|
|
232
|
+
acceptContactRequest(contact_uuid: string): Promise<string>;
|
|
233
|
+
removeDirLink(link: DirPublicLink): Promise<void>;
|
|
234
|
+
deleteContact(contact_uuid: string): Promise<void>;
|
|
235
|
+
getContacts(): Promise<Contact[]>;
|
|
236
|
+
removeSharedLinkIn(link_uuid: string): Promise<void>;
|
|
237
|
+
listInShared(dir?: DirWithMetaEnum | null): Promise<[SharedDirectory[], SharedFile[]]>;
|
|
238
|
+
makeUserFromContact(contact: Contact): Promise<User>;
|
|
239
|
+
listIncomingContactRequests(): Promise<ContactRequestIn[]>;
|
|
240
|
+
listLinkedDir(dir: DirWithMetaEnum, link: DirPublicLink): Promise<[Dir[], File[]]>;
|
|
241
|
+
getFileLinkStatus(file: File): Promise<FilePublicLink | undefined>;
|
|
242
|
+
sendContactRequest(email: string): Promise<string>;
|
|
243
|
+
updateDirLink(dir: Dir, link: DirPublicLink): Promise<void>;
|
|
244
|
+
getDirLinkStatus(dir: Dir): Promise<DirPublicLink | undefined>;
|
|
245
|
+
publicLinkFile(file: File): Promise<FilePublicLink>;
|
|
246
|
+
publicLinkDir(dir: Dir): Promise<DirPublicLink>;
|
|
247
|
+
removeSharedLinkOut(link_uuid: string, receiver_id: bigint): Promise<void>;
|
|
248
|
+
listOutShared(dir?: DirWithMetaEnum | null, user?: User | null): Promise<[SharedDirectory[], SharedFile[]]>;
|
|
249
|
+
shareDir(dir: Dir, user: User): Promise<void>;
|
|
250
|
+
cancelContactRequest(contact_uuid: string): Promise<void>;
|
|
251
|
+
denyContactRequest(contact_uuid: string): Promise<void>;
|
|
252
|
+
listOutgoingContactRequests(): Promise<ContactRequestOut[]>;
|
|
253
|
+
updateFileLink(file: File, link: FilePublicLink): Promise<void>;
|
|
254
|
+
shareFile(file: File, user: User): Promise<void>;
|
|
135
255
|
}
|
|
136
256
|
export class IntoUnderlyingByteSource {
|
|
137
257
|
private constructor();
|
|
138
258
|
free(): void;
|
|
139
|
-
start(controller: ReadableByteStreamController): void;
|
|
140
|
-
pull(controller: ReadableByteStreamController): Promise<any>;
|
|
141
259
|
cancel(): void;
|
|
142
|
-
|
|
260
|
+
pull(controller: ReadableByteStreamController): Promise<any>;
|
|
261
|
+
start(controller: ReadableByteStreamController): void;
|
|
143
262
|
readonly autoAllocateChunkSize: number;
|
|
263
|
+
readonly type: ReadableStreamType;
|
|
144
264
|
}
|
|
145
265
|
export class IntoUnderlyingSink {
|
|
146
266
|
private constructor();
|
|
147
267
|
free(): void;
|
|
148
268
|
write(chunk: any): Promise<any>;
|
|
149
|
-
abort(reason: any): Promise<any>;
|
|
150
269
|
close(): Promise<any>;
|
|
270
|
+
abort(reason: any): Promise<any>;
|
|
151
271
|
}
|
|
152
272
|
export class IntoUnderlyingSource {
|
|
153
273
|
private constructor();
|
|
@@ -160,42 +280,66 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
160
280
|
|
|
161
281
|
export interface InitOutput {
|
|
162
282
|
readonly memory: WebAssembly.Memory;
|
|
163
|
-
readonly
|
|
164
|
-
readonly
|
|
165
|
-
readonly main_js: () => void;
|
|
166
|
-
readonly client_downloadItemsToZip: (a: number, b: any) => any;
|
|
167
|
-
readonly __wbg_client_free: (a: number, b: number) => void;
|
|
168
|
-
readonly client_toStringified: (a: number) => any;
|
|
169
|
-
readonly client_downloadFile: (a: number, b: any) => any;
|
|
283
|
+
readonly client_makeThumbnailInMemory: (a: number, b: any) => any;
|
|
284
|
+
readonly client_trashFile: (a: number, b: any) => any;
|
|
170
285
|
readonly client_uploadFileFromReader: (a: number, b: any) => any;
|
|
286
|
+
readonly client_downloadFile: (a: number, b: any) => any;
|
|
171
287
|
readonly client_downloadFileToWriter: (a: number, b: any) => any;
|
|
172
|
-
readonly client_uploadFile: (a: number, b: number, c: number, d: any) => any;
|
|
173
288
|
readonly client_deleteFilePermanently: (a: number, b: any) => any;
|
|
174
|
-
readonly
|
|
175
|
-
readonly
|
|
176
|
-
readonly
|
|
177
|
-
readonly client_deleteDirPermanently: (a: number, b: any) => any;
|
|
178
|
-
readonly client_trashDir: (a: number, b: any) => any;
|
|
179
|
-
readonly client_dirExists: (a: number, b: any, c: number, d: number) => any;
|
|
180
|
-
readonly client_root: (a: number) => any;
|
|
289
|
+
readonly client_uploadFile: (a: number, b: number, c: number, d: any) => any;
|
|
290
|
+
readonly client_toStringified: (a: number) => any;
|
|
291
|
+
readonly __wbg_client_free: (a: number, b: number) => void;
|
|
181
292
|
readonly client_createDir: (a: number, b: any, c: number, d: number) => any;
|
|
182
293
|
readonly client_listFavorites: (a: number) => any;
|
|
294
|
+
readonly client_dirExists: (a: number, b: any, c: number, d: number) => any;
|
|
295
|
+
readonly client_getDirSize: (a: number, b: any) => any;
|
|
183
296
|
readonly client_listRecents: (a: number) => any;
|
|
297
|
+
readonly client_trashDir: (a: number, b: any) => any;
|
|
184
298
|
readonly client_listDirRecursive: (a: number, b: any) => any;
|
|
185
|
-
readonly
|
|
186
|
-
readonly
|
|
187
|
-
readonly
|
|
188
|
-
readonly
|
|
189
|
-
readonly
|
|
190
|
-
readonly
|
|
191
|
-
readonly
|
|
192
|
-
readonly
|
|
299
|
+
readonly client_listDir: (a: number, b: any) => any;
|
|
300
|
+
readonly client_deleteDirPermanently: (a: number, b: any) => any;
|
|
301
|
+
readonly client_root: (a: number) => any;
|
|
302
|
+
readonly client_findItemInDir: (a: number, b: any, c: number, d: number) => any;
|
|
303
|
+
readonly client_downloadItemsToZip: (a: number, b: any) => any;
|
|
304
|
+
readonly main_js: () => void;
|
|
305
|
+
readonly fromStringified: (a: any) => [number, number, number];
|
|
306
|
+
readonly login: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
307
|
+
readonly client_removeSharedLinkIn: (a: number, b: number, c: number) => any;
|
|
308
|
+
readonly client_getDirLinkStatus: (a: number, b: any) => any;
|
|
309
|
+
readonly client_publicLinkDir: (a: number, b: any) => any;
|
|
310
|
+
readonly client_getFileLinkStatus: (a: number, b: any) => any;
|
|
311
|
+
readonly client_cancelContactRequest: (a: number, b: number, c: number) => any;
|
|
312
|
+
readonly client_updateFileLink: (a: number, b: any, c: any) => any;
|
|
313
|
+
readonly client_removeDirLink: (a: number, b: any) => any;
|
|
314
|
+
readonly client_removeSharedLinkOut: (a: number, b: number, c: number, d: bigint) => any;
|
|
315
|
+
readonly client_denyContactRequest: (a: number, b: number, c: number) => any;
|
|
316
|
+
readonly client_publicLinkFile: (a: number, b: any) => any;
|
|
317
|
+
readonly client_shareDir: (a: number, b: any, c: any) => any;
|
|
318
|
+
readonly client_listIncomingContactRequests: (a: number) => any;
|
|
319
|
+
readonly client_listOutgoingContactRequests: (a: number) => any;
|
|
320
|
+
readonly client_listOutShared: (a: number, b: number, c: number) => any;
|
|
321
|
+
readonly client_makeUserFromContact: (a: number, b: any) => any;
|
|
322
|
+
readonly client_deleteContact: (a: number, b: number, c: number) => any;
|
|
323
|
+
readonly client_listLinkedDir: (a: number, b: any, c: any) => any;
|
|
324
|
+
readonly client_acceptContactRequest: (a: number, b: number, c: number) => any;
|
|
325
|
+
readonly client_sendContactRequest: (a: number, b: number, c: number) => any;
|
|
326
|
+
readonly client_listInShared: (a: number, b: number) => any;
|
|
327
|
+
readonly client_getContacts: (a: number) => any;
|
|
328
|
+
readonly client_updateDirLink: (a: number, b: any, c: any) => any;
|
|
329
|
+
readonly client_shareFile: (a: number, b: any, c: any) => any;
|
|
330
|
+
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
331
|
+
readonly intounderlyingbytesource_type: (a: number) => number;
|
|
193
332
|
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
194
333
|
readonly intounderlyingbytesource_pull: (a: number, b: any) => any;
|
|
195
|
-
readonly intounderlyingbytesource_type: (a: number) => number;
|
|
196
|
-
readonly intounderlyingbytesource_start: (a: number, b: any) => void;
|
|
197
|
-
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
198
334
|
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
335
|
+
readonly intounderlyingbytesource_start: (a: number, b: any) => void;
|
|
336
|
+
readonly intounderlyingsink_abort: (a: number, b: any) => any;
|
|
337
|
+
readonly intounderlyingsink_close: (a: number) => any;
|
|
338
|
+
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
339
|
+
readonly intounderlyingsink_write: (a: number, b: any) => any;
|
|
340
|
+
readonly intounderlyingsource_pull: (a: number, b: any) => any;
|
|
341
|
+
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
342
|
+
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
199
343
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
200
344
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
201
345
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
@@ -204,10 +348,10 @@ export interface InitOutput {
|
|
|
204
348
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
205
349
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
206
350
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
207
|
-
readonly
|
|
208
|
-
readonly
|
|
209
|
-
readonly
|
|
210
|
-
readonly
|
|
351
|
+
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hc5d531eab69f2018: (a: number, b: number) => void;
|
|
352
|
+
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7a4fb4e79b1372c1: (a: number, b: number) => void;
|
|
353
|
+
readonly closure1463_externref_shim: (a: number, b: number, c: any) => void;
|
|
354
|
+
readonly closure1626_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
211
355
|
readonly __wbindgen_start: () => void;
|
|
212
356
|
}
|
|
213
357
|
|
package/browser/sdk-rs.js
CHANGED
|
@@ -203,6 +203,13 @@ function debugString(val) {
|
|
|
203
203
|
return className;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
207
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
208
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
209
|
+
WASM_VECTOR_LEN = arg.length;
|
|
210
|
+
return ptr;
|
|
211
|
+
}
|
|
212
|
+
|
|
206
213
|
function takeFromExternrefTable0(idx) {
|
|
207
214
|
const value = wasm.__wbindgen_export_4.get(idx);
|
|
208
215
|
wasm.__externref_table_dealloc(idx);
|
|
@@ -241,26 +248,20 @@ export function login(email, password, twoFactorCode) {
|
|
|
241
248
|
return ret;
|
|
242
249
|
}
|
|
243
250
|
|
|
244
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
245
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
246
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
247
|
-
WASM_VECTOR_LEN = arg.length;
|
|
248
|
-
return ptr;
|
|
249
|
-
}
|
|
250
251
|
function __wbg_adapter_60(arg0, arg1) {
|
|
251
|
-
wasm.
|
|
252
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hc5d531eab69f2018(arg0, arg1);
|
|
252
253
|
}
|
|
253
254
|
|
|
254
255
|
function __wbg_adapter_63(arg0, arg1) {
|
|
255
|
-
wasm.
|
|
256
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7a4fb4e79b1372c1(arg0, arg1);
|
|
256
257
|
}
|
|
257
258
|
|
|
258
259
|
function __wbg_adapter_66(arg0, arg1, arg2) {
|
|
259
|
-
wasm.
|
|
260
|
+
wasm.closure1463_externref_shim(arg0, arg1, arg2);
|
|
260
261
|
}
|
|
261
262
|
|
|
262
|
-
function
|
|
263
|
-
wasm.
|
|
263
|
+
function __wbg_adapter_279(arg0, arg1, arg2, arg3) {
|
|
264
|
+
wasm.closure1626_externref_shim(arg0, arg1, arg2, arg3);
|
|
264
265
|
}
|
|
265
266
|
|
|
266
267
|
const __wbindgen_enum_ReadableStreamReaderMode = ["byob"];
|
|
@@ -297,26 +298,11 @@ export class Client {
|
|
|
297
298
|
wasm.__wbg_client_free(ptr, 0);
|
|
298
299
|
}
|
|
299
300
|
/**
|
|
300
|
-
* @param {
|
|
301
|
-
* @returns {Promise<
|
|
301
|
+
* @param {MakeThumbnailInMemoryParams} params
|
|
302
|
+
* @returns {Promise<MakeThumbnailInMemoryResult | undefined>}
|
|
302
303
|
*/
|
|
303
|
-
|
|
304
|
-
const ret = wasm.
|
|
305
|
-
return ret;
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* @returns {StringifiedClient}
|
|
309
|
-
*/
|
|
310
|
-
toStringified() {
|
|
311
|
-
const ret = wasm.client_toStringified(this.__wbg_ptr);
|
|
312
|
-
return ret;
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* @param {File} file
|
|
316
|
-
* @returns {Promise<void>}
|
|
317
|
-
*/
|
|
318
|
-
deleteFilePermanently(file) {
|
|
319
|
-
const ret = wasm.client_deleteFilePermanently(this.__wbg_ptr, file);
|
|
304
|
+
makeThumbnailInMemory(params) {
|
|
305
|
+
const ret = wasm.client_makeThumbnailInMemory(this.__wbg_ptr, params);
|
|
320
306
|
return ret;
|
|
321
307
|
}
|
|
322
308
|
/**
|
|
@@ -329,18 +315,18 @@ export class Client {
|
|
|
329
315
|
}
|
|
330
316
|
/**
|
|
331
317
|
* @param {File} file
|
|
332
|
-
* @returns {Promise<
|
|
318
|
+
* @returns {Promise<File>}
|
|
333
319
|
*/
|
|
334
|
-
|
|
335
|
-
const ret = wasm.
|
|
320
|
+
trashFile(file) {
|
|
321
|
+
const ret = wasm.client_trashFile(this.__wbg_ptr, file);
|
|
336
322
|
return ret;
|
|
337
323
|
}
|
|
338
324
|
/**
|
|
339
325
|
* @param {File} file
|
|
340
|
-
* @returns {Promise<
|
|
326
|
+
* @returns {Promise<void>}
|
|
341
327
|
*/
|
|
342
|
-
|
|
343
|
-
const ret = wasm.
|
|
328
|
+
deleteFilePermanently(file) {
|
|
329
|
+
const ret = wasm.client_deleteFilePermanently(this.__wbg_ptr, file);
|
|
344
330
|
return ret;
|
|
345
331
|
}
|
|
346
332
|
/**
|
|
@@ -363,11 +349,25 @@ export class Client {
|
|
|
363
349
|
return ret;
|
|
364
350
|
}
|
|
365
351
|
/**
|
|
366
|
-
* @param {
|
|
367
|
-
* @returns {Promise<
|
|
352
|
+
* @param {FileEnum} file
|
|
353
|
+
* @returns {Promise<Uint8Array>}
|
|
368
354
|
*/
|
|
369
|
-
|
|
370
|
-
const ret = wasm.
|
|
355
|
+
downloadFile(file) {
|
|
356
|
+
const ret = wasm.client_downloadFile(this.__wbg_ptr, file);
|
|
357
|
+
return ret;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* @returns {StringifiedClient}
|
|
361
|
+
*/
|
|
362
|
+
toStringified() {
|
|
363
|
+
const ret = wasm.client_toStringified(this.__wbg_ptr);
|
|
364
|
+
return ret;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* @returns {[Dir[], File[]]}
|
|
368
|
+
*/
|
|
369
|
+
listFavorites() {
|
|
370
|
+
const ret = wasm.client_listFavorites(this.__wbg_ptr);
|
|
371
371
|
return ret;
|
|
372
372
|
}
|
|
373
373
|
/**
|
|
@@ -378,14 +378,30 @@ export class Client {
|
|
|
378
378
|
return ret;
|
|
379
379
|
}
|
|
380
380
|
/**
|
|
381
|
-
* @param {
|
|
382
|
-
* @param {string} name
|
|
381
|
+
* @param {Dir} dir
|
|
383
382
|
* @returns {Promise<Dir>}
|
|
384
383
|
*/
|
|
385
|
-
|
|
386
|
-
const
|
|
384
|
+
trashDir(dir) {
|
|
385
|
+
const ret = wasm.client_trashDir(this.__wbg_ptr, dir);
|
|
386
|
+
return ret;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* @param {AnyDirEnum} dir
|
|
390
|
+
* @param {string} nameOrUuid
|
|
391
|
+
* @returns {Promise<NonRootObject | undefined>}
|
|
392
|
+
*/
|
|
393
|
+
findItemInDir(dir, nameOrUuid) {
|
|
394
|
+
const ptr0 = passStringToWasm0(nameOrUuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
387
395
|
const len0 = WASM_VECTOR_LEN;
|
|
388
|
-
const ret = wasm.
|
|
396
|
+
const ret = wasm.client_findItemInDir(this.__wbg_ptr, dir, ptr0, len0);
|
|
397
|
+
return ret;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* @param {DirEnum} dir
|
|
401
|
+
* @returns {[Dir[], File[]]}
|
|
402
|
+
*/
|
|
403
|
+
listDir(dir) {
|
|
404
|
+
const ret = wasm.client_listDir(this.__wbg_ptr, dir);
|
|
389
405
|
return ret;
|
|
390
406
|
}
|
|
391
407
|
/**
|
|
@@ -397,7 +413,14 @@ export class Client {
|
|
|
397
413
|
return ret;
|
|
398
414
|
}
|
|
399
415
|
/**
|
|
400
|
-
* @
|
|
416
|
+
* @returns {[Dir[], File[]]}
|
|
417
|
+
*/
|
|
418
|
+
listRecents() {
|
|
419
|
+
const ret = wasm.client_listRecents(this.__wbg_ptr);
|
|
420
|
+
return ret;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* @param {AnyDirEnum} parent
|
|
401
424
|
* @param {string} name
|
|
402
425
|
* @returns {Promise<void>}
|
|
403
426
|
*/
|
|
@@ -409,51 +432,239 @@ export class Client {
|
|
|
409
432
|
}
|
|
410
433
|
/**
|
|
411
434
|
* @param {Dir} dir
|
|
412
|
-
* @returns {Promise<
|
|
435
|
+
* @returns {Promise<DirSizeResponse>}
|
|
413
436
|
*/
|
|
414
|
-
|
|
415
|
-
const ret = wasm.
|
|
437
|
+
getDirSize(dir) {
|
|
438
|
+
const ret = wasm.client_getDirSize(this.__wbg_ptr, dir);
|
|
416
439
|
return ret;
|
|
417
440
|
}
|
|
418
441
|
/**
|
|
442
|
+
* @param {DirEnum} dir
|
|
419
443
|
* @returns {[Dir[], File[]]}
|
|
420
444
|
*/
|
|
421
|
-
|
|
422
|
-
const ret = wasm.
|
|
445
|
+
listDirRecursive(dir) {
|
|
446
|
+
const ret = wasm.client_listDirRecursive(this.__wbg_ptr, dir);
|
|
423
447
|
return ret;
|
|
424
448
|
}
|
|
425
449
|
/**
|
|
426
|
-
* @param {DirEnum}
|
|
427
|
-
* @param {string}
|
|
428
|
-
* @returns {Promise<
|
|
450
|
+
* @param {DirEnum} parent
|
|
451
|
+
* @param {string} name
|
|
452
|
+
* @returns {Promise<Dir>}
|
|
429
453
|
*/
|
|
430
|
-
|
|
431
|
-
const ptr0 = passStringToWasm0(
|
|
454
|
+
createDir(parent, name) {
|
|
455
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
432
456
|
const len0 = WASM_VECTOR_LEN;
|
|
433
|
-
const ret = wasm.
|
|
457
|
+
const ret = wasm.client_createDir(this.__wbg_ptr, parent, ptr0, len0);
|
|
434
458
|
return ret;
|
|
435
459
|
}
|
|
436
460
|
/**
|
|
437
|
-
* @param {
|
|
438
|
-
* @returns {
|
|
461
|
+
* @param {DownloadFileToZipParams} params
|
|
462
|
+
* @returns {Promise<void>}
|
|
439
463
|
*/
|
|
440
|
-
|
|
441
|
-
const ret = wasm.
|
|
464
|
+
downloadItemsToZip(params) {
|
|
465
|
+
const ret = wasm.client_downloadItemsToZip(this.__wbg_ptr, params);
|
|
442
466
|
return ret;
|
|
443
467
|
}
|
|
444
468
|
/**
|
|
445
|
-
* @
|
|
469
|
+
* @param {string} contact_uuid
|
|
470
|
+
* @returns {Promise<string>}
|
|
446
471
|
*/
|
|
447
|
-
|
|
448
|
-
const
|
|
472
|
+
acceptContactRequest(contact_uuid) {
|
|
473
|
+
const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
474
|
+
const len0 = WASM_VECTOR_LEN;
|
|
475
|
+
const ret = wasm.client_acceptContactRequest(this.__wbg_ptr, ptr0, len0);
|
|
449
476
|
return ret;
|
|
450
477
|
}
|
|
451
478
|
/**
|
|
452
|
-
* @param {
|
|
479
|
+
* @param {DirPublicLink} link
|
|
480
|
+
* @returns {Promise<void>}
|
|
481
|
+
*/
|
|
482
|
+
removeDirLink(link) {
|
|
483
|
+
const ret = wasm.client_removeDirLink(this.__wbg_ptr, link);
|
|
484
|
+
return ret;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* @param {string} contact_uuid
|
|
488
|
+
* @returns {Promise<void>}
|
|
489
|
+
*/
|
|
490
|
+
deleteContact(contact_uuid) {
|
|
491
|
+
const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
492
|
+
const len0 = WASM_VECTOR_LEN;
|
|
493
|
+
const ret = wasm.client_deleteContact(this.__wbg_ptr, ptr0, len0);
|
|
494
|
+
return ret;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* @returns {Contact[]}
|
|
498
|
+
*/
|
|
499
|
+
getContacts() {
|
|
500
|
+
const ret = wasm.client_getContacts(this.__wbg_ptr);
|
|
501
|
+
return ret;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* @param {string} link_uuid
|
|
505
|
+
* @returns {Promise<void>}
|
|
506
|
+
*/
|
|
507
|
+
removeSharedLinkIn(link_uuid) {
|
|
508
|
+
const ptr0 = passStringToWasm0(link_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
509
|
+
const len0 = WASM_VECTOR_LEN;
|
|
510
|
+
const ret = wasm.client_removeSharedLinkIn(this.__wbg_ptr, ptr0, len0);
|
|
511
|
+
return ret;
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* @param {DirWithMetaEnum | null} [dir]
|
|
515
|
+
* @returns {[SharedDirectory[], SharedFile[]]}
|
|
516
|
+
*/
|
|
517
|
+
listInShared(dir) {
|
|
518
|
+
const ret = wasm.client_listInShared(this.__wbg_ptr, isLikeNone(dir) ? 0 : addToExternrefTable0(dir));
|
|
519
|
+
return ret;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* @param {Contact} contact
|
|
523
|
+
* @returns {Promise<User>}
|
|
524
|
+
*/
|
|
525
|
+
makeUserFromContact(contact) {
|
|
526
|
+
const ret = wasm.client_makeUserFromContact(this.__wbg_ptr, contact);
|
|
527
|
+
return ret;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* @returns {ContactRequestIn[]}
|
|
531
|
+
*/
|
|
532
|
+
listIncomingContactRequests() {
|
|
533
|
+
const ret = wasm.client_listIncomingContactRequests(this.__wbg_ptr);
|
|
534
|
+
return ret;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* @param {DirWithMetaEnum} dir
|
|
538
|
+
* @param {DirPublicLink} link
|
|
453
539
|
* @returns {[Dir[], File[]]}
|
|
454
540
|
*/
|
|
455
|
-
|
|
456
|
-
const ret = wasm.
|
|
541
|
+
listLinkedDir(dir, link) {
|
|
542
|
+
const ret = wasm.client_listLinkedDir(this.__wbg_ptr, dir, link);
|
|
543
|
+
return ret;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* @param {File} file
|
|
547
|
+
* @returns {Promise<FilePublicLink | undefined>}
|
|
548
|
+
*/
|
|
549
|
+
getFileLinkStatus(file) {
|
|
550
|
+
const ret = wasm.client_getFileLinkStatus(this.__wbg_ptr, file);
|
|
551
|
+
return ret;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* @param {string} email
|
|
555
|
+
* @returns {Promise<string>}
|
|
556
|
+
*/
|
|
557
|
+
sendContactRequest(email) {
|
|
558
|
+
const ptr0 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
559
|
+
const len0 = WASM_VECTOR_LEN;
|
|
560
|
+
const ret = wasm.client_sendContactRequest(this.__wbg_ptr, ptr0, len0);
|
|
561
|
+
return ret;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* @param {Dir} dir
|
|
565
|
+
* @param {DirPublicLink} link
|
|
566
|
+
* @returns {Promise<void>}
|
|
567
|
+
*/
|
|
568
|
+
updateDirLink(dir, link) {
|
|
569
|
+
const ret = wasm.client_updateDirLink(this.__wbg_ptr, dir, link);
|
|
570
|
+
return ret;
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* @param {Dir} dir
|
|
574
|
+
* @returns {Promise<DirPublicLink | undefined>}
|
|
575
|
+
*/
|
|
576
|
+
getDirLinkStatus(dir) {
|
|
577
|
+
const ret = wasm.client_getDirLinkStatus(this.__wbg_ptr, dir);
|
|
578
|
+
return ret;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* @param {File} file
|
|
582
|
+
* @returns {Promise<FilePublicLink>}
|
|
583
|
+
*/
|
|
584
|
+
publicLinkFile(file) {
|
|
585
|
+
const ret = wasm.client_publicLinkFile(this.__wbg_ptr, file);
|
|
586
|
+
return ret;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* @param {Dir} dir
|
|
590
|
+
* @returns {Promise<DirPublicLink>}
|
|
591
|
+
*/
|
|
592
|
+
publicLinkDir(dir) {
|
|
593
|
+
const ret = wasm.client_publicLinkDir(this.__wbg_ptr, dir);
|
|
594
|
+
return ret;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* @param {string} link_uuid
|
|
598
|
+
* @param {bigint} receiver_id
|
|
599
|
+
* @returns {Promise<void>}
|
|
600
|
+
*/
|
|
601
|
+
removeSharedLinkOut(link_uuid, receiver_id) {
|
|
602
|
+
const ptr0 = passStringToWasm0(link_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
603
|
+
const len0 = WASM_VECTOR_LEN;
|
|
604
|
+
const ret = wasm.client_removeSharedLinkOut(this.__wbg_ptr, ptr0, len0, receiver_id);
|
|
605
|
+
return ret;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* @param {DirWithMetaEnum | null} [dir]
|
|
609
|
+
* @param {User | null} [user]
|
|
610
|
+
* @returns {[SharedDirectory[], SharedFile[]]}
|
|
611
|
+
*/
|
|
612
|
+
listOutShared(dir, user) {
|
|
613
|
+
const ret = wasm.client_listOutShared(this.__wbg_ptr, isLikeNone(dir) ? 0 : addToExternrefTable0(dir), isLikeNone(user) ? 0 : addToExternrefTable0(user));
|
|
614
|
+
return ret;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* @param {Dir} dir
|
|
618
|
+
* @param {User} user
|
|
619
|
+
* @returns {Promise<void>}
|
|
620
|
+
*/
|
|
621
|
+
shareDir(dir, user) {
|
|
622
|
+
const ret = wasm.client_shareDir(this.__wbg_ptr, dir, user);
|
|
623
|
+
return ret;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* @param {string} contact_uuid
|
|
627
|
+
* @returns {Promise<void>}
|
|
628
|
+
*/
|
|
629
|
+
cancelContactRequest(contact_uuid) {
|
|
630
|
+
const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
631
|
+
const len0 = WASM_VECTOR_LEN;
|
|
632
|
+
const ret = wasm.client_cancelContactRequest(this.__wbg_ptr, ptr0, len0);
|
|
633
|
+
return ret;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* @param {string} contact_uuid
|
|
637
|
+
* @returns {Promise<void>}
|
|
638
|
+
*/
|
|
639
|
+
denyContactRequest(contact_uuid) {
|
|
640
|
+
const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
641
|
+
const len0 = WASM_VECTOR_LEN;
|
|
642
|
+
const ret = wasm.client_denyContactRequest(this.__wbg_ptr, ptr0, len0);
|
|
643
|
+
return ret;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* @returns {ContactRequestOut[]}
|
|
647
|
+
*/
|
|
648
|
+
listOutgoingContactRequests() {
|
|
649
|
+
const ret = wasm.client_listOutgoingContactRequests(this.__wbg_ptr);
|
|
650
|
+
return ret;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* @param {File} file
|
|
654
|
+
* @param {FilePublicLink} link
|
|
655
|
+
* @returns {Promise<void>}
|
|
656
|
+
*/
|
|
657
|
+
updateFileLink(file, link) {
|
|
658
|
+
const ret = wasm.client_updateFileLink(this.__wbg_ptr, file, link);
|
|
659
|
+
return ret;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* @param {File} file
|
|
663
|
+
* @param {User} user
|
|
664
|
+
* @returns {Promise<void>}
|
|
665
|
+
*/
|
|
666
|
+
shareFile(file, user) {
|
|
667
|
+
const ret = wasm.client_shareFile(this.__wbg_ptr, file, user);
|
|
457
668
|
return ret;
|
|
458
669
|
}
|
|
459
670
|
}
|
|
@@ -475,13 +686,6 @@ export class IntoUnderlyingByteSource {
|
|
|
475
686
|
const ptr = this.__destroy_into_raw();
|
|
476
687
|
wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
|
|
477
688
|
}
|
|
478
|
-
/**
|
|
479
|
-
* @returns {ReadableStreamType}
|
|
480
|
-
*/
|
|
481
|
-
get type() {
|
|
482
|
-
const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
|
|
483
|
-
return __wbindgen_enum_ReadableStreamType[ret];
|
|
484
|
-
}
|
|
485
689
|
/**
|
|
486
690
|
* @returns {number}
|
|
487
691
|
*/
|
|
@@ -489,11 +693,9 @@ export class IntoUnderlyingByteSource {
|
|
|
489
693
|
const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
|
|
490
694
|
return ret >>> 0;
|
|
491
695
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
start(controller) {
|
|
496
|
-
wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
|
|
696
|
+
cancel() {
|
|
697
|
+
const ptr = this.__destroy_into_raw();
|
|
698
|
+
wasm.intounderlyingbytesource_cancel(ptr);
|
|
497
699
|
}
|
|
498
700
|
/**
|
|
499
701
|
* @param {ReadableByteStreamController} controller
|
|
@@ -503,9 +705,18 @@ export class IntoUnderlyingByteSource {
|
|
|
503
705
|
const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
|
|
504
706
|
return ret;
|
|
505
707
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
708
|
+
/**
|
|
709
|
+
* @returns {ReadableStreamType}
|
|
710
|
+
*/
|
|
711
|
+
get type() {
|
|
712
|
+
const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
|
|
713
|
+
return __wbindgen_enum_ReadableStreamType[ret];
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* @param {ReadableByteStreamController} controller
|
|
717
|
+
*/
|
|
718
|
+
start(controller) {
|
|
719
|
+
wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
|
|
509
720
|
}
|
|
510
721
|
}
|
|
511
722
|
|
|
@@ -535,20 +746,20 @@ export class IntoUnderlyingSink {
|
|
|
535
746
|
return ret;
|
|
536
747
|
}
|
|
537
748
|
/**
|
|
538
|
-
* @param {any} reason
|
|
539
749
|
* @returns {Promise<any>}
|
|
540
750
|
*/
|
|
541
|
-
|
|
751
|
+
close() {
|
|
542
752
|
const ptr = this.__destroy_into_raw();
|
|
543
|
-
const ret = wasm.
|
|
753
|
+
const ret = wasm.intounderlyingsink_close(ptr);
|
|
544
754
|
return ret;
|
|
545
755
|
}
|
|
546
756
|
/**
|
|
757
|
+
* @param {any} reason
|
|
547
758
|
* @returns {Promise<any>}
|
|
548
759
|
*/
|
|
549
|
-
|
|
760
|
+
abort(reason) {
|
|
550
761
|
const ptr = this.__destroy_into_raw();
|
|
551
|
-
const ret = wasm.
|
|
762
|
+
const ret = wasm.intounderlyingsink_abort(ptr, reason);
|
|
552
763
|
return ret;
|
|
553
764
|
}
|
|
554
765
|
}
|
|
@@ -666,6 +877,10 @@ function __wbg_get_imports() {
|
|
|
666
877
|
const ret = arg0.byteOffset;
|
|
667
878
|
return ret;
|
|
668
879
|
};
|
|
880
|
+
imports.wbg.__wbg_call_183d03aa1e7c9e23 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
881
|
+
const ret = arg0.call(arg1, arg2, arg3, arg4, arg5);
|
|
882
|
+
return ret;
|
|
883
|
+
}, arguments) };
|
|
669
884
|
imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
670
885
|
const ret = arg0.call(arg1);
|
|
671
886
|
return ret;
|
|
@@ -674,10 +889,6 @@ function __wbg_get_imports() {
|
|
|
674
889
|
const ret = arg0.call(arg1, arg2);
|
|
675
890
|
return ret;
|
|
676
891
|
}, arguments) };
|
|
677
|
-
imports.wbg.__wbg_call_a7beb83688026483 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
678
|
-
const ret = arg0.call(arg1, arg2, arg3, arg4, arg5);
|
|
679
|
-
return ret;
|
|
680
|
-
}, arguments) };
|
|
681
892
|
imports.wbg.__wbg_cancel_81ebaa65c2a54d20 = function(arg0) {
|
|
682
893
|
const ret = arg0.cancel();
|
|
683
894
|
return ret;
|
|
@@ -751,6 +962,10 @@ function __wbg_get_imports() {
|
|
|
751
962
|
const ret = arg0.fetch(arg1);
|
|
752
963
|
return ret;
|
|
753
964
|
};
|
|
965
|
+
imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
|
|
966
|
+
const ret = Array.from(arg0);
|
|
967
|
+
return ret;
|
|
968
|
+
};
|
|
754
969
|
imports.wbg.__wbg_getRandomValues_3c9c0d586e575a16 = function() { return handleError(function (arg0, arg1) {
|
|
755
970
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
756
971
|
}, arguments) };
|
|
@@ -916,7 +1131,7 @@ function __wbg_get_imports() {
|
|
|
916
1131
|
const a = state0.a;
|
|
917
1132
|
state0.a = 0;
|
|
918
1133
|
try {
|
|
919
|
-
return
|
|
1134
|
+
return __wbg_adapter_279(a, state0.b, arg0, arg1);
|
|
920
1135
|
} finally {
|
|
921
1136
|
state0.a = a;
|
|
922
1137
|
}
|
|
@@ -1194,16 +1409,16 @@ function __wbg_get_imports() {
|
|
|
1194
1409
|
const ret = false;
|
|
1195
1410
|
return ret;
|
|
1196
1411
|
};
|
|
1197
|
-
imports.wbg.
|
|
1198
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1412
|
+
imports.wbg.__wbindgen_closure_wrapper2347 = function(arg0, arg1, arg2) {
|
|
1413
|
+
const ret = makeMutClosure(arg0, arg1, 895, __wbg_adapter_60);
|
|
1199
1414
|
return ret;
|
|
1200
1415
|
};
|
|
1201
|
-
imports.wbg.
|
|
1202
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1416
|
+
imports.wbg.__wbindgen_closure_wrapper3589 = function(arg0, arg1, arg2) {
|
|
1417
|
+
const ret = makeMutClosure(arg0, arg1, 1424, __wbg_adapter_63);
|
|
1203
1418
|
return ret;
|
|
1204
1419
|
};
|
|
1205
|
-
imports.wbg.
|
|
1206
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1420
|
+
imports.wbg.__wbindgen_closure_wrapper3701 = function(arg0, arg1, arg2) {
|
|
1421
|
+
const ret = makeMutClosure(arg0, arg1, 1464, __wbg_adapter_66);
|
|
1207
1422
|
return ret;
|
|
1208
1423
|
};
|
|
1209
1424
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
package/browser/sdk-rs_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,42 +1,66 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
6
|
-
export const main_js: () => void;
|
|
7
|
-
export const client_downloadItemsToZip: (a: number, b: any) => any;
|
|
8
|
-
export const __wbg_client_free: (a: number, b: number) => void;
|
|
9
|
-
export const client_toStringified: (a: number) => any;
|
|
10
|
-
export const client_downloadFile: (a: number, b: any) => any;
|
|
4
|
+
export const client_makeThumbnailInMemory: (a: number, b: any) => any;
|
|
5
|
+
export const client_trashFile: (a: number, b: any) => any;
|
|
11
6
|
export const client_uploadFileFromReader: (a: number, b: any) => any;
|
|
7
|
+
export const client_downloadFile: (a: number, b: any) => any;
|
|
12
8
|
export const client_downloadFileToWriter: (a: number, b: any) => any;
|
|
13
|
-
export const client_uploadFile: (a: number, b: number, c: number, d: any) => any;
|
|
14
9
|
export const client_deleteFilePermanently: (a: number, b: any) => any;
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const client_deleteDirPermanently: (a: number, b: any) => any;
|
|
19
|
-
export const client_trashDir: (a: number, b: any) => any;
|
|
20
|
-
export const client_dirExists: (a: number, b: any, c: number, d: number) => any;
|
|
21
|
-
export const client_root: (a: number) => any;
|
|
10
|
+
export const client_uploadFile: (a: number, b: number, c: number, d: any) => any;
|
|
11
|
+
export const client_toStringified: (a: number) => any;
|
|
12
|
+
export const __wbg_client_free: (a: number, b: number) => void;
|
|
22
13
|
export const client_createDir: (a: number, b: any, c: number, d: number) => any;
|
|
23
14
|
export const client_listFavorites: (a: number) => any;
|
|
15
|
+
export const client_dirExists: (a: number, b: any, c: number, d: number) => any;
|
|
16
|
+
export const client_getDirSize: (a: number, b: any) => any;
|
|
24
17
|
export const client_listRecents: (a: number) => any;
|
|
18
|
+
export const client_trashDir: (a: number, b: any) => any;
|
|
25
19
|
export const client_listDirRecursive: (a: number, b: any) => any;
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
29
|
-
export const
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
33
|
-
export const
|
|
20
|
+
export const client_listDir: (a: number, b: any) => any;
|
|
21
|
+
export const client_deleteDirPermanently: (a: number, b: any) => any;
|
|
22
|
+
export const client_root: (a: number) => any;
|
|
23
|
+
export const client_findItemInDir: (a: number, b: any, c: number, d: number) => any;
|
|
24
|
+
export const client_downloadItemsToZip: (a: number, b: any) => any;
|
|
25
|
+
export const main_js: () => void;
|
|
26
|
+
export const fromStringified: (a: any) => [number, number, number];
|
|
27
|
+
export const login: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
28
|
+
export const client_removeSharedLinkIn: (a: number, b: number, c: number) => any;
|
|
29
|
+
export const client_getDirLinkStatus: (a: number, b: any) => any;
|
|
30
|
+
export const client_publicLinkDir: (a: number, b: any) => any;
|
|
31
|
+
export const client_getFileLinkStatus: (a: number, b: any) => any;
|
|
32
|
+
export const client_cancelContactRequest: (a: number, b: number, c: number) => any;
|
|
33
|
+
export const client_updateFileLink: (a: number, b: any, c: any) => any;
|
|
34
|
+
export const client_removeDirLink: (a: number, b: any) => any;
|
|
35
|
+
export const client_removeSharedLinkOut: (a: number, b: number, c: number, d: bigint) => any;
|
|
36
|
+
export const client_denyContactRequest: (a: number, b: number, c: number) => any;
|
|
37
|
+
export const client_publicLinkFile: (a: number, b: any) => any;
|
|
38
|
+
export const client_shareDir: (a: number, b: any, c: any) => any;
|
|
39
|
+
export const client_listIncomingContactRequests: (a: number) => any;
|
|
40
|
+
export const client_listOutgoingContactRequests: (a: number) => any;
|
|
41
|
+
export const client_listOutShared: (a: number, b: number, c: number) => any;
|
|
42
|
+
export const client_makeUserFromContact: (a: number, b: any) => any;
|
|
43
|
+
export const client_deleteContact: (a: number, b: number, c: number) => any;
|
|
44
|
+
export const client_listLinkedDir: (a: number, b: any, c: any) => any;
|
|
45
|
+
export const client_acceptContactRequest: (a: number, b: number, c: number) => any;
|
|
46
|
+
export const client_sendContactRequest: (a: number, b: number, c: number) => any;
|
|
47
|
+
export const client_listInShared: (a: number, b: number) => any;
|
|
48
|
+
export const client_getContacts: (a: number) => any;
|
|
49
|
+
export const client_updateDirLink: (a: number, b: any, c: any) => any;
|
|
50
|
+
export const client_shareFile: (a: number, b: any, c: any) => any;
|
|
51
|
+
export const intounderlyingbytesource_cancel: (a: number) => void;
|
|
52
|
+
export const intounderlyingbytesource_type: (a: number) => number;
|
|
34
53
|
export const __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
35
54
|
export const intounderlyingbytesource_pull: (a: number, b: any) => any;
|
|
36
|
-
export const intounderlyingbytesource_type: (a: number) => number;
|
|
37
|
-
export const intounderlyingbytesource_start: (a: number, b: any) => void;
|
|
38
|
-
export const intounderlyingbytesource_cancel: (a: number) => void;
|
|
39
55
|
export const intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
56
|
+
export const intounderlyingbytesource_start: (a: number, b: any) => void;
|
|
57
|
+
export const intounderlyingsink_abort: (a: number, b: any) => any;
|
|
58
|
+
export const intounderlyingsink_close: (a: number) => any;
|
|
59
|
+
export const __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
60
|
+
export const intounderlyingsink_write: (a: number, b: any) => any;
|
|
61
|
+
export const intounderlyingsource_pull: (a: number, b: any) => any;
|
|
62
|
+
export const __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
63
|
+
export const intounderlyingsource_cancel: (a: number) => void;
|
|
40
64
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
41
65
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
42
66
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
@@ -45,8 +69,8 @@ export const __wbindgen_export_4: WebAssembly.Table;
|
|
|
45
69
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
46
70
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
47
71
|
export const __externref_table_dealloc: (a: number) => void;
|
|
48
|
-
export const
|
|
49
|
-
export const
|
|
50
|
-
export const
|
|
51
|
-
export const
|
|
72
|
+
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hc5d531eab69f2018: (a: number, b: number) => void;
|
|
73
|
+
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7a4fb4e79b1372c1: (a: number, b: number) => void;
|
|
74
|
+
export const closure1463_externref_shim: (a: number, b: number, c: any) => void;
|
|
75
|
+
export const closure1626_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
52
76
|
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@filen/sdk-rs",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "Filen WASM SDK using filen-sdk-rs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@zip.js/zip.js": "^2.7.72",
|
|
34
34
|
"dotenv": "^17.2.1",
|
|
35
|
+
"sharp": "^0.34.3",
|
|
35
36
|
"typescript": "~5.8.3",
|
|
36
37
|
"vite": "^7.1.2",
|
|
37
38
|
"vite-plugin-top-level-await": "^1.6.0",
|