@taladb/web 0.10.1 → 0.11.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/LICENSE-MIT +21 -0
- package/package.json +9 -3
- package/pkg/LICENSE-APACHE +202 -0
- package/pkg/LICENSE-MIT +21 -0
- package/pkg/package.json +8 -3
- package/pkg/taladb_web.d.ts +71 -159
- package/pkg/taladb_web.js +78 -442
- package/pkg/taladb_web_bg.wasm +0 -0
- package/pkg/taladb_web_bg.wasm.d.ts +46 -58
- package/worker/taladb.worker.js +429 -175
- /package/{LICENSE → LICENSE-APACHE} +0 -0
package/pkg/taladb_web.js
CHANGED
|
@@ -118,21 +118,6 @@ export class CollectionWasm {
|
|
|
118
118
|
}
|
|
119
119
|
return ret[0] >>> 0;
|
|
120
120
|
}
|
|
121
|
-
/**
|
|
122
|
-
* Delete many documents by id, in one commit. Returns the number removed.
|
|
123
|
-
* @param {any} ids
|
|
124
|
-
* @param {string} origin
|
|
125
|
-
* @returns {number}
|
|
126
|
-
*/
|
|
127
|
-
deleteManyWithIds(ids, origin) {
|
|
128
|
-
const ptr0 = passStringToWasm0(origin, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
129
|
-
const len0 = WASM_VECTOR_LEN;
|
|
130
|
-
const ret = wasm.collectionwasm_deleteManyWithIds(this.__wbg_ptr, ids, ptr0, len0);
|
|
131
|
-
if (ret[2]) {
|
|
132
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
133
|
-
}
|
|
134
|
-
return ret[0] >>> 0;
|
|
135
|
-
}
|
|
136
121
|
/**
|
|
137
122
|
* Delete the first matching document. Returns true if deleted.
|
|
138
123
|
* @param {any} filter
|
|
@@ -306,29 +291,6 @@ export class CollectionWasm {
|
|
|
306
291
|
}
|
|
307
292
|
return takeFromExternrefTable0(ret[0]);
|
|
308
293
|
}
|
|
309
|
-
/**
|
|
310
|
-
* Upsert many documents **by caller-supplied `_id`**, in one commit.
|
|
311
|
-
*
|
|
312
|
-
* Unlike [`Self::insert_many`] — which mints a fresh ULID and discards `_id` —
|
|
313
|
-
* this honours the id on each document, which is what lets replication address
|
|
314
|
-
* a remote row by a *derived* id so repeated fetches converge on one document
|
|
315
|
-
* instead of duplicating it.
|
|
316
|
-
*
|
|
317
|
-
* `origin` is `"remote"` for authoritative rows replicated in from an origin,
|
|
318
|
-
* or `"local"` for ordinary user writes.
|
|
319
|
-
* @param {any} docs
|
|
320
|
-
* @param {string} origin
|
|
321
|
-
* @returns {any}
|
|
322
|
-
*/
|
|
323
|
-
replaceManyWithIds(docs, origin) {
|
|
324
|
-
const ptr0 = passStringToWasm0(origin, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
325
|
-
const len0 = WASM_VECTOR_LEN;
|
|
326
|
-
const ret = wasm.collectionwasm_replaceManyWithIds(this.__wbg_ptr, docs, ptr0, len0);
|
|
327
|
-
if (ret[2]) {
|
|
328
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
329
|
-
}
|
|
330
|
-
return takeFromExternrefTable0(ret[0]);
|
|
331
|
-
}
|
|
332
294
|
/**
|
|
333
295
|
* Rank documents against a free-text query using BM25 (OR semantics).
|
|
334
296
|
*
|
|
@@ -424,34 +386,6 @@ export class TalaDBWasm {
|
|
|
424
386
|
}
|
|
425
387
|
return CollectionWasm.__wrap(ret[0]);
|
|
426
388
|
}
|
|
427
|
-
/**
|
|
428
|
-
* Export changes to `collections` after `sinceMs` (exclusive) as a JSON
|
|
429
|
-
* changeset string, for bidirectional sync. `sinceMs` is a millisecond
|
|
430
|
-
* epoch timestamp (the persisted sync cursor).
|
|
431
|
-
* @param {number} since_ms
|
|
432
|
-
* @param {string[]} collections
|
|
433
|
-
* @returns {string}
|
|
434
|
-
*/
|
|
435
|
-
exportChanges(since_ms, collections) {
|
|
436
|
-
let deferred3_0;
|
|
437
|
-
let deferred3_1;
|
|
438
|
-
try {
|
|
439
|
-
const ptr0 = passArrayJsValueToWasm0(collections, wasm.__wbindgen_malloc);
|
|
440
|
-
const len0 = WASM_VECTOR_LEN;
|
|
441
|
-
const ret = wasm.taladbwasm_exportChanges(this.__wbg_ptr, since_ms, ptr0, len0);
|
|
442
|
-
var ptr2 = ret[0];
|
|
443
|
-
var len2 = ret[1];
|
|
444
|
-
if (ret[3]) {
|
|
445
|
-
ptr2 = 0; len2 = 0;
|
|
446
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
447
|
-
}
|
|
448
|
-
deferred3_0 = ptr2;
|
|
449
|
-
deferred3_1 = len2;
|
|
450
|
-
return getStringFromWasm0(ptr2, len2);
|
|
451
|
-
} finally {
|
|
452
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
389
|
/**
|
|
456
390
|
* Serialize the entire in-memory database to bytes.
|
|
457
391
|
*
|
|
@@ -469,24 +403,8 @@ export class TalaDBWasm {
|
|
|
469
403
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
470
404
|
return v1;
|
|
471
405
|
}
|
|
472
|
-
/**
|
|
473
|
-
* Merge a JSON changeset string (from a remote peer) into the local
|
|
474
|
-
* database via Last-Write-Wins. Returns the number of documents changed.
|
|
475
|
-
* @param {string} changeset_json
|
|
476
|
-
* @returns {number}
|
|
477
|
-
*/
|
|
478
|
-
importChanges(changeset_json) {
|
|
479
|
-
const ptr0 = passStringToWasm0(changeset_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
480
|
-
const len0 = WASM_VECTOR_LEN;
|
|
481
|
-
const ret = wasm.taladbwasm_importChanges(this.__wbg_ptr, ptr0, len0);
|
|
482
|
-
if (ret[2]) {
|
|
483
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
484
|
-
}
|
|
485
|
-
return ret[0] >>> 0;
|
|
486
|
-
}
|
|
487
406
|
/**
|
|
488
407
|
* User collection names (reserved `_`-prefixed collections excluded).
|
|
489
|
-
* Backs the sync orchestration's "sync all collections" default.
|
|
490
408
|
* @returns {string[]}
|
|
491
409
|
*/
|
|
492
410
|
listCollectionNames() {
|
|
@@ -623,31 +541,6 @@ export class WorkerDB {
|
|
|
623
541
|
throw takeFromExternrefTable0(ret[0]);
|
|
624
542
|
}
|
|
625
543
|
}
|
|
626
|
-
/**
|
|
627
|
-
* Remove tombstones older than `before_ms` from the given collection.
|
|
628
|
-
*
|
|
629
|
-
* Call periodically (e.g. on app startup) after your sync retention window
|
|
630
|
-
* has elapsed so deleted document IDs no longer accumulate indefinitely.
|
|
631
|
-
* Returns the number of tombstones removed.
|
|
632
|
-
*
|
|
633
|
-
* ```js
|
|
634
|
-
* // Prune tombstones older than 30 days
|
|
635
|
-
* const cutoff = Date.now() - 30 * 24 * 60 * 60 * 1000;
|
|
636
|
-
* const pruned = db.compactTombstones('users', cutoff);
|
|
637
|
-
* ```
|
|
638
|
-
* @param {string} collection
|
|
639
|
-
* @param {number} before_ms
|
|
640
|
-
* @returns {number}
|
|
641
|
-
*/
|
|
642
|
-
compactTombstones(collection, before_ms) {
|
|
643
|
-
const ptr0 = passStringToWasm0(collection, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
644
|
-
const len0 = WASM_VECTOR_LEN;
|
|
645
|
-
const ret = wasm.workerdb_compactTombstones(this.__wbg_ptr, ptr0, len0, before_ms);
|
|
646
|
-
if (ret[2]) {
|
|
647
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
648
|
-
}
|
|
649
|
-
return ret[0] >>> 0;
|
|
650
|
-
}
|
|
651
544
|
/**
|
|
652
545
|
* Count matching documents.
|
|
653
546
|
* @param {string} collection
|
|
@@ -755,20 +648,18 @@ export class WorkerDB {
|
|
|
755
648
|
return ret[0] >>> 0;
|
|
756
649
|
}
|
|
757
650
|
/**
|
|
758
|
-
* Delete
|
|
651
|
+
* Delete documents by id. Returns how many were present and removed.
|
|
652
|
+
* The delete half of cross-tab write propagation.
|
|
759
653
|
* @param {string} collection
|
|
760
654
|
* @param {string} ids_json
|
|
761
|
-
* @param {string} origin
|
|
762
655
|
* @returns {number}
|
|
763
656
|
*/
|
|
764
|
-
deleteManyWithIds(collection, ids_json
|
|
657
|
+
deleteManyWithIds(collection, ids_json) {
|
|
765
658
|
const ptr0 = passStringToWasm0(collection, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
766
659
|
const len0 = WASM_VECTOR_LEN;
|
|
767
660
|
const ptr1 = passStringToWasm0(ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
768
661
|
const len1 = WASM_VECTOR_LEN;
|
|
769
|
-
const
|
|
770
|
-
const len2 = WASM_VECTOR_LEN;
|
|
771
|
-
const ret = wasm.workerdb_deleteManyWithIds(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
662
|
+
const ret = wasm.workerdb_deleteManyWithIds(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
772
663
|
if (ret[2]) {
|
|
773
664
|
throw takeFromExternrefTable0(ret[1]);
|
|
774
665
|
}
|
|
@@ -849,40 +740,6 @@ export class WorkerDB {
|
|
|
849
740
|
throw takeFromExternrefTable0(ret[0]);
|
|
850
741
|
}
|
|
851
742
|
}
|
|
852
|
-
/**
|
|
853
|
-
* Export a changeset for the given collections since `since_ms`.
|
|
854
|
-
*
|
|
855
|
-
* Returns a JSON string representing `Vec<Change>` that can be sent
|
|
856
|
-
* to a remote peer via fetch, WebSocket, or SSE.
|
|
857
|
-
*
|
|
858
|
-
* ```js
|
|
859
|
-
* const json = db.exportChangeset(JSON.stringify(['users', 'posts']), 0);
|
|
860
|
-
* await fetch('/sync', { method: 'POST', body: json });
|
|
861
|
-
* ```
|
|
862
|
-
* @param {string} collections_json
|
|
863
|
-
* @param {number} since_ms
|
|
864
|
-
* @returns {string}
|
|
865
|
-
*/
|
|
866
|
-
exportChangeset(collections_json, since_ms) {
|
|
867
|
-
let deferred3_0;
|
|
868
|
-
let deferred3_1;
|
|
869
|
-
try {
|
|
870
|
-
const ptr0 = passStringToWasm0(collections_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
871
|
-
const len0 = WASM_VECTOR_LEN;
|
|
872
|
-
const ret = wasm.workerdb_exportChangeset(this.__wbg_ptr, ptr0, len0, since_ms);
|
|
873
|
-
var ptr2 = ret[0];
|
|
874
|
-
var len2 = ret[1];
|
|
875
|
-
if (ret[3]) {
|
|
876
|
-
ptr2 = 0; len2 = 0;
|
|
877
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
878
|
-
}
|
|
879
|
-
deferred3_0 = ptr2;
|
|
880
|
-
deferred3_1 = len2;
|
|
881
|
-
return getStringFromWasm0(ptr2, len2);
|
|
882
|
-
} finally {
|
|
883
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
743
|
/**
|
|
887
744
|
* Serialize the entire in-memory database to bytes for persistence.
|
|
888
745
|
*
|
|
@@ -1048,60 +905,6 @@ export class WorkerDB {
|
|
|
1048
905
|
wasm.__wbindgen_free(deferred9_0, deferred9_1, 1);
|
|
1049
906
|
}
|
|
1050
907
|
}
|
|
1051
|
-
/**
|
|
1052
|
-
* Import a remote changeset and merge it into the local database using
|
|
1053
|
-
* Last-Write-Wins conflict resolution.
|
|
1054
|
-
*
|
|
1055
|
-
* Returns the number of documents actually changed.
|
|
1056
|
-
*
|
|
1057
|
-
* ```js
|
|
1058
|
-
* const resp = await fetch('/sync?since=' + lastSync);
|
|
1059
|
-
* const applied = db.importChangeset(await resp.text());
|
|
1060
|
-
* if (applied > 0) { rerender(); }
|
|
1061
|
-
* ```
|
|
1062
|
-
* @param {string} changeset_json
|
|
1063
|
-
* @returns {number}
|
|
1064
|
-
*/
|
|
1065
|
-
importChangeset(changeset_json) {
|
|
1066
|
-
const ptr0 = passStringToWasm0(changeset_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1067
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1068
|
-
const ret = wasm.workerdb_importChangeset(this.__wbg_ptr, ptr0, len0);
|
|
1069
|
-
if (ret[2]) {
|
|
1070
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1071
|
-
}
|
|
1072
|
-
return ret[0] >>> 0;
|
|
1073
|
-
}
|
|
1074
|
-
/**
|
|
1075
|
-
* Import a remote changeset through a tolerant structural validator built
|
|
1076
|
-
* from `schemas_json` (`{ "<collection>": { version, required, types,
|
|
1077
|
-
* defaults } }`). Returns a JSON `{ applied, skipped, quarantined }`.
|
|
1078
|
-
* Rejected documents are set aside (see `quarantined`), never dropped.
|
|
1079
|
-
* @param {string} changeset_json
|
|
1080
|
-
* @param {string} schemas_json
|
|
1081
|
-
* @returns {string}
|
|
1082
|
-
*/
|
|
1083
|
-
importChangesetValidated(changeset_json, schemas_json) {
|
|
1084
|
-
let deferred4_0;
|
|
1085
|
-
let deferred4_1;
|
|
1086
|
-
try {
|
|
1087
|
-
const ptr0 = passStringToWasm0(changeset_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1088
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1089
|
-
const ptr1 = passStringToWasm0(schemas_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1090
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1091
|
-
const ret = wasm.workerdb_importChangesetValidated(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1092
|
-
var ptr3 = ret[0];
|
|
1093
|
-
var len3 = ret[1];
|
|
1094
|
-
if (ret[3]) {
|
|
1095
|
-
ptr3 = 0; len3 = 0;
|
|
1096
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
1097
|
-
}
|
|
1098
|
-
deferred4_0 = ptr3;
|
|
1099
|
-
deferred4_1 = len3;
|
|
1100
|
-
return getStringFromWasm0(ptr3, len3);
|
|
1101
|
-
} finally {
|
|
1102
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
908
|
/**
|
|
1106
909
|
* Insert a document. Returns the new ULID as a string.
|
|
1107
910
|
* @param {string} collection
|
|
@@ -1160,7 +963,6 @@ export class WorkerDB {
|
|
|
1160
963
|
}
|
|
1161
964
|
/**
|
|
1162
965
|
* Returns a JSON array of all collection names in the database.
|
|
1163
|
-
* Used by the Worker to build the collections list for exportChangeset.
|
|
1164
966
|
* @returns {string}
|
|
1165
967
|
*/
|
|
1166
968
|
listCollections() {
|
|
@@ -1221,8 +1023,6 @@ export class WorkerDB {
|
|
|
1221
1023
|
/**
|
|
1222
1024
|
* Open a database backed by OPFS with HTTP push sync config.
|
|
1223
1025
|
*
|
|
1224
|
-
* Not available when compiled with the `cf-workers` feature.
|
|
1225
|
-
*
|
|
1226
1026
|
* `config_json` - JSON-serialised `TalaDbConfig`, or `null` to open without sync.
|
|
1227
1027
|
*
|
|
1228
1028
|
* ```js
|
|
@@ -1274,8 +1074,6 @@ export class WorkerDB {
|
|
|
1274
1074
|
/**
|
|
1275
1075
|
* Open a database backed by an OPFS `FileSystemSyncAccessHandle`.
|
|
1276
1076
|
*
|
|
1277
|
-
* Not available when compiled with the `cf-workers` feature.
|
|
1278
|
-
*
|
|
1279
1077
|
* Call sequence in the SharedWorker:
|
|
1280
1078
|
* ```js
|
|
1281
1079
|
* const handle = await file_handle.createSyncAccessHandle();
|
|
@@ -1313,72 +1111,6 @@ export class WorkerDB {
|
|
|
1313
1111
|
}
|
|
1314
1112
|
return WorkerDB.__wrap(ret[0]);
|
|
1315
1113
|
}
|
|
1316
|
-
/**
|
|
1317
|
-
* Documents set aside in `collection`'s quarantine table, as a JSON array
|
|
1318
|
-
* of `{ document, reason, changedAt }`.
|
|
1319
|
-
* @param {string} collection
|
|
1320
|
-
* @returns {string}
|
|
1321
|
-
*/
|
|
1322
|
-
quarantined(collection) {
|
|
1323
|
-
let deferred3_0;
|
|
1324
|
-
let deferred3_1;
|
|
1325
|
-
try {
|
|
1326
|
-
const ptr0 = passStringToWasm0(collection, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1327
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1328
|
-
const ret = wasm.workerdb_quarantined(this.__wbg_ptr, ptr0, len0);
|
|
1329
|
-
var ptr2 = ret[0];
|
|
1330
|
-
var len2 = ret[1];
|
|
1331
|
-
if (ret[3]) {
|
|
1332
|
-
ptr2 = 0; len2 = 0;
|
|
1333
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
1334
|
-
}
|
|
1335
|
-
deferred3_0 = ptr2;
|
|
1336
|
-
deferred3_1 = len2;
|
|
1337
|
-
return getStringFromWasm0(ptr2, len2);
|
|
1338
|
-
} finally {
|
|
1339
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
/**
|
|
1343
|
-
* Upsert many documents **by caller-supplied `_id`**, in one commit.
|
|
1344
|
-
*
|
|
1345
|
-
* Unlike `insert_many` — which discards `_id` and mints a fresh ULID — this
|
|
1346
|
-
* honours the id in each document. That is what lets the replication
|
|
1347
|
-
* coordinator address a remote row by a *derived* id (see `deriveDocId`) and
|
|
1348
|
-
* have repeated fetches converge on one document instead of duplicating it.
|
|
1349
|
-
*
|
|
1350
|
-
* `origin` is `"remote"` for authoritative rows replicated in from an origin,
|
|
1351
|
-
* or `"local"` for ordinary user writes. Remote rows are marked so they can
|
|
1352
|
-
* never replicate back out — see `Collection::replace_many_with_ids`.
|
|
1353
|
-
* @param {string} collection
|
|
1354
|
-
* @param {string} docs_json
|
|
1355
|
-
* @param {string} origin
|
|
1356
|
-
* @returns {string}
|
|
1357
|
-
*/
|
|
1358
|
-
replaceManyWithIds(collection, docs_json, origin) {
|
|
1359
|
-
let deferred5_0;
|
|
1360
|
-
let deferred5_1;
|
|
1361
|
-
try {
|
|
1362
|
-
const ptr0 = passStringToWasm0(collection, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1363
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1364
|
-
const ptr1 = passStringToWasm0(docs_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1365
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1366
|
-
const ptr2 = passStringToWasm0(origin, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1367
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1368
|
-
const ret = wasm.workerdb_replaceManyWithIds(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1369
|
-
var ptr4 = ret[0];
|
|
1370
|
-
var len4 = ret[1];
|
|
1371
|
-
if (ret[3]) {
|
|
1372
|
-
ptr4 = 0; len4 = 0;
|
|
1373
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
1374
|
-
}
|
|
1375
|
-
deferred5_0 = ptr4;
|
|
1376
|
-
deferred5_1 = len4;
|
|
1377
|
-
return getStringFromWasm0(ptr4, len4);
|
|
1378
|
-
} finally {
|
|
1379
|
-
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
1114
|
/**
|
|
1383
1115
|
* Rank documents against a free-text query using BM25 (OR semantics).
|
|
1384
1116
|
*
|
|
@@ -1439,28 +1171,6 @@ export class WorkerDB {
|
|
|
1439
1171
|
throw takeFromExternrefTable0(ret[0]);
|
|
1440
1172
|
}
|
|
1441
1173
|
}
|
|
1442
|
-
/**
|
|
1443
|
-
* @returns {bigint}
|
|
1444
|
-
*/
|
|
1445
|
-
syncPending() {
|
|
1446
|
-
const ret = wasm.workerdb_syncPending(this.__wbg_ptr);
|
|
1447
|
-
return BigInt.asUintN(64, ret);
|
|
1448
|
-
}
|
|
1449
|
-
/**
|
|
1450
|
-
* @returns {string}
|
|
1451
|
-
*/
|
|
1452
|
-
syncStatus() {
|
|
1453
|
-
let deferred1_0;
|
|
1454
|
-
let deferred1_1;
|
|
1455
|
-
try {
|
|
1456
|
-
const ret = wasm.workerdb_syncStatus(this.__wbg_ptr);
|
|
1457
|
-
deferred1_0 = ret[0];
|
|
1458
|
-
deferred1_1 = ret[1];
|
|
1459
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1460
|
-
} finally {
|
|
1461
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1462
|
-
}
|
|
1463
|
-
}
|
|
1464
1174
|
/**
|
|
1465
1175
|
* Update all matching documents. Returns the count updated.
|
|
1466
1176
|
* @param {string} collection
|
|
@@ -1519,6 +1229,43 @@ export class WorkerDB {
|
|
|
1519
1229
|
throw takeFromExternrefTable0(ret[0]);
|
|
1520
1230
|
}
|
|
1521
1231
|
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Upsert documents **by their own `_id`**, in one commit per document.
|
|
1234
|
+
*
|
|
1235
|
+
* Backs cross-tab write propagation: a tab that cannot hold the OPFS lock
|
|
1236
|
+
* writes to an in-memory database, then forwards the committed documents
|
|
1237
|
+
* here so the tab holding the lock applies them to the durable file. The
|
|
1238
|
+
* `_id`s travel with the documents, so an id an application already holds
|
|
1239
|
+
* stays valid after the hand-off — which a plain re-`insert` would break by
|
|
1240
|
+
* minting a new ULID.
|
|
1241
|
+
*
|
|
1242
|
+
* Unlike `insert_many`, a caller-supplied `_id` is required, not ignored.
|
|
1243
|
+
* @param {string} collection
|
|
1244
|
+
* @param {string} docs_json
|
|
1245
|
+
* @returns {string}
|
|
1246
|
+
*/
|
|
1247
|
+
upsertManyWithIds(collection, docs_json) {
|
|
1248
|
+
let deferred4_0;
|
|
1249
|
+
let deferred4_1;
|
|
1250
|
+
try {
|
|
1251
|
+
const ptr0 = passStringToWasm0(collection, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1252
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1253
|
+
const ptr1 = passStringToWasm0(docs_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1254
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1255
|
+
const ret = wasm.workerdb_upsertManyWithIds(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1256
|
+
var ptr3 = ret[0];
|
|
1257
|
+
var len3 = ret[1];
|
|
1258
|
+
if (ret[3]) {
|
|
1259
|
+
ptr3 = 0; len3 = 0;
|
|
1260
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1261
|
+
}
|
|
1262
|
+
deferred4_0 = ptr3;
|
|
1263
|
+
deferred4_1 = len3;
|
|
1264
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1265
|
+
} finally {
|
|
1266
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1522
1269
|
/**
|
|
1523
1270
|
* Read the current application migration version (0 if never set). Backs
|
|
1524
1271
|
* the `openDB({ migrations })` runner, which advances it per migration.
|
|
@@ -1531,6 +1278,25 @@ export class WorkerDB {
|
|
|
1531
1278
|
}
|
|
1532
1279
|
return ret[0] >>> 0;
|
|
1533
1280
|
}
|
|
1281
|
+
/**
|
|
1282
|
+
* This collection's write generation — a counter bumped once per committed
|
|
1283
|
+
* mutation.
|
|
1284
|
+
*
|
|
1285
|
+
* Backs `subscribe()`: a live query can compare one integer per tick
|
|
1286
|
+
* instead of re-running the query and `JSON.stringify`-ing the whole
|
|
1287
|
+
* result set to see whether anything moved.
|
|
1288
|
+
* @param {string} collection
|
|
1289
|
+
* @returns {number}
|
|
1290
|
+
*/
|
|
1291
|
+
writeGeneration(collection) {
|
|
1292
|
+
const ptr0 = passStringToWasm0(collection, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1293
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1294
|
+
const ret = wasm.workerdb_writeGeneration(this.__wbg_ptr, ptr0, len0);
|
|
1295
|
+
if (ret[2]) {
|
|
1296
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1297
|
+
}
|
|
1298
|
+
return ret[0];
|
|
1299
|
+
}
|
|
1534
1300
|
}
|
|
1535
1301
|
if (Symbol.dispose) WorkerDB.prototype[Symbol.dispose] = WorkerDB.prototype.free;
|
|
1536
1302
|
|
|
@@ -1726,23 +1492,10 @@ function __wbg_get_imports() {
|
|
|
1726
1492
|
__wbg__wbg_cb_unref_6b5b6b8576d35cb1: function(arg0) {
|
|
1727
1493
|
arg0._wbg_cb_unref();
|
|
1728
1494
|
},
|
|
1729
|
-
__wbg_abort_5ef96933660780b7: function(arg0) {
|
|
1730
|
-
arg0.abort();
|
|
1731
|
-
},
|
|
1732
|
-
__wbg_abort_6479c2d794ebf2ee: function(arg0, arg1) {
|
|
1733
|
-
arg0.abort(arg1);
|
|
1734
|
-
},
|
|
1735
|
-
__wbg_append_608dfb635ee8998f: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1736
|
-
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
1737
|
-
}, arguments); },
|
|
1738
1495
|
__wbg_apply_ac9afb97ca32f169: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1739
1496
|
const ret = arg0.apply(arg1, arg2);
|
|
1740
1497
|
return ret;
|
|
1741
1498
|
}, arguments); },
|
|
1742
|
-
__wbg_apply_d7728efbea08f95e: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1743
|
-
const ret = Reflect.apply(arg0, arg1, arg2);
|
|
1744
|
-
return ret;
|
|
1745
|
-
}, arguments); },
|
|
1746
1499
|
__wbg_arrayBuffer_7ff5e58aa85a64f7: function(arg0) {
|
|
1747
1500
|
const ret = arg0.arrayBuffer();
|
|
1748
1501
|
return ret;
|
|
@@ -1759,10 +1512,6 @@ function __wbg_get_imports() {
|
|
|
1759
1512
|
const ret = arg0.call(arg1);
|
|
1760
1513
|
return ret;
|
|
1761
1514
|
}, arguments); },
|
|
1762
|
-
__wbg_clearTimeout_6b8d9a38b9263d65: function(arg0) {
|
|
1763
|
-
const ret = clearTimeout(arg0);
|
|
1764
|
-
return ret;
|
|
1765
|
-
},
|
|
1766
1515
|
__wbg_close_8b24f0978d9a4917: function(arg0) {
|
|
1767
1516
|
const ret = arg0.close();
|
|
1768
1517
|
return ret;
|
|
@@ -1794,14 +1543,6 @@ function __wbg_get_imports() {
|
|
|
1794
1543
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1795
1544
|
}
|
|
1796
1545
|
},
|
|
1797
|
-
__wbg_fetch_5550a88cf343aaa9: function(arg0, arg1) {
|
|
1798
|
-
const ret = arg0.fetch(arg1);
|
|
1799
|
-
return ret;
|
|
1800
|
-
},
|
|
1801
|
-
__wbg_fetch_9dad4fe911207b37: function(arg0) {
|
|
1802
|
-
const ret = fetch(arg0);
|
|
1803
|
-
return ret;
|
|
1804
|
-
},
|
|
1805
1546
|
__wbg_flush_1eca046e0ff7c399: function() { return handleError(function (arg0) {
|
|
1806
1547
|
arg0.flush();
|
|
1807
1548
|
}, arguments); },
|
|
@@ -1847,14 +1588,6 @@ function __wbg_get_imports() {
|
|
|
1847
1588
|
const ret = arg0[arg1 >>> 0];
|
|
1848
1589
|
return ret;
|
|
1849
1590
|
},
|
|
1850
|
-
__wbg_has_926ef2ff40b308cf: function() { return handleError(function (arg0, arg1) {
|
|
1851
|
-
const ret = Reflect.has(arg0, arg1);
|
|
1852
|
-
return ret;
|
|
1853
|
-
}, arguments); },
|
|
1854
|
-
__wbg_headers_eb2234545f9ff993: function(arg0) {
|
|
1855
|
-
const ret = arg0.headers;
|
|
1856
|
-
return ret;
|
|
1857
|
-
},
|
|
1858
1591
|
__wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
|
|
1859
1592
|
let result;
|
|
1860
1593
|
try {
|
|
@@ -1935,16 +1668,6 @@ function __wbg_get_imports() {
|
|
|
1935
1668
|
const ret = result;
|
|
1936
1669
|
return ret;
|
|
1937
1670
|
},
|
|
1938
|
-
__wbg_instanceof_Response_9b4d9fd451e051b1: function(arg0) {
|
|
1939
|
-
let result;
|
|
1940
|
-
try {
|
|
1941
|
-
result = arg0 instanceof Response;
|
|
1942
|
-
} catch (_) {
|
|
1943
|
-
result = false;
|
|
1944
|
-
}
|
|
1945
|
-
const ret = result;
|
|
1946
|
-
return ret;
|
|
1947
|
-
},
|
|
1948
1671
|
__wbg_instanceof_Uint8Array_740438561a5b956d: function(arg0) {
|
|
1949
1672
|
let result;
|
|
1950
1673
|
try {
|
|
@@ -1993,10 +1716,6 @@ function __wbg_get_imports() {
|
|
|
1993
1716
|
const ret = arg0.navigator;
|
|
1994
1717
|
return ret;
|
|
1995
1718
|
},
|
|
1996
|
-
__wbg_new_0837727332ac86ba: function() { return handleError(function () {
|
|
1997
|
-
const ret = new Headers();
|
|
1998
|
-
return ret;
|
|
1999
|
-
}, arguments); },
|
|
2000
1719
|
__wbg_new_227d7c05414eb861: function() {
|
|
2001
1720
|
const ret = new Error();
|
|
2002
1721
|
return ret;
|
|
@@ -2017,10 +1736,6 @@ function __wbg_get_imports() {
|
|
|
2017
1736
|
const ret = new Object();
|
|
2018
1737
|
return ret;
|
|
2019
1738
|
},
|
|
2020
|
-
__wbg_new_c518c60af666645b: function() { return handleError(function () {
|
|
2021
|
-
const ret = new AbortController();
|
|
2022
|
-
return ret;
|
|
2023
|
-
}, arguments); },
|
|
2024
1739
|
__wbg_new_d098e265629cd10f: function(arg0, arg1) {
|
|
2025
1740
|
try {
|
|
2026
1741
|
var state0 = {a: arg0, b: arg1};
|
|
@@ -2028,7 +1743,7 @@ function __wbg_get_imports() {
|
|
|
2028
1743
|
const a = state0.a;
|
|
2029
1744
|
state0.a = 0;
|
|
2030
1745
|
try {
|
|
2031
|
-
return
|
|
1746
|
+
return wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
2032
1747
|
} finally {
|
|
2033
1748
|
state0.a = a;
|
|
2034
1749
|
}
|
|
@@ -2050,7 +1765,7 @@ function __wbg_get_imports() {
|
|
|
2050
1765
|
const a = state0.a;
|
|
2051
1766
|
state0.a = 0;
|
|
2052
1767
|
try {
|
|
2053
|
-
return
|
|
1768
|
+
return wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
2054
1769
|
} finally {
|
|
2055
1770
|
state0.a = a;
|
|
2056
1771
|
}
|
|
@@ -2065,10 +1780,6 @@ function __wbg_get_imports() {
|
|
|
2065
1780
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
2066
1781
|
return ret;
|
|
2067
1782
|
},
|
|
2068
|
-
__wbg_new_with_str_and_init_b4b54d1a819bc724: function() { return handleError(function (arg0, arg1, arg2) {
|
|
2069
|
-
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
2070
|
-
return ret;
|
|
2071
|
-
}, arguments); },
|
|
2072
1783
|
__wbg_next_11b99ee6237339e3: function() { return handleError(function (arg0) {
|
|
2073
1784
|
const ret = arg0.next();
|
|
2074
1785
|
return ret;
|
|
@@ -2085,10 +1796,6 @@ function __wbg_get_imports() {
|
|
|
2085
1796
|
const ret = Date.now();
|
|
2086
1797
|
return ret;
|
|
2087
1798
|
},
|
|
2088
|
-
__wbg_of_d6376e3774c51f89: function(arg0, arg1) {
|
|
2089
|
-
const ret = Array.of(arg0, arg1);
|
|
2090
|
-
return ret;
|
|
2091
|
-
},
|
|
2092
1799
|
__wbg_process_44c7a14e11e9f69e: function(arg0) {
|
|
2093
1800
|
const ret = arg0.process;
|
|
2094
1801
|
return ret;
|
|
@@ -2122,10 +1829,6 @@ function __wbg_get_imports() {
|
|
|
2122
1829
|
const ret = Promise.resolve(arg0);
|
|
2123
1830
|
return ret;
|
|
2124
1831
|
},
|
|
2125
|
-
__wbg_setTimeout_f757f00851f76c42: function(arg0, arg1) {
|
|
2126
|
-
const ret = setTimeout(arg0, arg1);
|
|
2127
|
-
return ret;
|
|
2128
|
-
},
|
|
2129
1832
|
__wbg_set_282384002438957f: function(arg0, arg1, arg2) {
|
|
2130
1833
|
arg0[arg1 >>> 0] = arg2;
|
|
2131
1834
|
},
|
|
@@ -2140,34 +1843,9 @@ function __wbg_get_imports() {
|
|
|
2140
1843
|
const ret = arg0.set(arg1, arg2);
|
|
2141
1844
|
return ret;
|
|
2142
1845
|
},
|
|
2143
|
-
__wbg_set_body_a3d856b097dfda04: function(arg0, arg1) {
|
|
2144
|
-
arg0.body = arg1;
|
|
2145
|
-
},
|
|
2146
|
-
__wbg_set_cache_ec7e430c6056ebda: function(arg0, arg1) {
|
|
2147
|
-
arg0.cache = __wbindgen_enum_RequestCache[arg1];
|
|
2148
|
-
},
|
|
2149
1846
|
__wbg_set_create_ef897736206a6f05: function(arg0, arg1) {
|
|
2150
1847
|
arg0.create = arg1 !== 0;
|
|
2151
1848
|
},
|
|
2152
|
-
__wbg_set_credentials_ed63183445882c65: function(arg0, arg1) {
|
|
2153
|
-
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
2154
|
-
},
|
|
2155
|
-
__wbg_set_headers_3c8fecc693b75327: function(arg0, arg1) {
|
|
2156
|
-
arg0.headers = arg1;
|
|
2157
|
-
},
|
|
2158
|
-
__wbg_set_method_8c015e8bcafd7be1: function(arg0, arg1, arg2) {
|
|
2159
|
-
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
2160
|
-
},
|
|
2161
|
-
__wbg_set_mode_5a87f2c809cf37c2: function(arg0, arg1) {
|
|
2162
|
-
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
2163
|
-
},
|
|
2164
|
-
__wbg_set_signal_0cebecb698f25d21: function(arg0, arg1) {
|
|
2165
|
-
arg0.signal = arg1;
|
|
2166
|
-
},
|
|
2167
|
-
__wbg_signal_166e1da31adcac18: function(arg0) {
|
|
2168
|
-
const ret = arg0.signal;
|
|
2169
|
-
return ret;
|
|
2170
|
-
},
|
|
2171
1849
|
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
2172
1850
|
const ret = arg1.stack;
|
|
2173
1851
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -2191,18 +1869,10 @@ function __wbg_get_imports() {
|
|
|
2191
1869
|
const ret = typeof window === 'undefined' ? null : window;
|
|
2192
1870
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2193
1871
|
},
|
|
2194
|
-
__wbg_status_318629ab93a22955: function(arg0) {
|
|
2195
|
-
const ret = arg0.status;
|
|
2196
|
-
return ret;
|
|
2197
|
-
},
|
|
2198
1872
|
__wbg_storage_63fa6fa9455d2153: function(arg0) {
|
|
2199
1873
|
const ret = arg0.storage;
|
|
2200
1874
|
return ret;
|
|
2201
1875
|
},
|
|
2202
|
-
__wbg_stringify_5ae93966a84901ac: function() { return handleError(function (arg0) {
|
|
2203
|
-
const ret = JSON.stringify(arg0);
|
|
2204
|
-
return ret;
|
|
2205
|
-
}, arguments); },
|
|
2206
1876
|
__wbg_subarray_a068d24e39478a8a: function(arg0, arg1, arg2) {
|
|
2207
1877
|
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
2208
1878
|
return ret;
|
|
@@ -2218,13 +1888,6 @@ function __wbg_get_imports() {
|
|
|
2218
1888
|
__wbg_truncate_af8ac1613ab66393: function() { return handleError(function (arg0, arg1) {
|
|
2219
1889
|
arg0.truncate(arg1);
|
|
2220
1890
|
}, arguments); },
|
|
2221
|
-
__wbg_url_7fefc1820fba4e0c: function(arg0, arg1) {
|
|
2222
|
-
const ret = arg1.url;
|
|
2223
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2224
|
-
const len1 = WASM_VECTOR_LEN;
|
|
2225
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2226
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2227
|
-
},
|
|
2228
1891
|
__wbg_value_21fc78aab0322612: function(arg0) {
|
|
2229
1892
|
const ret = arg0.value;
|
|
2230
1893
|
return ret;
|
|
@@ -2234,46 +1897,41 @@ function __wbg_get_imports() {
|
|
|
2234
1897
|
return ret;
|
|
2235
1898
|
},
|
|
2236
1899
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2237
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2238
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1900
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [Externref], shim_idx: 2, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1901
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_188fd7264b65779d___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_188fd7264b65779d___JsValue____Output_______, wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue______true_);
|
|
2239
1902
|
return ret;
|
|
2240
1903
|
},
|
|
2241
1904
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2242
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2243
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1905
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 527, function: Function { arguments: [Externref], shim_idx: 528, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1906
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_188fd7264b65779d___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_188fd7264b65779d___JsValue____Output___core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_188fd7264b65779d___JsError___, wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_188fd7264b65779d___JsError___true_);
|
|
2244
1907
|
return ret;
|
|
2245
1908
|
},
|
|
2246
|
-
__wbindgen_cast_0000000000000003: function(arg0
|
|
2247
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 702, function: Function { arguments: [Externref], shim_idx: 703, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2248
|
-
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_4501a39796791c69___JsValue____Output___core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___, wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___true_);
|
|
2249
|
-
return ret;
|
|
2250
|
-
},
|
|
2251
|
-
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
1909
|
+
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
2252
1910
|
// Cast intrinsic for `F64 -> Externref`.
|
|
2253
1911
|
const ret = arg0;
|
|
2254
1912
|
return ret;
|
|
2255
1913
|
},
|
|
2256
|
-
|
|
1914
|
+
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
2257
1915
|
// Cast intrinsic for `I64 -> Externref`.
|
|
2258
1916
|
const ret = arg0;
|
|
2259
1917
|
return ret;
|
|
2260
1918
|
},
|
|
2261
|
-
|
|
1919
|
+
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
2262
1920
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
2263
1921
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
2264
1922
|
return ret;
|
|
2265
1923
|
},
|
|
2266
|
-
|
|
1924
|
+
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
2267
1925
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
2268
1926
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
2269
1927
|
return ret;
|
|
2270
1928
|
},
|
|
2271
|
-
|
|
1929
|
+
__wbindgen_cast_0000000000000007: function(arg0) {
|
|
2272
1930
|
// Cast intrinsic for `U64 -> Externref`.
|
|
2273
1931
|
const ret = BigInt.asUintN(64, arg0);
|
|
2274
1932
|
return ret;
|
|
2275
1933
|
},
|
|
2276
|
-
|
|
1934
|
+
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
2277
1935
|
var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
|
|
2278
1936
|
wasm.__wbindgen_free(arg0, arg1 * 1, 1);
|
|
2279
1937
|
// Cast intrinsic for `Vector(U8) -> Externref`.
|
|
@@ -2296,33 +1954,21 @@ function __wbg_get_imports() {
|
|
|
2296
1954
|
};
|
|
2297
1955
|
}
|
|
2298
1956
|
|
|
2299
|
-
function
|
|
2300
|
-
wasm.
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
function wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue______true_(arg0, arg1, arg2) {
|
|
2304
|
-
wasm.wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue______true_(arg0, arg1, arg2);
|
|
1957
|
+
function wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue______true_(arg0, arg1, arg2) {
|
|
1958
|
+
wasm.wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue______true_(arg0, arg1, arg2);
|
|
2305
1959
|
}
|
|
2306
1960
|
|
|
2307
|
-
function
|
|
2308
|
-
const ret = wasm.
|
|
1961
|
+
function wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_188fd7264b65779d___JsError___true_(arg0, arg1, arg2) {
|
|
1962
|
+
const ret = wasm.wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_188fd7264b65779d___JsError___true_(arg0, arg1, arg2);
|
|
2309
1963
|
if (ret[1]) {
|
|
2310
1964
|
throw takeFromExternrefTable0(ret[0]);
|
|
2311
1965
|
}
|
|
2312
1966
|
}
|
|
2313
1967
|
|
|
2314
|
-
function
|
|
2315
|
-
wasm.
|
|
1968
|
+
function wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
1969
|
+
wasm.wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
2316
1970
|
}
|
|
2317
1971
|
|
|
2318
|
-
|
|
2319
|
-
const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
2326
1972
|
const CollectionWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2327
1973
|
? { register: () => {}, unregister: () => {} }
|
|
2328
1974
|
: new FinalizationRegistry(ptr => wasm.__wbg_collectionwasm_free(ptr >>> 0, 1));
|
|
@@ -2508,16 +2154,6 @@ function passArrayF32ToWasm0(arg, malloc) {
|
|
|
2508
2154
|
return ptr;
|
|
2509
2155
|
}
|
|
2510
2156
|
|
|
2511
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
2512
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
2513
|
-
for (let i = 0; i < array.length; i++) {
|
|
2514
|
-
const add = addToExternrefTable0(array[i]);
|
|
2515
|
-
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
2516
|
-
}
|
|
2517
|
-
WASM_VECTOR_LEN = array.length;
|
|
2518
|
-
return ptr;
|
|
2519
|
-
}
|
|
2520
|
-
|
|
2521
2157
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
2522
2158
|
if (realloc === undefined) {
|
|
2523
2159
|
const buf = cachedTextEncoder.encode(arg);
|