@ping-app/ping-openmls-sdk 0.10.2 → 0.10.4
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/README.md +13 -10
- package/dist/index.cjs +1401 -266
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +999 -145
- package/dist/index.d.ts +999 -145
- package/dist/index.js +1360 -263
- package/dist/index.js.map +1 -1
- package/dist/notification-preview.cjs +1 -3
- package/dist/notification-preview.cjs.map +1 -1
- package/dist/notification-preview.d.cts +1 -8
- package/dist/notification-preview.d.ts +1 -8
- package/dist/notification-preview.js +1 -3
- package/dist/notification-preview.js.map +1 -1
- package/dist/storage/indexeddb.cjs +4 -3
- package/dist/storage/indexeddb.cjs.map +1 -1
- package/dist/storage/indexeddb.d.cts +1 -1
- package/dist/storage/indexeddb.d.ts +1 -1
- package/dist/storage/indexeddb.js +4 -3
- package/dist/storage/indexeddb.js.map +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-omhvRjtq.d.cts} +343 -45
- package/dist/{types-gAmJFSC-.d.ts → types-omhvRjtq.d.ts} +343 -45
- package/dist/worker.cjs +686 -69
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.js +716 -80
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/wasm/package.json +1 -1
- package/wasm/ping_wasm.d.ts +539 -112
- package/wasm/ping_wasm.js +1387 -322
- package/wasm/ping_wasm_bg.wasm +0 -0
- package/wasm/ping_wasm_bg.wasm.d.ts +74 -21
package/wasm/ping_wasm.d.ts
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A set-up session whose root is in memory only (rule R34 a): for the
|
|
6
|
+
* person who makes the backup during set-up. Freeing it wipes the root.
|
|
7
|
+
*/
|
|
8
|
+
export class AccountSetupSession {
|
|
9
|
+
private constructor();
|
|
10
|
+
free(): void;
|
|
11
|
+
[Symbol.dispose](): void;
|
|
12
|
+
/**
|
|
13
|
+
* End the session after the proof: writes the device record, wipes
|
|
14
|
+
* the root and answers what the host registers with the server.
|
|
15
|
+
* Before a proof it refuses and the session stays open.
|
|
16
|
+
*/
|
|
17
|
+
finish(storage: JsStorage): Promise<any>;
|
|
18
|
+
/**
|
|
19
|
+
* "Not now" after the session began (ruling ID42): writes THIS
|
|
20
|
+
* session's root as the pending item, then the device record.
|
|
21
|
+
*/
|
|
22
|
+
keepAsPending(storage: JsStorage, pending: JsPendingRootStore, slot: string, persistent_storage?: boolean | null): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* The session's backup: `{ rootPart, statePart, droppedAnchors }`.
|
|
25
|
+
*/
|
|
26
|
+
makeBackup(phrase: Uint8Array, account_id: Uint8Array, host_state: Uint8Array, now_ms: number): any;
|
|
27
|
+
/**
|
|
28
|
+
* Rule R10 (b) for the session. Answers `{ fingerprint }`.
|
|
29
|
+
*/
|
|
30
|
+
proveBackup(read_back_root_part: Uint8Array, phrase: Uint8Array): any;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* What `beginDeviceLink` answers: the staging client (taken once), the
|
|
35
|
+
* handshake payload, and the two secret halves the call drew.
|
|
36
|
+
*/
|
|
37
|
+
export class DeviceLinkBegun {
|
|
38
|
+
private constructor();
|
|
39
|
+
free(): void;
|
|
40
|
+
[Symbol.dispose](): void;
|
|
41
|
+
/**
|
|
42
|
+
* The staging client: it completes the link and is then freed. Taken
|
|
43
|
+
* once; a second call rejects.
|
|
44
|
+
*/
|
|
45
|
+
takeClient(): PingClient;
|
|
46
|
+
readonly deviceId: Uint8Array;
|
|
47
|
+
/**
|
|
48
|
+
* A SECRET: the device key the call drew, for the host's protected store.
|
|
49
|
+
*/
|
|
50
|
+
readonly deviceSigningSecretKey: Uint8Array;
|
|
51
|
+
/**
|
|
52
|
+
* A SECRET: the X-Wing seed the ticket and the link envelope are sealed to.
|
|
53
|
+
*/
|
|
54
|
+
readonly hpkeSecretKey: Uint8Array;
|
|
55
|
+
/**
|
|
56
|
+
* The handshake payload, version 3: publish exactly these bytes and
|
|
57
|
+
* show `linkCommitment` of exactly these bytes.
|
|
58
|
+
*/
|
|
59
|
+
readonly payload: Uint8Array;
|
|
60
|
+
}
|
|
61
|
+
|
|
4
62
|
export class PingClient {
|
|
5
63
|
private constructor();
|
|
6
64
|
free(): void;
|
|
@@ -23,6 +81,18 @@ export class PingClient {
|
|
|
23
81
|
* device's role does not allow the add; nothing sent).
|
|
24
82
|
*/
|
|
25
83
|
addMembersWithVerdicts(conv_id: Uint8Array, entries: any, now_ms: number): Promise<any>;
|
|
84
|
+
/**
|
|
85
|
+
* The one tap after a restore beside devices that stay: the
|
|
86
|
+
* device named `device_id`, which restored with the recovery phrase
|
|
87
|
+
* beside this one and waits for its DeviceGroup, added by this KEPT
|
|
88
|
+
* device at the person's tap (`ping_core`
|
|
89
|
+
* `MessagingClient::add_restored_device`; ruling V123's other half).
|
|
90
|
+
* `key_package` is a KeyPackage of that device as the host fetched it;
|
|
91
|
+
* it is believed only when its credential verifies for this device's
|
|
92
|
+
* own account root, at depth 0 and at the generation this device
|
|
93
|
+
* holds. Rejects with the core's refusal otherwise.
|
|
94
|
+
*/
|
|
95
|
+
addRestoredDevice(device_id: Uint8Array, key_package: Uint8Array, now_ms: number): Promise<void>;
|
|
26
96
|
/**
|
|
27
97
|
* Admit a single new device to every chat in `entries` — one Commit +
|
|
28
98
|
* one Welcome per chat, with the Welcome's `?recipient=` priming
|
|
@@ -45,6 +115,19 @@ export class PingClient {
|
|
|
45
115
|
* behaviour of `admitDeviceToChats`.
|
|
46
116
|
*/
|
|
47
117
|
admitDeviceToChatsConcurrent(device_id: Uint8Array, entries: any, now_ms: number, concurrency: number): Promise<any>;
|
|
118
|
+
/**
|
|
119
|
+
* Step 7 (`ping_recovery::adopt_generation`): this device's mailbox
|
|
120
|
+
* row. The credential must be this device's, the root's own, of the
|
|
121
|
+
* row's generation; the wrap must open with this device's delivery
|
|
122
|
+
* key and match the root's statement. Answers `{ generation, changed
|
|
123
|
+
* }`. On any refusal the device stays on its generation.
|
|
124
|
+
*/
|
|
125
|
+
adoptGeneration(generation: number, credential: Uint8Array, gs_wrap: Uint8Array, statement: any, now_ms: number): Promise<any>;
|
|
126
|
+
/**
|
|
127
|
+
* The server refused the publication and answered with the statement it
|
|
128
|
+
* holds: taken only when it verifies under THIS device's own key.
|
|
129
|
+
*/
|
|
130
|
+
adoptHistoryDeliveryKeyCounter(stored: any): Promise<any>;
|
|
48
131
|
/**
|
|
49
132
|
* Anchor an unanchored cursor at a host-recorded `(epoch, server_seq)`
|
|
50
133
|
* (`MessagingClient::adopt_log_position`). Resolves `false` when the
|
|
@@ -52,12 +135,13 @@ export class PingClient {
|
|
|
52
135
|
*/
|
|
53
136
|
adoptLogPosition(conv_id: Uint8Array, epoch: number, server_seq: number): Promise<boolean>;
|
|
54
137
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
138
|
+
* The linking ticket, version 3, for the handshake `payload`, verified
|
|
139
|
+
* here against `expected_code` or `expected_qr` (exactly one). For a
|
|
140
|
+
* client started from a device record: the new device's credential is
|
|
141
|
+
* signed by THIS device's key. `last_app_events` as for the version 2
|
|
142
|
+
* ticket.
|
|
59
143
|
*/
|
|
60
|
-
|
|
144
|
+
buildLinkingTicketV3For(payload: Uint8Array, expected_code: string | null | undefined, expected_qr: Uint8Array | null | undefined, last_app_events: any, now_ms: number): Promise<any>;
|
|
61
145
|
/**
|
|
62
146
|
* Commit buffered pending proposals (evicts a peer who left). No-op if
|
|
63
147
|
* none pending; on an epoch-advanced rejection re-sync.
|
|
@@ -68,13 +152,36 @@ export class PingClient {
|
|
|
68
152
|
* `{ conversation_id, attempts, next_attempt_at_ms }`.
|
|
69
153
|
*/
|
|
70
154
|
commitsInDoubt(): any;
|
|
155
|
+
/**
|
|
156
|
+
* Complete the link on the NEW device, on the staging client of
|
|
157
|
+
* `beginDeviceLink` and its store: every check of the ticket and of the
|
|
158
|
+
* envelope's two values, then the DeviceGroup, then the device record
|
|
159
|
+
* (`ping_recovery::complete_device_link`). Rejects with `account
|
|
160
|
+
* refused: link-refused` when anything does not fit: nothing was kept.
|
|
161
|
+
* Answers `{ userId, deviceId, generation, depth }`.
|
|
162
|
+
*/
|
|
163
|
+
completeDeviceLink(ticket: any, generation: number, generation_secret: Uint8Array, now_ms: number): Promise<any>;
|
|
164
|
+
/**
|
|
165
|
+
* Step 3 on the running client (`ping_recovery::complete_rotation_on`):
|
|
166
|
+
* the server's answer to a rotation this device built, AS RECEIVED:
|
|
167
|
+
* `{ status, error?, generation?, statement? }`, judged inside (ruling
|
|
168
|
+
* V161; no value says "applied"). When the device adopts, this client
|
|
169
|
+
* runs on the new record from that moment.
|
|
170
|
+
*/
|
|
171
|
+
completeRotation(record_id: Uint8Array, answer: any): Promise<any>;
|
|
71
172
|
/**
|
|
72
173
|
* [D27] Delete journal entries whose messages the host has durably
|
|
73
174
|
* persisted, and checkpoint so the deletion survives a reload. Unknown
|
|
74
175
|
* ids are ignored (idempotent).
|
|
75
176
|
*/
|
|
76
177
|
confirmApplied(journal_ids: string[]): Promise<void>;
|
|
77
|
-
|
|
178
|
+
/**
|
|
179
|
+
* Ruling V177: the host has saved the events of the bundle an open
|
|
180
|
+
* returned with `import_id`; from now on that bundle is refused as a
|
|
181
|
+
* replay. `true` when this call recorded it. Until this call the same
|
|
182
|
+
* transfer opens again as often as it is delivered.
|
|
183
|
+
*/
|
|
184
|
+
confirmHistoryImport(import_id: Uint8Array): Promise<boolean>;
|
|
78
185
|
/**
|
|
79
186
|
* ONE conversation's metadata as the group holds it now: the same shape
|
|
80
187
|
* as one element of `listConversations()`, or `null` when this client
|
|
@@ -181,12 +288,6 @@ export class PingClient {
|
|
|
181
288
|
* [CR-7] Export the MLS state snapshot for one conversation.
|
|
182
289
|
*/
|
|
183
290
|
exportConversationStateSnapshot(conv_id: Uint8Array, now_ms: number): Uint8Array;
|
|
184
|
-
/**
|
|
185
|
-
* Export the account identity seed (CBOR-wrapped Ed25519, SECRET). Transfer
|
|
186
|
-
* to a newly-linked device over the sealed channel so all of an account's
|
|
187
|
-
* devices share one user_id (basis for cross-device self-attribution).
|
|
188
|
-
*/
|
|
189
|
-
exportIdentity(): Uint8Array;
|
|
190
291
|
freshKeyPackage(): Promise<Uint8Array>;
|
|
191
292
|
/**
|
|
192
293
|
* Generate a fresh LAST-RESORT KeyPackage (RFC 9420 §10). The host
|
|
@@ -195,13 +296,37 @@ export class PingClient {
|
|
|
195
296
|
*/
|
|
196
297
|
freshLastResortKeyPackage(): Promise<Uint8Array>;
|
|
197
298
|
/**
|
|
198
|
-
*
|
|
299
|
+
* The credential this device HOLDS for itself (version 2). Public.
|
|
300
|
+
* Never absent since ruling V550 (3): every client a binding starts
|
|
301
|
+
* holds a device record. A read-only client (the record's public row,
|
|
302
|
+
* no credential) throws `NoDeviceRecord`.
|
|
199
303
|
*/
|
|
200
|
-
|
|
304
|
+
heldCredential(): Uint8Array;
|
|
201
305
|
/**
|
|
202
306
|
* Frames held in reorder buffers right now (diagnostics).
|
|
203
307
|
*/
|
|
204
308
|
heldFrameCount(): number;
|
|
309
|
+
/**
|
|
310
|
+
* The generation of the held credential. Throws `NoDeviceRecord` as
|
|
311
|
+
* [`Self::held_credential`] does.
|
|
312
|
+
*/
|
|
313
|
+
heldGeneration(): number;
|
|
314
|
+
/**
|
|
315
|
+
* The counter the next `publishHistoryDeliveryKey` with this floor will
|
|
316
|
+
* sign. A host that keeps the device key outside the SDK's store writes
|
|
317
|
+
* this number beside it BEFORE the publish.
|
|
318
|
+
*/
|
|
319
|
+
historyDeliveryKeyNextCounter(counter_floor: number): Promise<number>;
|
|
320
|
+
/**
|
|
321
|
+
* Rule H7 for a device of this account: `"automatic"`, `"ask"` or
|
|
322
|
+
* `"refused"` (ship by itself, only after the person confirms on this
|
|
323
|
+
* device, or not at all).
|
|
324
|
+
*/
|
|
325
|
+
historyShipDecision(device_id: Uint8Array): Promise<string>;
|
|
326
|
+
/**
|
|
327
|
+
* Rule H9: whether this device's trust record names `device_id`.
|
|
328
|
+
*/
|
|
329
|
+
historyTrust(device_id: Uint8Array): Promise<boolean>;
|
|
205
330
|
/**
|
|
206
331
|
* [CR-7] Import an MLS state snapshot produced by another device of the same
|
|
207
332
|
* user identity. Returns the conversation id the snapshot describes.
|
|
@@ -213,25 +338,25 @@ export class PingClient {
|
|
|
213
338
|
*/
|
|
214
339
|
importStateSnapshot(snapshot_bytes: Uint8Array, now_ms: number): Promise<Uint8Array>;
|
|
215
340
|
/**
|
|
216
|
-
*
|
|
341
|
+
* Start the client FROM THE DEVICE RECORD (`ping_core`'s
|
|
342
|
+
* `MessagingClient::init_from_device_record`): the start of a device
|
|
343
|
+
* under the root design. There is no identity export: the record that
|
|
344
|
+
* account set-up (or a link, or a restore) wrote into `storage` says
|
|
345
|
+
* which account and which device this is, and carries the ONE
|
|
346
|
+
* credential the device holds, which every leaf and KeyPackage it
|
|
347
|
+
* builds then carries.
|
|
217
348
|
*
|
|
218
|
-
* `device_signing_secret_key`:
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
* caller's input, so the host can align the SDK's `device_id`
|
|
223
|
-
* (which the SDK stamps into every envelope's `sender_device`)
|
|
224
|
-
* with whatever device_id the auth layer registered in the JWT.
|
|
225
|
-
* Ignored on re-init when a `LocalDevice` is already persisted
|
|
226
|
-
* in `storage`. Pass `null`/`undefined` to keep the legacy
|
|
227
|
-
* random-key behaviour.
|
|
349
|
+
* `device_signing_secret_key`: the device key the host kept from the
|
|
350
|
+
* call that made the device, or `null`/`undefined`. When given it must
|
|
351
|
+
* be the record's own device key, or the start rejects and nothing is
|
|
352
|
+
* written. Rejects when the store holds no device record.
|
|
228
353
|
*
|
|
229
354
|
* `expected_owners` (2026-11-04, round 2): an array of
|
|
230
355
|
* `{ conversationId, owner }` (`Uint8Array`s), the owner each
|
|
231
356
|
* conversation's FIRST roles write must name (the server's creator as
|
|
232
357
|
* an MLS user id); `null`/`undefined` for none. See `setExpectedOwners`.
|
|
233
358
|
*/
|
|
234
|
-
static
|
|
359
|
+
static initFromDeviceRecord(device_label: string, storage: JsStorage, transport: JsTransport, now_ms: number, device_signing_secret_key: Uint8Array | null | undefined, expected_owners: any): Promise<PingClient>;
|
|
235
360
|
joinConversation(welcome: any, now_ms: number): Promise<Uint8Array>;
|
|
236
361
|
/**
|
|
237
362
|
* `joinConversation` at the Welcome's log position, so the new
|
|
@@ -277,7 +402,26 @@ export class PingClient {
|
|
|
277
402
|
* no other member could take over.
|
|
278
403
|
*/
|
|
279
404
|
leaveConversation(conv_id: Uint8Array, now_ms: number): Promise<void>;
|
|
405
|
+
/**
|
|
406
|
+
* `{ generation, generationSecret }` for the link-auth envelope,
|
|
407
|
+
* version 6: answered only for a handshake whose version 3 ticket this
|
|
408
|
+
* client built since it started. `generationSecret` is a SECRET.
|
|
409
|
+
*/
|
|
410
|
+
linkGenerationFor(payload: Uint8Array, expected_code?: string | null, expected_qr?: Uint8Array | null): any;
|
|
411
|
+
/**
|
|
412
|
+
* The version 3 handshake payload this NEW device publishes: its own
|
|
413
|
+
* signing key, the id derived from it, `hpke_public_key` (X-Wing, 1216
|
|
414
|
+
* bytes) and a KeyPackage it just made. Show `linkCommitment` of exactly
|
|
415
|
+
* these bytes and publish exactly these bytes.
|
|
416
|
+
*/
|
|
417
|
+
linkHandshakePayload(hpke_public_key: Uint8Array, key_package: Uint8Array): Uint8Array;
|
|
280
418
|
listConversations(): any;
|
|
419
|
+
/**
|
|
420
|
+
* The holes of one conversation's log on this device
|
|
421
|
+
* (`MessagingClient::log_holes`): an array of `{ conversation_id,
|
|
422
|
+
* from_server_seq, to_server_seq, reason, content_hashes, kept }`.
|
|
423
|
+
*/
|
|
424
|
+
logHoles(conv_id: Uint8Array): any;
|
|
281
425
|
/**
|
|
282
426
|
* This device's applied position in one conversation, or `null` when
|
|
283
427
|
* it is not held.
|
|
@@ -307,9 +451,20 @@ export class PingClient {
|
|
|
307
451
|
*/
|
|
308
452
|
members(conv_id: Uint8Array): any;
|
|
309
453
|
onMessage(cb: Function): void;
|
|
454
|
+
/**
|
|
455
|
+
* Open a transfer sealed to this device's published delivery key:
|
|
456
|
+
* `{ bundle, not_yet_member }`. A bundle is returned ONCE; a replay is
|
|
457
|
+
* `history refused: replayed`.
|
|
458
|
+
*/
|
|
459
|
+
openHistoryBundleV3(sealed: Uint8Array, own_account: boolean): Promise<any>;
|
|
460
|
+
/**
|
|
461
|
+
* The NEW device opens its link's own transfer with the seed of the
|
|
462
|
+
* X-Wing key of the handshake it published.
|
|
463
|
+
*/
|
|
464
|
+
openLinkHistoryBundle(sealed: Uint8Array, recipient_priv: Uint8Array): Promise<any>;
|
|
310
465
|
/**
|
|
311
466
|
* [CR-5] Open the SDK **read-only**, for a second context that must read
|
|
312
|
-
* MLS state it does not own
|
|
467
|
+
* MLS state it does not own: on web, the Service Worker decrypting a push
|
|
313
468
|
* so the banner can show a sender and a preview instead of "New message".
|
|
314
469
|
*
|
|
315
470
|
* This is the web mirror of the iOS Notification Service Extension, and it
|
|
@@ -321,12 +476,12 @@ export class PingClient {
|
|
|
321
476
|
* snapshots the WHOLE `MemoryStorage` into one blob, so two writers
|
|
322
477
|
* replace rather than merge. If the Service Worker opened the store
|
|
323
478
|
* writable and checkpointed, it would clobber whatever the tab had
|
|
324
|
-
* advanced to
|
|
479
|
+
* advanced to: silently rolling back epochs and losing messages. A
|
|
325
480
|
* read-only open loads the tab's snapshot, never writes it back, and
|
|
326
481
|
* `checkpoint` becomes a no-op, so the tab stays the single writer.
|
|
327
482
|
*
|
|
328
483
|
* Requirements, all enforced rather than documented:
|
|
329
|
-
* * the store must already hold a snapshot
|
|
484
|
+
* * the store must already hold a snapshot: a reader that finds none is
|
|
330
485
|
* an error, not a fresh identity, because "successfully decrypt
|
|
331
486
|
* nothing" is the worst possible answer here;
|
|
332
487
|
* * no `LocalDevice` means this installation does not exist yet, which
|
|
@@ -336,8 +491,12 @@ export class PingClient {
|
|
|
336
491
|
* Pair with [`previewEnvelope`](Self::preview_envelope). Give it a
|
|
337
492
|
* read-only `JsStorage` too: this guards the MLS blob, not the host's own
|
|
338
493
|
* key-value writes.
|
|
494
|
+
*
|
|
495
|
+
* The store is opened FROM THE DEVICE RECORD it holds: no account
|
|
496
|
+
* identity is taken (2026-11-28). The Service Worker of a device opens
|
|
497
|
+
* the store this way to preview a push.
|
|
339
498
|
*/
|
|
340
|
-
static
|
|
499
|
+
static openReadOnlyFromDeviceRecord(device_label: string, storage: JsStorage, transport: JsTransport, now_ms: number): Promise<PingClient>;
|
|
341
500
|
/**
|
|
342
501
|
* [D27] Decrypted-but-unconfirmed messages surviving in the pending-apply
|
|
343
502
|
* journal, oldest first, as an array of plain objects
|
|
@@ -363,6 +522,13 @@ export class PingClient {
|
|
|
363
522
|
* nothing is pending, this device is not eligible, or the id is unknown.
|
|
364
523
|
*/
|
|
365
524
|
pendingProposalsCommitRank(conv_id: Uint8Array): number | undefined;
|
|
525
|
+
/**
|
|
526
|
+
* Step 0 (`ping_recovery::plan_rotation`): rule R31 first, then who
|
|
527
|
+
* may be kept. Answers `{ nextGeneration, offered: [{ deviceId, own }],
|
|
528
|
+
* notOffered: [{ deviceId, reason }] }`, `reason` being
|
|
529
|
+
* `"no-delivery-key"` or `"not-verified"`. Signs nothing.
|
|
530
|
+
*/
|
|
531
|
+
planRotation(start: any, devices: any, root_part_generation: number): Promise<any>;
|
|
366
532
|
/**
|
|
367
533
|
* [CR-5] Decrypt ONE envelope in memory for a preview, writing nothing.
|
|
368
534
|
*
|
|
@@ -420,6 +586,11 @@ export class PingClient {
|
|
|
420
586
|
* is not addressed to this device.
|
|
421
587
|
*/
|
|
422
588
|
processWelcomeAt(welcome: any, position: number | null | undefined, now_ms: number): Promise<any>;
|
|
589
|
+
/**
|
|
590
|
+
* This device's signed history delivery key: `{ device_id, counter,
|
|
591
|
+
* public_key, signature }`. The key pair is made once, inside the SDK.
|
|
592
|
+
*/
|
|
593
|
+
publishHistoryDeliveryKey(counter_floor: number): Promise<any>;
|
|
423
594
|
/**
|
|
424
595
|
* Re-admit a device that kept its signature key (`ping_core`
|
|
425
596
|
* `MessagingClient::re_admit_device`): one Commit removes the leaf with
|
|
@@ -450,6 +621,29 @@ export class PingClient {
|
|
|
450
621
|
* `MessagingClient::readmit_pending_conversations`.
|
|
451
622
|
*/
|
|
452
623
|
readmitPendingConversations(now_ms: number): any;
|
|
624
|
+
/**
|
|
625
|
+
* Rule H9: record a shipment the server accepted.
|
|
626
|
+
*/
|
|
627
|
+
recordHistoryShipped(device_id: Uint8Array): Promise<void>;
|
|
628
|
+
/**
|
|
629
|
+
* Create the DeviceGroup anew after a take-over
|
|
630
|
+
* (`ping_recovery::recreate_device_group`). Call it ONLY after the
|
|
631
|
+
* server answered the DeviceGroup reset with `200` or with the reason
|
|
632
|
+
* `already_reset`, and before the rotation is finished. Ruling V160:
|
|
633
|
+
* refused on a device whose store does not hold the take-over's
|
|
634
|
+
* adopted rotation record, and on one that waits for its DeviceGroup.
|
|
635
|
+
*/
|
|
636
|
+
recreateDeviceGroup(now_ms: number): Promise<void>;
|
|
637
|
+
/**
|
|
638
|
+
* THE ONE CALL A HOST REMEMBERS FOR THE ANCHOR RECORD: the account's
|
|
639
|
+
* state part written from the running client
|
|
640
|
+
* (`ping_recovery::refresh_state_backup_from`). The record is rebuilt
|
|
641
|
+
* from this client's own trees first, at every call (ruling V280; its
|
|
642
|
+
* row is written only when the record changed), and the part carries
|
|
643
|
+
* it. Answers `{ statePart,
|
|
644
|
+
* droppedAnchors }`.
|
|
645
|
+
*/
|
|
646
|
+
refreshStateBackup(account_id: Uint8Array, host_state: Uint8Array, now_ms: number): Promise<any>;
|
|
453
647
|
/**
|
|
454
648
|
* Remove one of THIS account's devices from every group this client is
|
|
455
649
|
* in, the DeviceGroup included, never stopping at a failure (`ping_core`
|
|
@@ -496,6 +690,12 @@ export class PingClient {
|
|
|
496
690
|
* may call it. Rejects in the DeviceGroup.
|
|
497
691
|
*/
|
|
498
692
|
removeOwnOtherLeaves(conv_id: Uint8Array, now_ms: number): Promise<number>;
|
|
693
|
+
/**
|
|
694
|
+
* The host filled a range of a conversation's log from elsewhere
|
|
695
|
+
* (`MessagingClient::resolve_log_hole`). Resolves `true` when a
|
|
696
|
+
* recorded hole changed.
|
|
697
|
+
*/
|
|
698
|
+
resolveLogHole(conv_id: Uint8Array, from_server_seq: number, to_server_seq: number): Promise<boolean>;
|
|
499
699
|
/**
|
|
500
700
|
* Undo `suspendStorage`. Idempotent.
|
|
501
701
|
*/
|
|
@@ -508,17 +708,52 @@ export class PingClient {
|
|
|
508
708
|
*/
|
|
509
709
|
revokeDevice(device_id: Uint8Array, now_ms: number): Promise<any>;
|
|
510
710
|
/**
|
|
511
|
-
*
|
|
512
|
-
*
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
-
*
|
|
711
|
+
* Step 1 with the backup as the root's source: the root part and the
|
|
712
|
+
* CURRENT phrase, and the NEW phrase when the person asked for one.
|
|
713
|
+
* Both phrases are UTF-8 BYTES (see [`phrase_in`]); this call's copies
|
|
714
|
+
* are wiped when it ends, whatever it answers. No store is an
|
|
715
|
+
* argument. Answers what [`build_out`] writes; a phrase that does not
|
|
716
|
+
* open the root part is `account refused: backup-authentication`.
|
|
717
|
+
*/
|
|
718
|
+
rotateGenerationWithBackup(root_part: Uint8Array, phrase: Uint8Array, new_phrase: Uint8Array | null | undefined, start: any, devices: any, kept: any, reason: string, account_id: Uint8Array, host_state: Uint8Array, now_ms: number): Promise<any>;
|
|
719
|
+
/**
|
|
720
|
+
* Step 1 with the pending item of `slot` as the root's source
|
|
721
|
+
* (`ping_recovery::rotate_generation`; an account with no backup yet).
|
|
722
|
+
* `pending` is the SDK's own store, built by the Worker that makes
|
|
723
|
+
* this call for the length of it: the item is read behind the store's
|
|
724
|
+
* own checks and never written or deleted. The request carries no root
|
|
725
|
+
* part. Answers what [`build_out`] writes.
|
|
726
|
+
*/
|
|
727
|
+
rotateGenerationWithPending(pending: JsPendingRootStore, slot: string, start: any, devices: any, kept: any, reason: string, account_id: Uint8Array, host_state: Uint8Array, now_ms: number): Promise<any>;
|
|
728
|
+
/**
|
|
729
|
+
* Verify `recipient` (the statement a server returned) in this device's
|
|
730
|
+
* own tree, then sign the bundle with the device key and seal it to that
|
|
731
|
+
* key. `own_account` is what the host believes and only ever a reason to
|
|
732
|
+
* refuse.
|
|
733
|
+
*/
|
|
734
|
+
sealHistoryBundleV3(bundle: any, recipient: any, own_account: boolean): Promise<Uint8Array>;
|
|
735
|
+
/**
|
|
736
|
+
* The link's own transfer. The handshake `payload` is VERIFIED HERE
|
|
737
|
+
* against what this device was shown (`expected_code` or `expected_qr`,
|
|
738
|
+
* exactly one), and the bundle is sealed to the verified handshake's
|
|
739
|
+
* key: no key can be passed.
|
|
740
|
+
*/
|
|
741
|
+
sealLinkHistoryBundle(bundle: any, payload: Uint8Array, expected_code?: string | null, expected_qr?: Uint8Array | null): Uint8Array;
|
|
742
|
+
/**
|
|
743
|
+
* Enter `conv_id` by this device's own act, from what the delivery
|
|
744
|
+
* service returned for it (`ping_recovery::self_admit_entry`). While
|
|
745
|
+
* the SDK is built without self-admission it answers `{ kind:
|
|
746
|
+
* "refused", refusal: "notCompiled" }` and touches nothing. Rejects
|
|
747
|
+
* only for an id of the wrong length.
|
|
516
748
|
*/
|
|
517
|
-
|
|
749
|
+
selfAdmit(conv_id: Uint8Array, blob: Uint8Array, wrap: Uint8Array, wrap_count: number, current_epoch: number | null | undefined, now_ms: number): Promise<any>;
|
|
518
750
|
/**
|
|
519
|
-
*
|
|
751
|
+
* Enter MANY conversations with few requests
|
|
752
|
+
* (`ping_recovery::self_admit_many_entry`): `first` at the head, then
|
|
753
|
+
* the order given, each once. Resolves to an array of `{
|
|
754
|
+
* conversationId, result }`, `result` as `selfAdmit` answers.
|
|
520
755
|
*/
|
|
521
|
-
|
|
756
|
+
selfAdmitMany(first: Uint8Array | null | undefined, conversations: Array<any>, now_ms: number): Promise<any>;
|
|
522
757
|
send(conv_id: Uint8Array, plaintext: Uint8Array, now_ms: number): Promise<any>;
|
|
523
758
|
/**
|
|
524
759
|
* Change a conversation's `name` (carried in the GroupContext) via an MLS
|
|
@@ -602,24 +837,68 @@ export class PingClient {
|
|
|
602
837
|
export function _start(): void;
|
|
603
838
|
|
|
604
839
|
/**
|
|
605
|
-
*
|
|
606
|
-
*
|
|
607
|
-
* (
|
|
840
|
+
* Rulings V212 and V227: abandon a rotation the SERVER REFUSED, at the
|
|
841
|
+
* person's choice (`ping_recovery::abandon_rotation`). A record the server
|
|
842
|
+
* never answered is refused (`RotationRefused`): its request is sent again.
|
|
843
|
+
*/
|
|
844
|
+
export function abandonRotation(storage: JsStorage, record_id: Uint8Array): Promise<void>;
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Begin a set-up session in memory
|
|
848
|
+
* (`ping_recovery::begin_account_setup_in_memory`).
|
|
849
|
+
*/
|
|
850
|
+
export function beginAccountSetupInMemory(identity_state: string | null | undefined, now_ms: number): AccountSetupSession;
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Begin a link on a NEW device (ruling V109): draws the device key, records
|
|
854
|
+
* "link begun", starts the staging client and builds the handshake payload
|
|
855
|
+
* (`ping_recovery::begin_device_link`). No argument is a key. A repeat
|
|
856
|
+
* answers the same key and the same handshake.
|
|
857
|
+
*/
|
|
858
|
+
export function beginDeviceLink(device_label: string, storage: JsStorage, transport: JsTransport, now_ms: number): Promise<DeviceLinkBegun>;
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Whether `mnemonicPhrase` opens `blob`, with THREE answers
|
|
862
|
+
* (`ping_recovery::check_backup_phrase`). Resolves
|
|
863
|
+
* `{ outcome: "opens" | "authenticationFailed" | "couldNotCheck", reason? }`,
|
|
864
|
+
* where `reason` is set exactly for `couldNotCheck`: `"invalidPhrase"`,
|
|
865
|
+
* `"unsupportedVersion"`, `"malformed"`, `"undecodable"` or `"internal"`. The
|
|
866
|
+
* codes are the core's (`outcome_code`, `BackupCheckFailure::code`), pinned
|
|
867
|
+
* there and replayed from one table by `sdk/js`
|
|
868
|
+
* (`backup-phrase-check.test.ts`).
|
|
608
869
|
*
|
|
609
|
-
* `
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
* [CR-13] Decode a `LinkingTicket.catchup_snapshot` blob. Pure function; no client
|
|
613
|
-
* required. The new device calls this after `consumeLinkingTicket` to populate its
|
|
614
|
-
* initial UI.
|
|
870
|
+
* `authenticationFailed` is the only proof that the phrase does not open
|
|
871
|
+
* these bytes; every `couldNotCheck` is a doubt. Never throws for an answer
|
|
872
|
+
* of the check, returns nothing of the backup, logs nothing.
|
|
615
873
|
*/
|
|
616
|
-
export function
|
|
874
|
+
export function checkBackupPhrase(blob: Uint8Array, mnemonic_phrase: string): any;
|
|
617
875
|
|
|
618
876
|
/**
|
|
619
|
-
*
|
|
620
|
-
*
|
|
877
|
+
* Step 3 of a rotation (`ping_recovery::complete_rotation`). `answer` is
|
|
878
|
+
* the server's answer AS RECEIVED, `{ status, error?, generation?,
|
|
879
|
+
* statement? }`, judged inside (ruling V161). Answers `{
|
|
880
|
+
* outcome: "adopted", userId, deviceId, generation }`, `{ outcome:
|
|
881
|
+
* "lost", pinnedStatement }`, or one of the outcomes that keep the record
|
|
882
|
+
* (`outcome_out`).
|
|
621
883
|
*/
|
|
622
|
-
export function
|
|
884
|
+
export function completeRotation(storage: JsStorage, record_id: Uint8Array, answer: any): Promise<any>;
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* Set a new account up: the pending item first, then the device record in
|
|
888
|
+
* one write (`ping_recovery::create_account`). `persistentStorage` is the
|
|
889
|
+
* browser's answer to the persistent-storage request, which the host asked
|
|
890
|
+
* for before this call (ruling ID39), or `undefined`. `identityState` is
|
|
891
|
+
* the sign-in body's `identity_state` field as the server sent it: only
|
|
892
|
+
* the text `none_pinned` lets the call run (ruling V102).
|
|
893
|
+
*/
|
|
894
|
+
export function createAccount(storage: JsStorage, pending: JsPendingRootStore, slot: string, identity_state: string | null | undefined, persistent_storage: boolean | null | undefined, now_ms: number): Promise<any>;
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* [CR-13] Decode the `catchup_snapshot` blob of a linking ticket. Pure
|
|
898
|
+
* function; no client required. The new device calls this after the link
|
|
899
|
+
* to populate its initial UI.
|
|
900
|
+
*/
|
|
901
|
+
export function decodeCatchupSnapshot(snapshot_bytes: Uint8Array): any;
|
|
623
902
|
|
|
624
903
|
/**
|
|
625
904
|
* The id (16 bytes) of an account's DeviceGroup, the private sync group of
|
|
@@ -633,13 +912,17 @@ export function decryptBackup(blob: Uint8Array, mnemonic_phrase: string): any;
|
|
|
633
912
|
export function deviceGroupIdFor(user_id: Uint8Array): Uint8Array;
|
|
634
913
|
|
|
635
914
|
/**
|
|
636
|
-
*
|
|
637
|
-
* `
|
|
638
|
-
*
|
|
639
|
-
|
|
640
|
-
|
|
915
|
+
* End PENDING: delete the pending item, only against the proof on record
|
|
916
|
+
* (`ping_recovery::end_pending`). `fingerprint` is what `proveBackup`
|
|
917
|
+
* answered.
|
|
918
|
+
*/
|
|
919
|
+
export function endPending(storage: JsStorage, pending: JsPendingRootStore, slot: string, fingerprint: Uint8Array): Promise<void>;
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* Step 6: delete the record of an adopted rotation
|
|
923
|
+
* (`ping_recovery::finish_rotation`).
|
|
641
924
|
*/
|
|
642
|
-
export function
|
|
925
|
+
export function finishRotation(storage: JsStorage, record_id: Uint8Array): Promise<void>;
|
|
643
926
|
|
|
644
927
|
/**
|
|
645
928
|
* Generate a fresh 12-word BIP39 mnemonic, returned as its canonical phrase string.
|
|
@@ -720,30 +1003,51 @@ export function hpkeSealRaw(plaintext: Uint8Array, recipient_pub: Uint8Array, in
|
|
|
720
1003
|
*/
|
|
721
1004
|
export function hpkeSealRawPq(plaintext: Uint8Array, recipient_pub: Uint8Array, info: Uint8Array): Uint8Array;
|
|
722
1005
|
|
|
1006
|
+
/**
|
|
1007
|
+
* The commitment of a handshake payload: `[commitment (Uint8Array, 32),
|
|
1008
|
+
* qrText, code, codeDisplay]`. The JS facade names the parts.
|
|
1009
|
+
*/
|
|
1010
|
+
export function linkCommitment(payload: Uint8Array): Array<any>;
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* The 32 bytes of a QR text `{"v":3,"h":"..."}`.
|
|
1014
|
+
*/
|
|
1015
|
+
export function linkQrCommitment(qr_text: string): Uint8Array;
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* The first backup of a PENDING account (`ping_recovery::make_backup`).
|
|
1019
|
+
*/
|
|
1020
|
+
export function makeBackup(storage: JsStorage, pending: JsPendingRootStore, slot: string, phrase: Uint8Array, account_id: Uint8Array, host_state: Uint8Array, now_ms: number): Promise<any>;
|
|
1021
|
+
|
|
1022
|
+
/**
|
|
1023
|
+
* THE normaliser of a typed link code: the 20 characters, or an error.
|
|
1024
|
+
*/
|
|
1025
|
+
export function normalizeLinkCode(typed: string): string;
|
|
1026
|
+
|
|
723
1027
|
/**
|
|
724
1028
|
* Validate + canonicalise a user-entered phrase (BIP39 wordlist + checksum).
|
|
725
1029
|
*/
|
|
726
1030
|
export function normalizeMnemonicPhrase(phrase: string): string;
|
|
727
1031
|
|
|
728
1032
|
/**
|
|
729
|
-
*
|
|
730
|
-
* `
|
|
731
|
-
*
|
|
1033
|
+
* Step 3 of a restore (`ping_recovery::open_backup_for_restore`). Answers
|
|
1034
|
+
* `{ userId, rootPublicKey, accountId, generation, hostState?,
|
|
1035
|
+
* anchoredConversations }`; writes nothing.
|
|
732
1036
|
*/
|
|
733
|
-
export function
|
|
1037
|
+
export function openBackupForRestore(root_part: Uint8Array, phrase: Uint8Array, state_part: Uint8Array | null | undefined, pinned_root_public_key: Uint8Array): any;
|
|
734
1038
|
|
|
735
1039
|
/**
|
|
736
|
-
*
|
|
1040
|
+
* HPKE-open a sealed version 3 ticket with the new device's X-Wing seed.
|
|
1041
|
+
* NOT yet verified: `completeDeviceLink` runs every check. Opaque error.
|
|
737
1042
|
*/
|
|
738
|
-
export function
|
|
739
|
-
|
|
740
|
-
export function openLinkingTicket(sealed: Uint8Array, new_device_priv: Uint8Array): any;
|
|
1043
|
+
export function openLinkingTicketV3(sealed: Uint8Array, new_device_priv: Uint8Array): any;
|
|
741
1044
|
|
|
742
1045
|
/**
|
|
743
|
-
*
|
|
744
|
-
*
|
|
1046
|
+
* Open the account's state part with the generation secret this device
|
|
1047
|
+
* holds and keep its anchors (`ping_recovery::open_state_backup`).
|
|
1048
|
+
* Answers `{ hostState, anchoredConversations }`.
|
|
745
1049
|
*/
|
|
746
|
-
export function
|
|
1050
|
+
export function openStateBackup(storage: JsStorage, state_part: Uint8Array): Promise<any>;
|
|
747
1051
|
|
|
748
1052
|
/**
|
|
749
1053
|
* `PBKDF2-HMAC-SHA256(password, salt, iterations)` truncated to `outLen` bytes.
|
|
@@ -756,42 +1060,93 @@ export function openLinkingTicketPq(sealed: Uint8Array, new_device_priv: Uint8Ar
|
|
|
756
1060
|
export function pbkdf2Sha256(password: Uint8Array, salt: Uint8Array, iterations: number, out_len: number): Uint8Array;
|
|
757
1061
|
|
|
758
1062
|
/**
|
|
759
|
-
*
|
|
760
|
-
*
|
|
761
|
-
* seed, 32 bytes) are Uint8Arrays. Authenticated (sign-then-encrypt).
|
|
1063
|
+
* `"present"`, `"absent"` or `"mismatch"` (a lost root), with no read of
|
|
1064
|
+
* the seed (`ping_recovery::pending_status`).
|
|
762
1065
|
*/
|
|
763
|
-
export function
|
|
1066
|
+
export function pendingStatus(storage: JsStorage, pending: JsPendingRootStore, slot: string): Promise<any>;
|
|
764
1067
|
|
|
765
1068
|
/**
|
|
766
|
-
*
|
|
1069
|
+
* Rule R10 (b): the root part READ BACK from its store opens to this
|
|
1070
|
+
* account (`ping_recovery::prove_backup`). Answers `{ fingerprint }`.
|
|
767
1071
|
*/
|
|
768
|
-
export function
|
|
1072
|
+
export function proveBackup(storage: JsStorage, read_back_root_part: Uint8Array, phrase: Uint8Array): Promise<any>;
|
|
769
1073
|
|
|
770
1074
|
/**
|
|
771
|
-
*
|
|
772
|
-
*
|
|
773
|
-
*
|
|
774
|
-
|
|
775
|
-
|
|
1075
|
+
* Write the account's state part anew under the generation secret this
|
|
1076
|
+
* device holds (`ping_recovery::refresh_state_backup`). Answers `{
|
|
1077
|
+
* statePart, droppedAnchors }`.
|
|
1078
|
+
*/
|
|
1079
|
+
export function refreshStateBackup(storage: JsStorage, account_id: Uint8Array, host_state: Uint8Array, now_ms: number): Promise<any>;
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* M2, join beside the devices that stay (`ping_recovery::restore_join`).
|
|
1083
|
+
* Answers `{ device, credential, hostState }`.
|
|
1084
|
+
*/
|
|
1085
|
+
export function restoreJoin(storage: JsStorage, root_part: Uint8Array, phrase: Uint8Array, state_part: Uint8Array, start: any, now_ms: number): Promise<any>;
|
|
1086
|
+
|
|
1087
|
+
/**
|
|
1088
|
+
* M1, take the account over with the backup
|
|
1089
|
+
* (`ping_recovery::restore_take_over`). Answers `{ request, recordId,
|
|
1090
|
+
* newDevice }`.
|
|
1091
|
+
*/
|
|
1092
|
+
export function restoreTakeOver(storage: JsStorage, root_part: Uint8Array, phrase: Uint8Array, start: any, old_state_part: Uint8Array | null | undefined, account_id: Uint8Array, host_state: Uint8Array, now_ms: number): Promise<any>;
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* The rotation this device built and has not finished, or `null`
|
|
1096
|
+
* (`ping_recovery::resume_rotation`).
|
|
1097
|
+
*/
|
|
1098
|
+
export function resumeRotation(storage: JsStorage): Promise<any>;
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* [`resume_rotation`] WITH THE HOST'S CLOCK (ruling V461;
|
|
1102
|
+
* `ping_recovery::resume_rotation_at`): a take-over the server never
|
|
1103
|
+
* answered loses the sealing seed it kept once 30 days have passed since
|
|
1104
|
+
* its record was made.
|
|
776
1105
|
*/
|
|
777
|
-
export function
|
|
1106
|
+
export function resumeRotationAt(storage: JsStorage, now_ms: number): Promise<any>;
|
|
778
1107
|
|
|
779
1108
|
/**
|
|
780
|
-
*
|
|
781
|
-
*
|
|
1109
|
+
* Ruling V232: whether this store holds a rotation record and whether
|
|
1110
|
+
* the server refused it for good (`ping_recovery::rotation_record_state`).
|
|
1111
|
+
* Answers one of `"no_record"`, `"pending"`, `"adopted"`, `"refused"`,
|
|
1112
|
+
* `"root_part_required"`. One local read; no secret, no id, no request.
|
|
782
1113
|
*/
|
|
783
|
-
export function
|
|
1114
|
+
export function rotationRecordState(storage: JsStorage): Promise<string>;
|
|
784
1115
|
|
|
785
1116
|
/**
|
|
786
|
-
*
|
|
787
|
-
*
|
|
788
|
-
* the SDK builds the signed bytes, so nothing else can be signed with the
|
|
789
|
-
* device key this way). Returns `approver_device_id (32) || new_device_id (32)
|
|
790
|
-
* || signature (64)` in one array; the JS facade splits it. Refuses a wrong
|
|
791
|
-
* width, a non-canonical audience, a small-order or non-canonical new key and
|
|
792
|
-
* the device's own key; errors name the rejected parameter, never a value.
|
|
1117
|
+
* HPKE-seal the device-linking auth envelope (`ping/link-auth/v2`) to the
|
|
1118
|
+
* X-Wing key of the handshake `payload`, verified here.
|
|
793
1119
|
*/
|
|
794
|
-
export function
|
|
1120
|
+
export function sealLinkAuthFor(plaintext: Uint8Array, payload: Uint8Array, expected_code?: string | null, expected_qr?: Uint8Array | null): Uint8Array;
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* HPKE-seal a version 3 ticket to the X-Wing key of the handshake
|
|
1124
|
+
* `payload`, verified here (`ping/link/v2`). Refused when the ticket was
|
|
1125
|
+
* built for another device than the handshake's, or carries group state.
|
|
1126
|
+
*/
|
|
1127
|
+
export function sealLinkingTicketV3For(ticket: any, payload: Uint8Array, expected_code?: string | null, expected_qr?: Uint8Array | null): Uint8Array;
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* The one switch of self-admission as this module was compiled
|
|
1131
|
+
* (`ping_core::SELF_ADMISSION`, a constant of the source: the same value in
|
|
1132
|
+
* every artifact built from one commit). Read-only; nothing sets it.
|
|
1133
|
+
*/
|
|
1134
|
+
export function selfAdmissionCompiled(): boolean;
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Move an adopted rotation forward (`ping_recovery::set_rotation_phase`):
|
|
1138
|
+
* `"device_group_done"` or `"queued"`.
|
|
1139
|
+
*/
|
|
1140
|
+
export function setRotationPhase(storage: JsStorage, record_id: Uint8Array, phase: string): Promise<void>;
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* Link verification v2, approving device: approve the new device of the
|
|
1144
|
+
* handshake `payload`, verified here, on ONE server link session with this
|
|
1145
|
+
* device's signing key. Returns `approver_device_id (32) || new_device_id
|
|
1146
|
+
* (32) || signature (64)`; the JS facade splits it. The signed bytes and
|
|
1147
|
+
* the refusals are `ping_core::device_link`'s.
|
|
1148
|
+
*/
|
|
1149
|
+
export function signDeviceLinkApprovalFor(device_signing_secret_key: Uint8Array, approval_session_id: Uint8Array, account_id: Uint8Array, payload: Uint8Array, expected_code: string | null | undefined, expected_qr: Uint8Array | null | undefined, audience: string): Uint8Array;
|
|
795
1150
|
|
|
796
1151
|
/**
|
|
797
1152
|
* Link verification v2, new device: prove it holds its key over the session
|
|
@@ -811,15 +1166,51 @@ export function signDeviceLinkPossession(device_signing_secret_key: Uint8Array,
|
|
|
811
1166
|
*/
|
|
812
1167
|
export function signDeviceReauth(device_signing_secret_key: Uint8Array, challenge_id: Uint8Array, nonce: Uint8Array, account_id: Uint8Array, audience: string): Uint8Array;
|
|
813
1168
|
|
|
1169
|
+
/**
|
|
1170
|
+
* "Take your account back": the take-over with the pending item of
|
|
1171
|
+
* `slot` as the root. The item is read, never written and never deleted.
|
|
1172
|
+
* `old_state_part` is the account's state part as the escrow served it
|
|
1173
|
+
* (ruling V436): it gives its anchors only, as in `restoreTakeOver`.
|
|
1174
|
+
* ON AN EMPTY STORE EVERY JOIN IS UNCHECKED: never empty the SDK's store
|
|
1175
|
+
* on the service's word while the slot holds a pending item (ruling V538).
|
|
1176
|
+
*/
|
|
1177
|
+
export function takeAccountBack(storage: JsStorage, pending: JsPendingRootStore, slot: string, start: any, old_state_part: Uint8Array | null | undefined, account_id: Uint8Array, host_state: Uint8Array, now_ms: number): Promise<any>;
|
|
1178
|
+
|
|
1179
|
+
/**
|
|
1180
|
+
* Verify the handshake a relay returned. Returns `device_id (32) ||
|
|
1181
|
+
* device_signing_pubkey (32) || commitment (32) || by_qr (1)`; the JS facade
|
|
1182
|
+
* splits it. `link commitment mismatch` when the payload is not the one the
|
|
1183
|
+
* code or the QR commits to. A host shows nothing of a handshake and sends
|
|
1184
|
+
* nothing for it before this call succeeded.
|
|
1185
|
+
*/
|
|
1186
|
+
export function verifyLinkHandshake(payload: Uint8Array, expected_code?: string | null, expected_qr?: Uint8Array | null): Uint8Array;
|
|
1187
|
+
|
|
814
1188
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
815
1189
|
|
|
816
1190
|
export interface InitOutput {
|
|
817
1191
|
readonly memory: WebAssembly.Memory;
|
|
1192
|
+
readonly __wbg_accountsetupsession_free: (a: number, b: number) => void;
|
|
1193
|
+
readonly __wbg_devicelinkbegun_free: (a: number, b: number) => void;
|
|
818
1194
|
readonly __wbg_pingclient_free: (a: number, b: number) => void;
|
|
1195
|
+
readonly abandonRotation: (a: number, b: number, c: number) => number;
|
|
1196
|
+
readonly accountsetupsession_finish: (a: number, b: number) => number;
|
|
1197
|
+
readonly accountsetupsession_keepAsPending: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
1198
|
+
readonly accountsetupsession_makeBackup: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
1199
|
+
readonly accountsetupsession_proveBackup: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1200
|
+
readonly beginAccountSetupInMemory: (a: number, b: number, c: number, d: number) => void;
|
|
1201
|
+
readonly beginDeviceLink: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
1202
|
+
readonly checkBackupPhrase: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1203
|
+
readonly completeRotation: (a: number, b: number, c: number, d: number) => number;
|
|
1204
|
+
readonly createAccount: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
819
1205
|
readonly decodeCatchupSnapshot: (a: number, b: number, c: number) => void;
|
|
820
|
-
readonly decryptBackup: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
821
1206
|
readonly deviceGroupIdFor: (a: number, b: number) => number;
|
|
822
|
-
readonly
|
|
1207
|
+
readonly devicelinkbegun_deviceId: (a: number) => number;
|
|
1208
|
+
readonly devicelinkbegun_deviceSigningSecretKey: (a: number) => number;
|
|
1209
|
+
readonly devicelinkbegun_hpkeSecretKey: (a: number) => number;
|
|
1210
|
+
readonly devicelinkbegun_payload: (a: number) => number;
|
|
1211
|
+
readonly devicelinkbegun_takeClient: (a: number, b: number) => void;
|
|
1212
|
+
readonly endPending: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
1213
|
+
readonly finishRotation: (a: number, b: number, c: number) => number;
|
|
823
1214
|
readonly generateMnemonicPhrase: (a: number) => void;
|
|
824
1215
|
readonly hpkeGenerateKeypair: () => number;
|
|
825
1216
|
readonly hpkeGenerateKeypairPq: (a: number) => void;
|
|
@@ -833,22 +1224,31 @@ export interface InitOutput {
|
|
|
833
1224
|
readonly hpkeSealPq: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
834
1225
|
readonly hpkeSealRaw: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
835
1226
|
readonly hpkeSealRawPq: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1227
|
+
readonly linkCommitment: (a: number, b: number, c: number) => void;
|
|
1228
|
+
readonly linkQrCommitment: (a: number, b: number, c: number) => void;
|
|
1229
|
+
readonly makeBackup: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
|
|
1230
|
+
readonly normalizeLinkCode: (a: number, b: number, c: number) => void;
|
|
836
1231
|
readonly normalizeMnemonicPhrase: (a: number, b: number, c: number) => void;
|
|
837
|
-
readonly
|
|
838
|
-
readonly
|
|
839
|
-
readonly
|
|
840
|
-
readonly openLinkingTicketPq: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1232
|
+
readonly openBackupForRestore: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
1233
|
+
readonly openLinkingTicketV3: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1234
|
+
readonly openStateBackup: (a: number, b: number, c: number) => number;
|
|
841
1235
|
readonly pbkdf2Sha256: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1236
|
+
readonly pendingStatus: (a: number, b: number, c: number, d: number) => number;
|
|
842
1237
|
readonly pingclient_addMembers: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
843
1238
|
readonly pingclient_addMembersWithVerdicts: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
1239
|
+
readonly pingclient_addRestoredDevice: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
844
1240
|
readonly pingclient_admitDeviceToChats: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
845
1241
|
readonly pingclient_admitDeviceToChatsConcurrent: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
1242
|
+
readonly pingclient_adoptGeneration: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
1243
|
+
readonly pingclient_adoptHistoryDeliveryKeyCounter: (a: number, b: number) => number;
|
|
846
1244
|
readonly pingclient_adoptLogPosition: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
847
|
-
readonly
|
|
1245
|
+
readonly pingclient_buildLinkingTicketV3For: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
848
1246
|
readonly pingclient_commitPendingProposals: (a: number, b: number, c: number, d: number) => number;
|
|
849
1247
|
readonly pingclient_commitsInDoubt: (a: number, b: number) => void;
|
|
1248
|
+
readonly pingclient_completeDeviceLink: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
1249
|
+
readonly pingclient_completeRotation: (a: number, b: number, c: number, d: number) => number;
|
|
850
1250
|
readonly pingclient_confirmApplied: (a: number, b: number, c: number) => number;
|
|
851
|
-
readonly
|
|
1251
|
+
readonly pingclient_confirmHistoryImport: (a: number, b: number, c: number) => number;
|
|
852
1252
|
readonly pingclient_conversationMeta: (a: number, b: number, c: number, d: number) => void;
|
|
853
1253
|
readonly pingclient_conversationPolicy: (a: number, b: number, c: number, d: number) => void;
|
|
854
1254
|
readonly pingclient_conversationsBehind: (a: number, b: number, c: number) => void;
|
|
@@ -862,42 +1262,60 @@ export interface InitOutput {
|
|
|
862
1262
|
readonly pingclient_exportConversationSecret: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
863
1263
|
readonly pingclient_exportConversationSecretWithEpoch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
864
1264
|
readonly pingclient_exportConversationStateSnapshot: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
865
|
-
readonly pingclient_exportIdentity: (a: number, b: number) => void;
|
|
866
1265
|
readonly pingclient_freshKeyPackage: (a: number) => number;
|
|
867
1266
|
readonly pingclient_freshLastResortKeyPackage: (a: number) => number;
|
|
868
|
-
readonly
|
|
1267
|
+
readonly pingclient_heldCredential: (a: number, b: number) => void;
|
|
869
1268
|
readonly pingclient_heldFrameCount: (a: number) => number;
|
|
1269
|
+
readonly pingclient_heldGeneration: (a: number, b: number) => void;
|
|
1270
|
+
readonly pingclient_historyDeliveryKeyNextCounter: (a: number, b: number) => number;
|
|
1271
|
+
readonly pingclient_historyShipDecision: (a: number, b: number, c: number) => number;
|
|
1272
|
+
readonly pingclient_historyTrust: (a: number, b: number, c: number) => number;
|
|
870
1273
|
readonly pingclient_importStateSnapshot: (a: number, b: number, c: number, d: number) => number;
|
|
871
|
-
readonly
|
|
1274
|
+
readonly pingclient_initFromDeviceRecord: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
872
1275
|
readonly pingclient_joinConversation: (a: number, b: number, c: number) => number;
|
|
873
1276
|
readonly pingclient_joinConversationAt: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
874
1277
|
readonly pingclient_keyPackageIdentity: (a: number, b: number, c: number, d: number) => void;
|
|
875
1278
|
readonly pingclient_leaveConversation: (a: number, b: number, c: number, d: number) => number;
|
|
1279
|
+
readonly pingclient_linkGenerationFor: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
1280
|
+
readonly pingclient_linkHandshakePayload: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
876
1281
|
readonly pingclient_listConversations: (a: number, b: number) => void;
|
|
1282
|
+
readonly pingclient_logHoles: (a: number, b: number, c: number, d: number) => void;
|
|
877
1283
|
readonly pingclient_logPosition: (a: number, b: number, c: number, d: number) => void;
|
|
878
1284
|
readonly pingclient_logPositions: (a: number, b: number) => void;
|
|
879
1285
|
readonly pingclient_mayReadmit: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
880
1286
|
readonly pingclient_members: (a: number, b: number, c: number, d: number) => void;
|
|
881
1287
|
readonly pingclient_onMessage: (a: number, b: number) => void;
|
|
882
|
-
readonly
|
|
1288
|
+
readonly pingclient_openHistoryBundleV3: (a: number, b: number, c: number, d: number) => number;
|
|
1289
|
+
readonly pingclient_openLinkHistoryBundle: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
1290
|
+
readonly pingclient_openReadOnlyFromDeviceRecord: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
883
1291
|
readonly pingclient_pendingApplies: (a: number, b: number) => void;
|
|
884
1292
|
readonly pingclient_pendingProposalsCommitRank: (a: number, b: number, c: number) => number;
|
|
1293
|
+
readonly pingclient_planRotation: (a: number, b: number, c: number, d: number) => number;
|
|
885
1294
|
readonly pingclient_previewEnvelope: (a: number, b: number, c: number, d: number) => void;
|
|
886
1295
|
readonly pingclient_previewEnvelopeWithPrerequisites: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
887
1296
|
readonly pingclient_processEnvelope: (a: number, b: number, c: number) => number;
|
|
888
1297
|
readonly pingclient_processSequencedBatch: (a: number, b: number, c: number) => number;
|
|
889
1298
|
readonly pingclient_processWelcomeAt: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
1299
|
+
readonly pingclient_publishHistoryDeliveryKey: (a: number, b: number) => number;
|
|
890
1300
|
readonly pingclient_reAdmitDevice: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
891
1301
|
readonly pingclient_readmitPendingConversations: (a: number, b: number, c: number) => void;
|
|
1302
|
+
readonly pingclient_recordHistoryShipped: (a: number, b: number, c: number) => number;
|
|
1303
|
+
readonly pingclient_recreateDeviceGroup: (a: number, b: number) => number;
|
|
1304
|
+
readonly pingclient_refreshStateBackup: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
892
1305
|
readonly pingclient_removeDeviceEverywhere: (a: number, b: number, c: number, d: number) => number;
|
|
893
1306
|
readonly pingclient_removeMembers: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
894
1307
|
readonly pingclient_removeMembersByIdentity: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
895
1308
|
readonly pingclient_removeOwnDevicesExcept: (a: number, b: number, c: number, d: number) => number;
|
|
896
1309
|
readonly pingclient_removeOwnOtherLeaves: (a: number, b: number, c: number, d: number) => number;
|
|
1310
|
+
readonly pingclient_resolveLogHole: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
897
1311
|
readonly pingclient_resumeStorage: (a: number) => void;
|
|
898
1312
|
readonly pingclient_revokeDevice: (a: number, b: number, c: number, d: number) => number;
|
|
899
|
-
readonly
|
|
900
|
-
readonly
|
|
1313
|
+
readonly pingclient_rotateGenerationWithBackup: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number) => number;
|
|
1314
|
+
readonly pingclient_rotateGenerationWithPending: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => number;
|
|
1315
|
+
readonly pingclient_sealHistoryBundleV3: (a: number, b: number, c: number, d: number) => number;
|
|
1316
|
+
readonly pingclient_sealLinkHistoryBundle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
1317
|
+
readonly pingclient_selfAdmit: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
|
|
1318
|
+
readonly pingclient_selfAdmitMany: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
901
1319
|
readonly pingclient_send: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
902
1320
|
readonly pingclient_setConversationName: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
903
1321
|
readonly pingclient_setConversationRoles: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
@@ -909,16 +1327,25 @@ export interface InitOutput {
|
|
|
909
1327
|
readonly pingclient_syncConversations: (a: number, b: number) => number;
|
|
910
1328
|
readonly pingclient_undeliverableCount: (a: number) => number;
|
|
911
1329
|
readonly pingclient_userId: (a: number, b: number) => void;
|
|
912
|
-
readonly
|
|
913
|
-
readonly
|
|
914
|
-
readonly
|
|
915
|
-
readonly
|
|
916
|
-
readonly
|
|
1330
|
+
readonly proveBackup: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
1331
|
+
readonly refreshStateBackup: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
1332
|
+
readonly restoreJoin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
1333
|
+
readonly restoreTakeOver: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => number;
|
|
1334
|
+
readonly resumeRotation: (a: number) => number;
|
|
1335
|
+
readonly resumeRotationAt: (a: number, b: number) => number;
|
|
1336
|
+
readonly rotationRecordState: (a: number) => number;
|
|
1337
|
+
readonly sealLinkAuthFor: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
1338
|
+
readonly sealLinkingTicketV3For: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
1339
|
+
readonly selfAdmissionCompiled: () => number;
|
|
1340
|
+
readonly setRotationPhase: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
1341
|
+
readonly signDeviceLinkApprovalFor: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => void;
|
|
917
1342
|
readonly signDeviceLinkPossession: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
918
1343
|
readonly signDeviceReauth: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
|
|
1344
|
+
readonly takeAccountBack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => number;
|
|
1345
|
+
readonly verifyLinkHandshake: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
919
1346
|
readonly _start: () => void;
|
|
920
|
-
readonly
|
|
921
|
-
readonly
|
|
1347
|
+
readonly __wasm_bindgen_func_elem_6256: (a: number, b: number, c: number, d: number) => void;
|
|
1348
|
+
readonly __wasm_bindgen_func_elem_6271: (a: number, b: number, c: number, d: number) => void;
|
|
922
1349
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
923
1350
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
924
1351
|
readonly __wbindgen_export3: (a: number) => void;
|