loro-crdt 1.13.6 → 1.13.7
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/CHANGELOG.md +17 -0
- package/base64/index.js +88 -87
- package/base64/loro_wasm.d.ts +8 -8
- package/browser/index.js +4 -4
- package/browser/loro_wasm.d.ts +8 -8
- package/browser/loro_wasm.js +12 -12
- package/browser/loro_wasm_bg.js +83 -82
- package/browser/loro_wasm_bg.wasm +0 -0
- package/browser/loro_wasm_bg.wasm.d.ts +2 -2
- package/bundler/index.js +4 -4
- package/bundler/loro_wasm.d.ts +8 -8
- package/bundler/loro_wasm_bg.js +83 -82
- package/bundler/loro_wasm_bg.wasm +0 -0
- package/bundler/loro_wasm_bg.wasm.d.ts +2 -2
- package/nodejs/loro_wasm.d.ts +8 -8
- package/nodejs/loro_wasm.js +83 -82
- package/nodejs/loro_wasm_bg.wasm +0 -0
- package/nodejs/loro_wasm_bg.wasm.d.ts +2 -2
- package/package.json +1 -1
- package/web/loro_wasm.d.ts +10 -10
- package/web/loro_wasm.js +82 -81
- package/web/loro_wasm_bg.wasm +0 -0
- package/web/loro_wasm_bg.wasm.d.ts +2 -2
package/base64/loro_wasm.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export function run(): void;
|
|
3
4
|
/**
|
|
4
5
|
* Enable debug info of Loro
|
|
5
6
|
*/
|
|
6
7
|
export function setDebug(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Get the version of Loro
|
|
10
|
+
*/
|
|
11
|
+
export function LORO_VERSION(): string;
|
|
7
12
|
/**
|
|
8
13
|
* Decode the metadata of the import blob.
|
|
9
14
|
*
|
|
@@ -17,14 +22,6 @@ export function setDebug(): void;
|
|
|
17
22
|
* - changeNum
|
|
18
23
|
*/
|
|
19
24
|
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
20
|
-
export function callPendingEvents(): void;
|
|
21
|
-
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
22
|
-
export function run(): void;
|
|
23
|
-
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
24
|
-
/**
|
|
25
|
-
* Get the version of Loro
|
|
26
|
-
*/
|
|
27
|
-
export function LORO_VERSION(): string;
|
|
28
25
|
/**
|
|
29
26
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
30
27
|
*
|
|
@@ -45,6 +42,9 @@ export function LORO_VERSION(): string;
|
|
|
45
42
|
* @returns {Object} The redacted JSON updates
|
|
46
43
|
*/
|
|
47
44
|
export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
|
|
45
|
+
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
46
|
+
export function callPendingEvents(): void;
|
|
47
|
+
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Container types supported by loro.
|
package/browser/index.js
CHANGED
|
@@ -409,8 +409,8 @@ export {
|
|
|
409
409
|
__wbg_done_769e5ede4b31c67b,
|
|
410
410
|
__wbg_entries_3265d4158b33e5dc,
|
|
411
411
|
__wbg_entries_c8a90a7ed73e84ce,
|
|
412
|
+
__wbg_error_30083555868aa7a9,
|
|
412
413
|
__wbg_error_7534b8e9a36f1ab4,
|
|
413
|
-
__wbg_error_ddc720e1a9bdab2e,
|
|
414
414
|
__wbg_from_2a5d3e218e67aa85,
|
|
415
415
|
__wbg_getOwnPropertySymbols_97eebed6fe6e08be,
|
|
416
416
|
__wbg_getRandomValues_b8f5dbd5f3995a9e,
|
|
@@ -428,7 +428,7 @@ export {
|
|
|
428
428
|
__wbg_length_a446193dc22c12f8,
|
|
429
429
|
__wbg_length_e2d2a49132c1b256,
|
|
430
430
|
__wbg_log_0cc1b7768397bcfe,
|
|
431
|
-
|
|
431
|
+
__wbg_log_c534a954ce262324,
|
|
432
432
|
__wbg_log_cb9e190acc5753fb,
|
|
433
433
|
__wbg_lorocounter_new,
|
|
434
434
|
__wbg_lorolist_new,
|
|
@@ -452,7 +452,7 @@ export {
|
|
|
452
452
|
__wbg_next_25feadfc0913fea9,
|
|
453
453
|
__wbg_next_6574e1a8a62d1055,
|
|
454
454
|
__wbg_node_905d3e251edff8a2,
|
|
455
|
-
|
|
455
|
+
__wbg_now_9a16e63446ca7697,
|
|
456
456
|
__wbg_ownKeys_3930041068756f1f,
|
|
457
457
|
__wbg_process_dc0fbacc7c1c06f7,
|
|
458
458
|
__wbg_push_737cfc8c1432c2c6,
|
|
@@ -476,7 +476,7 @@ export {
|
|
|
476
476
|
__wbg_value_cd1ffa7b1ab794f1,
|
|
477
477
|
__wbg_versions_c01dfd4722a88165,
|
|
478
478
|
__wbg_versionvector_new,
|
|
479
|
-
|
|
479
|
+
__wbg_warn_994f3bd0367746f9,
|
|
480
480
|
__wbindgen_as_number,
|
|
481
481
|
__wbindgen_bigint_from_i64,
|
|
482
482
|
__wbindgen_bigint_from_u64,
|
package/browser/loro_wasm.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export function run(): void;
|
|
3
4
|
/**
|
|
4
5
|
* Enable debug info of Loro
|
|
5
6
|
*/
|
|
6
7
|
export function setDebug(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Get the version of Loro
|
|
10
|
+
*/
|
|
11
|
+
export function LORO_VERSION(): string;
|
|
7
12
|
/**
|
|
8
13
|
* Decode the metadata of the import blob.
|
|
9
14
|
*
|
|
@@ -17,14 +22,6 @@ export function setDebug(): void;
|
|
|
17
22
|
* - changeNum
|
|
18
23
|
*/
|
|
19
24
|
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
20
|
-
export function callPendingEvents(): void;
|
|
21
|
-
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
22
|
-
export function run(): void;
|
|
23
|
-
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
24
|
-
/**
|
|
25
|
-
* Get the version of Loro
|
|
26
|
-
*/
|
|
27
|
-
export function LORO_VERSION(): string;
|
|
28
25
|
/**
|
|
29
26
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
30
27
|
*
|
|
@@ -45,6 +42,9 @@ export function LORO_VERSION(): string;
|
|
|
45
42
|
* @returns {Object} The redacted JSON updates
|
|
46
43
|
*/
|
|
47
44
|
export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
|
|
45
|
+
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
46
|
+
export function callPendingEvents(): void;
|
|
47
|
+
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Container types supported by loro.
|
package/browser/loro_wasm.js
CHANGED
|
@@ -28,8 +28,8 @@ import {
|
|
|
28
28
|
__wbg_done_769e5ede4b31c67b,
|
|
29
29
|
__wbg_entries_3265d4158b33e5dc,
|
|
30
30
|
__wbg_entries_c8a90a7ed73e84ce,
|
|
31
|
+
__wbg_error_30083555868aa7a9,
|
|
31
32
|
__wbg_error_7534b8e9a36f1ab4,
|
|
32
|
-
__wbg_error_ddc720e1a9bdab2e,
|
|
33
33
|
__wbg_from_2a5d3e218e67aa85,
|
|
34
34
|
__wbg_getOwnPropertySymbols_97eebed6fe6e08be,
|
|
35
35
|
__wbg_getRandomValues_b8f5dbd5f3995a9e,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
__wbg_length_a446193dc22c12f8,
|
|
48
48
|
__wbg_length_e2d2a49132c1b256,
|
|
49
49
|
__wbg_log_0cc1b7768397bcfe,
|
|
50
|
-
|
|
50
|
+
__wbg_log_c534a954ce262324,
|
|
51
51
|
__wbg_log_cb9e190acc5753fb,
|
|
52
52
|
__wbg_lorocounter_new,
|
|
53
53
|
__wbg_lorolist_new,
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
__wbg_next_25feadfc0913fea9,
|
|
72
72
|
__wbg_next_6574e1a8a62d1055,
|
|
73
73
|
__wbg_node_905d3e251edff8a2,
|
|
74
|
-
|
|
74
|
+
__wbg_now_9a16e63446ca7697,
|
|
75
75
|
__wbg_ownKeys_3930041068756f1f,
|
|
76
76
|
__wbg_process_dc0fbacc7c1c06f7,
|
|
77
77
|
__wbg_push_737cfc8c1432c2c6,
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
__wbg_value_cd1ffa7b1ab794f1,
|
|
96
96
|
__wbg_versions_c01dfd4722a88165,
|
|
97
97
|
__wbg_versionvector_new,
|
|
98
|
-
|
|
98
|
+
__wbg_warn_994f3bd0367746f9,
|
|
99
99
|
__wbindgen_as_number,
|
|
100
100
|
__wbindgen_bigint_from_i64,
|
|
101
101
|
__wbindgen_bigint_from_u64,
|
|
@@ -169,8 +169,8 @@ const imports = {
|
|
|
169
169
|
__wbg_done_769e5ede4b31c67b,
|
|
170
170
|
__wbg_entries_3265d4158b33e5dc,
|
|
171
171
|
__wbg_entries_c8a90a7ed73e84ce,
|
|
172
|
+
__wbg_error_30083555868aa7a9,
|
|
172
173
|
__wbg_error_7534b8e9a36f1ab4,
|
|
173
|
-
__wbg_error_ddc720e1a9bdab2e,
|
|
174
174
|
__wbg_from_2a5d3e218e67aa85,
|
|
175
175
|
__wbg_getOwnPropertySymbols_97eebed6fe6e08be,
|
|
176
176
|
__wbg_getRandomValues_b8f5dbd5f3995a9e,
|
|
@@ -188,7 +188,7 @@ const imports = {
|
|
|
188
188
|
__wbg_length_a446193dc22c12f8,
|
|
189
189
|
__wbg_length_e2d2a49132c1b256,
|
|
190
190
|
__wbg_log_0cc1b7768397bcfe,
|
|
191
|
-
|
|
191
|
+
__wbg_log_c534a954ce262324,
|
|
192
192
|
__wbg_log_cb9e190acc5753fb,
|
|
193
193
|
__wbg_lorocounter_new,
|
|
194
194
|
__wbg_lorolist_new,
|
|
@@ -212,7 +212,7 @@ const imports = {
|
|
|
212
212
|
__wbg_next_25feadfc0913fea9,
|
|
213
213
|
__wbg_next_6574e1a8a62d1055,
|
|
214
214
|
__wbg_node_905d3e251edff8a2,
|
|
215
|
-
|
|
215
|
+
__wbg_now_9a16e63446ca7697,
|
|
216
216
|
__wbg_ownKeys_3930041068756f1f,
|
|
217
217
|
__wbg_process_dc0fbacc7c1c06f7,
|
|
218
218
|
__wbg_push_737cfc8c1432c2c6,
|
|
@@ -236,7 +236,7 @@ const imports = {
|
|
|
236
236
|
__wbg_value_cd1ffa7b1ab794f1,
|
|
237
237
|
__wbg_versions_c01dfd4722a88165,
|
|
238
238
|
__wbg_versionvector_new,
|
|
239
|
-
|
|
239
|
+
__wbg_warn_994f3bd0367746f9,
|
|
240
240
|
__wbindgen_as_number,
|
|
241
241
|
__wbindgen_bigint_from_i64,
|
|
242
242
|
__wbindgen_bigint_from_u64,
|
|
@@ -362,8 +362,8 @@ export {
|
|
|
362
362
|
__wbg_done_769e5ede4b31c67b,
|
|
363
363
|
__wbg_entries_3265d4158b33e5dc,
|
|
364
364
|
__wbg_entries_c8a90a7ed73e84ce,
|
|
365
|
+
__wbg_error_30083555868aa7a9,
|
|
365
366
|
__wbg_error_7534b8e9a36f1ab4,
|
|
366
|
-
__wbg_error_ddc720e1a9bdab2e,
|
|
367
367
|
__wbg_from_2a5d3e218e67aa85,
|
|
368
368
|
__wbg_getOwnPropertySymbols_97eebed6fe6e08be,
|
|
369
369
|
__wbg_getRandomValues_b8f5dbd5f3995a9e,
|
|
@@ -381,7 +381,7 @@ export {
|
|
|
381
381
|
__wbg_length_a446193dc22c12f8,
|
|
382
382
|
__wbg_length_e2d2a49132c1b256,
|
|
383
383
|
__wbg_log_0cc1b7768397bcfe,
|
|
384
|
-
|
|
384
|
+
__wbg_log_c534a954ce262324,
|
|
385
385
|
__wbg_log_cb9e190acc5753fb,
|
|
386
386
|
__wbg_lorocounter_new,
|
|
387
387
|
__wbg_lorolist_new,
|
|
@@ -405,7 +405,7 @@ export {
|
|
|
405
405
|
__wbg_next_25feadfc0913fea9,
|
|
406
406
|
__wbg_next_6574e1a8a62d1055,
|
|
407
407
|
__wbg_node_905d3e251edff8a2,
|
|
408
|
-
|
|
408
|
+
__wbg_now_9a16e63446ca7697,
|
|
409
409
|
__wbg_ownKeys_3930041068756f1f,
|
|
410
410
|
__wbg_process_dc0fbacc7c1c06f7,
|
|
411
411
|
__wbg_push_737cfc8c1432c2c6,
|
|
@@ -429,7 +429,7 @@ export {
|
|
|
429
429
|
__wbg_value_cd1ffa7b1ab794f1,
|
|
430
430
|
__wbg_versions_c01dfd4722a88165,
|
|
431
431
|
__wbg_versionvector_new,
|
|
432
|
-
|
|
432
|
+
__wbg_warn_994f3bd0367746f9,
|
|
433
433
|
__wbindgen_as_number,
|
|
434
434
|
__wbindgen_bigint_from_i64,
|
|
435
435
|
__wbindgen_bigint_from_u64,
|
package/browser/loro_wasm_bg.js
CHANGED
|
@@ -263,6 +263,11 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
263
263
|
}
|
|
264
264
|
return result;
|
|
265
265
|
}
|
|
266
|
+
|
|
267
|
+
export function run() {
|
|
268
|
+
wasm.run();
|
|
269
|
+
}
|
|
270
|
+
|
|
266
271
|
/**
|
|
267
272
|
* Enable debug info of Loro
|
|
268
273
|
*/
|
|
@@ -270,6 +275,27 @@ export function setDebug() {
|
|
|
270
275
|
wasm.setDebug();
|
|
271
276
|
}
|
|
272
277
|
|
|
278
|
+
/**
|
|
279
|
+
* Get the version of Loro
|
|
280
|
+
* @returns {string}
|
|
281
|
+
*/
|
|
282
|
+
export function LORO_VERSION() {
|
|
283
|
+
let deferred1_0;
|
|
284
|
+
let deferred1_1;
|
|
285
|
+
try {
|
|
286
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
287
|
+
wasm.LORO_VERSION(retptr);
|
|
288
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
289
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
290
|
+
deferred1_0 = r0;
|
|
291
|
+
deferred1_1 = r1;
|
|
292
|
+
return getStringFromWasm0(r0, r1);
|
|
293
|
+
} finally {
|
|
294
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
295
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
273
299
|
/**
|
|
274
300
|
* Decode the metadata of the import blob.
|
|
275
301
|
*
|
|
@@ -303,48 +329,44 @@ export function decodeImportBlobMeta(blob, check_checksum) {
|
|
|
303
329
|
}
|
|
304
330
|
}
|
|
305
331
|
|
|
306
|
-
export function callPendingEvents() {
|
|
307
|
-
wasm.callPendingEvents();
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
311
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
312
|
-
const mem = getDataViewMemory0();
|
|
313
|
-
for (let i = 0; i < array.length; i++) {
|
|
314
|
-
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
315
|
-
}
|
|
316
|
-
WASM_VECTOR_LEN = array.length;
|
|
317
|
-
return ptr;
|
|
318
|
-
}
|
|
319
332
|
/**
|
|
320
|
-
*
|
|
321
|
-
*
|
|
333
|
+
* Redacts sensitive content in JSON updates within the specified version range.
|
|
334
|
+
*
|
|
335
|
+
* This function allows you to share document history while removing potentially sensitive content.
|
|
336
|
+
* It preserves the document structure and collaboration capabilities while replacing content with
|
|
337
|
+
* placeholders according to these redaction rules:
|
|
338
|
+
*
|
|
339
|
+
* - Preserves delete and move operations
|
|
340
|
+
* - Replaces text insertion content with the Unicode replacement character
|
|
341
|
+
* - Substitutes list and map insert values with null
|
|
342
|
+
* - Maintains structure of child containers
|
|
343
|
+
* - Replaces text mark values with null
|
|
344
|
+
* - Preserves map keys and text annotation keys
|
|
345
|
+
*
|
|
346
|
+
* @param {Object|string} jsonUpdates - The JSON updates to redact (object or JSON string)
|
|
347
|
+
* @param {Object} versionRange - Version range defining what content to redact,
|
|
348
|
+
* format: { peerId: [startCounter, endCounter], ... }
|
|
349
|
+
* @returns {Object} The redacted JSON updates
|
|
350
|
+
* @param {string | JsonSchema} json_updates
|
|
351
|
+
* @param {any} version_range
|
|
352
|
+
* @returns {JsonSchema}
|
|
322
353
|
*/
|
|
323
|
-
export function
|
|
354
|
+
export function redactJsonUpdates(json_updates, version_range) {
|
|
324
355
|
try {
|
|
325
356
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
326
|
-
|
|
327
|
-
const len0 = WASM_VECTOR_LEN;
|
|
328
|
-
wasm.encodeFrontiers(retptr, ptr0, len0);
|
|
357
|
+
wasm.redactJsonUpdates(retptr, addHeapObject(json_updates), addHeapObject(version_range));
|
|
329
358
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
330
359
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
331
360
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
throw takeObject(r2);
|
|
361
|
+
if (r2) {
|
|
362
|
+
throw takeObject(r1);
|
|
335
363
|
}
|
|
336
|
-
|
|
337
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
338
|
-
return v2;
|
|
364
|
+
return takeObject(r0);
|
|
339
365
|
} finally {
|
|
340
366
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
341
367
|
}
|
|
342
368
|
}
|
|
343
369
|
|
|
344
|
-
export function run() {
|
|
345
|
-
wasm.run();
|
|
346
|
-
}
|
|
347
|
-
|
|
348
370
|
/**
|
|
349
371
|
* @param {Uint8Array} bytes
|
|
350
372
|
* @returns {{ peer: PeerID, counter: number }[]}
|
|
@@ -367,71 +389,50 @@ export function decodeFrontiers(bytes) {
|
|
|
367
389
|
}
|
|
368
390
|
}
|
|
369
391
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
* @returns {string}
|
|
373
|
-
*/
|
|
374
|
-
export function LORO_VERSION() {
|
|
375
|
-
let deferred1_0;
|
|
376
|
-
let deferred1_1;
|
|
377
|
-
try {
|
|
378
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
379
|
-
wasm.LORO_VERSION(retptr);
|
|
380
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
381
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
382
|
-
deferred1_0 = r0;
|
|
383
|
-
deferred1_1 = r1;
|
|
384
|
-
return getStringFromWasm0(r0, r1);
|
|
385
|
-
} finally {
|
|
386
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
387
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
388
|
-
}
|
|
392
|
+
export function callPendingEvents() {
|
|
393
|
+
wasm.callPendingEvents();
|
|
389
394
|
}
|
|
390
395
|
|
|
396
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
397
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
398
|
+
const mem = getDataViewMemory0();
|
|
399
|
+
for (let i = 0; i < array.length; i++) {
|
|
400
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
401
|
+
}
|
|
402
|
+
WASM_VECTOR_LEN = array.length;
|
|
403
|
+
return ptr;
|
|
404
|
+
}
|
|
391
405
|
/**
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
* This function allows you to share document history while removing potentially sensitive content.
|
|
395
|
-
* It preserves the document structure and collaboration capabilities while replacing content with
|
|
396
|
-
* placeholders according to these redaction rules:
|
|
397
|
-
*
|
|
398
|
-
* - Preserves delete and move operations
|
|
399
|
-
* - Replaces text insertion content with the Unicode replacement character
|
|
400
|
-
* - Substitutes list and map insert values with null
|
|
401
|
-
* - Maintains structure of child containers
|
|
402
|
-
* - Replaces text mark values with null
|
|
403
|
-
* - Preserves map keys and text annotation keys
|
|
404
|
-
*
|
|
405
|
-
* @param {Object|string} jsonUpdates - The JSON updates to redact (object or JSON string)
|
|
406
|
-
* @param {Object} versionRange - Version range defining what content to redact,
|
|
407
|
-
* format: { peerId: [startCounter, endCounter], ... }
|
|
408
|
-
* @returns {Object} The redacted JSON updates
|
|
409
|
-
* @param {string | JsonSchema} json_updates
|
|
410
|
-
* @param {any} version_range
|
|
411
|
-
* @returns {JsonSchema}
|
|
406
|
+
* @param {({ peer: PeerID, counter: number })[]} frontiers
|
|
407
|
+
* @returns {Uint8Array}
|
|
412
408
|
*/
|
|
413
|
-
export function
|
|
409
|
+
export function encodeFrontiers(frontiers) {
|
|
414
410
|
try {
|
|
415
411
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
416
|
-
|
|
412
|
+
const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
|
|
413
|
+
const len0 = WASM_VECTOR_LEN;
|
|
414
|
+
wasm.encodeFrontiers(retptr, ptr0, len0);
|
|
417
415
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
418
416
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
419
417
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
420
|
-
|
|
421
|
-
|
|
418
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
419
|
+
if (r3) {
|
|
420
|
+
throw takeObject(r2);
|
|
422
421
|
}
|
|
423
|
-
|
|
422
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
423
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
424
|
+
return v2;
|
|
424
425
|
} finally {
|
|
425
426
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
426
427
|
}
|
|
427
428
|
}
|
|
428
429
|
|
|
429
430
|
function __wbg_adapter_60(arg0, arg1, arg2) {
|
|
430
|
-
wasm.
|
|
431
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbc243e3100319c48(arg0, arg1, addHeapObject(arg2));
|
|
431
432
|
}
|
|
432
433
|
|
|
433
434
|
function __wbg_adapter_63(arg0, arg1) {
|
|
434
|
-
wasm.
|
|
435
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h09294ef44fc27173(arg0, arg1);
|
|
435
436
|
}
|
|
436
437
|
|
|
437
438
|
const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -7009,6 +7010,10 @@ export function __wbg_entries_c8a90a7ed73e84ce(arg0) {
|
|
|
7009
7010
|
return addHeapObject(ret);
|
|
7010
7011
|
};
|
|
7011
7012
|
|
|
7013
|
+
export function __wbg_error_30083555868aa7a9(arg0, arg1) {
|
|
7014
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
7015
|
+
};
|
|
7016
|
+
|
|
7012
7017
|
export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
7013
7018
|
let deferred0_0;
|
|
7014
7019
|
let deferred0_1;
|
|
@@ -7021,10 +7026,6 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
|
7021
7026
|
}
|
|
7022
7027
|
};
|
|
7023
7028
|
|
|
7024
|
-
export function __wbg_error_ddc720e1a9bdab2e(arg0, arg1) {
|
|
7025
|
-
console.error(getStringFromWasm0(arg0, arg1));
|
|
7026
|
-
};
|
|
7027
|
-
|
|
7028
7029
|
export function __wbg_from_2a5d3e218e67aa85(arg0) {
|
|
7029
7030
|
const ret = Array.from(getObject(arg0));
|
|
7030
7031
|
return addHeapObject(ret);
|
|
@@ -7140,7 +7141,7 @@ export function __wbg_log_0cc1b7768397bcfe(arg0, arg1, arg2, arg3, arg4, arg5, a
|
|
|
7140
7141
|
}
|
|
7141
7142
|
};
|
|
7142
7143
|
|
|
7143
|
-
export function
|
|
7144
|
+
export function __wbg_log_c534a954ce262324(arg0, arg1) {
|
|
7144
7145
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
7145
7146
|
};
|
|
7146
7147
|
|
|
@@ -7277,7 +7278,7 @@ export function __wbg_node_905d3e251edff8a2(arg0) {
|
|
|
7277
7278
|
return addHeapObject(ret);
|
|
7278
7279
|
};
|
|
7279
7280
|
|
|
7280
|
-
export function
|
|
7281
|
+
export function __wbg_now_9a16e63446ca7697() {
|
|
7281
7282
|
const ret = Date.now();
|
|
7282
7283
|
return ret;
|
|
7283
7284
|
};
|
|
@@ -7390,7 +7391,7 @@ export function __wbg_versionvector_new(arg0) {
|
|
|
7390
7391
|
return addHeapObject(ret);
|
|
7391
7392
|
};
|
|
7392
7393
|
|
|
7393
|
-
export function
|
|
7394
|
+
export function __wbg_warn_994f3bd0367746f9(arg0, arg1) {
|
|
7394
7395
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
7395
7396
|
};
|
|
7396
7397
|
|
|
Binary file
|
|
@@ -330,6 +330,6 @@ export const __wbindgen_exn_store: (a: number) => void;
|
|
|
330
330
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
331
331
|
export const __wbindgen_export_4: WebAssembly.Table;
|
|
332
332
|
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
333
|
-
export const
|
|
334
|
-
export const
|
|
333
|
+
export const _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbc243e3100319c48: (a: number, b: number, c: number) => void;
|
|
334
|
+
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h09294ef44fc27173: (a: number, b: number) => void;
|
|
335
335
|
export const __wbindgen_start: () => void;
|
package/bundler/index.js
CHANGED
|
@@ -409,8 +409,8 @@ export {
|
|
|
409
409
|
__wbg_done_769e5ede4b31c67b,
|
|
410
410
|
__wbg_entries_3265d4158b33e5dc,
|
|
411
411
|
__wbg_entries_c8a90a7ed73e84ce,
|
|
412
|
+
__wbg_error_30083555868aa7a9,
|
|
412
413
|
__wbg_error_7534b8e9a36f1ab4,
|
|
413
|
-
__wbg_error_ddc720e1a9bdab2e,
|
|
414
414
|
__wbg_from_2a5d3e218e67aa85,
|
|
415
415
|
__wbg_getOwnPropertySymbols_97eebed6fe6e08be,
|
|
416
416
|
__wbg_getRandomValues_b8f5dbd5f3995a9e,
|
|
@@ -428,7 +428,7 @@ export {
|
|
|
428
428
|
__wbg_length_a446193dc22c12f8,
|
|
429
429
|
__wbg_length_e2d2a49132c1b256,
|
|
430
430
|
__wbg_log_0cc1b7768397bcfe,
|
|
431
|
-
|
|
431
|
+
__wbg_log_c534a954ce262324,
|
|
432
432
|
__wbg_log_cb9e190acc5753fb,
|
|
433
433
|
__wbg_lorocounter_new,
|
|
434
434
|
__wbg_lorolist_new,
|
|
@@ -452,7 +452,7 @@ export {
|
|
|
452
452
|
__wbg_next_25feadfc0913fea9,
|
|
453
453
|
__wbg_next_6574e1a8a62d1055,
|
|
454
454
|
__wbg_node_905d3e251edff8a2,
|
|
455
|
-
|
|
455
|
+
__wbg_now_9a16e63446ca7697,
|
|
456
456
|
__wbg_ownKeys_3930041068756f1f,
|
|
457
457
|
__wbg_process_dc0fbacc7c1c06f7,
|
|
458
458
|
__wbg_push_737cfc8c1432c2c6,
|
|
@@ -476,7 +476,7 @@ export {
|
|
|
476
476
|
__wbg_value_cd1ffa7b1ab794f1,
|
|
477
477
|
__wbg_versions_c01dfd4722a88165,
|
|
478
478
|
__wbg_versionvector_new,
|
|
479
|
-
|
|
479
|
+
__wbg_warn_994f3bd0367746f9,
|
|
480
480
|
__wbindgen_as_number,
|
|
481
481
|
__wbindgen_bigint_from_i64,
|
|
482
482
|
__wbindgen_bigint_from_u64,
|
package/bundler/loro_wasm.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export function run(): void;
|
|
3
4
|
/**
|
|
4
5
|
* Enable debug info of Loro
|
|
5
6
|
*/
|
|
6
7
|
export function setDebug(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Get the version of Loro
|
|
10
|
+
*/
|
|
11
|
+
export function LORO_VERSION(): string;
|
|
7
12
|
/**
|
|
8
13
|
* Decode the metadata of the import blob.
|
|
9
14
|
*
|
|
@@ -17,14 +22,6 @@ export function setDebug(): void;
|
|
|
17
22
|
* - changeNum
|
|
18
23
|
*/
|
|
19
24
|
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
20
|
-
export function callPendingEvents(): void;
|
|
21
|
-
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
22
|
-
export function run(): void;
|
|
23
|
-
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
24
|
-
/**
|
|
25
|
-
* Get the version of Loro
|
|
26
|
-
*/
|
|
27
|
-
export function LORO_VERSION(): string;
|
|
28
25
|
/**
|
|
29
26
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
30
27
|
*
|
|
@@ -45,6 +42,9 @@ export function LORO_VERSION(): string;
|
|
|
45
42
|
* @returns {Object} The redacted JSON updates
|
|
46
43
|
*/
|
|
47
44
|
export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
|
|
45
|
+
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
46
|
+
export function callPendingEvents(): void;
|
|
47
|
+
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Container types supported by loro.
|