libfw-client 0.2.4 → 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.
package/README.md CHANGED
@@ -9,13 +9,12 @@ WASM engine, the File System Access API and IndexedDB.
9
9
  import { LibfwClient } from 'libfw-client';
10
10
 
11
11
  const client = new LibfwClient({
12
- baseUrl: '/', // server origin; the engine derives ws(s)://host/ws
13
- // from it (or set wsUrl explicitly)
14
- concurrency: 4, // max parallel file transfers (one WS connection each)
15
- uploadWindow: 8, // in-flight blocks per single file upload (raise to
12
+ baseUrl: '/', // server origin (same-origin when empty)
13
+ concurrency: 4, // max parallel file transfers (independent HTTP streams)
14
+ uploadWindow: 8, // in-flight chunks per single file upload (raise to
16
15
  // reduce upload stutter on high-latency links)
17
- downloadWindow: 4, // in-flight blocks per single file download (raise to
18
- // reduce download stutter on high-latency links)
16
+ downloadWindow: 4, // parallel byte-range GETs per single file download
17
+ // (raise to reduce download stutter on high-latency links)
19
18
  compress: true, // zrip per-block compression
20
19
  onEvent: (e) => console.log(e), // { type: 'progress', done, total }
21
20
  });
@@ -40,29 +39,32 @@ client.cancel();
40
39
 
41
40
  ## How it works
42
41
 
43
- - **One WebSocket per transfer** — the engine talks to the server over
44
- `ws(s)://…/ws` for **all** control commands (handshake, directory listing,
45
- metadata) and data. Upload and download use the **same** block protocol:
46
- the sender pipelines fixed-size blocks with **no per-block ack** (they may
47
- travel out of order), and the receiver **verifies every block in real time**
48
- (CRC32 + length + bounds), marks bad blocks (`NAK`) and asks the sender to
49
- re-add them to its transfer queue; a wave boundary reconciles until every
50
- block is verified. `downloadWindow`/`uploadWindow` bound the in-flight
51
- blocks per wave (raise them on high-latency links).
52
- - `downloadFolder(token, dirPath?)` / `downloadFile(token, filePath)` the
53
- engine lists (for folders) and downloads each file as a receiver, reorders
54
- out-of-order blocks in memory and pushes `Uint8Array` chunks to the SDK
55
- strictly in order (append-mode `createWritable()`, no `.crswap` churn).
56
- With the File System Access API the SDK streams them to disk via
57
- `fileHandle.createWritable()`; without it (or with `downloadMode: 'browser'`)
58
- the SDK buffers the chunks and saves the result through a traditional
59
- browser download — a single file as-is, a folder packed into a `.zip`.
60
- - `upload(token, files?)` — the engine slices each file into fixed-size
61
- blocks, reads them via `readFile`, compresses each block into one zstd
62
- frame, and sends them over the WebSocket as the sender. Only the blocks the
63
- server still misses are sent (`READY.received` seeds resume), so a
64
- high-latency link stays saturated and interrupted uploads resume
65
- BitTorrent-style (only the broken/lost parts are re-transmitted).
42
+ - **HTTP transport, not WebSocket** — the engine drives all control commands
43
+ (directory listing, metadata) and data over plain HTTP. This is what keeps
44
+ transfers robust on lossy/unstable links: each transfer uses **independent
45
+ parallel HTTP streams**, so a lost packet stalls only that one stream
46
+ (which retries just its own bytes) instead of blocking a whole multiplexed
47
+ WebSocket connection.
48
+ - **Downloads** `downloadFolder(token, dirPath?)` / `downloadFile(token,
49
+ filePath)` list the tree (for folders) and fetch each large file as
50
+ `downloadWindow` concurrent `Range` GETs (tus-style parallel transfer, one
51
+ independent connection per range). Each chunk is retried independently
52
+ (only the lost part is re-fetched); the engine reorders the chunks in
53
+ memory and pushes `Uint8Array`s to the SDK **strictly in order**.
54
+ `Range`/`If-Range`/`416` give natural resume against the server ETag (the
55
+ server is the source of truth). With the File System Access API the SDK
56
+ streams chunks to disk via `fileHandle.createWritable()`; without it (or
57
+ with `downloadMode: 'browser'`) it buffers the chunks and saves the result
58
+ through a traditional browser download — a single file as-is, a folder
59
+ packed into a `.zip`.
60
+ - **Uploads** `upload(token, files?)` slices each file into chunks, reads
61
+ them via `readFile`, compresses each into one zstd frame and POSTs the
62
+ missing chunks concurrently (out of order) with `x-libfw-offset` into a
63
+ shared per-session temp on the server (positional writes). A final
64
+ `x-libfw-final` commit validates the size and atomically renames the temp
65
+ into place. Only the chunks the server still misses are re-sent
66
+ (`x-libfw-session-status` probe seeds resume), so interrupted uploads
67
+ resume BitTorrent-style (only the broken/lost parts are re-transmitted).
66
68
  - Resume state (`etag`, `offset`, `size`) is persisted per path in
