@ping-app/ping-openmls-sdk 0.10.0 → 0.10.1
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 +23 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/notification-preview.cjs +25 -0
- package/dist/notification-preview.cjs.map +1 -1
- package/dist/notification-preview.d.cts +40 -1
- package/dist/notification-preview.d.ts +40 -1
- package/dist/notification-preview.js +23 -0
- package/dist/notification-preview.js.map +1 -1
- package/dist/worker.cjs +6 -0
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.js +6 -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 +28 -2
- package/wasm/ping_wasm.js +65 -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
|
@@ -911,6 +911,49 @@ export class PingClient {
|
|
|
911
911
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
|
+
/**
|
|
915
|
+
* [`previewEnvelope`](Self::preview_envelope) for a message the stored
|
|
916
|
+
* snapshot cannot read yet: the first message of a conversation whose
|
|
917
|
+
* Welcome is still waiting on the server, or one sealed after a
|
|
918
|
+
* membership change the page has not applied.
|
|
919
|
+
*
|
|
920
|
+
* `prerequisites` is an array of envelopes: this device's pending Welcome
|
|
921
|
+
* for the conversation, and the Commits and Proposals that follow it in
|
|
922
|
+
* the log, in log order. They are applied to this client's private copy
|
|
923
|
+
* of the MLS state (the Welcome under the same rules as a real join),
|
|
924
|
+
* the envelope is decrypted, and all of it is discarded with the client.
|
|
925
|
+
* Nothing is written: the page still joins from the same Welcome and
|
|
926
|
+
* decrypts the same message when it next runs.
|
|
927
|
+
*
|
|
928
|
+
* Envelopes for another conversation and kinds other than welcome,
|
|
929
|
+
* commit and proposal are ignored; a commit or proposal that does not
|
|
930
|
+
* apply is skipped. At most 64 prerequisites; more rejects. Resolves
|
|
931
|
+
* `null` when there is nothing to show, and rejects with the join error
|
|
932
|
+
* when a Welcome was offered, none joined, and the conversation is still
|
|
933
|
+
* not held.
|
|
934
|
+
*
|
|
935
|
+
* Rejects on a client that did not come from
|
|
936
|
+
* [`openReadOnly`](Self::open_read_only).
|
|
937
|
+
* @param {any} prerequisites
|
|
938
|
+
* @param {any} envelope
|
|
939
|
+
* @param {number} now_ms
|
|
940
|
+
* @returns {any}
|
|
941
|
+
*/
|
|
942
|
+
previewEnvelopeWithPrerequisites(prerequisites, envelope, now_ms) {
|
|
943
|
+
try {
|
|
944
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
945
|
+
wasm.pingclient_previewEnvelopeWithPrerequisites(retptr, this.__wbg_ptr, addHeapObject(prerequisites), addHeapObject(envelope), now_ms);
|
|
946
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
947
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
948
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
949
|
+
if (r2) {
|
|
950
|
+
throw takeObject(r1);
|
|
951
|
+
}
|
|
952
|
+
return takeObject(r0);
|
|
953
|
+
} finally {
|
|
954
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
914
957
|
/**
|
|
915
958
|
* @param {any} env
|
|
916
959
|
* @param {number} now_ms
|
|
@@ -2300,7 +2343,7 @@ function __wbg_get_imports() {
|
|
|
2300
2343
|
__wbg__wbg_cb_unref_be22cc64ae6946a0: function(arg0) {
|
|
2301
2344
|
getObject(arg0)._wbg_cb_unref();
|
|
2302
2345
|
},
|
|
2303
|
-
|
|
2346
|
+
__wbg_applyBatch_406d7dbd1084b3f8: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2304
2347
|
const ret = getObject(arg0).applyBatch(getStringFromWasm0(arg1, arg2), takeObject(arg3), takeObject(arg4));
|
|
2305
2348
|
return addHeapObject(ret);
|
|
2306
2349
|
},
|
|
@@ -2316,11 +2359,11 @@ function __wbg_get_imports() {
|
|
|
2316
2359
|
const ret = getObject(arg0).crypto;
|
|
2317
2360
|
return addHeapObject(ret);
|
|
2318
2361
|
},
|
|
2319
|
-
|
|
2362
|
+
__wbg_del_77ee30f11147a08a: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2320
2363
|
const ret = getObject(arg0).del(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2321
2364
|
return addHeapObject(ret);
|
|
2322
2365
|
},
|
|
2323
|
-
|
|
2366
|
+
__wbg_discoverDevices_48997fecdd635ffe: function(arg0, arg1) {
|
|
2324
2367
|
const ret = getObject(arg0).discoverDevices(takeObject(arg1));
|
|
2325
2368
|
return addHeapObject(ret);
|
|
2326
2369
|
},
|
|
@@ -2343,15 +2386,15 @@ function __wbg_get_imports() {
|
|
|
2343
2386
|
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
2344
2387
|
}
|
|
2345
2388
|
},
|
|
2346
|
-
|
|
2389
|
+
__wbg_fetchLogHeads_e78f7b7086790e4e: function(arg0) {
|
|
2347
2390
|
const ret = getObject(arg0).fetchLogHeads();
|
|
2348
2391
|
return addHeapObject(ret);
|
|
2349
2392
|
},
|
|
2350
|
-
|
|
2393
|
+
__wbg_fetchLogSince_9160c59aa2abdb21: function(arg0, arg1, arg2) {
|
|
2351
2394
|
const ret = getObject(arg0).fetchLogSince(takeObject(arg1), arg2 >>> 0);
|
|
2352
2395
|
return addHeapObject(ret);
|
|
2353
2396
|
},
|
|
2354
|
-
|
|
2397
|
+
__wbg_fetchSince_b12814c52b08f8cf: function(arg0, arg1, arg2, arg3) {
|
|
2355
2398
|
const ret = getObject(arg0).fetchSince(takeObject(arg1), takeObject(arg2), arg3 >>> 0);
|
|
2356
2399
|
return addHeapObject(ret);
|
|
2357
2400
|
},
|
|
@@ -2372,6 +2415,10 @@ function __wbg_get_imports() {
|
|
|
2372
2415
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2373
2416
|
return addHeapObject(ret);
|
|
2374
2417
|
}, arguments); },
|
|
2418
|
+
__wbg_get_aa5df4f67a22a0ad: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2419
|
+
const ret = getObject(arg0).get(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2420
|
+
return addHeapObject(ret);
|
|
2421
|
+
},
|
|
2375
2422
|
__wbg_get_c0c8f8d7da0c03dd: function(arg0, arg1) {
|
|
2376
2423
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2377
2424
|
return addHeapObject(ret);
|
|
@@ -2380,10 +2427,6 @@ function __wbg_get_imports() {
|
|
|
2380
2427
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2381
2428
|
return addHeapObject(ret);
|
|
2382
2429
|
}, arguments); },
|
|
2383
|
-
__wbg_get_f63ac2a0fb06f019: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2384
|
-
const ret = getObject(arg0).get(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2385
|
-
return addHeapObject(ret);
|
|
2386
|
-
},
|
|
2387
2430
|
__wbg_get_unchecked_e20b893aeafc3fca: function(arg0, arg1) {
|
|
2388
2431
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2389
2432
|
return addHeapObject(ret);
|
|
@@ -2432,11 +2475,11 @@ function __wbg_get_imports() {
|
|
|
2432
2475
|
const ret = getObject(arg0).length;
|
|
2433
2476
|
return ret;
|
|
2434
2477
|
},
|
|
2435
|
-
|
|
2478
|
+
__wbg_listEntries_7b924b3e7ff2b526: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2436
2479
|
const ret = getObject(arg0).listEntries(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2437
2480
|
return addHeapObject(ret);
|
|
2438
2481
|
},
|
|
2439
|
-
|
|
2482
|
+
__wbg_listKeys_ffe3a9798e88abde: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2440
2483
|
const ret = getObject(arg0).listKeys(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2441
2484
|
return addHeapObject(ret);
|
|
2442
2485
|
},
|
|
@@ -2471,7 +2514,7 @@ function __wbg_get_imports() {
|
|
|
2471
2514
|
const a = state0.a;
|
|
2472
2515
|
state0.a = 0;
|
|
2473
2516
|
try {
|
|
2474
|
-
return
|
|
2517
|
+
return __wasm_bindgen_func_elem_4230(a, state0.b, arg0, arg1);
|
|
2475
2518
|
} finally {
|
|
2476
2519
|
state0.a = a;
|
|
2477
2520
|
}
|
|
@@ -2517,7 +2560,7 @@ function __wbg_get_imports() {
|
|
|
2517
2560
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
2518
2561
|
return ret;
|
|
2519
2562
|
},
|
|
2520
|
-
|
|
2563
|
+
__wbg_put_053c25b07020914f: function(arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
2521
2564
|
const ret = getObject(arg0).put(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), takeObject(arg5));
|
|
2522
2565
|
return addHeapObject(ret);
|
|
2523
2566
|
},
|
|
@@ -2539,15 +2582,15 @@ function __wbg_get_imports() {
|
|
|
2539
2582
|
const ret = Promise.resolve(getObject(arg0));
|
|
2540
2583
|
return addHeapObject(ret);
|
|
2541
2584
|
},
|
|
2542
|
-
|
|
2585
|
+
__wbg_sendBatch_642a94f23a738334: function(arg0, arg1) {
|
|
2543
2586
|
const ret = getObject(arg0).sendBatch(takeObject(arg1));
|
|
2544
2587
|
return addHeapObject(ret);
|
|
2545
2588
|
},
|
|
2546
|
-
|
|
2589
|
+
__wbg_send_50a83d84aca86680: function(arg0, arg1) {
|
|
2547
2590
|
const ret = getObject(arg0).send(takeObject(arg1));
|
|
2548
2591
|
return addHeapObject(ret);
|
|
2549
2592
|
},
|
|
2550
|
-
|
|
2593
|
+
__wbg_setNextWelcomeRecipients_a3c6e79d35538d0d: function(arg0, arg1, arg2) {
|
|
2551
2594
|
const ret = getObject(arg0).setNextWelcomeRecipients(takeObject(arg1), takeObject(arg2));
|
|
2552
2595
|
return addHeapObject(ret);
|
|
2553
2596
|
},
|
|
@@ -2602,7 +2645,7 @@ function __wbg_get_imports() {
|
|
|
2602
2645
|
},
|
|
2603
2646
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2604
2647
|
// 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`.
|
|
2605
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2648
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_4215);
|
|
2606
2649
|
return addHeapObject(ret);
|
|
2607
2650
|
},
|
|
2608
2651
|
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
@@ -2646,10 +2689,10 @@ function __wbg_get_imports() {
|
|
|
2646
2689
|
};
|
|
2647
2690
|
}
|
|
2648
2691
|
|
|
2649
|
-
function
|
|
2692
|
+
function __wasm_bindgen_func_elem_4215(arg0, arg1, arg2) {
|
|
2650
2693
|
try {
|
|
2651
2694
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2652
|
-
wasm.
|
|
2695
|
+
wasm.__wasm_bindgen_func_elem_4215(retptr, arg0, arg1, addHeapObject(arg2));
|
|
2653
2696
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2654
2697
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2655
2698
|
if (r1) {
|
|
@@ -2660,8 +2703,8 @@ function __wasm_bindgen_func_elem_4208(arg0, arg1, arg2) {
|
|
|
2660
2703
|
}
|
|
2661
2704
|
}
|
|
2662
2705
|
|
|
2663
|
-
function
|
|
2664
|
-
wasm.
|
|
2706
|
+
function __wasm_bindgen_func_elem_4230(arg0, arg1, arg2, arg3) {
|
|
2707
|
+
wasm.__wasm_bindgen_func_elem_4230(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
2665
2708
|
}
|
|
2666
2709
|
|
|
2667
2710
|
const PingClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
package/wasm/ping_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -68,6 +68,7 @@ export const pingclient_openReadOnly: (a: number, b: number, c: number, d: numbe
|
|
|
68
68
|
export const pingclient_pendingApplies: (a: number, b: number) => void;
|
|
69
69
|
export const pingclient_pendingProposalsCommitRank: (a: number, b: number, c: number) => number;
|
|
70
70
|
export const pingclient_previewEnvelope: (a: number, b: number, c: number, d: number) => void;
|
|
71
|
+
export const pingclient_previewEnvelopeWithPrerequisites: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
71
72
|
export const pingclient_processEnvelope: (a: number, b: number, c: number) => number;
|
|
72
73
|
export const pingclient_processSequencedBatch: (a: number, b: number, c: number) => number;
|
|
73
74
|
export const pingclient_processWelcomeAt: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
@@ -101,8 +102,8 @@ export const signDeviceLinkApproval: (a: number, b: number, c: number, d: number
|
|
|
101
102
|
export const signDeviceLinkPossession: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
102
103
|
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;
|
|
103
104
|
export const _start: () => void;
|
|
104
|
-
export const
|
|
105
|
-
export const
|
|
105
|
+
export const __wasm_bindgen_func_elem_4215: (a: number, b: number, c: number, d: number) => void;
|
|
106
|
+
export const __wasm_bindgen_func_elem_4230: (a: number, b: number, c: number, d: number) => void;
|
|
106
107
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
107
108
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
108
109
|
export const __wbindgen_export3: (a: number) => void;
|