@filen/sdk-rs 0.3.4 → 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.
@@ -18,6 +18,17 @@ export interface StringifiedClient {
18
18
  authVersion: number;
19
19
  }
20
20
 
21
+ export interface File {
22
+ uuid: UuidStr;
23
+ meta?: DecryptedFileMeta;
24
+ parent: ParentUuid;
25
+ size: bigint;
26
+ favorited: boolean;
27
+ region: string;
28
+ bucket: string;
29
+ chunks: bigint;
30
+ }
31
+
21
32
  export interface DecryptedFileMeta {
22
33
  name: string;
23
34
  mime: string;
@@ -29,15 +40,11 @@ export interface DecryptedFileMeta {
29
40
  version: FileEncryptionVersion;
30
41
  }
31
42
 
32
- export interface File {
33
- uuid: UuidStr;
34
- meta?: DecryptedFileMeta;
35
- parent: ParentUuid;
36
- size: bigint;
37
- favorited: boolean;
38
- region: string;
39
- bucket: string;
40
- chunks: bigint;
43
+ export interface DownloadFileToZipParams {
44
+ items: Item[];
45
+ writer: WritableStream<Uint8Array>;
46
+ progress?: (bytes: bigint) => void;
47
+ abort_signal?: AbortSignal;
41
48
  }
42
49
 
43
50
  export type AbortSignal = AbortSignal;
@@ -64,24 +71,12 @@ export interface DownloadFileStreamParams {
64
71
  abort_signal?: AbortSignal;
65
72
  }
66
73
 
67
- export interface DownloadFileToZipParams {
68
- items: Item[];
69
- writer: WritableStream<Uint8Array>;
70
- progress?: (bytes: bigint) => void;
71
- abort_signal?: AbortSignal;
72
- }
74
+ export type DirEnum = Dir | Root;
73
75
 
74
76
  export interface Root {
75
77
  uuid: UuidStr;
76
78
  }
77
79
 
78
- export type DirEnum = Dir | Root;
79
-
80
- export interface DecryptedDirMeta {
81
- name: string;
82
- created?: bigint;
83
- }
84
-
85
80
  export interface Dir {
86
81
  uuid: UuidStr;
87
82
  parent: ParentUuid;
@@ -90,6 +85,11 @@ export interface Dir {
90
85
  meta?: DecryptedDirMeta;
91
86
  }
92
87
 
88
+ export interface DecryptedDirMeta {
89
+ name: string;
90
+ created?: bigint;
91
+ }
92
+
93
93
  export type NonRootObject = ({ type: "dir" } & Dir) | ({ type: "file" } & File);
94
94
 
95
95
  export type Item = File | Dir | Root;
@@ -105,19 +105,19 @@ export class Client {
105
105
  free(): void;
106
106
  toStringified(): StringifiedClient;
107
107
  downloadItemsToZip(params: DownloadFileToZipParams): Promise<void>;
108
- downloadFileToWriter(params: DownloadFileStreamParams): Promise<void>;
109
108
  trashFile(file: File): Promise<File>;
110
- downloadFile(file: File): Promise<Uint8Array>;
111
109
  uploadFileFromReader(params: UploadFileStreamParams): Promise<File>;
110
+ downloadFile(file: File): Promise<Uint8Array>;
112
111
  deleteFilePermanently(file: File): Promise<void>;
113
112
  uploadFile(data: Uint8Array, params: UploadFileParams): Promise<File>;
114
- listDir(dir: DirEnum): Promise<[Dir[], File[]]>;
115
- root(): Root;
113
+ downloadFileToWriter(params: DownloadFileStreamParams): Promise<void>;
116
114
  findItemInDir(dir: DirEnum, nameOrUuid: string): Promise<NonRootObject | undefined>;
117
- trashDir(dir: Dir): Promise<Dir>;
118
115
  deleteDirPermanently(dir: Dir): Promise<void>;
119
- dirExists(parent: DirEnum, name: string): Promise<void>;
116
+ root(): Root;
117
+ listDir(dir: DirEnum): Promise<[Dir[], File[]]>;
120
118
  createDir(parent: DirEnum, name: string): Promise<Dir>;
119
+ trashDir(dir: Dir): Promise<Dir>;
120
+ dirExists(parent: DirEnum, name: string): Promise<void>;
121
121
  }
122
122
  export class IntoUnderlyingByteSource {
123
123
  private constructor();
@@ -141,3 +141,75 @@ export class IntoUnderlyingSource {
141
141
  cancel(): void;
142
142
  pull(controller: ReadableStreamDefaultController): Promise<any>;
143
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>;