@ping-app/ping-openmls-sdk 0.9.2 → 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 +91 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -5
- package/dist/index.d.ts +52 -5
- package/dist/index.js +90 -8
- 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 +214 -53
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.js +214 -53
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/wasm/package.json +1 -1
- package/wasm/ping_wasm.d.ts +47 -2
- package/wasm/ping_wasm.js +102 -23
- package/wasm/ping_wasm_bg.wasm +0 -0
- package/wasm/ping_wasm_bg.wasm.d.ts +4 -2
package/wasm/ping_wasm.js
CHANGED
|
@@ -183,6 +183,42 @@ export class PingClient {
|
|
|
183
183
|
const ret = wasm.pingclient_consumeLinkingTicket(this.__wbg_ptr, addHeapObject(ticket), now_ms);
|
|
184
184
|
return takeObject(ret);
|
|
185
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* ONE conversation's metadata as the group holds it now: the same shape
|
|
188
|
+
* as one element of `listConversations()`, or `null` when this client
|
|
189
|
+
* does not hold the conversation (unknown, dropped, removed, or left: a
|
|
190
|
+
* conversation is left for the host from the moment it asked). A pure
|
|
191
|
+
* read: nothing is fetched and nothing changes. Rejects for an id that
|
|
192
|
+
* is not 16 bytes.
|
|
193
|
+
*
|
|
194
|
+
* The JS worker attaches this to every conversation change it reports,
|
|
195
|
+
* so the host's copy of a conversation's name and epoch is never older
|
|
196
|
+
* than the change it was just told about, and a host reads one
|
|
197
|
+
* conversation with it instead of listing them all.
|
|
198
|
+
*
|
|
199
|
+
* The core's read of the metadata is the listing, so this walks it here
|
|
200
|
+
* and only the one record crosses to JS. A read by id in the core would
|
|
201
|
+
* make it a map lookup.
|
|
202
|
+
* @param {Uint8Array} conv_id
|
|
203
|
+
* @returns {any}
|
|
204
|
+
*/
|
|
205
|
+
conversationMeta(conv_id) {
|
|
206
|
+
try {
|
|
207
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
208
|
+
const ptr0 = passArray8ToWasm0(conv_id, wasm.__wbindgen_export);
|
|
209
|
+
const len0 = WASM_VECTOR_LEN;
|
|
210
|
+
wasm.pingclient_conversationMeta(retptr, this.__wbg_ptr, ptr0, len0);
|
|
211
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
212
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
213
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
214
|
+
if (r2) {
|
|
215
|
+
throw takeObject(r1);
|
|
216
|
+
}
|
|
217
|
+
return takeObject(r0);
|
|
218
|
+
} finally {
|
|
219
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
186
222
|
/**
|
|
187
223
|
* A conversation's credential policy (`ping_core`
|
|
188
224
|
* `MessagingClient::conversation_policy`, 2026-11-04). Resolves
|
|
@@ -875,6 +911,49 @@ export class PingClient {
|
|
|
875
911
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
876
912
|
}
|
|
877
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
|
+
}
|
|
878
957
|
/**
|
|
879
958
|
* @param {any} env
|
|
880
959
|
* @param {number} now_ms
|
|
@@ -2264,7 +2343,7 @@ function __wbg_get_imports() {
|
|
|
2264
2343
|
__wbg__wbg_cb_unref_be22cc64ae6946a0: function(arg0) {
|
|
2265
2344
|
getObject(arg0)._wbg_cb_unref();
|
|
2266
2345
|
},
|
|
2267
|
-
|
|
2346
|
+
__wbg_applyBatch_406d7dbd1084b3f8: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2268
2347
|
const ret = getObject(arg0).applyBatch(getStringFromWasm0(arg1, arg2), takeObject(arg3), takeObject(arg4));
|
|
2269
2348
|
return addHeapObject(ret);
|
|
2270
2349
|
},
|
|
@@ -2280,11 +2359,11 @@ function __wbg_get_imports() {
|
|
|
2280
2359
|
const ret = getObject(arg0).crypto;
|
|
2281
2360
|
return addHeapObject(ret);
|
|
2282
2361
|
},
|
|
2283
|
-
|
|
2362
|
+
__wbg_del_77ee30f11147a08a: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2284
2363
|
const ret = getObject(arg0).del(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2285
2364
|
return addHeapObject(ret);
|
|
2286
2365
|
},
|
|
2287
|
-
|
|
2366
|
+
__wbg_discoverDevices_48997fecdd635ffe: function(arg0, arg1) {
|
|
2288
2367
|
const ret = getObject(arg0).discoverDevices(takeObject(arg1));
|
|
2289
2368
|
return addHeapObject(ret);
|
|
2290
2369
|
},
|
|
@@ -2307,15 +2386,15 @@ function __wbg_get_imports() {
|
|
|
2307
2386
|
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
2308
2387
|
}
|
|
2309
2388
|
},
|
|
2310
|
-
|
|
2389
|
+
__wbg_fetchLogHeads_e78f7b7086790e4e: function(arg0) {
|
|
2311
2390
|
const ret = getObject(arg0).fetchLogHeads();
|
|
2312
2391
|
return addHeapObject(ret);
|
|
2313
2392
|
},
|
|
2314
|
-
|
|
2393
|
+
__wbg_fetchLogSince_9160c59aa2abdb21: function(arg0, arg1, arg2) {
|
|
2315
2394
|
const ret = getObject(arg0).fetchLogSince(takeObject(arg1), arg2 >>> 0);
|
|
2316
2395
|
return addHeapObject(ret);
|
|
2317
2396
|
},
|
|
2318
|
-
|
|
2397
|
+
__wbg_fetchSince_b12814c52b08f8cf: function(arg0, arg1, arg2, arg3) {
|
|
2319
2398
|
const ret = getObject(arg0).fetchSince(takeObject(arg1), takeObject(arg2), arg3 >>> 0);
|
|
2320
2399
|
return addHeapObject(ret);
|
|
2321
2400
|
},
|
|
@@ -2336,6 +2415,10 @@ function __wbg_get_imports() {
|
|
|
2336
2415
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2337
2416
|
return addHeapObject(ret);
|
|
2338
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
|
+
},
|
|
2339
2422
|
__wbg_get_c0c8f8d7da0c03dd: function(arg0, arg1) {
|
|
2340
2423
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2341
2424
|
return addHeapObject(ret);
|
|
@@ -2344,10 +2427,6 @@ function __wbg_get_imports() {
|
|
|
2344
2427
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2345
2428
|
return addHeapObject(ret);
|
|
2346
2429
|
}, arguments); },
|
|
2347
|
-
__wbg_get_f2fe3963459a1e86: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2348
|
-
const ret = getObject(arg0).get(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2349
|
-
return addHeapObject(ret);
|
|
2350
|
-
},
|
|
2351
2430
|
__wbg_get_unchecked_e20b893aeafc3fca: function(arg0, arg1) {
|
|
2352
2431
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2353
2432
|
return addHeapObject(ret);
|
|
@@ -2396,11 +2475,11 @@ function __wbg_get_imports() {
|
|
|
2396
2475
|
const ret = getObject(arg0).length;
|
|
2397
2476
|
return ret;
|
|
2398
2477
|
},
|
|
2399
|
-
|
|
2478
|
+
__wbg_listEntries_7b924b3e7ff2b526: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2400
2479
|
const ret = getObject(arg0).listEntries(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2401
2480
|
return addHeapObject(ret);
|
|
2402
2481
|
},
|
|
2403
|
-
|
|
2482
|
+
__wbg_listKeys_ffe3a9798e88abde: function(arg0, arg1, arg2, arg3, arg4) {
|
|
2404
2483
|
const ret = getObject(arg0).listKeys(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2405
2484
|
return addHeapObject(ret);
|
|
2406
2485
|
},
|
|
@@ -2435,7 +2514,7 @@ function __wbg_get_imports() {
|
|
|
2435
2514
|
const a = state0.a;
|
|
2436
2515
|
state0.a = 0;
|
|
2437
2516
|
try {
|
|
2438
|
-
return
|
|
2517
|
+
return __wasm_bindgen_func_elem_4230(a, state0.b, arg0, arg1);
|
|
2439
2518
|
} finally {
|
|
2440
2519
|
state0.a = a;
|
|
2441
2520
|
}
|
|
@@ -2481,7 +2560,7 @@ function __wbg_get_imports() {
|
|
|
2481
2560
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
2482
2561
|
return ret;
|
|
2483
2562
|
},
|
|
2484
|
-
|
|
2563
|
+
__wbg_put_053c25b07020914f: function(arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
2485
2564
|
const ret = getObject(arg0).put(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), takeObject(arg5));
|
|
2486
2565
|
return addHeapObject(ret);
|
|
2487
2566
|
},
|
|
@@ -2503,15 +2582,15 @@ function __wbg_get_imports() {
|
|
|
2503
2582
|
const ret = Promise.resolve(getObject(arg0));
|
|
2504
2583
|
return addHeapObject(ret);
|
|
2505
2584
|
},
|
|
2506
|
-
|
|
2585
|
+
__wbg_sendBatch_642a94f23a738334: function(arg0, arg1) {
|
|
2507
2586
|
const ret = getObject(arg0).sendBatch(takeObject(arg1));
|
|
2508
2587
|
return addHeapObject(ret);
|
|
2509
2588
|
},
|
|
2510
|
-
|
|
2589
|
+
__wbg_send_50a83d84aca86680: function(arg0, arg1) {
|
|
2511
2590
|
const ret = getObject(arg0).send(takeObject(arg1));
|
|
2512
2591
|
return addHeapObject(ret);
|
|
2513
2592
|
},
|
|
2514
|
-
|
|
2593
|
+
__wbg_setNextWelcomeRecipients_a3c6e79d35538d0d: function(arg0, arg1, arg2) {
|
|
2515
2594
|
const ret = getObject(arg0).setNextWelcomeRecipients(takeObject(arg1), takeObject(arg2));
|
|
2516
2595
|
return addHeapObject(ret);
|
|
2517
2596
|
},
|
|
@@ -2565,8 +2644,8 @@ function __wbg_get_imports() {
|
|
|
2565
2644
|
return addHeapObject(ret);
|
|
2566
2645
|
},
|
|
2567
2646
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2568
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
2569
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
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`.
|
|
2648
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_4215);
|
|
2570
2649
|
return addHeapObject(ret);
|
|
2571
2650
|
},
|
|
2572
2651
|
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
@@ -2610,10 +2689,10 @@ function __wbg_get_imports() {
|
|
|
2610
2689
|
};
|
|
2611
2690
|
}
|
|
2612
2691
|
|
|
2613
|
-
function
|
|
2692
|
+
function __wasm_bindgen_func_elem_4215(arg0, arg1, arg2) {
|
|
2614
2693
|
try {
|
|
2615
2694
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2616
|
-
wasm.
|
|
2695
|
+
wasm.__wasm_bindgen_func_elem_4215(retptr, arg0, arg1, addHeapObject(arg2));
|
|
2617
2696
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2618
2697
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2619
2698
|
if (r1) {
|
|
@@ -2624,8 +2703,8 @@ function __wasm_bindgen_func_elem_4197(arg0, arg1, arg2) {
|
|
|
2624
2703
|
}
|
|
2625
2704
|
}
|
|
2626
2705
|
|
|
2627
|
-
function
|
|
2628
|
-
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));
|
|
2629
2708
|
}
|
|
2630
2709
|
|
|
2631
2710
|
const PingClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
package/wasm/ping_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -35,6 +35,7 @@ export const pingclient_commitPendingProposals: (a: number, b: number, c: number
|
|
|
35
35
|
export const pingclient_commitsInDoubt: (a: number, b: number) => void;
|
|
36
36
|
export const pingclient_confirmApplied: (a: number, b: number, c: number) => number;
|
|
37
37
|
export const pingclient_consumeLinkingTicket: (a: number, b: number, c: number) => number;
|
|
38
|
+
export const pingclient_conversationMeta: (a: number, b: number, c: number, d: number) => void;
|
|
38
39
|
export const pingclient_conversationPolicy: (a: number, b: number, c: number, d: number) => void;
|
|
39
40
|
export const pingclient_conversationsBehind: (a: number, b: number, c: number) => void;
|
|
40
41
|
export const pingclient_conversationsLeaveStalled: (a: number, b: number) => void;
|
|
@@ -67,6 +68,7 @@ export const pingclient_openReadOnly: (a: number, b: number, c: number, d: numbe
|
|
|
67
68
|
export const pingclient_pendingApplies: (a: number, b: number) => void;
|
|
68
69
|
export const pingclient_pendingProposalsCommitRank: (a: number, b: number, c: number) => number;
|
|
69
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;
|
|
70
72
|
export const pingclient_processEnvelope: (a: number, b: number, c: number) => number;
|
|
71
73
|
export const pingclient_processSequencedBatch: (a: number, b: number, c: number) => number;
|
|
72
74
|
export const pingclient_processWelcomeAt: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
@@ -100,8 +102,8 @@ export const signDeviceLinkApproval: (a: number, b: number, c: number, d: number
|
|
|
100
102
|
export const signDeviceLinkPossession: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
101
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;
|
|
102
104
|
export const _start: () => void;
|
|
103
|
-
export const
|
|
104
|
-
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;
|
|
105
107
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
106
108
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
107
109
|
export const __wbindgen_export3: (a: number) => void;
|