@automerge/sedimentree 0.8.1 → 0.8.3
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/dist/cjs/wasm-base64.cjs +1 -1
- package/dist/cjs/web-bindings.cjs +136 -23
- package/dist/cjs/web.cjs +137 -24
- package/dist/esm/wasm-base64.js +1 -1
- package/dist/iife/index.js +137 -24
- package/dist/index.d.ts +7 -0
- package/dist/sedimentree.wasm +0 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm.d.ts +7 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm_bg.js +144 -24
- package/dist/wasm_bindgen/bundler/sedimentree_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm_bg.wasm.d.ts +10 -9
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm.cjs +144 -24
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm.d.ts +7 -0
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm_bg.wasm.d.ts +10 -9
- package/dist/wasm_bindgen/web/sedimentree_wasm.d.ts +17 -9
- package/dist/wasm_bindgen/web/sedimentree_wasm.js +144 -24
- package/dist/wasm_bindgen/web/sedimentree_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/web/sedimentree_wasm_bg.wasm.d.ts +10 -9
- package/package.json +1 -1
- /package/dist/wasm_bindgen/bundler/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline0.js +0 -0
- /package/dist/wasm_bindgen/bundler/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline1.js +0 -0
- /package/dist/wasm_bindgen/bundler/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline2.js +0 -0
- /package/dist/wasm_bindgen/nodejs/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline0.js +0 -0
- /package/dist/wasm_bindgen/nodejs/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline1.js +0 -0
- /package/dist/wasm_bindgen/nodejs/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline2.js +0 -0
- /package/dist/wasm_bindgen/web/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline0.js +0 -0
- /package/dist/wasm_bindgen/web/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline1.js +0 -0
- /package/dist/wasm_bindgen/web/snippets/{sedimentree_wasm-7c7e743695651440 → sedimentree_wasm-c507f5285f2927a0}/inline2.js +0 -0
|
@@ -48,7 +48,7 @@ class BlobMeta {
|
|
|
48
48
|
* @param {Uint8Array} blob
|
|
49
49
|
*/
|
|
50
50
|
constructor(blob) {
|
|
51
|
-
const ptr0 = passArray8ToWasm0(blob, wasm.
|
|
51
|
+
const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_export);
|
|
52
52
|
const len0 = WASM_VECTOR_LEN;
|
|
53
53
|
const ret = wasm.blobmeta_new(ptr0, len0);
|
|
54
54
|
this.__wbg_ptr = ret >>> 0;
|
|
@@ -237,7 +237,7 @@ class Digest {
|
|
|
237
237
|
* @returns {Digest}
|
|
238
238
|
*/
|
|
239
239
|
static fromBase58(s) {
|
|
240
|
-
const ptr0 = passStringToWasm0(s, wasm.
|
|
240
|
+
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
241
241
|
const len0 = WASM_VECTOR_LEN;
|
|
242
242
|
const ret = wasm.digest_fromBase58(ptr0, len0);
|
|
243
243
|
if (ret[2]) {
|
|
@@ -255,7 +255,7 @@ class Digest {
|
|
|
255
255
|
* @returns {Digest}
|
|
256
256
|
*/
|
|
257
257
|
static fromBytes(bytes) {
|
|
258
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.
|
|
258
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
259
259
|
const len0 = WASM_VECTOR_LEN;
|
|
260
260
|
const ret = wasm.digest_fromBytes(ptr0, len0);
|
|
261
261
|
if (ret[2]) {
|
|
@@ -273,7 +273,7 @@ class Digest {
|
|
|
273
273
|
* @returns {Digest}
|
|
274
274
|
*/
|
|
275
275
|
static fromHexString(s) {
|
|
276
|
-
const ptr0 = passStringToWasm0(s, wasm.
|
|
276
|
+
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
277
277
|
const len0 = WASM_VECTOR_LEN;
|
|
278
278
|
const ret = wasm.digest_fromHexString(ptr0, len0);
|
|
279
279
|
if (ret[2]) {
|
|
@@ -290,7 +290,7 @@ class Digest {
|
|
|
290
290
|
* @param {Uint8Array} bytes
|
|
291
291
|
*/
|
|
292
292
|
constructor(bytes) {
|
|
293
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.
|
|
293
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
294
294
|
const len0 = WASM_VECTOR_LEN;
|
|
295
295
|
const ret = wasm.digest_new(ptr0, len0);
|
|
296
296
|
if (ret[2]) {
|
|
@@ -398,9 +398,9 @@ class Fragment {
|
|
|
398
398
|
var ptr0 = sedimentree_id.__destroy_into_raw();
|
|
399
399
|
_assertClass(head, Digest);
|
|
400
400
|
var ptr1 = head.__destroy_into_raw();
|
|
401
|
-
const ptr2 = passArrayJsValueToWasm0(boundary, wasm.
|
|
401
|
+
const ptr2 = passArrayJsValueToWasm0(boundary, wasm.__wbindgen_export);
|
|
402
402
|
const len2 = WASM_VECTOR_LEN;
|
|
403
|
-
const ptr3 = passArrayJsValueToWasm0(checkpoints, wasm.
|
|
403
|
+
const ptr3 = passArrayJsValueToWasm0(checkpoints, wasm.__wbindgen_export);
|
|
404
404
|
const len3 = WASM_VECTOR_LEN;
|
|
405
405
|
_assertClass(blob_meta, BlobMeta);
|
|
406
406
|
var ptr4 = blob_meta.__destroy_into_raw();
|
|
@@ -559,7 +559,7 @@ class LooseCommit {
|
|
|
559
559
|
constructor(sedimentree_id, parents, blob_meta) {
|
|
560
560
|
_assertClass(sedimentree_id, SedimentreeId);
|
|
561
561
|
var ptr0 = sedimentree_id.__destroy_into_raw();
|
|
562
|
-
const ptr1 = passArrayJsValueToWasm0(parents, wasm.
|
|
562
|
+
const ptr1 = passArrayJsValueToWasm0(parents, wasm.__wbindgen_export);
|
|
563
563
|
const len1 = WASM_VECTOR_LEN;
|
|
564
564
|
_assertClass(blob_meta, BlobMeta);
|
|
565
565
|
const ret = wasm.loosecommit_new(ptr0, ptr1, len1, blob_meta.__wbg_ptr);
|
|
@@ -732,6 +732,18 @@ class MemoryStorage {
|
|
|
732
732
|
MemoryStorageFinalization.register(this, this.__wbg_ptr, this);
|
|
733
733
|
return this;
|
|
734
734
|
}
|
|
735
|
+
/**
|
|
736
|
+
* Save commits and fragments in a single batch.
|
|
737
|
+
* @param {SedimentreeId} sedimentree_id
|
|
738
|
+
* @param {Array<any>} commits
|
|
739
|
+
* @param {Array<any>} fragments
|
|
740
|
+
* @returns {Promise<any>}
|
|
741
|
+
*/
|
|
742
|
+
saveBatchAll(sedimentree_id, commits, fragments) {
|
|
743
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
744
|
+
const ret = wasm.memorystorage_saveBatchAll(this.__wbg_ptr, sedimentree_id.__wbg_ptr, commits, fragments);
|
|
745
|
+
return ret;
|
|
746
|
+
}
|
|
735
747
|
/**
|
|
736
748
|
* Save a commit with its blob.
|
|
737
749
|
* @param {SedimentreeId} sedimentree_id
|
|
@@ -811,9 +823,9 @@ class Sedimentree {
|
|
|
811
823
|
* @param {LooseCommit[]} commits
|
|
812
824
|
*/
|
|
813
825
|
constructor(fragments, commits) {
|
|
814
|
-
const ptr0 = passArrayJsValueToWasm0(fragments, wasm.
|
|
826
|
+
const ptr0 = passArrayJsValueToWasm0(fragments, wasm.__wbindgen_export);
|
|
815
827
|
const len0 = WASM_VECTOR_LEN;
|
|
816
|
-
const ptr1 = passArrayJsValueToWasm0(commits, wasm.
|
|
828
|
+
const ptr1 = passArrayJsValueToWasm0(commits, wasm.__wbindgen_export);
|
|
817
829
|
const len1 = WASM_VECTOR_LEN;
|
|
818
830
|
const ret = wasm.sedimentree_new(ptr0, len0, ptr1, len1);
|
|
819
831
|
this.__wbg_ptr = ret >>> 0;
|
|
@@ -863,7 +875,7 @@ class SedimentreeId {
|
|
|
863
875
|
* @returns {SedimentreeId}
|
|
864
876
|
*/
|
|
865
877
|
static fromBytes(bytes) {
|
|
866
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.
|
|
878
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
867
879
|
const len0 = WASM_VECTOR_LEN;
|
|
868
880
|
const ret = wasm.sedimentreeid_fromBytes(ptr0, len0);
|
|
869
881
|
if (ret[2]) {
|
|
@@ -942,6 +954,12 @@ class SignedFragment {
|
|
|
942
954
|
SignedFragmentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
943
955
|
return obj;
|
|
944
956
|
}
|
|
957
|
+
static __unwrap(jsValue) {
|
|
958
|
+
if (!(jsValue instanceof SignedFragment)) {
|
|
959
|
+
return 0;
|
|
960
|
+
}
|
|
961
|
+
return jsValue.__destroy_into_raw();
|
|
962
|
+
}
|
|
945
963
|
__destroy_into_raw() {
|
|
946
964
|
const ptr = this.__wbg_ptr;
|
|
947
965
|
this.__wbg_ptr = 0;
|
|
@@ -1014,6 +1032,12 @@ class SignedLooseCommit {
|
|
|
1014
1032
|
SignedLooseCommitFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1015
1033
|
return obj;
|
|
1016
1034
|
}
|
|
1035
|
+
static __unwrap(jsValue) {
|
|
1036
|
+
if (!(jsValue instanceof SignedLooseCommit)) {
|
|
1037
|
+
return 0;
|
|
1038
|
+
}
|
|
1039
|
+
return jsValue.__destroy_into_raw();
|
|
1040
|
+
}
|
|
1017
1041
|
__destroy_into_raw() {
|
|
1018
1042
|
const ptr = this.__wbg_ptr;
|
|
1019
1043
|
this.__wbg_ptr = 0;
|
|
@@ -1078,24 +1102,31 @@ exports.SignedLooseCommit = SignedLooseCommit;
|
|
|
1078
1102
|
function __wbg_get_imports() {
|
|
1079
1103
|
const import0 = {
|
|
1080
1104
|
__proto__: null,
|
|
1081
|
-
|
|
1105
|
+
__wbg___wasm_refgen_toWasmDigest_476b24805f220005: function(arg0) {
|
|
1082
1106
|
const ret = arg0.__wasm_refgen_toWasmDigest();
|
|
1083
1107
|
_assertClass(ret, Digest);
|
|
1084
1108
|
var ptr1 = ret.__destroy_into_raw();
|
|
1085
1109
|
return ptr1;
|
|
1086
1110
|
},
|
|
1087
|
-
|
|
1111
|
+
__wbg___wasm_refgen_toWasmFragment_10dd1ff9b3934840: function(arg0) {
|
|
1088
1112
|
const ret = arg0.__wasm_refgen_toWasmFragment();
|
|
1089
1113
|
_assertClass(ret, Fragment);
|
|
1090
1114
|
var ptr1 = ret.__destroy_into_raw();
|
|
1091
1115
|
return ptr1;
|
|
1092
1116
|
},
|
|
1093
|
-
|
|
1117
|
+
__wbg___wasm_refgen_toWasmLooseCommit_f36ad6a9389cee03: function(arg0) {
|
|
1094
1118
|
const ret = arg0.__wasm_refgen_toWasmLooseCommit();
|
|
1095
1119
|
_assertClass(ret, LooseCommit);
|
|
1096
1120
|
var ptr1 = ret.__destroy_into_raw();
|
|
1097
1121
|
return ptr1;
|
|
1098
1122
|
},
|
|
1123
|
+
__wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
|
|
1124
|
+
const ret = debugString(arg1);
|
|
1125
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1126
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1127
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1128
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1129
|
+
},
|
|
1099
1130
|
__wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
|
|
1100
1131
|
const ret = typeof(arg0) === 'function';
|
|
1101
1132
|
return ret;
|
|
@@ -1132,14 +1163,30 @@ function __wbg_get_imports() {
|
|
|
1132
1163
|
const ret = FragmentWithBlob.__wrap(arg0);
|
|
1133
1164
|
return ret;
|
|
1134
1165
|
},
|
|
1166
|
+
__wbg_get_3ef1eba1850ade27: function() { return handleError(function (arg0, arg1) {
|
|
1167
|
+
const ret = Reflect.get(arg0, arg1);
|
|
1168
|
+
return ret;
|
|
1169
|
+
}, arguments); },
|
|
1170
|
+
__wbg_get_unchecked_329cfe50afab7352: function(arg0, arg1) {
|
|
1171
|
+
const ret = arg0[arg1 >>> 0];
|
|
1172
|
+
return ret;
|
|
1173
|
+
},
|
|
1135
1174
|
__wbg_isSafeInteger_ecd6a7f9c3e053cd: function(arg0) {
|
|
1136
1175
|
const ret = Number.isSafeInteger(arg0);
|
|
1137
1176
|
return ret;
|
|
1138
1177
|
},
|
|
1178
|
+
__wbg_length_b3416cf66a5452c8: function(arg0) {
|
|
1179
|
+
const ret = arg0.length;
|
|
1180
|
+
return ret;
|
|
1181
|
+
},
|
|
1139
1182
|
__wbg_length_ea16607d7b61445b: function(arg0) {
|
|
1140
1183
|
const ret = arg0.length;
|
|
1141
1184
|
return ret;
|
|
1142
1185
|
},
|
|
1186
|
+
__wbg_new_5f486cdf45a04d78: function(arg0) {
|
|
1187
|
+
const ret = new Uint8Array(arg0);
|
|
1188
|
+
return ret;
|
|
1189
|
+
},
|
|
1143
1190
|
__wbg_new_a70fbab9066b301f: function() {
|
|
1144
1191
|
const ret = new Array();
|
|
1145
1192
|
return ret;
|
|
@@ -1159,7 +1206,7 @@ function __wbg_get_imports() {
|
|
|
1159
1206
|
const a = state0.a;
|
|
1160
1207
|
state0.a = 0;
|
|
1161
1208
|
try {
|
|
1162
|
-
return
|
|
1209
|
+
return __wasm_bindgen_func_elem_552_67(a, state0.b, arg0, arg1);
|
|
1163
1210
|
} finally {
|
|
1164
1211
|
state0.a = a;
|
|
1165
1212
|
}
|
|
@@ -1195,6 +1242,14 @@ function __wbg_get_imports() {
|
|
|
1195
1242
|
__wbg_set_name_7ef37fe858379aaf: function(arg0, arg1, arg2) {
|
|
1196
1243
|
arg0.name = getStringFromWasm0(arg1, arg2);
|
|
1197
1244
|
},
|
|
1245
|
+
__wbg_signedfragment_unwrap: function(arg0) {
|
|
1246
|
+
const ret = SignedFragment.__unwrap(arg0);
|
|
1247
|
+
return ret;
|
|
1248
|
+
},
|
|
1249
|
+
__wbg_signedloosecommit_unwrap: function(arg0) {
|
|
1250
|
+
const ret = SignedLooseCommit.__unwrap(arg0);
|
|
1251
|
+
return ret;
|
|
1252
|
+
},
|
|
1198
1253
|
__wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
|
|
1199
1254
|
const ret = typeof global === 'undefined' ? null : global;
|
|
1200
1255
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -1216,8 +1271,8 @@ function __wbg_get_imports() {
|
|
|
1216
1271
|
return ret;
|
|
1217
1272
|
},
|
|
1218
1273
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1219
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1220
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1274
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 70, function: Function { arguments: [Externref], shim_idx: 132, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1275
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_385, __wasm_bindgen_func_elem_552);
|
|
1221
1276
|
return ret;
|
|
1222
1277
|
},
|
|
1223
1278
|
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
@@ -1246,15 +1301,15 @@ function __wbg_get_imports() {
|
|
|
1246
1301
|
};
|
|
1247
1302
|
}
|
|
1248
1303
|
|
|
1249
|
-
function
|
|
1250
|
-
const ret = wasm.
|
|
1304
|
+
function __wasm_bindgen_func_elem_552(arg0, arg1, arg2) {
|
|
1305
|
+
const ret = wasm.__wasm_bindgen_func_elem_552(arg0, arg1, arg2);
|
|
1251
1306
|
if (ret[1]) {
|
|
1252
1307
|
throw takeFromExternrefTable0(ret[0]);
|
|
1253
1308
|
}
|
|
1254
1309
|
}
|
|
1255
1310
|
|
|
1256
|
-
function
|
|
1257
|
-
wasm.
|
|
1311
|
+
function __wasm_bindgen_func_elem_552_67(arg0, arg1, arg2, arg3) {
|
|
1312
|
+
wasm.__wasm_bindgen_func_elem_552_67(arg0, arg1, arg2, arg3);
|
|
1258
1313
|
}
|
|
1259
1314
|
|
|
1260
1315
|
const MemoryStorageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -1301,7 +1356,7 @@ const SignedLooseCommitFinalization = (typeof FinalizationRegistry === 'undefine
|
|
|
1301
1356
|
: new FinalizationRegistry(ptr => wasm.__wbg_signedloosecommit_free(ptr >>> 0, 1));
|
|
1302
1357
|
|
|
1303
1358
|
function addToExternrefTable0(obj) {
|
|
1304
|
-
const idx = wasm.
|
|
1359
|
+
const idx = wasm.__wbindgen_export4();
|
|
1305
1360
|
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
1306
1361
|
return idx;
|
|
1307
1362
|
}
|
|
@@ -1316,6 +1371,71 @@ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
|
1316
1371
|
? { register: () => {}, unregister: () => {} }
|
|
1317
1372
|
: new FinalizationRegistry(state => state.dtor(state.a, state.b));
|
|
1318
1373
|
|
|
1374
|
+
function debugString(val) {
|
|
1375
|
+
// primitive types
|
|
1376
|
+
const type = typeof val;
|
|
1377
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
1378
|
+
return `${val}`;
|
|
1379
|
+
}
|
|
1380
|
+
if (type == 'string') {
|
|
1381
|
+
return `"${val}"`;
|
|
1382
|
+
}
|
|
1383
|
+
if (type == 'symbol') {
|
|
1384
|
+
const description = val.description;
|
|
1385
|
+
if (description == null) {
|
|
1386
|
+
return 'Symbol';
|
|
1387
|
+
} else {
|
|
1388
|
+
return `Symbol(${description})`;
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
if (type == 'function') {
|
|
1392
|
+
const name = val.name;
|
|
1393
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
1394
|
+
return `Function(${name})`;
|
|
1395
|
+
} else {
|
|
1396
|
+
return 'Function';
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
// objects
|
|
1400
|
+
if (Array.isArray(val)) {
|
|
1401
|
+
const length = val.length;
|
|
1402
|
+
let debug = '[';
|
|
1403
|
+
if (length > 0) {
|
|
1404
|
+
debug += debugString(val[0]);
|
|
1405
|
+
}
|
|
1406
|
+
for(let i = 1; i < length; i++) {
|
|
1407
|
+
debug += ', ' + debugString(val[i]);
|
|
1408
|
+
}
|
|
1409
|
+
debug += ']';
|
|
1410
|
+
return debug;
|
|
1411
|
+
}
|
|
1412
|
+
// Test for built-in
|
|
1413
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1414
|
+
let className;
|
|
1415
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
1416
|
+
className = builtInMatches[1];
|
|
1417
|
+
} else {
|
|
1418
|
+
// Failed to match the standard '[object ClassName]'
|
|
1419
|
+
return toString.call(val);
|
|
1420
|
+
}
|
|
1421
|
+
if (className == 'Object') {
|
|
1422
|
+
// we're a user defined class or Object
|
|
1423
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1424
|
+
// easier than looping through ownProperties of `val`.
|
|
1425
|
+
try {
|
|
1426
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1427
|
+
} catch (_) {
|
|
1428
|
+
return 'Object';
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
// errors
|
|
1432
|
+
if (val instanceof Error) {
|
|
1433
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1434
|
+
}
|
|
1435
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1436
|
+
return className;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1319
1439
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
1320
1440
|
ptr = ptr >>> 0;
|
|
1321
1441
|
const mem = getDataViewMemory0();
|
|
@@ -1358,7 +1478,7 @@ function handleError(f, args) {
|
|
|
1358
1478
|
return f.apply(this, args);
|
|
1359
1479
|
} catch (e) {
|
|
1360
1480
|
const idx = addToExternrefTable0(e);
|
|
1361
|
-
wasm.
|
|
1481
|
+
wasm.__wbindgen_export3(idx);
|
|
1362
1482
|
}
|
|
1363
1483
|
}
|
|
1364
1484
|
|
|
@@ -1450,7 +1570,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
1450
1570
|
|
|
1451
1571
|
function takeFromExternrefTable0(idx) {
|
|
1452
1572
|
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1453
|
-
wasm.
|
|
1573
|
+
wasm.__wbindgen_export5(idx);
|
|
1454
1574
|
return value;
|
|
1455
1575
|
}
|
|
1456
1576
|
|
|
@@ -21,6 +21,9 @@ export interface SedimentreeStorage {
|
|
|
21
21
|
loadAllFragments(sedimentreeId: SedimentreeId): Promise<FragmentWithBlob[]>;
|
|
22
22
|
deleteFragment(sedimentreeId: SedimentreeId, digest: Digest): Promise<void>;
|
|
23
23
|
deleteAllFragments(sedimentreeId: SedimentreeId): Promise<void>;
|
|
24
|
+
|
|
25
|
+
// Batch save: write all commits + fragments in a single storage transaction.
|
|
26
|
+
saveBatchAll(sedimentreeId: SedimentreeId, commits: Array<{digest: Digest, signedCommit: SignedLooseCommit, blob: Uint8Array}>, fragments: Array<{digest: Digest, signedFragment: SignedFragment, blob: Uint8Array}>): Promise<number>;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
|
|
@@ -309,6 +312,10 @@ export class MemoryStorage {
|
|
|
309
312
|
* Create a new in-memory storage instance.
|
|
310
313
|
*/
|
|
311
314
|
constructor();
|
|
315
|
+
/**
|
|
316
|
+
* Save commits and fragments in a single batch.
|
|
317
|
+
*/
|
|
318
|
+
saveBatchAll(sedimentree_id: SedimentreeId, commits: Array<any>, fragments: Array<any>): Promise<any>;
|
|
312
319
|
/**
|
|
313
320
|
* Save a commit with its blob.
|
|
314
321
|
*/
|
|
Binary file
|
|
@@ -72,23 +72,24 @@ export const memorystorage_listFragmentDigests: (a: number, b: number) => any;
|
|
|
72
72
|
export const memorystorage_loadAllFragments: (a: number, b: number) => any;
|
|
73
73
|
export const memorystorage_deleteFragment: (a: number, b: number, c: number) => any;
|
|
74
74
|
export const memorystorage_deleteAllFragments: (a: number, b: number) => any;
|
|
75
|
+
export const memorystorage_saveBatchAll: (a: number, b: number, c: any, d: any) => any;
|
|
75
76
|
export const depth___wasm_refgen_toWasmDepth: (a: number) => number;
|
|
76
77
|
export const fragmentwithblob_new: (a: number, b: any) => number;
|
|
77
78
|
export const __wbg_sedimentreeid_free: (a: number, b: number) => void;
|
|
78
79
|
export const __wbg_fragmentwithblob_free: (a: number, b: number) => void;
|
|
79
80
|
export const __wbg_signedloosecommit_free: (a: number, b: number) => void;
|
|
80
|
-
export const sedimentreeid___wasm_refgen_toWasmSedimentreeId: (a: number) => number;
|
|
81
81
|
export const sedimentreeid_toBytes: (a: number) => [number, number];
|
|
82
|
+
export const sedimentreeid___wasm_refgen_toWasmSedimentreeId: (a: number) => number;
|
|
82
83
|
export const fragmentwithblob_blob: (a: number) => any;
|
|
83
|
-
export const
|
|
84
|
-
export const
|
|
85
|
-
export const
|
|
86
|
-
export const __wbindgen_export: (a: number) =>
|
|
87
|
-
export const __wbindgen_export2: () => number;
|
|
84
|
+
export const __wasm_bindgen_func_elem_385: (a: number, b: number) => void;
|
|
85
|
+
export const __wasm_bindgen_func_elem_552: (a: number, b: number, c: any) => [number, number];
|
|
86
|
+
export const __wasm_bindgen_func_elem_552_67: (a: number, b: number, c: any, d: any) => void;
|
|
87
|
+
export const __wbindgen_export: (a: number, b: number) => number;
|
|
88
|
+
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
89
|
+
export const __wbindgen_export3: (a: number) => void;
|
|
90
|
+
export const __wbindgen_export4: () => number;
|
|
88
91
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
89
|
-
export const
|
|
90
|
-
export const __wbindgen_export4: (a: number) => void;
|
|
91
|
-
export const __wbindgen_export5: (a: number, b: number, c: number, d: number) => number;
|
|
92
|
+
export const __wbindgen_export5: (a: number) => void;
|
|
92
93
|
export const __wbindgen_export6: (a: number, b: number, c: number) => void;
|
|
93
94
|
export const __wbindgen_export7: (a: number, b: number) => void;
|
|
94
95
|
export const __wbindgen_start: () => void;
|
|
@@ -21,6 +21,9 @@ export interface SedimentreeStorage {
|
|
|
21
21
|
loadAllFragments(sedimentreeId: SedimentreeId): Promise<FragmentWithBlob[]>;
|
|
22
22
|
deleteFragment(sedimentreeId: SedimentreeId, digest: Digest): Promise<void>;
|
|
23
23
|
deleteAllFragments(sedimentreeId: SedimentreeId): Promise<void>;
|
|
24
|
+
|
|
25
|
+
// Batch save: write all commits + fragments in a single storage transaction.
|
|
26
|
+
saveBatchAll(sedimentreeId: SedimentreeId, commits: Array<{digest: Digest, signedCommit: SignedLooseCommit, blob: Uint8Array}>, fragments: Array<{digest: Digest, signedFragment: SignedFragment, blob: Uint8Array}>): Promise<number>;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
|
|
@@ -309,6 +312,10 @@ export class MemoryStorage {
|
|
|
309
312
|
* Create a new in-memory storage instance.
|
|
310
313
|
*/
|
|
311
314
|
constructor();
|
|
315
|
+
/**
|
|
316
|
+
* Save commits and fragments in a single batch.
|
|
317
|
+
*/
|
|
318
|
+
saveBatchAll(sedimentree_id: SedimentreeId, commits: Array<any>, fragments: Array<any>): Promise<any>;
|
|
312
319
|
/**
|
|
313
320
|
* Save a commit with its blob.
|
|
314
321
|
*/
|
|
@@ -519,23 +526,24 @@ export interface InitOutput {
|
|
|
519
526
|
readonly memorystorage_loadAllFragments: (a: number, b: number) => any;
|
|
520
527
|
readonly memorystorage_deleteFragment: (a: number, b: number, c: number) => any;
|
|
521
528
|
readonly memorystorage_deleteAllFragments: (a: number, b: number) => any;
|
|
529
|
+
readonly memorystorage_saveBatchAll: (a: number, b: number, c: any, d: any) => any;
|
|
522
530
|
readonly depth___wasm_refgen_toWasmDepth: (a: number) => number;
|
|
523
531
|
readonly fragmentwithblob_new: (a: number, b: any) => number;
|
|
524
532
|
readonly __wbg_sedimentreeid_free: (a: number, b: number) => void;
|
|
525
533
|
readonly __wbg_fragmentwithblob_free: (a: number, b: number) => void;
|
|
526
534
|
readonly __wbg_signedloosecommit_free: (a: number, b: number) => void;
|
|
527
|
-
readonly sedimentreeid___wasm_refgen_toWasmSedimentreeId: (a: number) => number;
|
|
528
535
|
readonly sedimentreeid_toBytes: (a: number) => [number, number];
|
|
536
|
+
readonly sedimentreeid___wasm_refgen_toWasmSedimentreeId: (a: number) => number;
|
|
529
537
|
readonly fragmentwithblob_blob: (a: number) => any;
|
|
530
|
-
readonly
|
|
531
|
-
readonly
|
|
532
|
-
readonly
|
|
533
|
-
readonly __wbindgen_export: (a: number) =>
|
|
534
|
-
readonly __wbindgen_export2: () => number;
|
|
538
|
+
readonly __wasm_bindgen_func_elem_385: (a: number, b: number) => void;
|
|
539
|
+
readonly __wasm_bindgen_func_elem_552: (a: number, b: number, c: any) => [number, number];
|
|
540
|
+
readonly __wasm_bindgen_func_elem_552_67: (a: number, b: number, c: any, d: any) => void;
|
|
541
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
542
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
543
|
+
readonly __wbindgen_export3: (a: number) => void;
|
|
544
|
+
readonly __wbindgen_export4: () => number;
|
|
535
545
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
536
|
-
readonly
|
|
537
|
-
readonly __wbindgen_export4: (a: number) => void;
|
|
538
|
-
readonly __wbindgen_export5: (a: number, b: number, c: number, d: number) => number;
|
|
546
|
+
readonly __wbindgen_export5: (a: number) => void;
|
|
539
547
|
readonly __wbindgen_export6: (a: number, b: number, c: number) => void;
|
|
540
548
|
readonly __wbindgen_export7: (a: number, b: number) => void;
|
|
541
549
|
readonly __wbindgen_start: () => void;
|