67
69
  IndexedDB and re-validated on every retry.
68
70
  - Pause/resume/cancel drive the WASM state machine
@@ -91,16 +93,13 @@ dist/libfw-client.umd.js UMD bundle (after build:umd)
91
93
  ## API
92
94
 
93
95
  - `new LibfwClient(options?)`
94
- - `downloadWindow: number` (default `4`) — in-flight blocks per single file
95
- download (how many blocks the server pipelines per wave before a
96
- reconciliation round); raise it on high-latency links.
97
- - `downloadChunkSize: number` (default `262144`, 256 KiB) — block size for
98
- downloads; the engine reorders out-of-order blocks in memory (worst case
99
- ≈ `downloadWindow * downloadChunkSize` bytes) so the SDK still receives
100
- data in order.
101
- - `wsUrl: string` — explicit WebSocket endpoint (`wss://host/ws`); when
102
- omitted it is derived from `baseUrl` (`http://h:8080` → `ws://h:8080/ws`,
103
- same-origin when empty).
96
+ - `downloadWindow: number` (default `4`) — in-flight byte-range window per
97
+ single file download (how many concurrent `Range` GETs); raise it on
98
+ high-latency links. `1` disables parallelism (sequential downloads).
99
+ - `downloadChunkSize: number` (default `262144`, 256 KiB) — byte range size
100
+ for parallel downloads; the engine reorders in-flight chunks in memory
101
+ (worst case ≈ `downloadWindow * downloadChunkSize` bytes) so the SDK
102
+ still receives data in order.
104
103
  - `downloadMode: 'auto' | 'fs' | 'browser'` (default `'auto'`) — `'fs'`
105
104
  streams downloads through the File System Access API; `'browser'` buffers
106
105
  and triggers a traditional browser download (folders become `.zip`);
