@filen/sdk-rs 0.3.3 → 0.3.5
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 +124 -47
- package/browser/sdk-rs.js +1342 -5
- package/browser/sdk-rs_bg.wasm +0 -0
- package/browser/sdk-rs_bg.wasm.d.ts +15 -15
- package/package.json +1 -1
- package/browser/sdk-rs_bg.js +0 -1369
package/browser/sdk-rs.d.ts
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export function main_js(): void;
|
|
4
|
-
export function login(email: string, password: string, twoFactorCode?: string | null): Promise<Client>;
|
|
5
3
|
export function fromStringified(serialized: StringifiedClient): Client;
|
|
4
|
+
export function login(email: string, password: string, twoFactorCode?: string | null): Promise<Client>;
|
|
5
|
+
export function main_js(): void;
|
|
6
6
|
/**
|
|
7
7
|
* The `ReadableStreamType` enum.
|
|
8
8
|
*
|
|
9
9
|
* *This API requires the following crate features to be activated: `ReadableStreamType`*
|
|
10
10
|
*/
|
|
11
11
|
type ReadableStreamType = "bytes";
|
|
12
|
+
export interface StringifiedClient {
|
|
13
|
+
email: string;
|
|
14
|
+
rootUuid: string;
|
|
15
|
+
authInfo: string;
|
|
16
|
+
privateKey: string;
|
|
17
|
+
apiKey: string;
|
|
18
|
+
authVersion: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
12
21
|
export interface File {
|
|
13
22
|
uuid: UuidStr;
|
|
14
23
|
meta?: DecryptedFileMeta;
|
|
@@ -31,64 +40,60 @@ export interface DecryptedFileMeta {
|
|
|
31
40
|
version: FileEncryptionVersion;
|
|
32
41
|
}
|
|
33
42
|
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
authInfo: string;
|
|
40
|
-
privateKey: string;
|
|
41
|
-
apiKey: string;
|
|
42
|
-
authVersion: number;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface Root {
|
|
46
|
-
uuid: UuidStr;
|
|
43
|
+
export interface DownloadFileToZipParams {
|
|
44
|
+
items: Item[];
|
|
45
|
+
writer: WritableStream<Uint8Array>;
|
|
46
|
+
progress?: (bytes: bigint) => void;
|
|
47
|
+
abort_signal?: AbortSignal;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
export type
|
|
50
|
+
export type AbortSignal = AbortSignal;
|
|
50
51
|
|
|
51
|
-
export interface
|
|
52
|
-
|
|
53
|
-
parent: ParentUuid;
|
|
54
|
-
color?: string;
|
|
55
|
-
favorited: boolean;
|
|
56
|
-
meta?: DecryptedDirMeta;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface DecryptedDirMeta {
|
|
52
|
+
export interface UploadFileParams {
|
|
53
|
+
parent: DirEnum;
|
|
60
54
|
name: string;
|
|
61
55
|
created?: bigint;
|
|
56
|
+
modified?: bigint;
|
|
57
|
+
mime?: string | undefined;
|
|
58
|
+
abortSignal?: AbortSignal;
|
|
62
59
|
}
|
|
63
60
|
|
|
64
|
-
export type NonRootObject = ({ type: "dir" } & Dir) | ({ type: "file" } & File);
|
|
65
|
-
|
|
66
61
|
export interface UploadFileStreamParams extends UploadFileParams {
|
|
67
62
|
reader: ReadableStream<Uint8Array>;
|
|
68
63
|
known_size: bigint | undefined;
|
|
69
64
|
progress?: (bytes: bigint) => void;
|
|
70
65
|
}
|
|
71
66
|
|
|
72
|
-
export interface DownloadFileToZipParams {
|
|
73
|
-
items: Item[];
|
|
74
|
-
writer: WritableStream<Uint8Array>;
|
|
75
|
-
progress?: (bytes: bigint) => void;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
67
|
export interface DownloadFileStreamParams {
|
|
79
68
|
file: File;
|
|
80
69
|
writer: WritableStream<Uint8Array>;
|
|
81
70
|
progress?: (bytes: bigint) => void;
|
|
71
|
+
abort_signal?: AbortSignal;
|
|
82
72
|
}
|
|
83
73
|
|
|
84
|
-
export
|
|
85
|
-
|
|
74
|
+
export type DirEnum = Dir | Root;
|
|
75
|
+
|
|
76
|
+
export interface Root {
|
|
77
|
+
uuid: UuidStr;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface Dir {
|
|
81
|
+
uuid: UuidStr;
|
|
82
|
+
parent: ParentUuid;
|
|
83
|
+
color?: string;
|
|
84
|
+
favorited: boolean;
|
|
85
|
+
meta?: DecryptedDirMeta;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface DecryptedDirMeta {
|
|
86
89
|
name: string;
|
|
87
90
|
created?: bigint;
|
|
88
|
-
modified?: bigint;
|
|
89
|
-
mime?: string;
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
export type NonRootObject = ({ type: "dir" } & Dir) | ({ type: "file" } & File);
|
|
94
|
+
|
|
95
|
+
export type Item = File | Dir | Root;
|
|
96
|
+
|
|
92
97
|
export type ParentUuid = UuidStr | "trash" | "recents" | "favorites" | "links";
|
|
93
98
|
|
|
94
99
|
export type FileEncryptionVersion = 1 | 2 | 3;
|
|
@@ -98,21 +103,21 @@ export type UuidStr = string;
|
|
|
98
103
|
export class Client {
|
|
99
104
|
private constructor();
|
|
100
105
|
free(): void;
|
|
101
|
-
createDir(parent: DirEnum, name: string): Promise<Dir>;
|
|
102
|
-
findItemInDir(dir: DirEnum, nameOrUuid: string): Promise<NonRootObject | undefined>;
|
|
103
|
-
trashDir(dir: Dir): Promise<Dir>;
|
|
104
|
-
deleteDirPermanently(dir: Dir): Promise<void>;
|
|
105
|
-
dirExists(parent: DirEnum, name: string): Promise<void>;
|
|
106
|
-
root(): Root;
|
|
107
|
-
listDir(dir: DirEnum): Promise<[Dir[], File[]]>;
|
|
108
106
|
toStringified(): StringifiedClient;
|
|
109
107
|
downloadItemsToZip(params: DownloadFileToZipParams): Promise<void>;
|
|
110
108
|
trashFile(file: File): Promise<File>;
|
|
111
|
-
deleteFilePermanently(file: File): Promise<void>;
|
|
112
|
-
downloadFile(file: File): Promise<Uint8Array>;
|
|
113
|
-
downloadFileToWriter(params: DownloadFileStreamParams): Promise<void>;
|
|
114
109
|
uploadFileFromReader(params: UploadFileStreamParams): Promise<File>;
|
|
110
|
+
downloadFile(file: File): Promise<Uint8Array>;
|
|
111
|
+
deleteFilePermanently(file: File): Promise<void>;
|
|
115
112
|
uploadFile(data: Uint8Array, params: UploadFileParams): Promise<File>;
|
|
113
|
+
downloadFileToWriter(params: DownloadFileStreamParams): Promise<void>;
|
|
114
|
+
findItemInDir(dir: DirEnum, nameOrUuid: string): Promise<NonRootObject | undefined>;
|
|
115
|
+
deleteDirPermanently(dir: Dir): Promise<void>;
|
|
116
|
+
root(): Root;
|
|
117
|
+
listDir(dir: DirEnum): Promise<[Dir[], File[]]>;
|
|
118
|
+
createDir(parent: DirEnum, name: string): Promise<Dir>;
|
|
119
|
+
trashDir(dir: Dir): Promise<Dir>;
|
|
120
|
+
dirExists(parent: DirEnum, name: string): Promise<void>;
|
|
116
121
|
}
|
|
117
122
|
export class IntoUnderlyingByteSource {
|
|
118
123
|
private constructor();
|
|
@@ -136,3 +141,75 @@ export class IntoUnderlyingSource {
|
|
|
136
141
|
cancel(): void;
|
|
137
142
|
pull(controller: ReadableStreamDefaultController): Promise<any>;
|
|
138
143
|
}
|
|
144
|
+
|
|
145
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
146
|
+
|
|
147
|
+
export interface InitOutput {
|
|
148
|
+
readonly memory: WebAssembly.Memory;
|
|
149
|
+
readonly client_toStringified: (a: number) => any;
|
|
150
|
+
readonly __wbg_client_free: (a: number, b: number) => void;
|
|
151
|
+
readonly client_downloadItemsToZip: (a: number, b: any) => any;
|
|
152
|
+
readonly client_uploadFile: (a: number, b: number, c: number, d: any) => any;
|
|
153
|
+
readonly client_deleteFilePermanently: (a: number, b: any) => any;
|
|
154
|
+
readonly client_downloadFile: (a: number, b: any) => any;
|
|
155
|
+
readonly client_downloadFileToWriter: (a: number, b: any) => any;
|
|
156
|
+
readonly client_uploadFileFromReader: (a: number, b: any) => any;
|
|
157
|
+
readonly client_trashFile: (a: number, b: any) => any;
|
|
158
|
+
readonly main_js: () => void;
|
|
159
|
+
readonly login: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
160
|
+
readonly fromStringified: (a: any) => [number, number, number];
|
|
161
|
+
readonly client_trashDir: (a: number, b: any) => any;
|
|
162
|
+
readonly client_findItemInDir: (a: number, b: any, c: number, d: number) => any;
|
|
163
|
+
readonly client_root: (a: number) => any;
|
|
164
|
+
readonly client_deleteDirPermanently: (a: number, b: any) => any;
|
|
165
|
+
readonly client_createDir: (a: number, b: any, c: number, d: number) => any;
|
|
166
|
+
readonly client_listDir: (a: number, b: any) => any;
|
|
167
|
+
readonly client_dirExists: (a: number, b: any, c: number, d: number) => any;
|
|
168
|
+
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
169
|
+
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
170
|
+
readonly intounderlyingsource_pull: (a: number, b: any) => any;
|
|
171
|
+
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
172
|
+
readonly intounderlyingsink_abort: (a: number, b: any) => any;
|
|
173
|
+
readonly intounderlyingsink_write: (a: number, b: any) => any;
|
|
174
|
+
readonly intounderlyingsink_close: (a: number) => any;
|
|
175
|
+
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
176
|
+
readonly intounderlyingbytesource_pull: (a: number, b: any) => any;
|
|
177
|
+
readonly intounderlyingbytesource_type: (a: number) => number;
|
|
178
|
+
readonly intounderlyingbytesource_start: (a: number, b: any) => void;
|
|
179
|
+
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
180
|
+
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
181
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
182
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
183
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
184
|
+
readonly __externref_table_alloc: () => number;
|
|
185
|
+
readonly __wbindgen_export_4: WebAssembly.Table;
|
|
186
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
187
|
+
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
188
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
189
|
+
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1ad07d0627257b45: (a: number, b: number) => void;
|
|
190
|
+
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h96ccbfe273ba439a: (a: number, b: number) => void;
|
|
191
|
+
readonly closure837_externref_shim: (a: number, b: number, c: any) => void;
|
|
192
|
+
readonly closure996_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
193
|
+
readonly __wbindgen_start: () => void;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
197
|
+
/**
|
|
198
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
199
|
+
* a precompiled `WebAssembly.Module`.
|
|
200
|
+
*
|
|
201
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
202
|
+
*
|
|
203
|
+
* @returns {InitOutput}
|
|
204
|
+
*/
|
|
205
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
209
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
210
|
+
*
|
|
211
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
212
|
+
*
|
|
213
|
+
* @returns {Promise<InitOutput>}
|
|
214
|
+
*/
|
|
215
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|