@freesignal/protocol 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.d.ts CHANGED
@@ -81,6 +81,7 @@ export declare class FreeSignalNode {
81
81
  protected encrypt(receiverId: string | UserId, protocol: Protocols, data: Uint8Array): Promise<SendEventData>;
82
82
  sendHandshake(data: KeyExchangeData): Promise<void>;
83
83
  sendHandshake(session: KeySession): Promise<void>;
84
+ sendHandshake(userId: UserId | string): Promise<void>;
84
85
  sendData<T>(receiverId: string | UserId, data: T): Promise<void>;
85
86
  sendRelay(relayId: string | UserId, receiverId: string | UserId, data: Datagram): Promise<void>;
86
87
  sendPing(receiverId: string | UserId): Promise<void>;
package/dist/node.js CHANGED
@@ -126,6 +126,12 @@ export class FreeSignalNode {
126
126
  }
127
127
  sendHandshake(data) {
128
128
  return __awaiter(this, void 0, void 0, function* () {
129
+ if (data instanceof UserId || typeof data === 'string') {
130
+ const session = yield this.sessions.get(data.toString());
131
+ if (!session)
132
+ throw new Error("Session not found for userId: " + data.toString());
133
+ data = session;
134
+ }
129
135
  if (data instanceof KeySession) {
130
136
  //console.debug("Sending Handshake Ack");
131
137
  const session = yield this.sessions.get(data.sessionTag);
package/package.json CHANGED
@@ -1,45 +1,45 @@
1
- {
2
- "name": "@freesignal/protocol",
3
- "version": "0.8.0",
4
- "description": "Signal Protocol implementation in javascript",
5
- "license": "GPL-3.0-or-later",
6
- "author": "Christian Braghette",
7
- "type": "module",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/index.js",
11
- "require": "./dist/index.js",
12
- "types": "./dist/index.d.ts"
13
- },
14
- "./double-ratchet": {
15
- "import": "./dist/double-ratchet.js",
16
- "require": "./dist/double-ratchet.js",
17
- "types": "./dist/double-ratchet.d.ts"
18
- },
19
- "./node": {
20
- "import": "./dist/node.js",
21
- "require": "./dist/node.js",
22
- "types": "./dist/node.d.ts"
23
- },
24
- "./x3dh": {
25
- "import": "./dist/x3dh.js",
26
- "require": "./dist/x3dh.js",
27
- "types": "./dist/x3dh.d.ts"
28
- }
29
- },
30
- "main": "./dist/index.js",
31
- "scripts": {
32
- "pretest": "tsc",
33
- "test": "node ./dist/test.js",
34
- "prepare": "tsc"
35
- },
36
- "dependencies": {
37
- "@freesignal/crypto": "^0.4.2",
38
- "@freesignal/interfaces": "^0.3.0",
39
- "@freesignal/utils": "^1.5.1",
40
- "easyemitter.ts": "^1.1.0"
41
- },
42
- "devDependencies": {
43
- "@types/node": "^24.2.1"
44
- }
45
- }
1
+ {
2
+ "name": "@freesignal/protocol",
3
+ "version": "0.8.1",
4
+ "description": "Signal Protocol implementation in javascript",
5
+ "license": "GPL-3.0-or-later",
6
+ "author": "Christian Braghette",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./double-ratchet": {
15
+ "import": "./dist/double-ratchet.js",
16
+ "require": "./dist/double-ratchet.js",
17
+ "types": "./dist/double-ratchet.d.ts"
18
+ },
19
+ "./node": {
20
+ "import": "./dist/node.js",
21
+ "require": "./dist/node.js",
22
+ "types": "./dist/node.d.ts"
23
+ },
24
+ "./x3dh": {
25
+ "import": "./dist/x3dh.js",
26
+ "require": "./dist/x3dh.js",
27
+ "types": "./dist/x3dh.d.ts"
28
+ }
29
+ },
30
+ "main": "./dist/index.js",
31
+ "scripts": {
32
+ "pretest": "tsc",
33
+ "test": "node ./dist/test.js",
34
+ "prepare": "tsc"
35
+ },
36
+ "dependencies": {
37
+ "@freesignal/crypto": "^0.4.2",
38
+ "@freesignal/interfaces": "^0.3.0",
39
+ "@freesignal/utils": "^1.5.1",
40
+ "easyemitter.ts": "^1.1.0"
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^24.2.1"
44
+ }
45
+ }