package/index.d.ts CHANGED
@@ -51,39 +51,39 @@ export interface LibfwEvent {
51
51
  /** Options accepted by the {@link LibfwClient} constructor. */
52
52
  export interface LibfwClientOptions {
53
53
  /**
54
- * Base URL the libfw server is served from. The engine derives the
55
- * WebSocket endpoint from it (`http://h:8080` `ws://h:8080/ws`);
56
- * same-origin when empty. All control commands and data transfer travel
57
- * over that WebSocket. Default `''`.
54
+ * Base URL the libfw server is served from (same-origin when empty). The
55
+ * engine drives all control commands and data transfer over plain HTTP
56
+ * (parallel `Range` downloads, tus-style chunked uploads) no WebSocket
57
+ * is used. Default `''`.
58
58
  */
59
59
  baseUrl?: string;
60
60
  /** Max concurrently-transferring files. Default `4`. */
61
61
  concurrency?: number;
62
62
  /**
63
- * In-flight block window for a single file's upload, independent of
64
- * `concurrency`. Blocks are pipelined over one WebSocket without per-block
65
- * acknowledgments; this bounds how many are in flight before a
66
- * reconciliation round. A higher value keeps high-latency links saturated.
67
- * Default `8`.
63
+ * In-flight chunk window for a single file's upload, independent of
64
+ * `concurrency`. The missing chunks are POSTed concurrently (out of
65
+ * order) into a shared per-session temp on the server; a higher value
66
+ * keeps high-latency links saturated. Default `8`.
68
67
  */
69
68
  uploadWindow?: number;
70
69
  /**
71
- * In-flight block window for a single file's download. The server
72
- * pipelines up to this many blocks per wave; a higher value keeps
73
- * high-latency links saturated. The engine reorders out-of-order blocks in
74
- * memory (worst case `downloadWindow * downloadChunkSize` bytes) so the
75
- * SDK still receives data strictly in order. Default `4`.
70
+ * In-flight byte-range window for a single file's download. Large files
71
+ * are fetched as `downloadWindow` concurrent `Range` GETs (tus-style
72
+ * parallel transfer), so a single file's throughput is bounded by
73
+ * bandwidth instead of one connection's `chunkSize / RTT`. `1` disables
74
+ * parallelism (sequential downloads). Default `4`.
76
75
  */
77
76
  downloadWindow?: number;
78
77
  /**
79
- * Block size for downloads. The engine reorders in-flight blocks in
80
- * memory (worst case ≈ `downloadWindow * downloadChunkSize` bytes) so the
81
- * SDK still receives data strictly in order. Default `262144` (256 KiB).
78
+ * Byte range size for parallel downloads. The engine reorders in-flight
79
+ * chunks in memory (worst case ≈ `downloadWindow * downloadChunkSize`
80
+ * bytes) so the SDK still receives data strictly in order. Default
81
+ * `262144` (256 KiB).
82
82
  */
83
83
  downloadChunkSize?: number;
84
84
  /** Negotiate zrip compression. Default `true`. */
85
85
  compress?: boolean;
86
- /** Upload block size in bytes. Default 2 MiB. */
86
+ /** Upload chunk size in bytes. Default 2 MiB. */
87
87
  chunkSize?: number;
88
88
  /** Retries per chunk/file before failing. Default `3`. */
89
89
  maxRetries?: number;
@@ -93,11 +93,6 @@ export interface LibfwClientOptions {
93
93
  maxRetryDelayMs?: number;
94
94
  /** Per-read timeout (ms). Default `60000`. */
95
95
  timeoutMs?: number;
96
- /**
97
- * Explicit WebSocket endpoint (e.g. `wss://host/ws`). When omitted it is
98
- * derived from `baseUrl`.
99
- */
100
- wsUrl?: string;
101
96
  /**
102
97
  * Explicit URL of `libfw_client_bg.wasm`. When omitted it is resolved
103
98
  * automatically for both ESM and classic-`<script>`/UMD consumers.
package/index.js CHANGED
@@ -187,10 +187,10 @@ const BUNDLE_SCRIPT_SRC =
187
187
  export class LibfwClient {
188
188
  /**
189
189
  * @param {object} [options]
190
- * @param {string} [options.baseUrl=''] base URL the server is served from. The
191
- * engine derives the WebSocket endpoint from it (e.g. `http://h:8080`
192
- * `ws://h:8080/ws`); same-origin when empty. All control commands
193
- * and data transfer travel over that WebSocket.
190
+ * @param {string} [options.baseUrl=''] base URL the server is served from
191
+ * (same-origin when empty). The engine drives all control commands
192
+ * and data transfer over plain HTTP (parallel `Range` downloads,
193
+ * tus-style chunked uploads) no WebSocket is used.
194
194
  * @param {number} [options.concurrency=4] max concurrently-transferring files
195
195
  * @param {number} [options.uploadWindow=8] in-flight chunk window for a
196
196
  * single file's upload; independent of `concurrency`, keeps a
@@ -213,8 +213,6 @@ export class LibfwClient {
213
213
  * @param {number} [options.baseRetryDelayMs=500] initial backoff (ms)
214
214
  * @param {number} [options.maxRetryDelayMs=30000] backoff ceiling (ms)
215
215
  * @param {number} [options.timeoutMs=60000] per-read timeout (ms)
216
- * @param {string} [options.wsUrl] explicit WebSocket endpoint (e.g.
217
- * `wss://host/ws`); when omitted it is derived from `baseUrl`
218
216
  * @param {string} [options.wasmUrl] explicit URL of `libfw_client_bg.wasm`;
219
217
  * when omitted it is resolved automatically for both ESM and
220
218
  * classic-`<script>`/UMD consumers (see {@link LibfwClient#_wasmUrl})
@@ -245,7 +243,6 @@ export class LibfwClient {
245
243
  baseRetryDelayMs: 500,
246
244
  maxRetryDelayMs: 30000,
247
245
  timeoutMs: 60000,
248
- wsUrl: null,
249
246
  wasmUrl: null,
250
247
  downloadMode: 'auto',
251
248
  maxFallbackBytes: 512 * 1024 * 1024,
@@ -305,7 +302,6 @@ export class LibfwClient {
305
302
  baseRetryDelayMs: this._options.baseRetryDelayMs,
306
303
  maxRetryDelayMs: this._options.maxRetryDelayMs,
307
304
  timeoutMs: this._options.timeoutMs,
308
- wsUrl: this._options.wsUrl,
309
305
  });
310
306
  engine.set_callbacks(this._makeCallbacks());
311
307
  this._engine = engine;
@@ -729,7 +725,20 @@ export class LibfwClient {
729
725
  this._emit({ type: 'fileCompleted', path });
730
726
  return;
731
727
  }
732
- await this._closeWritable(path);
728
+ if (this._writables.has(path)) {
729
+ await this._closeWritable(path);
730
+ } else {
731
+ // No bytes were written this run — either a zero-byte file or a file
732
+ // already fully on disk from a resume. Materialize the target so an
733
+ // empty file still appears on disk. `getFileHandle({ create: true })`
734
+ // only creates a missing file, so an already-complete (resumed) file
735
+ // is never truncated here.
736
+ try {
737
+ await this._ensureFileHandle(path);
738
+ } catch {
739
+ /* best-effort: never fail the transfer on materialization errors */
740
+ }
741
+ }
733
742
  this._emit({ type: 'fileCompleted', path });
734
743
  }
