@freesignal/protocol 0.5.1 → 0.5.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/dist/node.d.ts +1 -0
- package/dist/node.js +4 -1
- package/dist/types.d.ts +3 -3
- package/dist/types.js +4 -2
- package/package.json +1 -1
package/dist/node.d.ts
CHANGED
package/dist/node.js
CHANGED
|
@@ -241,7 +241,7 @@ class FreeSignalNode {
|
|
|
241
241
|
if (bootstrap)
|
|
242
242
|
out.datagram = yield this.packHandshake(bootstrap);
|
|
243
243
|
return out;
|
|
244
|
-
case types_1.Protocols.
|
|
244
|
+
case types_1.Protocols.PING:
|
|
245
245
|
return out;
|
|
246
246
|
default:
|
|
247
247
|
throw new Error("Invalid protocol");
|
|
@@ -286,4 +286,7 @@ class SessionMap {
|
|
|
286
286
|
this.cache.clear();
|
|
287
287
|
return this.storage.clear();
|
|
288
288
|
}
|
|
289
|
+
entries() {
|
|
290
|
+
throw new Error("Method not implemented.");
|
|
291
|
+
}
|
|
289
292
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* You should have received a copy of the GNU General Public License
|
|
17
17
|
* along with this program. If not, see <https://www.gnu.org/licenses/>
|
|
18
18
|
*/
|
|
19
|
-
import { LocalStorage, Encodable, KeyExchangeData } from "@freesignal/interfaces";
|
|
19
|
+
import type { LocalStorage, Encodable, KeyExchangeData } from "@freesignal/interfaces";
|
|
20
20
|
import { EncryptionKeys, KeySession } from "./double-ratchet";
|
|
21
21
|
export declare function encryptData(session: KeySession, data: Uint8Array): EncryptedData;
|
|
22
22
|
export declare function decryptData(session: KeySession, encryptedData: Uint8Array): Uint8Array;
|
|
@@ -64,7 +64,7 @@ export interface DiscoverMessage {
|
|
|
64
64
|
data?: KeyExchangeData;
|
|
65
65
|
}
|
|
66
66
|
export declare enum Protocols {
|
|
67
|
-
|
|
67
|
+
PING = "/freesignal/ping",
|
|
68
68
|
MESSAGE = "/freesignal/message",
|
|
69
69
|
RELAY = "/freesignal/relay",
|
|
70
70
|
HANDSHAKE = "/freesignal/handshake",
|
|
@@ -174,6 +174,6 @@ export declare class AsyncMap<K, V> implements LocalStorage<K, V> {
|
|
|
174
174
|
has(key: K): Promise<boolean>;
|
|
175
175
|
delete(key: K): Promise<boolean>;
|
|
176
176
|
clear(): Promise<void>;
|
|
177
|
-
entries():
|
|
177
|
+
entries(): Promise<Iterator<[K, V]>>;
|
|
178
178
|
}
|
|
179
179
|
export {};
|
package/dist/types.js
CHANGED
|
@@ -210,7 +210,7 @@ var DiscoverType;
|
|
|
210
210
|
})(DiscoverType || (exports.DiscoverType = DiscoverType = {}));
|
|
211
211
|
var Protocols;
|
|
212
212
|
(function (Protocols) {
|
|
213
|
-
Protocols["
|
|
213
|
+
Protocols["PING"] = "/freesignal/ping";
|
|
214
214
|
Protocols["MESSAGE"] = "/freesignal/message";
|
|
215
215
|
Protocols["RELAY"] = "/freesignal/relay";
|
|
216
216
|
Protocols["HANDSHAKE"] = "/freesignal/handshake";
|
|
@@ -456,7 +456,9 @@ class AsyncMap {
|
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
458
|
entries() {
|
|
459
|
-
return
|
|
459
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
460
|
+
return this.map.entries();
|
|
461
|
+
});
|
|
460
462
|
}
|
|
461
463
|
}
|
|
462
464
|
exports.AsyncMap = AsyncMap;
|