@wireapp/core 22.0.0 → 22.1.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/CHANGELOG.md CHANGED
@@ -3,6 +3,44 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [22.1.3](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@22.1.2...@wireapp/core@22.1.3) (2022-02-17)
7
+
8
+ **Note:** Version bump only for package @wireapp/core
9
+
10
+
11
+
12
+
13
+
14
+ ## [22.1.2](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@22.1.1...@wireapp/core@22.1.2) (2022-02-01)
15
+
16
+ **Note:** Version bump only for package @wireapp/core
17
+
18
+
19
+
20
+
21
+
22
+ ## [22.1.1](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@22.1.0...@wireapp/core@22.1.1) (2022-02-01)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **core:** Do not try to encrypt for clients without prekeys ([#4220](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/issues/4220)) ([1adea26](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/1adea2652de6fd7833a3f1ae99b488f2d25e9817))
28
+
29
+
30
+
31
+
32
+
33
+ # [22.1.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@22.0.0...@wireapp/core@22.1.0) (2022-02-01)
34
+
35
+
36
+ ### Features
37
+
38
+ * **core:** Enable mismatch hook into broadcast messages ([#4219](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/issues/4219)) ([55d8aad](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/55d8aad4519d708af7ed67a6a591d3f6ccd7f55a))
39
+
40
+
41
+
42
+
43
+
6
44
  # [22.0.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@21.0.2...@wireapp/core@22.0.0) (2022-01-31)
7
45
 
8
46
 
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "dependencies": {
6
6
  "@types/long": "4.0.1",
7
7
  "@types/node": "~14",
8
- "@wireapp/api-client": "16.6.0",
8
+ "@wireapp/api-client": "16.8.0",
9
9
  "@wireapp/cryptobox": "12.7.1",
10
10
  "bazinga64": "5.10.0",
11
11
  "hash.js": "1.1.7",
@@ -20,14 +20,14 @@
20
20
  "@types/jasmine": "3.8.2",
21
21
  "@types/karma": "6.3.1",
22
22
  "@wireapp/commons": "4.2.13",
23
- "@wireapp/store-engine-dexie": "1.6.7",
23
+ "@wireapp/store-engine-dexie": "1.6.8",
24
24
  "commander": "8.0.0",
25
25
  "cross-env": "7.0.3",
26
26
  "dotenv-defaults": "2.0.2",
27
27
  "faker": "5.5.3",
28
28
  "istanbul": "1.1.0-alpha.1",
29
29
  "jasmine": "3.8.0",
30
- "karma": "6.3.4",
30
+ "karma": "6.3.14",
31
31
  "karma-chrome-launcher": "3.1.0",
32
32
  "karma-jasmine": "4.0.1",
33
33
  "karma-jasmine-diff-reporter": "2.0.1",
@@ -69,6 +69,6 @@
69
69
  "test:project": "yarn dist && yarn test",
70
70
  "test:node": "nyc jasmine --config=jasmine.json"
71
71
  },
72
- "version": "22.0.0",
73
- "gitHead": "6f85fe1a8bc2dfe0ef0db6dfe094916aa00dc1f7"
72
+ "version": "22.1.3",
73
+ "gitHead": "778751890ab31d8f9d2cfba66d7ef272546579fc"
74
74
  }
@@ -16,5 +16,5 @@ export declare class BroadcastService {
16
16
  * @param onlyDirectConnections=false Will generate a bundle only for directly connected users (users the self user has conversation with). Allows avoiding broadcasting messages to too many people
17
17
  */
18
18
  getPreKeyBundlesFromTeam(teamId: string, skipOwnClients?: boolean, onlyDirectConnections?: boolean): Promise<UserPreKeyBundleMap>;
19
- broadcastGenericMessage(genericMessage: GenericMessage, recipients: UserPreKeyBundleMap | UserClients, sendAsProtobuf?: boolean): Promise<ClientMismatch>;
19
+ broadcastGenericMessage(genericMessage: GenericMessage, recipients: UserPreKeyBundleMap | UserClients, sendAsProtobuf?: boolean, onClientMismatch?: (mismatch: ClientMismatch) => void | boolean | Promise<boolean>): Promise<ClientMismatch>;
20
20
  }
@@ -54,11 +54,12 @@ class BroadcastService {
54
54
  return bundleMap;
55
55
  }, {});
56
56
  }
57
- async broadcastGenericMessage(genericMessage, recipients, sendAsProtobuf) {
57
+ async broadcastGenericMessage(genericMessage, recipients, sendAsProtobuf, onClientMismatch) {
58
58
  const plainTextArray = protocol_messaging_1.GenericMessage.encode(genericMessage).finish();
59
59
  return this.messageService.sendMessage(this.apiClient.validatedClientId, recipients, plainTextArray, {
60
60
  sendAsProtobuf,
61
61
  reportMissing: Object.keys(recipients),
62
+ onClientMismatch,
62
63
  });
63
64
  }
64
65
  }
@@ -94,12 +94,17 @@ class CryptographyService {
94
94
  };
95
95
  }
96
96
  async encrypt(plainText, users, domain) {
97
+ var _a;
97
98
  const encrypted = {};
98
99
  const missing = {};
99
100
  for (const userId in users) {
100
- const clientIds = (0, util_1.isUserClients)(users) ? users[userId] : Object.keys(users[userId]);
101
+ const clientIds = (0, util_1.isUserClients)(users)
102
+ ? users[userId]
103
+ : Object.keys(users[userId])
104
+ // We filter out clients that have `null` prekey
105
+ .filter(clientId => !!users[userId][clientId]);
101
106
  for (const clientId of clientIds) {
102
- const base64PreKey = (0, util_1.isUserClients)(users) ? undefined : users[userId][clientId].key;
107
+ const base64PreKey = (0, util_1.isUserClients)(users) ? undefined : (_a = users[userId][clientId]) === null || _a === void 0 ? void 0 : _a.key;
103
108
  const sessionId = CryptographyService.constructSessionId(userId, clientId, domain || null);
104
109
  const result = await this.encryptPayloadForSession(sessionId, plainText, base64PreKey);
105
110
  if (result) {