735
744
 
@@ -835,7 +844,13 @@ export class LibfwClient {
835
844
  const offset = Number(state.offset) || 0;
836
845
  if (offset <= 0) return state;
837
846
  const handle = await this._resolveFileHandle(path);
838
- if (!handle) return state; // can't know the on-disk length → trust state
847
+ if (!handle) {
848
+ // No on-disk file to resume from: whatever offset was persisted has
849
+ // nothing behind it. Restart from 0 instead of trusting a stale offset
850
+ // that would make the engine skip the download entirely (producing an
851
+ // empty/missing file while reporting "complete").
852
+ return { ...state, offset: 0, size: 0 };
853
+ }
839
854
  let diskLen = 0;
840
855
  try {
841
856
  diskLen = (await handle.getFile()).size;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libfw-client",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "description": "High-performance streaming file & folder transfer SDK for the browser (libfw WASM engine + File System Access API + IndexedDB resume).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -97,9 +97,6 @@ export interface InitOutput {
97
97
  readonly libfwclient_upload: (a: number, b: number, c: number, d: number, e: number) => any;
98
98
  readonly wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___wasm_bindgen_1e05ddb24c0b7df4___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_1e05ddb24c0b7df4___JsError___true_: (a: number, b: number, c: any) => [number, number];
99
99
  readonly wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___js_sys_bb6c79d0abe11c10___Function_fn_wasm_bindgen_1e05ddb24c0b7df4___JsValue_____wasm_bindgen_1e05ddb24c0b7df4___sys__Undefined___js_sys_bb6c79d0abe11c10___Function_fn_wasm_bindgen_1e05ddb24c0b7df4___JsValue_____wasm_bindgen_1e05ddb24c0b7df4___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
100
- readonly wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true_: (a: number, b: number, c: any) => void;
101
- readonly wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__2: (a: number, b: number, c: any) => void;
102
- readonly wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__3: (a: number, b: number, c: any) => void;
103
100
  readonly __wbindgen_malloc: (a: number, b: number) => number;
104
101
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
105
102
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -231,22 +231,41 @@ function __wbg_get_imports() {
231
231
  const ret = arg0.apply(arg1, arg2);
232
232
  return ret;
233
233
  }, arguments); },
234
- __wbg_bufferedAmount_2f95480ad75d4988: function(arg0) {
235
- const ret = arg0.bufferedAmount;
234
+ __wbg_arrayBuffer_3b637f0fa65c5351: function() { return handleError(function (arg0) {
235
+ const ret = arg0.arrayBuffer();
236
236
  return ret;
237
+ }, arguments); },
238
+ __wbg_body_18c9f2ac15ead4b2: function(arg0) {
239
+ const ret = arg0.body;
240
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
237
241
  },
238
242
  __wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
239
243
  const ret = arg0.call(arg1, arg2);
240
244
  return ret;
241
245
  }, arguments); },
