@filen/sdk-rs 0.2.3 → 0.3.0

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.
@@ -1,8 +1,8 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function from_serialized(serialized: StringifiedClient): FilenState;
4
3
  export function main_js(): void;
5
4
  export function login(email: string, password: string, two_factor_code?: string | null): Promise<FilenState>;
5
+ export function from_serialized(serialized: StringifiedClient): FilenState;
6
6
  /**
7
7
  * Chroma subsampling format
8
8
  */
@@ -30,35 +30,67 @@ export enum ChromaSampling {
30
30
  * *This API requires the following crate features to be activated: `ReadableStreamType`*
31
31
  */
32
32
  type ReadableStreamType = "bytes";
33
- export interface DownloadFileStreamParams {
34
- writer: WritableStream<Uint8Array>;
33
+ export interface File {
34
+ uuid: UuidStr;
35
+ meta?: DecryptedFileMeta;
36
+ parent: ParentUuid;
37
+ size: bigint;
38
+ favorited: boolean;
39
+ region: string;
40
+ bucket: string;
41
+ chunks: bigint;
42
+ }
43
+
44
+ export interface UploadFileStreamParams extends UploadFileParams {
45
+ reader: ReadableStream<Uint8Array>;
46
+ known_size?: bigint | undefined;
35
47
  progress?: (bytes: bigint) => void;
36
48
  }
37
49
 
38
- export interface FileMeta {
50
+ export interface UploadFileParams {
51
+ parent: DirEnum;
39
52
  name: string;
40
- mime: string;
41
- created: Date | undefined;
42
- modified: Date;
43
- hash: Uint8Array | undefined;
53
+ created?: bigint;
54
+ modified?: bigint;
55
+ mime?: string;
44
56
  }
45
57
 
46
- export interface UploadFileStreamParams extends UploadFileParams {
47
- reader: ReadableStream<Uint8Array>;
48
- known_size?: bigint;
58
+ export interface DownloadFileStreamParams {
59
+ file: File;
60
+ writer: WritableStream<Uint8Array>;
49
61
  progress?: (bytes: bigint) => void;
50
62
  }
51
63
 
52
- export interface DirMeta {
64
+ export type DirEnum = Dir | Root;
65
+
66
+ export type NonRootObject = ({ type: "dir" } & Dir) | ({ type: "file" } & File);
67
+
68
+ export interface Dir {
69
+ uuid: UuidStr;
70
+ parent: ParentUuid;
71
+ color?: string;
72
+ favorited: boolean;
73
+ meta?: DecryptedDirMeta;
74
+ }
75
+
76
+ export interface DecryptedDirMeta {
53
77
  name: string;
54
- created: Date | undefined;
78
+ created?: bigint;
55
79
  }
56
80
 
57
- export interface UploadFileParams {
81
+ export interface DecryptedFileMeta {
58
82
  name: string;
59
- created?: Date;
60
- modified?: Date;
61
- mime?: string;
83
+ mime: string;
84
+ created?: bigint;
85
+ modified: bigint;
86
+ hash?: Uint8Array;
87
+ size: bigint;
88
+ key: string;
89
+ version: FileEncryptionVersion;
90
+ }
91
+
92
+ export interface Root {
93
+ uuid: UuidStr;
62
94
  }
63
95
 
64
96
  export interface StringifiedClient {
@@ -70,48 +102,30 @@ export interface StringifiedClient {
70
102
  authVersion: number;
71
103
  }
72
104
 
73
- export class Dir {
74
- private constructor();
75
- free(): void;
76
- readonly color: string;
77
- readonly uuid: string;
78
- readonly favorited: boolean;
79
- readonly parent: string;
80
- readonly meta: DirMeta | undefined;
81
- }
82
- export class File {
83
- private constructor();
84
- free(): void;
85
- readonly uuid: string;
86
- readonly favorited: boolean;
87
- readonly parent: string;
88
- readonly meta: FileMeta | undefined;
89
- readonly size: bigint;
90
- }
91
105
  export class FilenState {
92
106
  private constructor();
93
107
  free(): void;
94
108
  serialize(): StringifiedClient;
95
- createDir(parent: Dir, name: string): Promise<Dir>;
96
- dirExists(parent: Dir, name: string): Promise<void>;
97
- listDir(dir: Dir): Promise<[Dir[], File[]]>;
98
- root(): Dir;
99
- findItemInDir(dir: Dir, name_or_uuid: string): Promise<Dir | File | undefined>;
109
+ findItemInDir(dir: DirEnum, name_or_uuid: string): Promise<NonRootObject | undefined>;
110
+ listDir(dir: DirEnum): Promise<[DirEnum[], File[]]>;
111
+ trashDir(dir: DirEnum): Promise<void>;
100
112
  deleteDirPermanently(dir: Dir): Promise<void>;
101
- trashDir(dir: Dir): Promise<void>;
102
- uploadFileStream(parent: Dir, params: UploadFileStreamParams): Promise<File>;
103
- uploadFile(parent: Dir, data: Uint8Array, params: UploadFileParams): Promise<File>;
104
- downloadFile(file: File): Promise<Uint8Array>;
113
+ dirExists(parent: DirEnum, name: string): Promise<void>;
114
+ createDir(parent: DirEnum, name: string): Promise<Dir>;
115
+ root(): Root;
116
+ uploadFileStream(params: UploadFileStreamParams): Promise<File>;
105
117
  trashFile(file: File): Promise<void>;
106
- downloadFileToWriter(file: File, params: DownloadFileStreamParams): Promise<void>;
107
118
  deleteFilePermanently(file: File): Promise<void>;
119
+ downloadFileToWriter(params: DownloadFileStreamParams): Promise<void>;
120
+ downloadFile(file: File): Promise<Uint8Array>;
121
+ uploadFile(data: Uint8Array, params: UploadFileParams): Promise<File>;
108
122
  }
109
123
  export class IntoUnderlyingByteSource {
110
124
  private constructor();
111
125
  free(): void;
126
+ cancel(): void;
112
127
  pull(controller: ReadableByteStreamController): Promise<any>;
113
128
  start(controller: ReadableByteStreamController): void;
114
- cancel(): void;
115
129
  readonly type: ReadableStreamType;
116
130
  readonly autoAllocateChunkSize: number;
117
131
  }
@@ -125,6 +139,6 @@ export class IntoUnderlyingSink {
125
139
  export class IntoUnderlyingSource {
126
140
  private constructor();
127
141
  free(): void;
128
- pull(controller: ReadableStreamDefaultController): Promise<any>;
129
142
  cancel(): void;
143
+ pull(controller: ReadableStreamDefaultController): Promise<any>;
130
144
  }
@@ -221,23 +221,6 @@ function debugString(val) {
221
221
  return className;
222
222
  }
223
223
 
224
- function takeFromExternrefTable0(idx) {
225
- const value = wasm.__wbindgen_export_2.get(idx);
226
- wasm.__externref_table_dealloc(idx);
227
- return value;
228
- }
229
- /**
230
- * @param {StringifiedClient} serialized
231
- * @returns {FilenState}
232
- */
233
- export function from_serialized(serialized) {
234
- const ret = wasm.from_serialized(serialized);
235
- if (ret[2]) {
236
- throw takeFromExternrefTable0(ret[1]);
237
- }
238
- return FilenState.__wrap(ret[0]);
239
- }
240
-
241
224
  export function main_js() {
242
225
  wasm.main_js();
243
226
  }
@@ -259,10 +242,21 @@ export function login(email, password, two_factor_code) {
259
242
  return ret;
260
243
  }
261
244
 
262
- function _assertClass(instance, klass) {
263
- if (!(instance instanceof klass)) {
264
- throw new Error(`expected instance of ${klass.name}`);
245
+ function takeFromExternrefTable0(idx) {
246
+ const value = wasm.__wbindgen_export_2.get(idx);
247
+ wasm.__externref_table_dealloc(idx);
248
+ return value;
249
+ }
250
+ /**
251
+ * @param {StringifiedClient} serialized
252
+ * @returns {FilenState}
253
+ */
254
+ export function from_serialized(serialized) {
255
+ const ret = wasm.from_serialized(serialized);
256
+ if (ret[2]) {
257
+ throw takeFromExternrefTable0(ret[1]);
265
258
  }
259
+ return FilenState.__wrap(ret[0]);
266
260
  }
267
261
 
268
262
  function passArray8ToWasm0(arg, malloc) {
@@ -276,11 +270,11 @@ function __wbg_adapter_58(arg0, arg1, arg2) {
276
270
  }
277
271
 
278
272
  function __wbg_adapter_61(arg0, arg1) {
279
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h11fe32c58007d6ae(arg0, arg1);
273
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3a28bb1da68602c0(arg0, arg1);
280
274
  }
281
275
 
282
- function __wbg_adapter_165(arg0, arg1, arg2, arg3) {
283
- wasm.closure83_externref_shim(arg0, arg1, arg2, arg3);
276
+ function __wbg_adapter_131(arg0, arg1, arg2, arg3) {
277
+ wasm.closure85_externref_shim(arg0, arg1, arg2, arg3);
284
278
  }
285
279
 
286
280
  /**
@@ -316,140 +310,6 @@ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
316
310
 
317
311
  const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
318
312
 
319
- const DirFinalization = (typeof FinalizationRegistry === 'undefined')
320
- ? { register: () => {}, unregister: () => {} }
321
- : new FinalizationRegistry(ptr => wasm.__wbg_dir_free(ptr >>> 0, 1));
322
-
323
- export class Dir {
324
-
325
- static __wrap(ptr) {
326
- ptr = ptr >>> 0;
327
- const obj = Object.create(Dir.prototype);
328
- obj.__wbg_ptr = ptr;
329
- DirFinalization.register(obj, obj.__wbg_ptr, obj);
330
- return obj;
331
- }
332
-
333
- __destroy_into_raw() {
334
- const ptr = this.__wbg_ptr;
335
- this.__wbg_ptr = 0;
336
- DirFinalization.unregister(this);
337
- return ptr;
338
- }
339
-
340
- free() {
341
- const ptr = this.__destroy_into_raw();
342
- wasm.__wbg_dir_free(ptr, 0);
343
- }
344
- /**
345
- * @returns {string}
346
- */
347
- get color() {
348
- const ret = wasm.dir_color(this.__wbg_ptr);
349
- var v1 = getCachedStringFromWasm0(ret[0], ret[1]);
350
- if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
351
- return v1;
352
- }
353
- /**
354
- * @returns {string}
355
- */
356
- get uuid() {
357
- const ret = wasm.dir_uuid(this.__wbg_ptr);
358
- var v1 = getCachedStringFromWasm0(ret[0], ret[1]);
359
- if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
360
- return v1;
361
- }
362
- /**
363
- * @returns {boolean}
364
- */
365
- get favorited() {
366
- const ret = wasm.dir_favorited(this.__wbg_ptr);
367
- return ret !== 0;
368
- }
369
- /**
370
- * @returns {string}
371
- */
372
- get parent() {
373
- const ret = wasm.dir_parent(this.__wbg_ptr);
374
- var v1 = getCachedStringFromWasm0(ret[0], ret[1]);
375
- if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
376
- return v1;
377
- }
378
- /**
379
- * @returns {DirMeta | undefined}
380
- */
381
- get meta() {
382
- const ret = wasm.dir_meta(this.__wbg_ptr);
383
- return ret;
384
- }
385
- }
386
-
387
- const FileFinalization = (typeof FinalizationRegistry === 'undefined')
388
- ? { register: () => {}, unregister: () => {} }
389
- : new FinalizationRegistry(ptr => wasm.__wbg_file_free(ptr >>> 0, 1));
390
-
391
- export class File {
392
-
393
- static __wrap(ptr) {
394
- ptr = ptr >>> 0;
395
- const obj = Object.create(File.prototype);
396
- obj.__wbg_ptr = ptr;
397
- FileFinalization.register(obj, obj.__wbg_ptr, obj);
398
- return obj;
399
- }
400
-
401
- __destroy_into_raw() {
402
- const ptr = this.__wbg_ptr;
403
- this.__wbg_ptr = 0;
404
- FileFinalization.unregister(this);
405
- return ptr;
406
- }
407
-
408
- free() {
409
- const ptr = this.__destroy_into_raw();
410
- wasm.__wbg_file_free(ptr, 0);
411
- }
412
- /**
413
- * @returns {string}
414
- */
415
- get uuid() {
416
- const ret = wasm.file_uuid(this.__wbg_ptr);
417
- var v1 = getCachedStringFromWasm0(ret[0], ret[1]);
418
- if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
419
- return v1;
420
- }
421
- /**
422
- * @returns {boolean}
423
- */
424
- get favorited() {
425
- const ret = wasm.file_favorited(this.__wbg_ptr);
426
- return ret !== 0;
427
- }
428
- /**
429
- * @returns {string}
430
- */
431
- get parent() {
432
- const ret = wasm.file_parent(this.__wbg_ptr);
433
- var v1 = getCachedStringFromWasm0(ret[0], ret[1]);
434
- if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
435
- return v1;
436
- }
437
- /**
438
- * @returns {FileMeta | undefined}
439
- */
440
- get meta() {
441
- const ret = wasm.file_meta(this.__wbg_ptr);
442
- return ret;
443
- }
444
- /**
445
- * @returns {bigint}
446
- */
447
- get size() {
448
- const ret = wasm.file_size(this.__wbg_ptr);
449
- return BigInt.asUintN(64, ret);
450
- }
451
- }
452
-
453
313
  const FilenStateFinalization = (typeof FinalizationRegistry === 'undefined')
454
314
  ? { register: () => {}, unregister: () => {} }
455
315
  : new FinalizationRegistry(ptr => wasm.__wbg_filenstate_free(ptr >>> 0, 1));
@@ -483,135 +343,118 @@ export class FilenState {
483
343
  return ret;
484
344
  }
485
345
  /**
486
- * @param {Dir} parent
487
- * @param {string} name
488
- * @returns {Promise<Dir>}
489
- */
490
- createDir(parent, name) {
491
- _assertClass(parent, Dir);
492
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
493
- const len0 = WASM_VECTOR_LEN;
494
- const ret = wasm.filenstate_createDir(this.__wbg_ptr, parent.__wbg_ptr, ptr0, len0);
495
- return ret;
496
- }
497
- /**
498
- * @param {Dir} parent
499
- * @param {string} name
500
- * @returns {Promise<void>}
346
+ * @param {DirEnum} dir
347
+ * @param {string} name_or_uuid
348
+ * @returns {Promise<NonRootObject | undefined>}
501
349
  */
502
- dirExists(parent, name) {
503
- _assertClass(parent, Dir);
504
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
350
+ findItemInDir(dir, name_or_uuid) {
351
+ const ptr0 = passStringToWasm0(name_or_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
505
352
  const len0 = WASM_VECTOR_LEN;
506
- const ret = wasm.filenstate_dirExists(this.__wbg_ptr, parent.__wbg_ptr, ptr0, len0);
353
+ const ret = wasm.filenstate_findItemInDir(this.__wbg_ptr, dir, ptr0, len0);
507
354
  return ret;
508
355
  }
509
356
  /**
510
- * @param {Dir} dir
511
- * @returns {[Dir[], File[]]}
357
+ * @param {DirEnum} dir
358
+ * @returns {[DirEnum[], File[]]}
512
359
  */
513
360
  listDir(dir) {
514
- _assertClass(dir, Dir);
515
- const ret = wasm.filenstate_listDir(this.__wbg_ptr, dir.__wbg_ptr);
361
+ const ret = wasm.filenstate_listDir(this.__wbg_ptr, dir);
516
362
  return ret;
517
363
  }
518
364
  /**
519
- * @returns {Dir}
365
+ * @param {DirEnum} dir
366
+ * @returns {Promise<void>}
520
367
  */
521
- root() {
522
- const ret = wasm.filenstate_root(this.__wbg_ptr);
523
- return Dir.__wrap(ret);
368
+ trashDir(dir) {
369
+ const ret = wasm.filenstate_trashDir(this.__wbg_ptr, dir);
370
+ return ret;
524
371
  }
525
372
  /**
526
373
  * @param {Dir} dir
527
- * @param {string} name_or_uuid
528
- * @returns {Dir | File | undefined}
374
+ * @returns {Promise<void>}
529
375
  */
530
- findItemInDir(dir, name_or_uuid) {
531
- _assertClass(dir, Dir);
532
- const ptr0 = passStringToWasm0(name_or_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
533
- const len0 = WASM_VECTOR_LEN;
534
- const ret = wasm.filenstate_findItemInDir(this.__wbg_ptr, dir.__wbg_ptr, ptr0, len0);
376
+ deleteDirPermanently(dir) {
377
+ const ret = wasm.filenstate_deleteDirPermanently(this.__wbg_ptr, dir);
535
378
  return ret;
536
379
  }
537
380
  /**
538
- * @param {Dir} dir
381
+ * @param {DirEnum} parent
382
+ * @param {string} name
539
383
  * @returns {Promise<void>}
540
384
  */
541
- deleteDirPermanently(dir) {
542
- _assertClass(dir, Dir);
543
- var ptr0 = dir.__destroy_into_raw();
544
- const ret = wasm.filenstate_deleteDirPermanently(this.__wbg_ptr, ptr0);
385
+ dirExists(parent, name) {
386
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
387
+ const len0 = WASM_VECTOR_LEN;
388
+ const ret = wasm.filenstate_dirExists(this.__wbg_ptr, parent, ptr0, len0);
545
389
  return ret;
546
390
  }
547
391
  /**
548
- * @param {Dir} dir
549
- * @returns {Promise<void>}
392
+ * @param {DirEnum} parent
393
+ * @param {string} name
394
+ * @returns {Promise<Dir>}
550
395
  */
551
- trashDir(dir) {
552
- _assertClass(dir, Dir);
553
- const ret = wasm.filenstate_trashDir(this.__wbg_ptr, dir.__wbg_ptr);
396
+ createDir(parent, name) {
397
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
398
+ const len0 = WASM_VECTOR_LEN;
399
+ const ret = wasm.filenstate_createDir(this.__wbg_ptr, parent, ptr0, len0);
554
400
  return ret;
555
401
  }
556
402
  /**
557
- * @param {Dir} parent
558
- * @param {UploadFileStreamParams} params
559
- * @returns {Promise<File>}
403
+ * @returns {Root}
560
404
  */
561
- uploadFileStream(parent, params) {
562
- _assertClass(parent, Dir);
563
- const ret = wasm.filenstate_uploadFileStream(this.__wbg_ptr, parent.__wbg_ptr, params);
405
+ root() {
406
+ const ret = wasm.filenstate_root(this.__wbg_ptr);
564
407
  return ret;
565
408
  }
566
409
  /**
567
- * @param {Dir} parent
568
- * @param {Uint8Array} data
569
- * @param {UploadFileParams} params
410
+ * @param {UploadFileStreamParams} params
570
411
  * @returns {Promise<File>}
571
412
  */
572
- uploadFile(parent, data, params) {
573
- _assertClass(parent, Dir);
574
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
575
- const len0 = WASM_VECTOR_LEN;
576
- const ret = wasm.filenstate_uploadFile(this.__wbg_ptr, parent.__wbg_ptr, ptr0, len0, params);
413
+ uploadFileStream(params) {
414
+ const ret = wasm.filenstate_uploadFileStream(this.__wbg_ptr, params);
577
415
  return ret;
578
416
  }
579
417
  /**
580
418
  * @param {File} file
581
- * @returns {Promise<Uint8Array>}
419
+ * @returns {Promise<void>}
582
420
  */
583
- downloadFile(file) {
584
- _assertClass(file, File);
585
- const ret = wasm.filenstate_downloadFile(this.__wbg_ptr, file.__wbg_ptr);
421
+ trashFile(file) {
422
+ const ret = wasm.filenstate_trashFile(this.__wbg_ptr, file);
586
423
  return ret;
587
424
  }
588
425
  /**
589
426
  * @param {File} file
590
427
  * @returns {Promise<void>}
591
428
  */
592
- trashFile(file) {
593
- _assertClass(file, File);
594
- const ret = wasm.filenstate_trashFile(this.__wbg_ptr, file.__wbg_ptr);
429
+ deleteFilePermanently(file) {
430
+ const ret = wasm.filenstate_deleteFilePermanently(this.__wbg_ptr, file);
595
431
  return ret;
596
432
  }
597
433
  /**
598
- * @param {File} file
599
434
  * @param {DownloadFileStreamParams} params
600
435
  * @returns {Promise<void>}
601
436
  */
602
- downloadFileToWriter(file, params) {
603
- _assertClass(file, File);
604
- const ret = wasm.filenstate_downloadFileToWriter(this.__wbg_ptr, file.__wbg_ptr, params);
437
+ downloadFileToWriter(params) {
438
+ const ret = wasm.filenstate_downloadFileToWriter(this.__wbg_ptr, params);
605
439
  return ret;
606
440
  }
607
441
  /**
608
442
  * @param {File} file
609
- * @returns {Promise<void>}
443
+ * @returns {Promise<Uint8Array>}
610
444
  */
611
- deleteFilePermanently(file) {
612
- _assertClass(file, File);
613
- var ptr0 = file.__destroy_into_raw();
614
- const ret = wasm.filenstate_deleteFilePermanently(this.__wbg_ptr, ptr0);
445
+ downloadFile(file) {
446
+ const ret = wasm.filenstate_downloadFile(this.__wbg_ptr, file);
447
+ return ret;
448
+ }
449
+ /**
450
+ * @param {Uint8Array} data
451
+ * @param {UploadFileParams} params
452
+ * @returns {Promise<File>}
453
+ */
454
+ uploadFile(data, params) {
455
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
456
+ const len0 = WASM_VECTOR_LEN;
457
+ const ret = wasm.filenstate_uploadFile(this.__wbg_ptr, ptr0, len0, params);
615
458
  return ret;
616
459
  }
617
460
  }
@@ -633,6 +476,10 @@ export class IntoUnderlyingByteSource {
633
476
  const ptr = this.__destroy_into_raw();
634
477
  wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
635
478
  }
479
+ cancel() {
480
+ const ptr = this.__destroy_into_raw();
481
+ wasm.intounderlyingbytesource_cancel(ptr);
482
+ }
636
483
  /**
637
484
  * @param {ReadableByteStreamController} controller
638
485
  * @returns {Promise<any>}
@@ -654,10 +501,6 @@ export class IntoUnderlyingByteSource {
654
501
  const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
655
502
  return __wbindgen_enum_ReadableStreamType[ret];
656
503
  }
657
- cancel() {
658
- const ptr = this.__destroy_into_raw();
659
- wasm.intounderlyingbytesource_cancel(ptr);
660
- }
661
504
  /**
662
505
  * @returns {number}
663
506
  */
@@ -728,6 +571,10 @@ export class IntoUnderlyingSource {
728
571
  const ptr = this.__destroy_into_raw();
729
572
  wasm.__wbg_intounderlyingsource_free(ptr, 0);
730
573
  }
574
+ cancel() {
575
+ const ptr = this.__destroy_into_raw();
576
+ wasm.intounderlyingsource_cancel(ptr);
577
+ }
731
578
  /**
732
579
  * @param {ReadableStreamDefaultController} controller
733
580
  * @returns {Promise<any>}
@@ -736,10 +583,6 @@ export class IntoUnderlyingSource {
736
583
  const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
737
584
  return ret;
738
585
  }
739
- cancel() {
740
- const ptr = this.__destroy_into_raw();
741
- wasm.intounderlyingsource_cancel(ptr);
742
- }
743
586
  }
744
587
 
745
588
  export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
@@ -846,10 +689,10 @@ export function __wbg_debug_e17b51583ca6a632(arg0, arg1, arg2, arg3) {
846
689
  console.debug(arg0, arg1, arg2, arg3);
847
690
  };
848
691
 
849
- export function __wbg_dir_new(arg0) {
850
- const ret = Dir.__wrap(arg0);
692
+ export function __wbg_deleteProperty_96363d4a1d977c97() { return handleError(function (arg0, arg1) {
693
+ const ret = Reflect.deleteProperty(arg0, arg1);
851
694
  return ret;
852
- };
695
+ }, arguments) };
853
696
 
854
697
  export function __wbg_done_769e5ede4b31c67b(arg0) {
855
698
  const ret = arg0.done;
@@ -889,11 +732,6 @@ export function __wbg_fetch_f156d10be9a5c88a(arg0) {
889
732
  return ret;
890
733
  };
891
734
 
892
- export function __wbg_file_new(arg0) {
893
- const ret = File.__wrap(arg0);
894
- return ret;
895
- };
896
-
897
735
  export function __wbg_filenstate_new(arg0) {
898
736
  const ret = FilenState.__wrap(arg0);
899
737
  return ret;
@@ -1083,7 +921,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
1083
921
  const a = state0.a;
1084
922
  state0.a = 0;
1085
923
  try {
1086
- return __wbg_adapter_165(a, state0.b, arg0, arg1);
924
+ return __wbg_adapter_131(a, state0.b, arg0, arg1);
1087
925
  } finally {
1088
926
  state0.a = a;
1089
927
  }
@@ -1095,13 +933,13 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
1095
933
  }
1096
934
  };
1097
935
 
1098
- export function __wbg_new_31a97dac4f10fab7(arg0) {
1099
- const ret = new Date(arg0);
936
+ export function __wbg_new_405e22f390576ce2() {
937
+ const ret = new Object();
1100
938
  return ret;
1101
939
  };
1102
940
 
1103
- export function __wbg_new_405e22f390576ce2() {
1104
- const ret = new Object();
941
+ export function __wbg_new_78feb108b6472713() {
942
+ const ret = new Array();
1105
943
  return ret;
1106
944
  };
1107
945
 
@@ -1259,6 +1097,11 @@ export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
1259
1097
  arg0.set(arg1, arg2 >>> 0);
1260
1098
  };
1261
1099
 
1100
+ export function __wbg_set_bb8cecf6a62b9f46() { return handleError(function (arg0, arg1, arg2) {
1101
+ const ret = Reflect.set(arg0, arg1, arg2);
1102
+ return ret;
1103
+ }, arguments) };
1104
+
1262
1105
  export function __wbg_setbody_5923b78a95eedf29(arg0, arg1) {
1263
1106
  arg0.body = arg1;
1264
1107
  };
@@ -1434,17 +1277,17 @@ export function __wbindgen_cb_drop(arg0) {
1434
1277
  return ret;
1435
1278
  };
1436
1279
 
1437
- export function __wbindgen_closure_wrapper2348(arg0, arg1, arg2) {
1280
+ export function __wbindgen_closure_wrapper2409(arg0, arg1, arg2) {
1438
1281
  const ret = makeMutClosure(arg0, arg1, 102, __wbg_adapter_61);
1439
1282
  return ret;
1440
1283
  };
1441
1284
 
1442
- export function __wbindgen_closure_wrapper2653(arg0, arg1, arg2) {
1285
+ export function __wbindgen_closure_wrapper2706(arg0, arg1, arg2) {
1443
1286
  const ret = makeMutClosure(arg0, arg1, 110, __wbg_adapter_61);
1444
1287
  return ret;
1445
1288
  };
1446
1289
 
1447
- export function __wbindgen_closure_wrapper461(arg0, arg1, arg2) {
1290
+ export function __wbindgen_closure_wrapper472(arg0, arg1, arg2) {
1448
1291
  const ret = makeMutClosure(arg0, arg1, 110, __wbg_adapter_58);
1449
1292
  return ret;
1450
1293
  };
Binary file
@@ -1,48 +1,36 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const file_meta: (a: number) => any;
5
- export const dir_favorited: (a: number) => number;
6
- export const file_uuid: (a: number) => [number, number];
7
- export const __wbg_file_free: (a: number, b: number) => void;
8
- export const __wbg_dir_free: (a: number, b: number) => void;
9
- export const file_favorited: (a: number) => number;
10
- export const file_parent: (a: number) => [number, number];
11
- export const file_size: (a: number) => bigint;
12
- export const dir_color: (a: number) => [number, number];
13
- export const dir_meta: (a: number) => any;
14
- export const dir_parent: (a: number) => [number, number];
15
- export const dir_uuid: (a: number) => [number, number];
16
4
  export const from_serialized: (a: any) => [number, number, number];
17
- export const main_js: () => void;
18
- export const login: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
19
5
  export const __wbg_filenstate_free: (a: number, b: number) => void;
6
+ export const login: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
7
+ export const main_js: () => void;
20
8
  export const filenstate_serialize: (a: number) => any;
21
- export const filenstate_root: (a: number) => number;
22
- export const filenstate_createDir: (a: number, b: number, c: number, d: number) => any;
23
- export const filenstate_listDir: (a: number, b: number) => any;
24
- export const filenstate_dirExists: (a: number, b: number, c: number, d: number) => any;
25
- export const filenstate_findItemInDir: (a: number, b: number, c: number, d: number) => any;
26
- export const filenstate_trashDir: (a: number, b: number) => any;
27
- export const filenstate_deleteDirPermanently: (a: number, b: number) => any;
28
- export const filenstate_downloadFile: (a: number, b: number) => any;
29
- export const filenstate_trashFile: (a: number, b: number) => any;
30
- export const filenstate_uploadFile: (a: number, b: number, c: number, d: number, e: any) => any;
31
- export const filenstate_downloadFileToWriter: (a: number, b: number, c: any) => any;
32
- export const filenstate_uploadFileStream: (a: number, b: number, c: any) => any;
33
- export const filenstate_deleteFilePermanently: (a: number, b: number) => any;
34
- export const __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
35
- export const intounderlyingbytesource_type: (a: number) => number;
36
- export const intounderlyingbytesource_cancel: (a: number) => void;
9
+ export const filenstate_trashDir: (a: number, b: any) => any;
10
+ export const filenstate_listDir: (a: number, b: any) => any;
11
+ export const filenstate_createDir: (a: number, b: any, c: number, d: number) => any;
12
+ export const filenstate_deleteDirPermanently: (a: number, b: any) => any;
13
+ export const filenstate_findItemInDir: (a: number, b: any, c: number, d: number) => any;
14
+ export const filenstate_root: (a: number) => any;
15
+ export const filenstate_dirExists: (a: number, b: any, c: number, d: number) => any;
16
+ export const filenstate_downloadFile: (a: number, b: any) => any;
17
+ export const filenstate_uploadFileStream: (a: number, b: any) => any;
18
+ export const filenstate_trashFile: (a: number, b: any) => any;
19
+ export const filenstate_deleteFilePermanently: (a: number, b: any) => any;
20
+ export const filenstate_downloadFileToWriter: (a: number, b: any) => any;
21
+ export const filenstate_uploadFile: (a: number, b: number, c: number, d: any) => any;
37
22
  export const intounderlyingbytesource_start: (a: number, b: any) => void;
23
+ export const intounderlyingbytesource_type: (a: number) => number;
38
24
  export const intounderlyingbytesource_pull: (a: number, b: any) => any;
25
+ export const intounderlyingbytesource_cancel: (a: number) => void;
26
+ export const __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
39
27
  export const intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
40
- export const intounderlyingsource_pull: (a: number, b: any) => any;
41
28
  export const __wbg_intounderlyingsource_free: (a: number, b: number) => void;
29
+ export const intounderlyingsource_pull: (a: number, b: any) => any;
42
30
  export const intounderlyingsource_cancel: (a: number) => void;
43
- export const intounderlyingsink_close: (a: number) => any;
44
31
  export const __wbg_intounderlyingsink_free: (a: number, b: number) => void;
45
32
  export const intounderlyingsink_abort: (a: number, b: any) => any;
33
+ export const intounderlyingsink_close: (a: number) => any;
46
34
  export const intounderlyingsink_write: (a: number, b: any) => any;
47
35
  export const __wbindgen_malloc: (a: number, b: number) => number;
48
36
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
@@ -53,6 +41,6 @@ export const __wbindgen_free: (a: number, b: number, c: number) => void;
53
41
  export const __wbindgen_export_6: WebAssembly.Table;
54
42
  export const __externref_table_dealloc: (a: number) => void;
55
43
  export const closure109_externref_shim: (a: number, b: number, c: any) => void;
56
- export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h11fe32c58007d6ae: (a: number, b: number) => void;
57
- export const closure83_externref_shim: (a: number, b: number, c: any, d: any) => void;
44
+ export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3a28bb1da68602c0: (a: number, b: number) => void;
45
+ export const closure85_externref_shim: (a: number, b: number, c: any, d: any) => void;
58
46
  export const __wbindgen_start: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filen/sdk-rs",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "Filen WASM SDK using filen-sdk-rs",
5
5
  "type": "module",
6
6
  "scripts": {