@freesignal/protocol 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node.d.ts +2 -1
- package/dist/node.js +4 -1
- package/package.json +1 -1
package/dist/node.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* along with this program. If not, see <https://www.gnu.org/licenses/>
|
|
18
18
|
*/
|
|
19
19
|
import { Database, LocalStorage, Crypto, KeyExchangeDataBundle, KeyExchangeData } from "@freesignal/interfaces";
|
|
20
|
-
import { Datagram, DatagramHeader, IdentityKey, PrivateIdentityKey, Protocols, UserId } from "./types";
|
|
20
|
+
import { Datagram, DatagramHeader, DiscoverType, IdentityKey, PrivateIdentityKey, Protocols, UserId } from "./types";
|
|
21
21
|
import { KeyExchange } from "./x3dh";
|
|
22
22
|
import { ExportedKeySession, KeySession } from "./double-ratchet";
|
|
23
23
|
export declare class BootstrapRequest {
|
|
@@ -65,6 +65,7 @@ export declare class FreeSignalNode {
|
|
|
65
65
|
open(datagram: Datagram | Uint8Array): Promise<{
|
|
66
66
|
header: DatagramHeader;
|
|
67
67
|
payload?: Uint8Array;
|
|
68
|
+
discoverType?: DiscoverType;
|
|
68
69
|
}>;
|
|
69
70
|
}
|
|
70
71
|
declare class SessionMap implements LocalStorage<string, KeySession> {
|
package/dist/node.js
CHANGED
|
@@ -219,11 +219,14 @@ class FreeSignalNode {
|
|
|
219
219
|
}
|
|
220
220
|
const response = { type: types_1.DiscoverType.RESPONSE, discoverId: message.discoverId, data };
|
|
221
221
|
out.payload = (yield this.encrypt(datagram.sender, types_1.Protocols.DISCOVER, (0, utils_1.encodeData)(response))).toBytes();
|
|
222
|
+
out.discoverType = types_1.DiscoverType.REQUEST;
|
|
222
223
|
}
|
|
223
224
|
else if (message.type === types_1.DiscoverType.RESPONSE && this.discovers.has(message.discoverId)) {
|
|
224
225
|
this.discovers.delete(message.discoverId);
|
|
225
|
-
if (message.data)
|
|
226
|
+
if (message.data) {
|
|
226
227
|
out.payload = (0, utils_1.encodeData)(message.data);
|
|
228
|
+
out.discoverType = types_1.DiscoverType.RESPONSE;
|
|
229
|
+
}
|
|
227
230
|
}
|
|
228
231
|
return out;
|
|
229
232
|
case types_1.Protocols.BOOTSTRAP:
|