242
- __wbg_data_328de4280640da92: function(arg0) {
243
- const ret = arg0.data;
246
+ __wbg_encodeURIComponent_d0140ae6e13eb27b: function(arg0, arg1) {
247
+ const ret = encodeURIComponent(getStringFromWasm0(arg0, arg1));
248
+ return ret;
249
+ },
250
+ __wbg_fetch_6ecc661950e58d49: function(arg0, arg1) {
251
+ const ret = arg0.fetch(arg1);
244
252
  return ret;
245
253
  },
246
254
  __wbg_from_13e323c65fc8f464: function(arg0) {
247
255
  const ret = Array.from(arg0);
248
256
  return ret;
249
257
  },
258
+ __wbg_getReader_7455d080fa48369b: function(arg0) {
259
+ const ret = arg0.getReader();
260
+ return ret;
261
+ },
262
+ __wbg_get_18e0163e38e5048d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
263
+ const ret = arg1.get(getStringFromWasm0(arg2, arg3));
264
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
265
+ var len1 = WASM_VECTOR_LEN;
266
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
267
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
268
+ }, arguments); },
250
269
  __wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
251
270
  const ret = Reflect.get(arg0, arg1);
252
271
  return ret;
@@ -255,13 +274,10 @@ function __wbg_get_imports() {
255
274
  const ret = arg0[arg1 >>> 0];
256
275
  return ret;
257
276
  },
258
- __wbg_host_21c8d54c9bdcd04a: function() { return handleError(function (arg0, arg1) {
259
- const ret = arg1.host;
260
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
261
- const len1 = WASM_VECTOR_LEN;
262
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
263
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
264
- }, arguments); },
277
+ __wbg_headers_cf9c80f30e2a4eff: function(arg0) {
278
+ const ret = arg0.headers;
279
+ return ret;
280
+ },
265
281
  __wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
266
282
  let result;
