@ping-app/ping-openmls-sdk 0.10.2 → 0.10.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/index.cjs +50 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -3
- package/dist/index.d.ts +35 -3
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -1
- package/dist/notification-preview.d.cts +1 -1
- package/dist/notification-preview.d.ts +1 -1
- package/dist/storage/indexeddb.d.cts +1 -1
- package/dist/storage/indexeddb.d.ts +1 -1
- package/dist/transport/websocket.d.cts +1 -1
- package/dist/transport/websocket.d.ts +1 -1
- package/dist/{types-gAmJFSC-.d.cts → types-BOXvsHgp.d.cts} +30 -1
- package/dist/{types-gAmJFSC-.d.ts → types-BOXvsHgp.d.ts} +30 -1
- package/dist/worker.cjs +2 -0
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.js +3 -0
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/wasm/package.json +1 -1
- package/wasm/ping_wasm.d.ts +20 -2
- package/wasm/ping_wasm.js +60 -22
- package/wasm/ping_wasm_bg.wasm +0 -0
- package/wasm/ping_wasm_bg.wasm.d.ts +3 -2
package/wasm/ping_wasm.js
CHANGED
|
@@ -1424,6 +1424,44 @@ export function _start() {
|
|
|
1424
1424
|
wasm._start();
|
|
1425
1425
|
}
|
|
1426
1426
|
|
|
1427
|
+
/**
|
|
1428
|
+
* Whether `mnemonicPhrase` opens `blob`, with THREE answers
|
|
1429
|
+
* (`ping_recovery::check_backup_phrase`). Resolves
|
|
1430
|
+
* `{ outcome: "opens" | "authenticationFailed" | "couldNotCheck", reason? }`,
|
|
1431
|
+
* where `reason` is set exactly for `couldNotCheck`: `"invalidPhrase"`,
|
|
1432
|
+
* `"unsupportedVersion"`, `"malformed"`, `"undecodable"` or `"internal"`. The
|
|
1433
|
+
* codes are the core's (`outcome_code`, `BackupCheckFailure::code`), pinned
|
|
1434
|
+
* there and replayed from one table by `sdk/js`
|
|
1435
|
+
* (`backup-phrase-check.test.ts`).
|
|
1436
|
+
*
|
|
1437
|
+
* `authenticationFailed` is the only proof that the phrase does not open
|
|
1438
|
+
* these bytes; every `couldNotCheck` is a doubt. Never throws for an answer
|
|
1439
|
+
* of the check, returns nothing of the backup, logs nothing. `decryptBackup`
|
|
1440
|
+
* is unchanged and still rejects with its one message.
|
|
1441
|
+
* @param {Uint8Array} blob
|
|
1442
|
+
* @param {string} mnemonic_phrase
|
|
1443
|
+
* @returns {any}
|
|
1444
|
+
*/
|
|
1445
|
+
export function checkBackupPhrase(blob, mnemonic_phrase) {
|
|
1446
|
+
try {
|
|
1447
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1448
|
+
const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_export);
|
|
1449
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1450
|
+
const ptr1 = passStringToWasm0(mnemonic_phrase, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1451
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1452
|
+
wasm.checkBackupPhrase(retptr, ptr0, len0, ptr1, len1);
|
|
1453
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1454
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1455
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1456
|
+
if (r2) {
|
|
1457
|
+
throw takeObject(r1);
|
|
1458
|
+
}
|
|
1459
|
+
return takeObject(r0);
|
|
1460
|
+
} finally {
|
|
1461
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1427
1465
|
/**
|
|
1428
1466
|
* HPKE-open a sealed `LinkingTicket` ([CR-3]). Pure function — usable without an
|
|
1429
1467
|
* initialized `PingClient`, which is exactly the situation the receiving device is in
|
|
@@ -2383,7 +2421,7 @@ function __wbg_get_imports() {
|
|
|
2383
2421
|
__wbg__wbg_cb_unref_be22cc64ae6946a0: function(arg0) {
|
|
2384
2422
|
getObject(arg0)._wbg_cb_unref();
|
|
2385
2423
|
},
|
|
2386
|
-
|
|
2424
|
+
__wbg_applyBatch_de14959bc7389069: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2387
2425
|
const ret = getObject(arg0).applyBatch(getStringFromWasm0(arg1, arg2), takeObject(arg3), takeObject(arg4));
|
|
2388
2426
|
return addHeapObject(ret);
|
|
2389
2427
|
},
|
|
@@ -2399,11 +2437,11 @@ function __wbg_get_imports() {
|
|
|
2399
2437
|
const ret = getObject(arg0).crypto;
|
|
2400
2438
|
return addHeapObject(ret);
|
|
2401
2439
|
},
|
|
2402
|
-
|
|
2440
|
+
__wbg_del_c3b129e21a741c9d: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2403
2441
|
const ret = getObject(arg0).del(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2404
2442
|
return addHeapObject(ret);
|
|
2405
2443
|
},
|
|
2406
|
-
|
|
2444
|
+
__wbg_discoverDevices_8ca6166b2842dbe2: function(arg0, arg1) {
|
|
2407
2445
|
const ret = getObject(arg0).discoverDevices(takeObject(arg1));
|
|
2408
2446
|
return addHeapObject(ret);
|
|
2409
2447
|
},
|
|
@@ -2426,15 +2464,15 @@ function __wbg_get_imports() {
|
|
|
2426
2464
|
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
2427
2465
|
}
|
|
2428
2466
|
},
|
|
2429
|
-
|
|
2467
|
+
__wbg_fetchLogHeads_20d58ba96250ab8e: function(arg0) {
|
|
2430
2468
|
const ret = getObject(arg0).fetchLogHeads();
|
|
2431
2469
|
return addHeapObject(ret);
|
|
2432
2470
|
},
|
|
2433
|
-
|
|
2471
|
+
__wbg_fetchLogSince_a8f2ff64d0fc895c: function(arg0, arg1, arg2) {
|
|
2434
2472
|
const ret = getObject(arg0).fetchLogSince(takeObject(arg1), arg2 >>> 0);
|
|
2435
2473
|
return addHeapObject(ret);
|
|
2436
2474
|
},
|
|
2437
|
-
|
|
2475
|
+
__wbg_fetchSince_ff2315684811363f: function(arg0, arg1, arg2, arg3) {
|
|
2438
2476
|
const ret = getObject(arg0).fetchSince(takeObject(arg1), takeObject(arg2), arg3 >>> 0);
|
|
2439
2477
|
return addHeapObject(ret);
|
|
2440
2478
|
},
|
|
@@ -2451,6 +2489,10 @@ function __wbg_get_imports() {
|
|
|
2451
2489
|
__wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
|
|
2452
2490
|
getObject(arg0).getRandomValues(getObject(arg1));
|
|
2453
2491
|
}, arguments); },
|
|
2492
|
+
__wbg_get_05ecab9f9d0da0cb: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2493
|
+
const ret = getObject(arg0).get(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2494
|
+
return addHeapObject(ret);
|
|
2495
|
+
},
|
|
2454
2496
|
__wbg_get_971a0c45d172643f: function() { return handleError(function (arg0, arg1) {
|
|
2455
2497
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2456
2498
|
return addHeapObject(ret);
|
|
@@ -2463,10 +2505,6 @@ function __wbg_get_imports() {
|
|
|
2463
2505
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2464
2506
|
return addHeapObject(ret);
|
|
2465
2507
|
}, arguments); },
|
|
2466
|
-
__wbg_get_fda3c223a9e9bd0c: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2467
|
-
const ret = getObject(arg0).get(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2468
|
-
return addHeapObject(ret);
|
|
2469
|
-
},
|
|
2470
2508
|
__wbg_get_unchecked_e20b893aeafc3fca: function(arg0, arg1) {
|
|
2471
2509
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2472
2510
|
return addHeapObject(ret);
|
|
@@ -2515,11 +2553,11 @@ function __wbg_get_imports() {
|
|
|
2515
2553
|
const ret = getObject(arg0).length;
|
|
2516
2554
|
return ret;
|
|
2517
2555
|
},
|
|
2518
|
-
|
|
2556
|
+
__wbg_listEntries_3a4c3185f2cb86ca: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2519
2557
|
const ret = getObject(arg0).listEntries(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2520
2558
|
return addHeapObject(ret);
|
|
2521
2559
|
},
|
|
2522
|
-
|
|
2560
|
+
__wbg_listKeys_f114996c3760f96e: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2523
2561
|
const ret = getObject(arg0).listKeys(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2524
2562
|
return addHeapObject(ret);
|
|
2525
2563
|
},
|
|
@@ -2554,7 +2592,7 @@ function __wbg_get_imports() {
|
|
|
2554
2592
|
const a = state0.a;
|
|
2555
2593
|
state0.a = 0;
|
|
2556
2594
|
try {
|
|
2557
|
-
return
|
|
2595
|
+
return __wasm_bindgen_func_elem_4238(a, state0.b, arg0, arg1);
|
|
2558
2596
|
} finally {
|
|
2559
2597
|
state0.a = a;
|
|
2560
2598
|
}
|
|
@@ -2600,7 +2638,7 @@ function __wbg_get_imports() {
|
|
|
2600
2638
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
2601
2639
|
return ret;
|
|
2602
2640
|
},
|
|
2603
|
-
|
|
2641
|
+
__wbg_put_975419b1499979f6: function(arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
2604
2642
|
const ret = getObject(arg0).put(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), takeObject(arg5));
|
|
2605
2643
|
return addHeapObject(ret);
|
|
2606
2644
|
},
|
|
@@ -2622,15 +2660,15 @@ function __wbg_get_imports() {
|
|
|
2622
2660
|
const ret = Promise.resolve(getObject(arg0));
|
|
2623
2661
|
return addHeapObject(ret);
|
|
2624
2662
|
},
|
|
2625
|
-
|
|
2663
|
+
__wbg_sendBatch_880a500001e45ea8: function(arg0, arg1) {
|
|
2626
2664
|
const ret = getObject(arg0).sendBatch(takeObject(arg1));
|
|
2627
2665
|
return addHeapObject(ret);
|
|
2628
2666
|
},
|
|
2629
|
-
|
|
2667
|
+
__wbg_send_60a6ce072d4fd782: function(arg0, arg1) {
|
|
2630
2668
|
const ret = getObject(arg0).send(takeObject(arg1));
|
|
2631
2669
|
return addHeapObject(ret);
|
|
2632
2670
|
},
|
|
2633
|
-
|
|
2671
|
+
__wbg_setNextWelcomeRecipients_0ef5b85f2041b914: function(arg0, arg1, arg2) {
|
|
2634
2672
|
const ret = getObject(arg0).setNextWelcomeRecipients(takeObject(arg1), takeObject(arg2));
|
|
2635
2673
|
return addHeapObject(ret);
|
|
2636
2674
|
},
|
|
@@ -2689,7 +2727,7 @@ function __wbg_get_imports() {
|
|
|
2689
2727
|
},
|
|
2690
2728
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2691
2729
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1048, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2692
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2730
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_4223);
|
|
2693
2731
|
return addHeapObject(ret);
|
|
2694
2732
|
},
|
|
2695
2733
|
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
@@ -2733,10 +2771,10 @@ function __wbg_get_imports() {
|
|
|
2733
2771
|
};
|
|
2734
2772
|
}
|
|
2735
2773
|
|
|
2736
|
-
function
|
|
2774
|
+
function __wasm_bindgen_func_elem_4223(arg0, arg1, arg2) {
|
|
2737
2775
|
try {
|
|
2738
2776
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2739
|
-
wasm.
|
|
2777
|
+
wasm.__wasm_bindgen_func_elem_4223(retptr, arg0, arg1, addHeapObject(arg2));
|
|
2740
2778
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2741
2779
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2742
2780
|
if (r1) {
|
|
@@ -2747,8 +2785,8 @@ function __wasm_bindgen_func_elem_4220(arg0, arg1, arg2) {
|
|
|
2747
2785
|
}
|
|
2748
2786
|
}
|
|
2749
2787
|
|
|
2750
|
-
function
|
|
2751
|
-
wasm.
|
|
2788
|
+
function __wasm_bindgen_func_elem_4238(arg0, arg1, arg2, arg3) {
|
|
2789
|
+
wasm.__wasm_bindgen_func_elem_4238(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
2752
2790
|
}
|
|
2753
2791
|
|
|
2754
2792
|
const PingClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
package/wasm/ping_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_pingclient_free: (a: number, b: number) => void;
|
|
5
|
+
export const checkBackupPhrase: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
5
6
|
export const decodeCatchupSnapshot: (a: number, b: number, c: number) => void;
|
|
6
7
|
export const decryptBackup: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
7
8
|
export const deviceGroupIdFor: (a: number, b: number) => number;
|
|
@@ -103,8 +104,8 @@ export const signDeviceLinkApproval: (a: number, b: number, c: number, d: number
|
|
|
103
104
|
export const signDeviceLinkPossession: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
104
105
|
export const signDeviceReauth: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
|
|
105
106
|
export const _start: () => void;
|
|
106
|
-
export const
|
|
107
|
-
export const
|
|
107
|
+
export const __wasm_bindgen_func_elem_4223: (a: number, b: number, c: number, d: number) => void;
|
|
108
|
+
export const __wasm_bindgen_func_elem_4238: (a: number, b: number, c: number, d: number) => void;
|
|
108
109
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
109
110
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
110
111
|
export const __wbindgen_export3: (a: number) => void;
|