@derec-alliance/nodejs 0.0.2 → 0.0.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/README.md +31 -1
- package/derec_library.d.ts +74 -14
- package/derec_library.js +118 -22
- package/derec_library_bg.wasm +0 -0
- package/derec_library_bg.wasm.d.ts +34 -31
- package/index.d.ts +439 -52
- package/index.js +67 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -458,6 +458,35 @@ response back to me," without rewriting channel state.
|
|
|
458
458
|
|
|
459
459
|
---
|
|
460
460
|
|
|
461
|
+
## Store filtered listings
|
|
462
|
+
|
|
463
|
+
`ChannelStore.listHelpers` and `ChannelStore.listReplicas` receive a filter
|
|
464
|
+
object — `ids`, `status`, `role` and `exclude`, where every empty value means
|
|
465
|
+
"do not restrict on this", so an all-empty filter selects everything.
|
|
466
|
+
`exclude` is applied last, overriding `ids`. Ids are decimal strings, like
|
|
467
|
+
every other `u64` on this bridge.
|
|
468
|
+
|
|
469
|
+
**Apply it in your query.** That is the point: a `WHERE` clause or a
|
|
470
|
+
key-condition expression instead of transferring rows the caller will discard.
|
|
471
|
+
That transfer costs bandwidth everywhere, and on a metered backing such as
|
|
472
|
+
DynamoDB, which bills by bytes read, it costs money.
|
|
473
|
+
|
|
474
|
+
**A store that ignores it is slow, not wrong.** The library re-applies the
|
|
475
|
+
filter to every listing before acting on it and drops anything the filter
|
|
476
|
+
excluded.
|
|
477
|
+
|
|
478
|
+
**That is a one-way guarantee, not a validation of your store.** Dropping rows
|
|
479
|
+
enforces an upper bound; it cannot recover a row you omitted. A store that
|
|
480
|
+
returns *fewer* rows than the filter selects is still wrong, in a way nothing
|
|
481
|
+
in the library can detect — the protocol simply fails to act. Applying the
|
|
482
|
+
filter faithfully is still your job.
|
|
483
|
+
|
|
484
|
+
The backstop matters here in particular: TypeScript accepts a function of fewer
|
|
485
|
+
parameters where more are declared, so a store written before the filter
|
|
486
|
+
existed still satisfies this interface and compiles without a diagnostic.
|
|
487
|
+
|
|
488
|
+
---
|
|
489
|
+
|
|
461
490
|
## Package Contents
|
|
462
491
|
|
|
463
492
|
```text
|
|
@@ -507,7 +536,8 @@ that you can retire as soon as the PrePair leg completes.
|
|
|
507
536
|
|
|
508
537
|
The recommended pattern is: pair on the ephemeral URI, then — as soon
|
|
509
538
|
as the pairing completes on the contact creator side — call
|
|
510
|
-
`
|
|
539
|
+
`setOwnTransports` with the permanent endpoint (`setOwnTransport` is
|
|
540
|
+
deprecated and removed at 0.0.5) and start an
|
|
511
541
|
`UpdateChannelInfo` flow against the peer to announce the swap. Once
|
|
512
542
|
the peer acknowledges, retire the ephemeral URI. This keeps the
|
|
513
543
|
plaintext PrePair window tight while letting subsequent traffic ride
|
package/derec_library.d.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* docs.
|
|
10
10
|
*
|
|
11
11
|
* Required setters: `withChannelStore`, `withShareStore`,
|
|
12
|
-
* `withSecretStore`, `withTransport`, `withOwnTransport
|
|
13
|
-
* `build()` without all five throws.
|
|
12
|
+
* `withSecretStore`, `withTransport`, and either `withOwnTransport` or
|
|
13
|
+
* `withOwnTransports`. Calling `build()` without all five throws.
|
|
14
14
|
*
|
|
15
15
|
* All optional setters carry the defaults documented on the Rust
|
|
16
16
|
* builder.
|
|
@@ -63,16 +63,40 @@ export class DeRecProtocolBuilder {
|
|
|
63
63
|
withKeepVersionsCount(count: number): DeRecProtocolBuilder;
|
|
64
64
|
/**
|
|
65
65
|
* `endpoint` shape: `{ uri: string, protocol: string }`.
|
|
66
|
-
* `protocol`
|
|
66
|
+
* `protocol` is `"https"` or `"grpc"` (case-insensitive).
|
|
67
|
+
*
|
|
68
|
+
* @deprecated Use `withOwnTransports`, which takes the whole preference
|
|
69
|
+
* list — `withOwnTransports([endpoint])` is the direct replacement.
|
|
70
|
+
* Removed at 0.0.5.
|
|
67
71
|
*/
|
|
68
72
|
withOwnTransport(endpoint: any): DeRecProtocolBuilder;
|
|
73
|
+
/**
|
|
74
|
+
* Every transport endpoint this application serves, in preference
|
|
75
|
+
* order. `transports` is an array of `{ uri: string, protocol: string
|
|
76
|
+
* }` objects, `protocol` being `"https"` or `"grpc"`
|
|
77
|
+
* (case-insensitive), same shape as [`Self::with_own_transport`].
|
|
78
|
+
*
|
|
79
|
+
* The order is the application's own preference and decides which of
|
|
80
|
+
* a peer's offered endpoints is used. Every listed transport must
|
|
81
|
+
* actually be served, because delivery is push-only — listing an
|
|
82
|
+
* endpoint this application does not serve makes pairing succeed and
|
|
83
|
+
* replies vanish.
|
|
84
|
+
*
|
|
85
|
+
* Supersedes [`Self::with_own_transport`] for applications serving
|
|
86
|
+
* more than one transport; the single-endpoint setter remains fully
|
|
87
|
+
* supported.
|
|
88
|
+
*/
|
|
89
|
+
withOwnTransports(transports: any[]): DeRecProtocolBuilder;
|
|
69
90
|
/**
|
|
70
91
|
* Declare the local node's acceptable parameter range for pair
|
|
71
|
-
* negotiation. `range` is a JS object whose keys
|
|
72
|
-
* `ParameterRange`
|
|
73
|
-
* `
|
|
74
|
-
*
|
|
75
|
-
*
|
|
92
|
+
* negotiation. `range` is a JS object whose keys match the
|
|
93
|
+
* `ParameterRange` interface every binding already declares —
|
|
94
|
+
* `min_share_size`, `max_share_size`, `min_time_between_verifications`,
|
|
95
|
+
* … — so one shape serves the wasm and FFI paths alike. Each field is
|
|
96
|
+
* `i64`: accept either a number or a `BigInt` on the JS side. Every
|
|
97
|
+
* field is optional and defaults to `0`, which the proto reads as no
|
|
98
|
+
* constraint on that dimension. Default: unset (no constraints
|
|
99
|
+
* advertised, every peer range accepted).
|
|
76
100
|
*/
|
|
77
101
|
withParameterRange(range: any): DeRecProtocolBuilder;
|
|
78
102
|
/**
|
|
@@ -112,6 +136,12 @@ export class DeRecProtocolBuilder {
|
|
|
112
136
|
* `ack` is `"required"` (default) or `"not_required"`.
|
|
113
137
|
*/
|
|
114
138
|
withUnpairAck(ack: string): DeRecProtocolBuilder;
|
|
139
|
+
/**
|
|
140
|
+
* Accept plaintext transport endpoints — `http://` and `grpc://`.
|
|
141
|
+
* **Development only.** Default `false`. See `withUnsafeHttp` for the
|
|
142
|
+
* conflict rule when both are set.
|
|
143
|
+
*/
|
|
144
|
+
withUnsafeConnection(allow: boolean): DeRecProtocolBuilder;
|
|
115
145
|
/**
|
|
116
146
|
* Accept plaintext `http://` transport endpoints. **Development only.**
|
|
117
147
|
* Default `false`.
|
|
@@ -122,6 +152,9 @@ export class DeRecProtocolBuilder {
|
|
|
122
152
|
* With it `true`, plaintext is accepted for any host on any path,
|
|
123
153
|
* including endpoints a peer supplies. That is what makes the LAN case
|
|
124
154
|
* work (a phone against a laptop), and why the name is blunt.
|
|
155
|
+
*
|
|
156
|
+
* Superseded by `withUnsafeConnection`; still honored, and wins on
|
|
157
|
+
* conflict. Removed at 0.0.5.
|
|
125
158
|
*/
|
|
126
159
|
withUnsafeHttp(allow: boolean): DeRecProtocolBuilder;
|
|
127
160
|
withUserSecretStore(store: any): DeRecProtocolBuilder;
|
|
@@ -277,12 +310,39 @@ export class DeRecProtocolWasm {
|
|
|
277
310
|
*/
|
|
278
311
|
setCommunicationInfo(info: any): void;
|
|
279
312
|
/**
|
|
280
|
-
* Replace this node's
|
|
281
|
-
*
|
|
313
|
+
* Replace this node's endpoint for one protocol, leaving the others
|
|
314
|
+
* alone. A node serves at most one endpoint per protocol, so the
|
|
315
|
+
* `(uri, protocol)` pair identifies the entry it replaces; an entry for
|
|
316
|
+
* a protocol not yet served is appended, and a replaced one keeps its
|
|
317
|
+
* position in the preference order.
|
|
318
|
+
*
|
|
319
|
+
* @deprecated Use `setOwnTransports`, which takes the whole preference
|
|
320
|
+
* list and is the only way to change which protocols this node serves,
|
|
321
|
+
* or their order. Removed at 0.0.5.
|
|
322
|
+
*
|
|
323
|
+
* See `setCommunicationInfo` for the matching update-propagation
|
|
324
|
+
* flow, and `setOwnTransports` to keep more than one endpoint.
|
|
282
325
|
* IMPORTANT: keep the old endpoint operational during the changeover —
|
|
283
326
|
* see the Rust docs on `set_own_transport` for the discipline.
|
|
284
327
|
*/
|
|
285
328
|
setOwnTransport(uri: string, protocol: string): void;
|
|
329
|
+
/**
|
|
330
|
+
* Replace every endpoint this node advertises, in preference order.
|
|
331
|
+
*
|
|
332
|
+
* `transports` is an array of `{ uri: string, protocol: string }`
|
|
333
|
+
* objects, same shape as `withOwnTransports`. The runtime counterpart
|
|
334
|
+
* to that builder setter, and the way to change the whole set:
|
|
335
|
+
* `setOwnTransport` replaces only the entry for the protocol its URI
|
|
336
|
+
* names. A node serves at most one endpoint per protocol, so this list
|
|
337
|
+
* is a preference order over distinct protocols and two entries of the
|
|
338
|
+
* same protocol are rejected.
|
|
339
|
+
*
|
|
340
|
+
* Every entry is validated before any is stored, so a malformed URI
|
|
341
|
+
* leaves the previous set intact. IMPORTANT: keep the old endpoints
|
|
342
|
+
* operational during the changeover — see the Rust docs on
|
|
343
|
+
* `set_own_transports` for the discipline.
|
|
344
|
+
*/
|
|
345
|
+
setOwnTransports(transports: any[]): void;
|
|
286
346
|
/**
|
|
287
347
|
* Unified entry point for initiating any protocol flow.
|
|
288
348
|
*
|
|
@@ -357,7 +417,7 @@ export function envelope_read_trace_id(envelope_bytes: Uint8Array): bigint;
|
|
|
357
417
|
*/
|
|
358
418
|
export function pairing_contact_message_validate(contact_message: any): void;
|
|
359
419
|
|
|
360
|
-
export function pairing_request_create_contact(channel_id: bigint, contact_mode: number,
|
|
420
|
+
export function pairing_request_create_contact(channel_id: bigint, contact_mode: number, transport_protocols: any, nonce: any): any;
|
|
361
421
|
|
|
362
422
|
/**
|
|
363
423
|
* Decodes a proto-encoded [`ContactMessage`]. Structurally validates the
|
|
@@ -381,13 +441,13 @@ export function pairing_request_extract(envelope_bytes: Uint8Array, secret_key:
|
|
|
381
441
|
*/
|
|
382
442
|
export function pairing_request_extract_pre_pair(envelope_bytes: Uint8Array): any;
|
|
383
443
|
|
|
384
|
-
export function pairing_request_produce(kind: number,
|
|
444
|
+
export function pairing_request_produce(kind: number, transport_protocols: any, contact_message: any, communication_info: any, parameter_range: any): any;
|
|
385
445
|
|
|
386
446
|
/**
|
|
387
447
|
* Scanner-side: build the plaintext `PrePairRequest` envelope for a
|
|
388
448
|
* `HASHED_KEYS` contact.
|
|
389
449
|
*/
|
|
390
|
-
export function pairing_request_produce_pre_pair(
|
|
450
|
+
export function pairing_request_produce_pre_pair(own_transports: any, contact_message: any): any;
|
|
391
451
|
|
|
392
452
|
export function pairing_response_extract(envelope_bytes: Uint8Array, secret_key: Uint8Array): any;
|
|
393
453
|
|
|
@@ -404,7 +464,7 @@ export function pairing_response_process(contact_message: any, response: any, se
|
|
|
404
464
|
*/
|
|
405
465
|
export function pairing_response_process_pre_pair(contact_message: any, response: any): any;
|
|
406
466
|
|
|
407
|
-
export function pairing_response_produce(channel_id: bigint, request: any, secret_key: Uint8Array, communication_info: any, parameter_range: any): any;
|
|
467
|
+
export function pairing_response_produce(channel_id: bigint, request: any, secret_key: Uint8Array, communication_info: any, parameter_range: any, unsafe_connection: boolean): any;
|
|
408
468
|
|
|
409
469
|
/**
|
|
410
470
|
* Contact-creator side: publish the actual public keys back to the scanner.
|
package/derec_library.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* docs.
|
|
9
9
|
*
|
|
10
10
|
* Required setters: `withChannelStore`, `withShareStore`,
|
|
11
|
-
* `withSecretStore`, `withTransport`, `withOwnTransport
|
|
12
|
-
* `build()` without all five throws.
|
|
11
|
+
* `withSecretStore`, `withTransport`, and either `withOwnTransport` or
|
|
12
|
+
* `withOwnTransports`. Calling `build()` without all five throws.
|
|
13
13
|
*
|
|
14
14
|
* All optional setters carry the defaults documented on the Rust
|
|
15
15
|
* builder.
|
|
@@ -137,7 +137,11 @@ class DeRecProtocolBuilder {
|
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* `endpoint` shape: `{ uri: string, protocol: string }`.
|
|
140
|
-
* `protocol`
|
|
140
|
+
* `protocol` is `"https"` or `"grpc"` (case-insensitive).
|
|
141
|
+
*
|
|
142
|
+
* @deprecated Use `withOwnTransports`, which takes the whole preference
|
|
143
|
+
* list — `withOwnTransports([endpoint])` is the direct replacement.
|
|
144
|
+
* Removed at 0.0.5.
|
|
141
145
|
* @param {any} endpoint
|
|
142
146
|
* @returns {DeRecProtocolBuilder}
|
|
143
147
|
*/
|
|
@@ -149,13 +153,44 @@ class DeRecProtocolBuilder {
|
|
|
149
153
|
}
|
|
150
154
|
return DeRecProtocolBuilder.__wrap(ret[0]);
|
|
151
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Every transport endpoint this application serves, in preference
|
|
158
|
+
* order. `transports` is an array of `{ uri: string, protocol: string
|
|
159
|
+
* }` objects, `protocol` being `"https"` or `"grpc"`
|
|
160
|
+
* (case-insensitive), same shape as [`Self::with_own_transport`].
|
|
161
|
+
*
|
|
162
|
+
* The order is the application's own preference and decides which of
|
|
163
|
+
* a peer's offered endpoints is used. Every listed transport must
|
|
164
|
+
* actually be served, because delivery is push-only — listing an
|
|
165
|
+
* endpoint this application does not serve makes pairing succeed and
|
|
166
|
+
* replies vanish.
|
|
167
|
+
*
|
|
168
|
+
* Supersedes [`Self::with_own_transport`] for applications serving
|
|
169
|
+
* more than one transport; the single-endpoint setter remains fully
|
|
170
|
+
* supported.
|
|
171
|
+
* @param {any[]} transports
|
|
172
|
+
* @returns {DeRecProtocolBuilder}
|
|
173
|
+
*/
|
|
174
|
+
withOwnTransports(transports) {
|
|
175
|
+
const ptr = this.__destroy_into_raw();
|
|
176
|
+
const ptr0 = passArrayJsValueToWasm0(transports, wasm.__wbindgen_malloc);
|
|
177
|
+
const len0 = WASM_VECTOR_LEN;
|
|
178
|
+
const ret = wasm.derecprotocolbuilder_withOwnTransports(ptr, ptr0, len0);
|
|
179
|
+
if (ret[2]) {
|
|
180
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
181
|
+
}
|
|
182
|
+
return DeRecProtocolBuilder.__wrap(ret[0]);
|
|
183
|
+
}
|
|
152
184
|
/**
|
|
153
185
|
* Declare the local node's acceptable parameter range for pair
|
|
154
|
-
* negotiation. `range` is a JS object whose keys
|
|
155
|
-
* `ParameterRange`
|
|
156
|
-
* `
|
|
157
|
-
*
|
|
158
|
-
*
|
|
186
|
+
* negotiation. `range` is a JS object whose keys match the
|
|
187
|
+
* `ParameterRange` interface every binding already declares —
|
|
188
|
+
* `min_share_size`, `max_share_size`, `min_time_between_verifications`,
|
|
189
|
+
* … — so one shape serves the wasm and FFI paths alike. Each field is
|
|
190
|
+
* `i64`: accept either a number or a `BigInt` on the JS side. Every
|
|
191
|
+
* field is optional and defaults to `0`, which the proto reads as no
|
|
192
|
+
* constraint on that dimension. Default: unset (no constraints
|
|
193
|
+
* advertised, every peer range accepted).
|
|
159
194
|
* @param {any} range
|
|
160
195
|
* @returns {DeRecProtocolBuilder}
|
|
161
196
|
*/
|
|
@@ -271,6 +306,18 @@ class DeRecProtocolBuilder {
|
|
|
271
306
|
}
|
|
272
307
|
return DeRecProtocolBuilder.__wrap(ret[0]);
|
|
273
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* Accept plaintext transport endpoints — `http://` and `grpc://`.
|
|
311
|
+
* **Development only.** Default `false`. See `withUnsafeHttp` for the
|
|
312
|
+
* conflict rule when both are set.
|
|
313
|
+
* @param {boolean} allow
|
|
314
|
+
* @returns {DeRecProtocolBuilder}
|
|
315
|
+
*/
|
|
316
|
+
withUnsafeConnection(allow) {
|
|
317
|
+
const ptr = this.__destroy_into_raw();
|
|
318
|
+
const ret = wasm.derecprotocolbuilder_withUnsafeConnection(ptr, allow);
|
|
319
|
+
return DeRecProtocolBuilder.__wrap(ret);
|
|
320
|
+
}
|
|
274
321
|
/**
|
|
275
322
|
* Accept plaintext `http://` transport endpoints. **Development only.**
|
|
276
323
|
* Default `false`.
|
|
@@ -281,6 +328,9 @@ class DeRecProtocolBuilder {
|
|
|
281
328
|
* With it `true`, plaintext is accepted for any host on any path,
|
|
282
329
|
* including endpoints a peer supplies. That is what makes the LAN case
|
|
283
330
|
* work (a phone against a laptop), and why the name is blunt.
|
|
331
|
+
*
|
|
332
|
+
* Superseded by `withUnsafeConnection`; still honored, and wins on
|
|
333
|
+
* conflict. Removed at 0.0.5.
|
|
284
334
|
* @param {boolean} allow
|
|
285
335
|
* @returns {DeRecProtocolBuilder}
|
|
286
336
|
*/
|
|
@@ -523,8 +573,18 @@ class DeRecProtocolWasm {
|
|
|
523
573
|
}
|
|
524
574
|
}
|
|
525
575
|
/**
|
|
526
|
-
* Replace this node's
|
|
527
|
-
*
|
|
576
|
+
* Replace this node's endpoint for one protocol, leaving the others
|
|
577
|
+
* alone. A node serves at most one endpoint per protocol, so the
|
|
578
|
+
* `(uri, protocol)` pair identifies the entry it replaces; an entry for
|
|
579
|
+
* a protocol not yet served is appended, and a replaced one keeps its
|
|
580
|
+
* position in the preference order.
|
|
581
|
+
*
|
|
582
|
+
* @deprecated Use `setOwnTransports`, which takes the whole preference
|
|
583
|
+
* list and is the only way to change which protocols this node serves,
|
|
584
|
+
* or their order. Removed at 0.0.5.
|
|
585
|
+
*
|
|
586
|
+
* See `setCommunicationInfo` for the matching update-propagation
|
|
587
|
+
* flow, and `setOwnTransports` to keep more than one endpoint.
|
|
528
588
|
* IMPORTANT: keep the old endpoint operational during the changeover —
|
|
529
589
|
* see the Rust docs on `set_own_transport` for the discipline.
|
|
530
590
|
* @param {string} uri
|
|
@@ -540,6 +600,31 @@ class DeRecProtocolWasm {
|
|
|
540
600
|
throw takeFromExternrefTable0(ret[0]);
|
|
541
601
|
}
|
|
542
602
|
}
|
|
603
|
+
/**
|
|
604
|
+
* Replace every endpoint this node advertises, in preference order.
|
|
605
|
+
*
|
|
606
|
+
* `transports` is an array of `{ uri: string, protocol: string }`
|
|
607
|
+
* objects, same shape as `withOwnTransports`. The runtime counterpart
|
|
608
|
+
* to that builder setter, and the way to change the whole set:
|
|
609
|
+
* `setOwnTransport` replaces only the entry for the protocol its URI
|
|
610
|
+
* names. A node serves at most one endpoint per protocol, so this list
|
|
611
|
+
* is a preference order over distinct protocols and two entries of the
|
|
612
|
+
* same protocol are rejected.
|
|
613
|
+
*
|
|
614
|
+
* Every entry is validated before any is stored, so a malformed URI
|
|
615
|
+
* leaves the previous set intact. IMPORTANT: keep the old endpoints
|
|
616
|
+
* operational during the changeover — see the Rust docs on
|
|
617
|
+
* `set_own_transports` for the discipline.
|
|
618
|
+
* @param {any[]} transports
|
|
619
|
+
*/
|
|
620
|
+
setOwnTransports(transports) {
|
|
621
|
+
const ptr0 = passArrayJsValueToWasm0(transports, wasm.__wbindgen_malloc);
|
|
622
|
+
const len0 = WASM_VECTOR_LEN;
|
|
623
|
+
const ret = wasm.derecprotocolwasm_setOwnTransports(this.__wbg_ptr, ptr0, len0);
|
|
624
|
+
if (ret[1]) {
|
|
625
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
543
628
|
/**
|
|
544
629
|
* Unified entry point for initiating any protocol flow.
|
|
545
630
|
*
|
|
@@ -742,12 +827,12 @@ exports.pairing_contact_message_validate = pairing_contact_message_validate;
|
|
|
742
827
|
/**
|
|
743
828
|
* @param {bigint} channel_id
|
|
744
829
|
* @param {number} contact_mode
|
|
745
|
-
* @param {any}
|
|
830
|
+
* @param {any} transport_protocols
|
|
746
831
|
* @param {any} nonce
|
|
747
832
|
* @returns {any}
|
|
748
833
|
*/
|
|
749
|
-
function pairing_request_create_contact(channel_id, contact_mode,
|
|
750
|
-
const ret = wasm.pairing_request_create_contact(channel_id, contact_mode,
|
|
834
|
+
function pairing_request_create_contact(channel_id, contact_mode, transport_protocols, nonce) {
|
|
835
|
+
const ret = wasm.pairing_request_create_contact(channel_id, contact_mode, transport_protocols, nonce);
|
|
751
836
|
if (ret[2]) {
|
|
752
837
|
throw takeFromExternrefTable0(ret[1]);
|
|
753
838
|
}
|
|
@@ -828,14 +913,14 @@ exports.pairing_request_extract_pre_pair = pairing_request_extract_pre_pair;
|
|
|
828
913
|
|
|
829
914
|
/**
|
|
830
915
|
* @param {number} kind
|
|
831
|
-
* @param {any}
|
|
916
|
+
* @param {any} transport_protocols
|
|
832
917
|
* @param {any} contact_message
|
|
833
918
|
* @param {any} communication_info
|
|
834
919
|
* @param {any} parameter_range
|
|
835
920
|
* @returns {any}
|
|
836
921
|
*/
|
|
837
|
-
function pairing_request_produce(kind,
|
|
838
|
-
const ret = wasm.pairing_request_produce(kind,
|
|
922
|
+
function pairing_request_produce(kind, transport_protocols, contact_message, communication_info, parameter_range) {
|
|
923
|
+
const ret = wasm.pairing_request_produce(kind, transport_protocols, contact_message, communication_info, parameter_range);
|
|
839
924
|
if (ret[2]) {
|
|
840
925
|
throw takeFromExternrefTable0(ret[1]);
|
|
841
926
|
}
|
|
@@ -846,12 +931,12 @@ exports.pairing_request_produce = pairing_request_produce;
|
|
|
846
931
|
/**
|
|
847
932
|
* Scanner-side: build the plaintext `PrePairRequest` envelope for a
|
|
848
933
|
* `HASHED_KEYS` contact.
|
|
849
|
-
* @param {any}
|
|
934
|
+
* @param {any} own_transports
|
|
850
935
|
* @param {any} contact_message
|
|
851
936
|
* @returns {any}
|
|
852
937
|
*/
|
|
853
|
-
function pairing_request_produce_pre_pair(
|
|
854
|
-
const ret = wasm.pairing_request_produce_pre_pair(
|
|
938
|
+
function pairing_request_produce_pre_pair(own_transports, contact_message) {
|
|
939
|
+
const ret = wasm.pairing_request_produce_pre_pair(own_transports, contact_message);
|
|
855
940
|
if (ret[2]) {
|
|
856
941
|
throw takeFromExternrefTable0(ret[1]);
|
|
857
942
|
}
|
|
@@ -932,12 +1017,13 @@ exports.pairing_response_process_pre_pair = pairing_response_process_pre_pair;
|
|
|
932
1017
|
* @param {Uint8Array} secret_key
|
|
933
1018
|
* @param {any} communication_info
|
|
934
1019
|
* @param {any} parameter_range
|
|
1020
|
+
* @param {boolean} unsafe_connection
|
|
935
1021
|
* @returns {any}
|
|
936
1022
|
*/
|
|
937
|
-
function pairing_response_produce(channel_id, request, secret_key, communication_info, parameter_range) {
|
|
1023
|
+
function pairing_response_produce(channel_id, request, secret_key, communication_info, parameter_range, unsafe_connection) {
|
|
938
1024
|
const ptr0 = passArray8ToWasm0(secret_key, wasm.__wbindgen_malloc);
|
|
939
1025
|
const len0 = WASM_VECTOR_LEN;
|
|
940
|
-
const ret = wasm.pairing_response_produce(channel_id, request, ptr0, len0, communication_info, parameter_range);
|
|
1026
|
+
const ret = wasm.pairing_response_produce(channel_id, request, ptr0, len0, communication_info, parameter_range, unsafe_connection);
|
|
941
1027
|
if (ret[2]) {
|
|
942
1028
|
throw takeFromExternrefTable0(ret[1]);
|
|
943
1029
|
}
|
|
@@ -1725,7 +1811,7 @@ function __wbg_get_imports() {
|
|
|
1725
1811
|
return ret;
|
|
1726
1812
|
},
|
|
1727
1813
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1728
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1814
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 385, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1729
1815
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h379e0770a020d351);
|
|
1730
1816
|
return ret;
|
|
1731
1817
|
},
|
|
@@ -1936,6 +2022,16 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
1936
2022
|
return ptr;
|
|
1937
2023
|
}
|
|
1938
2024
|
|
|
2025
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
2026
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
2027
|
+
for (let i = 0; i < array.length; i++) {
|
|
2028
|
+
const add = addToExternrefTable0(array[i]);
|
|
2029
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
2030
|
+
}
|
|
2031
|
+
WASM_VECTOR_LEN = array.length;
|
|
2032
|
+
return ptr;
|
|
2033
|
+
}
|
|
2034
|
+
|
|
1939
2035
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
1940
2036
|
if (realloc === undefined) {
|
|
1941
2037
|
const buf = cachedTextEncoder.encode(arg);
|
package/derec_library_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const recovery_response_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
5
|
+
export const recovery_response_produce: (a: bigint, b: any, c: any, d: number, e: number) => [number, number, number];
|
|
6
|
+
export const recovery_response_recover: (a: bigint, b: number, c: any) => [number, number, number];
|
|
7
|
+
export const recovery_request_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
8
|
+
export const recovery_request_produce: (a: bigint, b: bigint, c: number, d: number, e: number, f: any) => [number, number, number];
|
|
9
|
+
export const verification_response_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
10
|
+
export const verification_response_process: (a: any, b: any, c: number, d: number) => [number, number, number];
|
|
11
|
+
export const verification_response_produce: (a: bigint, b: any, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
12
|
+
export const discovery_response_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
13
|
+
export const discovery_response_process: (a: any) => [number, number, number];
|
|
14
|
+
export const discovery_response_produce: (a: bigint, b: any, c: number, d: number) => [number, number, number];
|
|
15
|
+
export const discovery_request_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
16
|
+
export const discovery_request_produce: (a: bigint, b: number, c: number, d: any) => [number, number, number];
|
|
17
|
+
export const unpairing_request_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
18
|
+
export const unpairing_request_produce: (a: bigint, b: number, c: number, d: number, e: number, f: any) => [number, number, number];
|
|
19
|
+
export const verification_request_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
20
|
+
export const verification_request_produce: (a: bigint, b: bigint, c: number, d: number, e: number, f: any) => [number, number, number];
|
|
21
|
+
export const pairing_response_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
22
|
+
export const pairing_response_extract_pre_pair: (a: number, b: number) => [number, number, number];
|
|
23
|
+
export const pairing_response_process: (a: any, b: any, c: number, d: number) => [number, number, number];
|
|
24
|
+
export const pairing_response_process_pre_pair: (a: any, b: any) => [number, number, number];
|
|
25
|
+
export const pairing_response_produce: (a: bigint, b: any, c: number, d: number, e: any, f: any, g: number) => [number, number, number];
|
|
26
|
+
export const pairing_response_produce_pre_pair: (a: bigint, b: any, c: number, d: number) => [number, number, number];
|
|
4
27
|
export const __wbg_derecprotocolbuilder_free: (a: number, b: number) => void;
|
|
5
28
|
export const __wbg_derecprotocolwasm_free: (a: number, b: number) => void;
|
|
6
29
|
export const derecprotocolbuilder_build: (a: number) => [number, number, number];
|
|
@@ -12,6 +35,7 @@ export const derecprotocolbuilder_withChannelStore: (a: number, b: any) => numbe
|
|
|
12
35
|
export const derecprotocolbuilder_withCommunicationInfo: (a: number, b: any) => [number, number, number];
|
|
13
36
|
export const derecprotocolbuilder_withKeepVersionsCount: (a: number, b: number) => number;
|
|
14
37
|
export const derecprotocolbuilder_withOwnTransport: (a: number, b: any) => [number, number, number];
|
|
38
|
+
export const derecprotocolbuilder_withOwnTransports: (a: number, b: number, c: number) => [number, number, number];
|
|
15
39
|
export const derecprotocolbuilder_withParameterRange: (a: number, b: any) => [number, number, number];
|
|
16
40
|
export const derecprotocolbuilder_withReplicaId: (a: number, b: any) => [number, number, number];
|
|
17
41
|
export const derecprotocolbuilder_withSecretStore: (a: number, b: any) => number;
|
|
@@ -21,6 +45,7 @@ export const derecprotocolbuilder_withThreshold: (a: number, b: number) => numbe
|
|
|
21
45
|
export const derecprotocolbuilder_withTimeouts: (a: number, b: any) => [number, number, number];
|
|
22
46
|
export const derecprotocolbuilder_withTransport: (a: number, b: any) => number;
|
|
23
47
|
export const derecprotocolbuilder_withUnpairAck: (a: number, b: number, c: number) => [number, number, number];
|
|
48
|
+
export const derecprotocolbuilder_withUnsafeConnection: (a: number, b: number) => number;
|
|
24
49
|
export const derecprotocolbuilder_withUnsafeHttp: (a: number, b: number) => number;
|
|
25
50
|
export const derecprotocolbuilder_withUserSecretStore: (a: number, b: any) => number;
|
|
26
51
|
export const derecprotocolwasm_accept: (a: number, b: number, c: number) => any;
|
|
@@ -33,29 +58,18 @@ export const derecprotocolwasm_restore: (a: number, b: any, c: number) => any;
|
|
|
33
58
|
export const derecprotocolwasm_secretId: (a: number) => bigint;
|
|
34
59
|
export const derecprotocolwasm_setCommunicationInfo: (a: number, b: any) => [number, number];
|
|
35
60
|
export const derecprotocolwasm_setOwnTransport: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
61
|
+
export const derecprotocolwasm_setOwnTransports: (a: number, b: number, c: number) => [number, number];
|
|
36
62
|
export const derecprotocolwasm_start: (a: number, b: number, c: any) => any;
|
|
37
63
|
export const derecprotocolwasm_tick: (a: number) => any;
|
|
38
64
|
export const derecprotocolwasm_verifyFingerprint: (a: number, b: any, c: number, d: number) => any;
|
|
39
|
-
export const
|
|
40
|
-
export const
|
|
41
|
-
export const
|
|
42
|
-
export const
|
|
43
|
-
export const
|
|
44
|
-
export const recovery_response_produce: (a: bigint, b: any, c: any, d: number, e: number) => [number, number, number];
|
|
45
|
-
export const recovery_response_recover: (a: bigint, b: number, c: any) => [number, number, number];
|
|
65
|
+
export const envelope_apply_trace_id: (a: number, b: number, c: bigint) => [number, number, number, number];
|
|
66
|
+
export const envelope_read_trace_id: (a: number, b: number) => [bigint, number, number];
|
|
67
|
+
export const sharing_response_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
68
|
+
export const sharing_response_process: (a: number, b: any) => [number, number];
|
|
69
|
+
export const sharing_response_produce: (a: bigint, b: any, c: number, d: number) => [number, number, number];
|
|
46
70
|
export const unpairing_response_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
47
71
|
export const unpairing_response_process: (a: any) => [number, number, number];
|
|
48
72
|
export const unpairing_response_produce: (a: bigint, b: number, c: number) => [number, number, number];
|
|
49
|
-
export const sharing_request_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
50
|
-
export const sharing_request_produce: (a: bigint, b: number, c: bigint, d: any, e: any, f: number, g: number, h: number, i: number, j: any) => [number, number, number];
|
|
51
|
-
export const sharing_request_split: (a: any, b: bigint, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
52
|
-
export const discovery_request_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
53
|
-
export const discovery_request_produce: (a: bigint, b: number, c: number, d: any) => [number, number, number];
|
|
54
|
-
export const discovery_response_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
55
|
-
export const discovery_response_process: (a: any) => [number, number, number];
|
|
56
|
-
export const discovery_response_produce: (a: bigint, b: any, c: number, d: number) => [number, number, number];
|
|
57
|
-
export const envelope_apply_trace_id: (a: number, b: number, c: bigint) => [number, number, number, number];
|
|
58
|
-
export const envelope_read_trace_id: (a: number, b: number) => [bigint, number, number];
|
|
59
73
|
export const pairing_contact_message_validate: (a: any) => [number, number];
|
|
60
74
|
export const pairing_request_create_contact: (a: bigint, b: number, c: any, d: any) => [number, number, number];
|
|
61
75
|
export const pairing_request_decode_contact: (a: number, b: number) => [number, number, number];
|
|
@@ -64,21 +78,10 @@ export const pairing_request_extract: (a: number, b: number, c: number, d: numbe
|
|
|
64
78
|
export const pairing_request_extract_pre_pair: (a: number, b: number) => [number, number, number];
|
|
65
79
|
export const pairing_request_produce: (a: number, b: any, c: any, d: any, e: any) => [number, number, number];
|
|
66
80
|
export const pairing_request_produce_pre_pair: (a: any, b: any) => [number, number, number];
|
|
67
|
-
export const
|
|
68
|
-
export const
|
|
69
|
-
export const
|
|
70
|
-
export const pairing_response_process_pre_pair: (a: any, b: any) => [number, number, number];
|
|
71
|
-
export const pairing_response_produce: (a: bigint, b: any, c: number, d: number, e: any, f: any) => [number, number, number];
|
|
72
|
-
export const pairing_response_produce_pre_pair: (a: bigint, b: any, c: number, d: number) => [number, number, number];
|
|
73
|
-
export const sharing_response_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
74
|
-
export const sharing_response_process: (a: number, b: any) => [number, number];
|
|
75
|
-
export const sharing_response_produce: (a: bigint, b: any, c: number, d: number) => [number, number, number];
|
|
76
|
-
export const verification_response_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
77
|
-
export const verification_response_process: (a: any, b: any, c: number, d: number) => [number, number, number];
|
|
78
|
-
export const verification_response_produce: (a: bigint, b: any, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
81
|
+
export const sharing_request_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
82
|
+
export const sharing_request_produce: (a: bigint, b: number, c: bigint, d: any, e: any, f: number, g: number, h: number, i: number, j: any) => [number, number, number];
|
|
83
|
+
export const sharing_request_split: (a: any, b: bigint, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
79
84
|
export const wasm_start: () => void;
|
|
80
|
-
export const recovery_request_extract: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
81
|
-
export const recovery_request_produce: (a: bigint, b: bigint, c: number, d: number, e: number, f: any) => [number, number, number];
|
|
82
85
|
export const wasm_bindgen__convert__closures_____invoke__h379e0770a020d351: (a: number, b: number, c: any) => [number, number];
|
|
83
86
|
export const wasm_bindgen__convert__closures_____invoke__h037700d3f721a480: (a: number, b: number, c: any, d: any) => void;
|
|
84
87
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|