267
283
  try {
@@ -300,10 +316,10 @@ function __wbg_get_imports() {
300
316
  const ret = arg0.length;
301
317
  return ret;
302
318
  },
303
- __wbg_location_c9a2271428996698: function(arg0) {
304
- const ret = arg0.location;
319
+ __wbg_new_0d809930cd1354c6: function() { return handleError(function () {
320
+ const ret = new Headers();
305
321
  return ret;
306
- },
322
+ }, arguments); },
307
323
  __wbg_new_32b398fb48b6d94a: function() {
308
324
  const ret = new Array();
309
325
  return ret;
@@ -330,10 +346,6 @@ function __wbg_get_imports() {
330
346
  const ret = new Error(getStringFromWasm0(arg0, arg1));
331
347
  return ret;
332
348
  },
333
- __wbg_new_bf8729ffe10e9ee7: function() { return handleError(function (arg0, arg1) {
334
- const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
335
- return ret;
336
- }, arguments); },
337
349
  __wbg_new_cd45aabdf6073e84: function(arg0) {
338
350
  const ret = new Uint8Array(arg0);
339
351
  return ret;
@@ -364,21 +376,14 @@ function __wbg_get_imports() {
364
376
  state0.a = 0;
365
377
  }
366
378
  },
367
- __wbg_now_86c0d4ba3fa605b8: function() {
368
- const ret = Date.now();
379
+ __wbg_new_with_str_and_init_d95cbe11ce28e65e: function() { return handleError(function (arg0, arg1, arg2) {
380
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
369
381
  return ret;
370
- },
382
+ }, arguments); },
371
383
  __wbg_of_5f1b88183ddb5d94: function(arg0, arg1) {
372
384
  const ret = Array.of(arg0, arg1);
373
385
  return ret;
374
386
  },
375
- __wbg_protocol_0598aef25eb71eae: function() { return handleError(function (arg0, arg1) {
376
- const ret = arg1.protocol;
377
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
378
- const len1 = WASM_VECTOR_LEN;
379
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
380
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
381
- }, arguments); },
382
387
  __wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
383
388
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
384
389
  },
@@ -397,13 +402,14 @@ function __wbg_get_imports() {
397
402
  const ret = Promise.race(arg0);
398
403
  return ret;
399
404
  },
405
+ __wbg_read_8afa15f12a160ef8: function(arg0) {
406
+ const ret = arg0.read();
407
+ return ret;
408
+ },
400
409
  __wbg_resolve_2191a4dfe481c25b: function(arg0) {
401
410
  const ret = Promise.resolve(arg0);
402
411
  return ret;
403
412
  },
404
- __wbg_send_a321b376d40ec867: function() { return handleError(function (arg0, arg1, arg2) {
405
- arg0.send(getArrayU8FromWasm0(arg1, arg2));
406
- }, arguments); },
407
413
  __wbg_setTimeout_725a27c387d005c7: function() { return handleError(function (arg0, arg1, arg2, arg3) {
408
414
  const ret = arg0.setTimeout(arg1, arg2, arg3);
409
415
  return ret;
@@ -412,24 +418,21 @@ function __wbg_get_imports() {
412
418
  const ret = arg0.setTimeout(arg1, arg2);
413
419
  return ret;
414
420
  }, arguments); },
421
+ __wbg_set_0de9c62c23d04ad5: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
422
+ arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
423
+ }, arguments); },
415
424
  __wbg_set_8535240470bf2500: function() { return handleError(function (arg0, arg1, arg2) {
416
425
  const ret = Reflect.set(arg0, arg1, arg2);
417
426
  return ret;
418
427
  }, arguments); },
419
- __wbg_set_binaryType_a37b086c78ca7c29: function(arg0, arg1) {
420
- arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
428
+ __wbg_set_body_029f2d171e0a005f: function(arg0, arg1) {
429
+ arg0.body = arg1;
421
430
  },
422
- __wbg_set_onclose_f706475385ecce07: function(arg0, arg1) {
423
- arg0.onclose = arg1;
431
+ __wbg_set_headers_9c61d123c3ee1f10: function(arg0, arg1) {
432
+ arg0.headers = arg1;
424
433
  },
425
- __wbg_set_onerror_9f5773fd31512333: function(arg0, arg1) {
426
- arg0.onerror = arg1;
427
- },
428
- __wbg_set_onmessage_836d2f72130b4706: function(arg0, arg1) {
429
- arg0.onmessage = arg1;
430
- },
431
- __wbg_set_onopen_4f65470ae522a61a: function(arg0, arg1) {
432
- arg0.onopen = arg1;
434
+ __wbg_set_method_5532d59b92d76467: function(arg0, arg1, arg2) {
435
+ arg0.method = getStringFromWasm0(arg1, arg2);
433
436
  },
434
437
  __wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
435
438
  const ret = typeof global === 'undefined' ? null : global;
@@ -447,6 +450,10 @@ function __wbg_get_imports() {
447
450
  const ret = typeof window === 'undefined' ? null : window;
448
451
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
449
452
  },
453
+ __wbg_status_c45b3b9b3033184a: function(arg0) {
454
+ const ret = arg0.status;
455
+ return ret;
456
+ },
450
457
  __wbg_then_16d107c451e9905d: function(arg0, arg1, arg2) {
451
458
  const ret = arg0.then(arg1, arg2);
452
459
  return ret;
@@ -456,31 +463,16 @@ function __wbg_get_imports() {
456
463
  return ret;
457
464
  },
458
465
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
459
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 151, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
466
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 145, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
460
467
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___wasm_bindgen_1e05ddb24c0b7df4___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_1e05ddb24c0b7df4___JsError___true_);
461
468
  return ret;
462
469
  },
463
- __wbindgen_cast_0000000000000002: function(arg0, arg1) {
464
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 4, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
465
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true_);
466
- return ret;
467
- },
468
- __wbindgen_cast_0000000000000003: function(arg0, arg1) {
469
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 4, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
470
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__2);
471
- return ret;
472
- },
473
- __wbindgen_cast_0000000000000004: function(arg0, arg1) {
474
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 4, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
475
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__3);
476
- return ret;
477
- },
478
- __wbindgen_cast_0000000000000005: function(arg0) {
470
+ __wbindgen_cast_0000000000000002: function(arg0) {
479
471
  // Cast intrinsic for `F64 -> Externref`.
480
472
  const ret = arg0;
481
473
  return ret;
482
474
  },
483
- __wbindgen_cast_0000000000000006: function(arg0, arg1) {
475
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
484
476
  // Cast intrinsic for `Ref(String) -> Externref`.
485
477
  const ret = getStringFromWasm0(arg0, arg1);
486
478
  return ret;
@@ -501,18 +493,6 @@ function __wbg_get_imports() {
501
493
  };
502
494
  }
503
495
 
504
- function wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true_(arg0, arg1, arg2) {
505
- wasm.wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true_(arg0, arg1, arg2);
506
- }
507
-
508
- function wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__2(arg0, arg1, arg2) {
509
- wasm.wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__2(arg0, arg1, arg2);
510
- }
511
-
512
- function wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__3(arg0, arg1, arg2) {
513
- wasm.wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__3(arg0, arg1, arg2);
514
- }
515
-
516
496
  function wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___wasm_bindgen_1e05ddb24c0b7df4___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_1e05ddb24c0b7df4___JsError___true_(arg0, arg1, arg2) {
517
497
  const ret = wasm.wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___wasm_bindgen_1e05ddb24c0b7df4___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_1e05ddb24c0b7df4___JsError___true_(arg0, arg1, arg2);
518
498
  if (ret[1]) {
@@ -524,8 +504,6 @@ function wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___js_sys_b
524
504
  wasm.wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___js_sys_bb6c79d0abe11c10___Function_fn_wasm_bindgen_1e05ddb24c0b7df4___JsValue_____wasm_bindgen_1e05ddb24c0b7df4___sys__Undefined___js_sys_bb6c79d0abe11c10___Function_fn_wasm_bindgen_1e05ddb24c0b7df4___JsValue_____wasm_bindgen_1e05ddb24c0b7df4___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
525
505
  }
526
506
 
527
-
528
- const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
529
507
  const LibfwClientFinalization = (typeof FinalizationRegistry === 'undefined')
530
508
  ? { register: () => {}, unregister: () => {} }
531
509
  : new FinalizationRegistry(ptr => wasm.__wbg_libfwclient_free(ptr, 1));
Binary file
@@ -18,9 +18,6 @@ export const libfwclient_total_bytes: (a: number) => number;
18
18
  export const libfwclient_upload: (a: number, b: number, c: number, d: number, e: number) => any;
19
19
  export const wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___wasm_bindgen_1e05ddb24c0b7df4___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_1e05ddb24c0b7df4___JsError___true_: (a: number, b: number, c: any) => [number, number];
20
20
  export const wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___js_sys_bb6c79d0abe11c10___Function_fn_wasm_bindgen_1e05ddb24c0b7df4___JsValue_____wasm_bindgen_1e05ddb24c0b7df4___sys__Undefined___js_sys_bb6c79d0abe11c10___Function_fn_wasm_bindgen_1e05ddb24c0b7df4___JsValue_____wasm_bindgen_1e05ddb24c0b7df4___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
21
- export const wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true_: (a: number, b: number, c: any) => void;
22
- export const wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__2: (a: number, b: number, c: any) => void;
23
- export const wasm_bindgen_1e05ddb24c0b7df4___convert__closures_____invoke___web_sys_86e1b1c7d411e716___features__gen_CloseEvent__CloseEvent______true__3: (a: number, b: number, c: any) => void;
24
21
  export const __wbindgen_malloc: (a: number, b: number) => number;
25
22
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
26
23
  export const __wbindgen_exn_store: (a: number) => void;
package/pkg/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "libfw-client",
3
3
  "type": "module",
4
4
  "description": "WASM engine + JS SDK for libfw browser clients",
5
- "version": "0.2.4",
5
+ "version": "0.3.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",