@wireapp/core 46.44.0 → 46.45.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/lib/Account.d.ts +1 -1
- package/lib/Account.d.ts.map +1 -1
- package/lib/Account.js +1 -1
- package/lib/Account.test.js +10 -0
- package/lib/conversation/AssetService/AssetService.d.ts +3 -3
- package/lib/conversation/AssetService/AssetService.test.js +8 -3
- package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.js +2 -1
- package/lib/conversation/ConversationService/ConversationService.test.js +39 -32
- package/lib/conversation/ConversationService/ConversationService.types.d.ts +4 -3
- package/lib/conversation/ConversationService/ConversationService.types.d.ts.map +1 -1
- package/lib/conversation/SubconversationService/SubconversationService.test.js +5 -0
- package/lib/conversation/message/MessageService.test.js +6 -0
- package/lib/cryptography/AssetCryptography/EncryptedAsset.d.ts +2 -2
- package/lib/cryptography/AssetCryptography/EncryptedAsset.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.test.js +5 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.d.ts +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.js +8 -1
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.test.js +11 -7
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts +3 -2
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/WithMockedGenerics.test.js +8 -4
- package/lib/messagingProtocols/proteus/Utility/SessionHandler/SessionHandler.test.js +1 -0
- package/lib/notification/NotificationService.test.js +8 -0
- package/lib/self/SelfService.d.ts +2 -2
- package/lib/self/SelfService.d.ts.map +1 -1
- package/lib/self/SelfService.test.js +5 -2
- package/lib/user/UserService.d.ts +2 -2
- package/lib/user/UserService.d.ts.map +1 -1
- package/lib/user/UserService.js +3 -3
- package/lib/util/TypePredicateUtil.d.ts.map +1 -1
- package/lib/util/TypePredicateUtil.js +2 -2
- package/package.json +3 -3
package/lib/Account.d.ts
CHANGED
|
@@ -335,7 +335,7 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
335
335
|
private readonly initEngine;
|
|
336
336
|
private readonly groupIdFromConversationId;
|
|
337
337
|
isMLSActiveForClient: () => Promise<boolean>;
|
|
338
|
-
private isMLSConversationRecoveryEnabled;
|
|
338
|
+
private readonly isMLSConversationRecoveryEnabled;
|
|
339
339
|
}
|
|
340
340
|
export {};
|
|
341
341
|
//# sourceMappingURL=Account.d.ts.map
|
package/lib/Account.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../src/Account.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EAGZ,OAAO,EACP,MAAM,EAEN,SAAS,EAEV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAC,gBAAgB,EAAwB,UAAU,EAAE,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAErH,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AAExD,OAAO,EAAC,YAAY,EAAC,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAEL,sBAAsB,EAGvB,MAAM,6DAA6D,CAAC;AAQrE,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAa,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAC,UAAU,EAAe,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,WAAW,CAAC;AACpD,OAAO,EAAC,iBA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QAAQ,CAAC,sCAAsC,CAErD;IAEF,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAyBhD;IAEF,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAwBzC;IAEK,wBAAwB,iBAAkB,MAAM,CAAC,YAAY,mBAMlE;IAEF;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,CAAC,sCAAsC,CAYrD;IAEF;;;;;;;;;;OAUG;IACH,OAAO,CAAC,QAAQ,CAAC,uCAAuC,CA0CtD;IAEF;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAI7C;IAEF,SAAgB,sBAAsB,aAGpC;IAEF,SAAgB,uBAAuB,aAGrC;IAEF;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAsCtC;IAEF;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAgBxC;IAEK,qBAAqB,2BAE1B;IAEF,OAAc,iBAAiB,iBACf,YAAY,GAAG,sBAAsB,KAClD,YAAY,IAAI,sBAAsB,CAEvC;IAEF,OAAc,yBAAyB,iBACvB,YAAY,GAAG,sBAAsB,KAClD,YAAY,IAAI,YAAY,CAE7B;IAEF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAG7B;IAEF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAEjC;IAEF,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAEtC;IAEF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAqBzB;IAEF,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CASxC;IAEK,oBAAoB,QAAa,OAAO,CAAC,OAAO,CAAC,CAetD;IAEF,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAG/C;CACH"}
|
package/lib/Account.js
CHANGED
|
@@ -897,7 +897,7 @@ class Account extends commons_1.TypedEventEmitter {
|
|
|
897
897
|
}
|
|
898
898
|
// Check if MLS is enabled for the public via backend feature flag
|
|
899
899
|
const commonConfig = (await this.service?.team.getCommonFeatureConfig()) ?? {};
|
|
900
|
-
return commonConfig[team_1.FEATURE_KEY.MLS]?.status === team_1.
|
|
900
|
+
return commonConfig[team_1.FEATURE_KEY.MLS]?.status === team_1.FEATURE_STATUS.ENABLED;
|
|
901
901
|
};
|
|
902
902
|
isMLSConversationRecoveryEnabled = async () => {
|
|
903
903
|
const commonConfig = (await this.service?.team.getCommonFeatureConfig()) ?? {};
|
package/lib/Account.test.js
CHANGED
|
@@ -65,8 +65,10 @@ const MOCK_BACKEND = {
|
|
|
65
65
|
rest: `https://${BASE_URL}`,
|
|
66
66
|
ws: `wss://${BASE_URL}`,
|
|
67
67
|
};
|
|
68
|
+
const apiClients = [];
|
|
68
69
|
async function createAccount() {
|
|
69
70
|
const apiClient = new api_client_1.APIClient({ urls: MOCK_BACKEND });
|
|
71
|
+
apiClients.push(apiClient);
|
|
70
72
|
const account = new Account_1.Account(apiClient);
|
|
71
73
|
await account['initServices']({
|
|
72
74
|
clientType: client_1.ClientType.TEMPORARY,
|
|
@@ -97,6 +99,9 @@ const waitFor = (assertion) => {
|
|
|
97
99
|
/* eslint-disable jest/no-conditional-expect */
|
|
98
100
|
describe('Account', () => {
|
|
99
101
|
const CLIENT_ID = '4e37b32f57f6da55';
|
|
102
|
+
afterAll(() => {
|
|
103
|
+
apiClients.forEach(client => client.disconnect());
|
|
104
|
+
});
|
|
100
105
|
// Fix for node 16, crypto.subtle.decrypt has a type problem
|
|
101
106
|
jest.spyOn(global.crypto.subtle, 'decrypt').mockResolvedValue(new Uint8Array(32));
|
|
102
107
|
const accessTokenData = {
|
|
@@ -194,6 +199,9 @@ describe('Account', () => {
|
|
|
194
199
|
describe('"init"', () => {
|
|
195
200
|
it('initializes the Protocol buffers', async () => {
|
|
196
201
|
const account = new Account_1.Account();
|
|
202
|
+
if (account['apiClient']) {
|
|
203
|
+
apiClients.push(account['apiClient']);
|
|
204
|
+
}
|
|
197
205
|
await account['initServices']({ clientType: client_1.ClientType.TEMPORARY, userId: '' });
|
|
198
206
|
expect(account.service.conversation).toBeDefined();
|
|
199
207
|
const message = protocol_messaging_1.GenericMessage.create({
|
|
@@ -206,6 +214,7 @@ describe('Account', () => {
|
|
|
206
214
|
describe('"login"', () => {
|
|
207
215
|
it('logs in with correct credentials', async () => {
|
|
208
216
|
const apiClient = new api_client_1.APIClient({ urls: MOCK_BACKEND });
|
|
217
|
+
apiClients.push(apiClient);
|
|
209
218
|
const account = new Account_1.Account(apiClient);
|
|
210
219
|
await account['initServices']({ clientType: client_1.ClientType.TEMPORARY, userId: '' });
|
|
211
220
|
const { clientType, userId } = await account.login({
|
|
@@ -218,6 +227,7 @@ describe('Account', () => {
|
|
|
218
227
|
});
|
|
219
228
|
it('does not log in with incorrect credentials', async () => {
|
|
220
229
|
const apiClient = new api_client_1.APIClient({ urls: MOCK_BACKEND });
|
|
230
|
+
apiClients.push(apiClient);
|
|
221
231
|
const account = new Account_1.Account(apiClient);
|
|
222
232
|
let backendError;
|
|
223
233
|
await account['initServices']({ clientType: client_1.ClientType.TEMPORARY, userId: '' });
|
|
@@ -31,9 +31,9 @@ export declare class AssetService {
|
|
|
31
31
|
*/
|
|
32
32
|
uploadRawAsset(asset: Buffer | Uint8Array, options?: AssetOptions, progressCallback?: ProgressCallback): RequestCancelable<{
|
|
33
33
|
key: string;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
domain: string;
|
|
35
|
+
token?: string | undefined;
|
|
36
|
+
expires?: string | undefined;
|
|
37
37
|
}>;
|
|
38
38
|
/**
|
|
39
39
|
* Will encrypt and upload an asset to the backend
|
|
@@ -23,10 +23,15 @@ const api_client_1 = require("@wireapp/api-client");
|
|
|
23
23
|
const AssetService_1 = require("./AssetService");
|
|
24
24
|
describe('AssetService', () => {
|
|
25
25
|
describe('"uploadAsset"', () => {
|
|
26
|
+
let apiClient;
|
|
27
|
+
afterEach(() => {
|
|
28
|
+
apiClient?.disconnect();
|
|
29
|
+
});
|
|
26
30
|
it('builds an encrypted asset payload', async () => {
|
|
27
|
-
|
|
31
|
+
apiClient = new api_client_1.APIClient();
|
|
28
32
|
const assetService = new AssetService_1.AssetService(apiClient);
|
|
29
33
|
const assetServerData = {
|
|
34
|
+
domain: 'asset-server.test.wire.com',
|
|
30
35
|
key: `3-2-${(0, uuid_1.v4)()}`,
|
|
31
36
|
token: (0, uuid_1.v4)(),
|
|
32
37
|
expires: '',
|
|
@@ -44,7 +49,7 @@ describe('AssetService', () => {
|
|
|
44
49
|
}));
|
|
45
50
|
});
|
|
46
51
|
it('allows cancelling asset upload', async () => {
|
|
47
|
-
|
|
52
|
+
apiClient = new api_client_1.APIClient();
|
|
48
53
|
const assetService = new AssetService_1.AssetService(apiClient);
|
|
49
54
|
const apiUpload = {
|
|
50
55
|
cancel: jest.fn(),
|
|
@@ -56,7 +61,7 @@ describe('AssetService', () => {
|
|
|
56
61
|
expect(apiUpload.cancel).toHaveBeenCalled();
|
|
57
62
|
});
|
|
58
63
|
it('exposes upload progress', async () => {
|
|
59
|
-
|
|
64
|
+
apiClient = new api_client_1.APIClient();
|
|
60
65
|
const assetService = new AssetService_1.AssetService(apiClient);
|
|
61
66
|
const apiUpload = {
|
|
62
67
|
cancel: jest.fn(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAKnB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,YAAY,EAIZ,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B,gCAAgC;YA0BhC,4BAA4B;IA2B1C,OAAO,CAAC,2BAA2B;IAmBnC;;;OAGG;YACW,uCAAuC;YA4BvC,wBAAwB;YAIxB,yBAAyB;IAKvC;;;;OAIG;IACU,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAoB3E"}
|
|
@@ -22,6 +22,7 @@ exports.ConversationService = void 0;
|
|
|
22
22
|
const conversation_1 = require("@wireapp/api-client/lib/conversation");
|
|
23
23
|
const data_1 = require("@wireapp/api-client/lib/conversation/data");
|
|
24
24
|
const event_1 = require("@wireapp/api-client/lib/event");
|
|
25
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
25
26
|
const bazinga64_1 = require("bazinga64");
|
|
26
27
|
const commons_1 = require("@wireapp/commons");
|
|
27
28
|
const core_crypto_1 = require("@wireapp/core-crypto");
|
|
@@ -131,7 +132,7 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
131
132
|
*/
|
|
132
133
|
async send(params) {
|
|
133
134
|
function isMLS(params) {
|
|
134
|
-
return params.protocol ===
|
|
135
|
+
return params.protocol === team_1.CONVERSATION_PROTOCOL.MLS;
|
|
135
136
|
}
|
|
136
137
|
return (0, messageSender_1.sendMessage)(() => (isMLS(params) ? this.sendMLSMessage(params) : this.proteusService.sendMessage(params)));
|
|
137
138
|
}
|
|
@@ -45,6 +45,7 @@ const client_1 = require("@wireapp/api-client/lib/client");
|
|
|
45
45
|
const conversation_1 = require("@wireapp/api-client/lib/conversation");
|
|
46
46
|
const event_1 = require("@wireapp/api-client/lib/event");
|
|
47
47
|
const http_1 = require("@wireapp/api-client/lib/http");
|
|
48
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
48
49
|
const http_status_codes_1 = require("http-status-codes");
|
|
49
50
|
const api_client_1 = require("@wireapp/api-client");
|
|
50
51
|
const core_crypto_1 = require("@wireapp/core-crypto");
|
|
@@ -88,9 +89,14 @@ const mockedProteusService = {
|
|
|
88
89
|
encryptGenericMessage: () => Promise.resolve(),
|
|
89
90
|
sendProteusMessage: () => Promise.resolve({ sentAt: new Date() }),
|
|
90
91
|
};
|
|
92
|
+
const apiClients = [];
|
|
91
93
|
describe('ConversationService', () => {
|
|
94
|
+
afterAll(() => {
|
|
95
|
+
apiClients.forEach(client => client.disconnect());
|
|
96
|
+
});
|
|
92
97
|
async function buildConversationService() {
|
|
93
98
|
const client = new api_client_1.APIClient({ urls: api_client_1.APIClient.BACKEND.STAGING });
|
|
99
|
+
apiClients.push(client);
|
|
94
100
|
jest.spyOn(client.api.conversation, 'postMlsMessage').mockReturnValue(Promise.resolve({
|
|
95
101
|
events: [],
|
|
96
102
|
time: new Date().toISOString(),
|
|
@@ -108,7 +114,7 @@ describe('ConversationService', () => {
|
|
|
108
114
|
}));
|
|
109
115
|
jest
|
|
110
116
|
.spyOn(client.api.user, 'getUserSupportedProtocols')
|
|
111
|
-
.mockReturnValue(Promise.resolve([
|
|
117
|
+
.mockReturnValue(Promise.resolve([team_1.CONVERSATION_PROTOCOL.MLS, team_1.CONVERSATION_PROTOCOL.PROTEUS]));
|
|
112
118
|
client.context = {
|
|
113
119
|
clientType: client_1.ClientType.NONE,
|
|
114
120
|
userId: PayloadHelper.getUUID(),
|
|
@@ -162,7 +168,7 @@ describe('ConversationService', () => {
|
|
|
162
168
|
const sentTime = new Date().toISOString();
|
|
163
169
|
mockedProteusService.sendMessage = jest.fn().mockResolvedValue({ sentAt: sentTime });
|
|
164
170
|
const promise = conversationService.send({
|
|
165
|
-
protocol:
|
|
171
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
166
172
|
conversationId: { id: 'conv1', domain: '' },
|
|
167
173
|
payload: message,
|
|
168
174
|
});
|
|
@@ -200,7 +206,7 @@ describe('ConversationService', () => {
|
|
|
200
206
|
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
201
207
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValue({
|
|
202
208
|
qualified_id: mockConversationId,
|
|
203
|
-
protocol:
|
|
209
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
204
210
|
epoch: remoteEpoch,
|
|
205
211
|
group_id: mockGroupId,
|
|
206
212
|
});
|
|
@@ -237,7 +243,7 @@ describe('ConversationService', () => {
|
|
|
237
243
|
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
238
244
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
239
245
|
qualified_id: conversationId,
|
|
240
|
-
protocol:
|
|
246
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
241
247
|
epoch: remoteEpoch,
|
|
242
248
|
group_id: 'gid-join-stale',
|
|
243
249
|
});
|
|
@@ -260,7 +266,7 @@ describe('ConversationService', () => {
|
|
|
260
266
|
it(`calls callbacks when sending '${type}' message is starting and successful`, async () => {
|
|
261
267
|
const [conversationService] = await buildConversationService();
|
|
262
268
|
const promise = conversationService.send({
|
|
263
|
-
protocol:
|
|
269
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
264
270
|
groupId,
|
|
265
271
|
payload: message,
|
|
266
272
|
conversationId: { id: '', domain: '' },
|
|
@@ -286,12 +292,12 @@ describe('ConversationService', () => {
|
|
|
286
292
|
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
287
293
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
288
294
|
qualified_id: mockConversationId,
|
|
289
|
-
protocol:
|
|
295
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
290
296
|
epoch: remoteEpoch,
|
|
291
297
|
group_id: mockGroupId,
|
|
292
298
|
});
|
|
293
299
|
await conversationService.send({
|
|
294
|
-
protocol:
|
|
300
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
295
301
|
groupId: mockGroupId,
|
|
296
302
|
payload: mockedMessage,
|
|
297
303
|
conversationId: mockConversationId,
|
|
@@ -319,12 +325,12 @@ describe('ConversationService', () => {
|
|
|
319
325
|
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
320
326
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
321
327
|
qualified_id: mockConversationId,
|
|
322
|
-
protocol:
|
|
328
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
323
329
|
epoch: remoteEpoch,
|
|
324
330
|
group_id: mockGroupId,
|
|
325
331
|
});
|
|
326
332
|
await conversationService.send({
|
|
327
|
-
protocol:
|
|
333
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
328
334
|
groupId: mockGroupId,
|
|
329
335
|
payload: mockedMessage,
|
|
330
336
|
conversationId: mockConversationId,
|
|
@@ -351,7 +357,7 @@ describe('ConversationService', () => {
|
|
|
351
357
|
.spyOn(conversationService, 'addUsersToMLSConversation')
|
|
352
358
|
.mockResolvedValueOnce({ conversation: { members: { others: [] } } });
|
|
353
359
|
await conversationService.send({
|
|
354
|
-
protocol:
|
|
360
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
355
361
|
groupId: mockGroupId,
|
|
356
362
|
payload: mockedMessage,
|
|
357
363
|
conversationId: mockConversationId,
|
|
@@ -372,7 +378,7 @@ describe('ConversationService', () => {
|
|
|
372
378
|
return {
|
|
373
379
|
group_id: 'group-id',
|
|
374
380
|
qualified_id: { id: conversationId || 'conversation-id', domain: 'staging.zinfra.io' },
|
|
375
|
-
protocol:
|
|
381
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
376
382
|
epoch,
|
|
377
383
|
};
|
|
378
384
|
};
|
|
@@ -422,7 +428,7 @@ describe('ConversationService', () => {
|
|
|
422
428
|
const remoteEpoch = 1;
|
|
423
429
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
424
430
|
qualified_id: mockConversationId,
|
|
425
|
-
protocol:
|
|
431
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
426
432
|
epoch: remoteEpoch,
|
|
427
433
|
group_id: mockGroupId,
|
|
428
434
|
});
|
|
@@ -441,14 +447,14 @@ describe('ConversationService', () => {
|
|
|
441
447
|
const updatedEpoch = 2;
|
|
442
448
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
443
449
|
qualified_id: mockConversationId,
|
|
444
|
-
protocol:
|
|
450
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
445
451
|
epoch: remoteEpoch,
|
|
446
452
|
group_id: mockGroupId,
|
|
447
453
|
});
|
|
448
454
|
// The 2nd request we make after joining the conversation with external commit
|
|
449
455
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
450
456
|
qualified_id: mockConversationId,
|
|
451
|
-
protocol:
|
|
457
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
452
458
|
epoch: updatedEpoch,
|
|
453
459
|
group_id: mockGroupId,
|
|
454
460
|
});
|
|
@@ -469,14 +475,14 @@ describe('ConversationService', () => {
|
|
|
469
475
|
const updatedEpoch = 1;
|
|
470
476
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
471
477
|
qualified_id: mockConversationId,
|
|
472
|
-
protocol:
|
|
478
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
473
479
|
epoch: remoteEpoch,
|
|
474
480
|
group_id: mockGroupId,
|
|
475
481
|
});
|
|
476
482
|
// The 2nd request we make after successfully registering a group
|
|
477
483
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
478
484
|
qualified_id: mockConversationId,
|
|
479
|
-
protocol:
|
|
485
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
480
486
|
epoch: updatedEpoch,
|
|
481
487
|
group_id: mockGroupId,
|
|
482
488
|
});
|
|
@@ -498,21 +504,21 @@ describe('ConversationService', () => {
|
|
|
498
504
|
const updatedEpoch = 1;
|
|
499
505
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
500
506
|
qualified_id: mockConversationId,
|
|
501
|
-
protocol:
|
|
507
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
502
508
|
epoch: remoteEpoch,
|
|
503
509
|
group_id: mockGroupId,
|
|
504
510
|
});
|
|
505
511
|
// The 2nd request we make when retrying to register the conversation
|
|
506
512
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
507
513
|
qualified_id: mockConversationId,
|
|
508
|
-
protocol:
|
|
514
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
509
515
|
epoch: remoteEpoch,
|
|
510
516
|
group_id: mockGroupId,
|
|
511
517
|
});
|
|
512
518
|
// The 3rd request we make after successfully registering a group
|
|
513
519
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
514
520
|
qualified_id: mockConversationId,
|
|
515
|
-
protocol:
|
|
521
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
516
522
|
epoch: updatedEpoch,
|
|
517
523
|
group_id: mockGroupId,
|
|
518
524
|
});
|
|
@@ -541,7 +547,7 @@ describe('ConversationService', () => {
|
|
|
541
547
|
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
542
548
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
543
549
|
qualified_id: conversationId,
|
|
544
|
-
protocol:
|
|
550
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
545
551
|
epoch: remoteEpoch,
|
|
546
552
|
group_id: mockGroupId,
|
|
547
553
|
});
|
|
@@ -585,7 +591,7 @@ describe('ConversationService', () => {
|
|
|
585
591
|
jest.spyOn(mlsService, 'handleMLSWelcomeMessageEvent').mockRejectedValueOnce(orphanWelcomeMessageError);
|
|
586
592
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
587
593
|
qualified_id: conversationId,
|
|
588
|
-
protocol:
|
|
594
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
589
595
|
});
|
|
590
596
|
await conversationService.handleEvent(mockMLSWelcomeMessageEvent);
|
|
591
597
|
await new Promise(resolve => setImmediate(resolve));
|
|
@@ -661,7 +667,7 @@ describe('ConversationService', () => {
|
|
|
661
667
|
.mockResolvedValueOnce({ keyPackages: [new Uint8Array(0)], failures: [] });
|
|
662
668
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
663
669
|
qualified_id: mockConversationId,
|
|
664
|
-
protocol:
|
|
670
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
665
671
|
epoch: 1,
|
|
666
672
|
group_id: mockGroupId,
|
|
667
673
|
});
|
|
@@ -689,9 +695,9 @@ describe('ConversationService', () => {
|
|
|
689
695
|
};
|
|
690
696
|
jest.spyOn(apiClient.api.user, 'getUserSupportedProtocols').mockImplementation(id => {
|
|
691
697
|
if (id === otherUsersToAdd[2]) {
|
|
692
|
-
return Promise.resolve([
|
|
698
|
+
return Promise.resolve([team_1.CONVERSATION_PROTOCOL.PROTEUS]);
|
|
693
699
|
}
|
|
694
|
-
return Promise.resolve([
|
|
700
|
+
return Promise.resolve([team_1.CONVERSATION_PROTOCOL.MLS, team_1.CONVERSATION_PROTOCOL.PROTEUS]);
|
|
695
701
|
});
|
|
696
702
|
jest.spyOn(mlsService, 'getKeyPackagesPayload').mockResolvedValueOnce({
|
|
697
703
|
keyPackages: [new Uint8Array(0)],
|
|
@@ -699,7 +705,7 @@ describe('ConversationService', () => {
|
|
|
699
705
|
});
|
|
700
706
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
701
707
|
qualified_id: mockConversationId,
|
|
702
|
-
protocol:
|
|
708
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
703
709
|
epoch: 1,
|
|
704
710
|
group_id: mockGroupId,
|
|
705
711
|
});
|
|
@@ -745,7 +751,7 @@ describe('ConversationService', () => {
|
|
|
745
751
|
const getConvSpy = jest.spyOn(apiClient.api.conversation, 'getConversation');
|
|
746
752
|
getConvSpy.mockResolvedValue({
|
|
747
753
|
qualified_id: mockConversationId,
|
|
748
|
-
protocol:
|
|
754
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
749
755
|
epoch: remoteEpoch,
|
|
750
756
|
group_id: mockGroupId,
|
|
751
757
|
});
|
|
@@ -814,7 +820,7 @@ describe('ConversationService', () => {
|
|
|
814
820
|
const groupId = 'group-1';
|
|
815
821
|
const qualified_id = { id: 'conv-1', domain: 'staging.zinfra.io' };
|
|
816
822
|
jest.spyOn(apiClient.api.conversation, 'getConversationList').mockResolvedValueOnce({
|
|
817
|
-
found: [{ group_id: groupId, qualified_id, protocol:
|
|
823
|
+
found: [{ group_id: groupId, qualified_id, protocol: team_1.CONVERSATION_PROTOCOL.MLS, epoch: 1 }],
|
|
818
824
|
});
|
|
819
825
|
const resetSpy = jest
|
|
820
826
|
.spyOn(conversationService, 'handleBrokenMLSConversation')
|
|
@@ -843,7 +849,7 @@ describe('ConversationService', () => {
|
|
|
843
849
|
{ id: 'u2', domain: 'staging.zinfra.io' },
|
|
844
850
|
];
|
|
845
851
|
jest.spyOn(apiClient.api.conversation, 'getConversationList').mockResolvedValueOnce({
|
|
846
|
-
found: [{ group_id: groupId, qualified_id, protocol:
|
|
852
|
+
found: [{ group_id: groupId, qualified_id, protocol: team_1.CONVERSATION_PROTOCOL.MLS, epoch: 1 }],
|
|
847
853
|
});
|
|
848
854
|
const addUsersSpy = jest
|
|
849
855
|
.spyOn(conversationService, 'addUsersToMLSConversation')
|
|
@@ -877,7 +883,7 @@ describe('ConversationService', () => {
|
|
|
877
883
|
const groupId = 'group-dup';
|
|
878
884
|
const qualified_id = { id: 'conv-dup', domain: 'staging.zinfra.io' };
|
|
879
885
|
jest.spyOn(apiClient.api.conversation, 'getConversationList').mockResolvedValue({
|
|
880
|
-
found: [{ group_id: groupId, qualified_id, protocol:
|
|
886
|
+
found: [{ group_id: groupId, qualified_id, protocol: team_1.CONVERSATION_PROTOCOL.MLS, epoch: 1 }],
|
|
881
887
|
});
|
|
882
888
|
// Make the recovery hang until we resolve it, to simulate overlapping calls
|
|
883
889
|
let resolveDeferred;
|
|
@@ -909,7 +915,7 @@ describe('ConversationService', () => {
|
|
|
909
915
|
const groupId = 'group-stale';
|
|
910
916
|
const qualified_id = { id: 'conv-stale', domain: 'staging.zinfra.io' };
|
|
911
917
|
jest.spyOn(apiClient.api.conversation, 'getConversationList').mockResolvedValueOnce({
|
|
912
|
-
found: [{ group_id: groupId, qualified_id, protocol:
|
|
918
|
+
found: [{ group_id: groupId, qualified_id, protocol: team_1.CONVERSATION_PROTOCOL.MLS, epoch: 2 }],
|
|
913
919
|
});
|
|
914
920
|
const handler = getKeyMaterialFailureHandler(mlsService);
|
|
915
921
|
const staleMessageError = {
|
|
@@ -927,7 +933,7 @@ describe('ConversationService', () => {
|
|
|
927
933
|
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
928
934
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
929
935
|
qualified_id,
|
|
930
|
-
protocol:
|
|
936
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
931
937
|
epoch: remoteEpoch,
|
|
932
938
|
group_id: groupId,
|
|
933
939
|
});
|
|
@@ -942,7 +948,7 @@ describe('ConversationService', () => {
|
|
|
942
948
|
return {
|
|
943
949
|
group_id,
|
|
944
950
|
qualified_id: { id, domain: 'staging.zinfra.io' },
|
|
945
|
-
protocol:
|
|
951
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
946
952
|
epoch: 1,
|
|
947
953
|
};
|
|
948
954
|
}
|
|
@@ -998,6 +1004,7 @@ function generateImage() {
|
|
|
998
1004
|
keyBytes: Buffer.from([]),
|
|
999
1005
|
sha256: Buffer.from([]),
|
|
1000
1006
|
token: '',
|
|
1007
|
+
domain: 'example.com',
|
|
1001
1008
|
},
|
|
1002
1009
|
};
|
|
1003
1010
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { QualifiedUserClients,
|
|
1
|
+
import { QualifiedUserClients, MessageSendingStatus, Conversation } from '@wireapp/api-client/lib/conversation';
|
|
2
2
|
import { ConversationEvent, ConversationMemberJoinEvent } from '@wireapp/api-client/lib/event';
|
|
3
|
+
import { CONVERSATION_PROTOCOL } from '@wireapp/api-client/lib/team';
|
|
3
4
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
4
5
|
import { GenericMessage } from '@wireapp/protocol-messaging';
|
|
5
6
|
import { MessageSendingState } from '..';
|
|
@@ -48,7 +49,7 @@ export interface MessageSendingCallbacks {
|
|
|
48
49
|
* The protocol to use to send the message (MLS or Proteus)
|
|
49
50
|
*/
|
|
50
51
|
export type ProtocolParam = {
|
|
51
|
-
protocol:
|
|
52
|
+
protocol: CONVERSATION_PROTOCOL;
|
|
52
53
|
};
|
|
53
54
|
/**
|
|
54
55
|
* The message to send to the conversation
|
|
@@ -62,7 +63,7 @@ export type SendMlsMessageParams = SendCommonParams & {
|
|
|
62
63
|
* The groupId of the conversation to send the message to (Needed only for MLS)
|
|
63
64
|
*/
|
|
64
65
|
groupId: string;
|
|
65
|
-
protocol:
|
|
66
|
+
protocol: CONVERSATION_PROTOCOL.MLS;
|
|
66
67
|
};
|
|
67
68
|
export type KeyPackageClaimUser = QualifiedId & {
|
|
68
69
|
skipOwnClientId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.types.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"ConversationService.types.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,oBAAoB,EAAE,oBAAoB,EAAE,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAC9G,OAAO,EAAC,iBAAiB,EAAE,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAC,qBAAqB,EAAC,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,IAAI,CAAC;AAEvC,oBAAY,iBAAiB;IAC3B,IAAI,IAAA;IACJ,KAAK,IAAA;IACL,aAAa,IAAA;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC;IAE/C,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,gBAAgB,CAAC,EAAE,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;IAE/D;;;;;OAKG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1G;AAED;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,qBAAqB,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,OAAO,EAAE,cAAc,CAAC;IACxB,cAAc,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,YAAY,CAAC;IAC3B,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;CACjC;AAED,MAAM,MAAM,iCAAiC,GAAG,8BAA8B,CAAC;AAC/E,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,CAAC,EAAE,2BAA2B,CAAC;IACpC,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;CACjC,CAAC;AAEF,MAAM,WAAW,6BAA8B,SAAQ,8BAA8B;IACnF,MAAM,EAAE,iBAAiB,EAAE,CAAC;CAC7B;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,iCAAiC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,KAAK,EAAE,mBAAmB,CAAC;IAC3B,4MAA4M;IAC5M,YAAY,CAAC,EAAE;QACb,gIAAgI;QAChI,MAAM,CAAC,EAAE,oBAAoB,GAAG,WAAW,EAAE,CAAC;QAC9C,oJAAoJ;QACpJ,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;KACxB,CAAC;CACH,CAAC"}
|
|
@@ -36,8 +36,10 @@ const getSubconversationResponse = ({ epoch, epochTimestamp, parentConversationI
|
|
|
36
36
|
epoch_timestamp: epochTimestamp,
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
|
+
const apiClients = [];
|
|
39
40
|
const buildSubconversationService = async (isFederated = false) => {
|
|
40
41
|
const apiClient = new api_client_1.APIClient({ urls: api_client_1.APIClient.BACKEND.STAGING });
|
|
42
|
+
apiClients.push(apiClient);
|
|
41
43
|
apiClient.backendFeatures.isFederated = isFederated;
|
|
42
44
|
const mlsService = {
|
|
43
45
|
conversationExists: jest.fn(),
|
|
@@ -58,6 +60,9 @@ const buildSubconversationService = async (isFederated = false) => {
|
|
|
58
60
|
return [subconversationService, { apiClient, mlsService, coreDatabase }];
|
|
59
61
|
};
|
|
60
62
|
describe('SubconversationService', () => {
|
|
63
|
+
afterAll(() => {
|
|
64
|
+
apiClients.forEach(client => client.disconnect());
|
|
65
|
+
});
|
|
61
66
|
describe('joinConferenceSubconversation', () => {
|
|
62
67
|
afterEach(() => {
|
|
63
68
|
jest.useRealTimers();
|
|
@@ -71,14 +71,20 @@ function fakeEncrypt(_, recipients) {
|
|
|
71
71
|
}, {});
|
|
72
72
|
return Promise.resolve({ payloads: encryptedPayload });
|
|
73
73
|
}
|
|
74
|
+
const apiClients = [];
|
|
74
75
|
const buildMessageService = async () => {
|
|
75
76
|
const apiClient = new api_client_1.APIClient();
|
|
77
|
+
apiClients.push(apiClient);
|
|
76
78
|
const [proteusService] = await (0, ProteusService_mocks_1.buildProteusService)();
|
|
77
79
|
const messageService = new MessageService_1.MessageService(apiClient, proteusService);
|
|
78
80
|
jest.spyOn(proteusService, 'encrypt').mockImplementation(fakeEncrypt);
|
|
79
81
|
return [messageService, { apiClient, proteusService }];
|
|
80
82
|
};
|
|
81
83
|
describe('MessageService', () => {
|
|
84
|
+
afterAll(() => {
|
|
85
|
+
apiClients.forEach(client => client.disconnect());
|
|
86
|
+
(0, ProteusService_mocks_1.cleanupProteusServiceMocks)();
|
|
87
|
+
});
|
|
82
88
|
describe('sendMessage', () => {
|
|
83
89
|
const generateUsers = (userCount, clientsPerUser) => {
|
|
84
90
|
return Array.from(Array(userCount)).map((_, i) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EncryptedAsset.d.ts","sourceRoot":"","sources":["../../../src/cryptography/AssetCryptography/EncryptedAsset.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,UAAU,CAAC;IACrB,sCAAsC;IACtC,MAAM,EAAE,UAAU,CAAC;CACpB;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,
|
|
1
|
+
{"version":3,"file":"EncryptedAsset.d.ts","sourceRoot":"","sources":["../../../src/cryptography/AssetCryptography/EncryptedAsset.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,UAAU,CAAC;IACrB,sCAAsC;IACtC,MAAM,EAAE,UAAU,CAAC;CACpB;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -70,8 +70,10 @@ const defaultMLSInitConfig = {
|
|
|
70
70
|
// Needs to be divisible by 4 to be a valid base64 string
|
|
71
71
|
const mockGroupId = 'Z3JvdXAtdGVzdC0x';
|
|
72
72
|
const mockedMLSWelcomeEventData = '';
|
|
73
|
+
const apiClients = [];
|
|
73
74
|
const createMLSService = async () => {
|
|
74
75
|
const apiClient = new api_client_1.APIClient();
|
|
76
|
+
apiClients.push(apiClient);
|
|
75
77
|
const transactionContext = {
|
|
76
78
|
mlsInit: jest.fn(),
|
|
77
79
|
wipeConversation: jest.fn(),
|
|
@@ -112,6 +114,9 @@ afterAll(() => {
|
|
|
112
114
|
jest.clearAllTimers();
|
|
113
115
|
});
|
|
114
116
|
describe('MLSService', () => {
|
|
117
|
+
afterAll(() => {
|
|
118
|
+
apiClients.forEach(client => client.disconnect());
|
|
119
|
+
});
|
|
115
120
|
describe('registerConversation', () => {
|
|
116
121
|
let mlsService;
|
|
117
122
|
let apiClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProteusService.mocks.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.mocks.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ProteusService.mocks.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.mocks.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAOhD,eAAO,MAAM,mBAAmB,QAAa,OAAO,CAClD,CAAC,cAAc,EAAE;IAAC,SAAS,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,YAAY,CAAA;CAAC,CAAC,CAyBrE,CAAC;AAEF,eAAO,MAAM,0BAA0B,YAGtC,CAAC"}
|
|
@@ -18,15 +18,17 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.buildProteusService = void 0;
|
|
21
|
+
exports.cleanupProteusServiceMocks = exports.buildProteusService = void 0;
|
|
22
22
|
const client_1 = require("@wireapp/api-client/lib/client");
|
|
23
23
|
const api_client_1 = require("@wireapp/api-client");
|
|
24
24
|
const CoreCryptoWrapper_1 = require("./CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper");
|
|
25
25
|
const ProteusService_1 = require("./ProteusService");
|
|
26
26
|
const PayloadHelper_1 = require("../../../test/PayloadHelper");
|
|
27
27
|
const StoreHelper_1 = require("../../../test/StoreHelper");
|
|
28
|
+
const createdApiClients = [];
|
|
28
29
|
const buildProteusService = async () => {
|
|
29
30
|
const apiClient = new api_client_1.APIClient({ urls: api_client_1.APIClient.BACKEND.STAGING });
|
|
31
|
+
createdApiClients.push(apiClient);
|
|
30
32
|
apiClient.context = {
|
|
31
33
|
clientType: client_1.ClientType.NONE,
|
|
32
34
|
userId: (0, PayloadHelper_1.getUUID)(),
|
|
@@ -40,3 +42,8 @@ const buildProteusService = async () => {
|
|
|
40
42
|
return [proteusService, { apiClient, cryptoClient }];
|
|
41
43
|
};
|
|
42
44
|
exports.buildProteusService = buildProteusService;
|
|
45
|
+
const cleanupProteusServiceMocks = () => {
|
|
46
|
+
createdApiClients.forEach(client => client.disconnect());
|
|
47
|
+
createdApiClients.length = 0;
|
|
48
|
+
};
|
|
49
|
+
exports.cleanupProteusServiceMocks = cleanupProteusServiceMocks;
|
|
@@ -52,6 +52,7 @@ const event_1 = require("@wireapp/api-client/lib/event");
|
|
|
52
52
|
const protocol_messaging_1 = require("@wireapp/protocol-messaging");
|
|
53
53
|
const errors_1 = require("../../../errors");
|
|
54
54
|
const testUtils_1 = require("../../../testUtils");
|
|
55
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
55
56
|
jest.mock('./CryptoClient/CoreCryptoWrapper/PrekeysTracker', () => {
|
|
56
57
|
return {
|
|
57
58
|
PrekeyTracker: jest.fn().mockImplementation(() => {
|
|
@@ -127,6 +128,9 @@ const prepareDataForEncryption = async () => {
|
|
|
127
128
|
};
|
|
128
129
|
};
|
|
129
130
|
describe('ProteusService', () => {
|
|
131
|
+
afterAll(() => {
|
|
132
|
+
(0, ProteusService_mocks_1.cleanupProteusServiceMocks)();
|
|
133
|
+
});
|
|
130
134
|
const domain1 = 'domain1';
|
|
131
135
|
const domain2 = 'domain2';
|
|
132
136
|
const domain3 = 'domain3';
|
|
@@ -346,7 +350,7 @@ describe('ProteusService', () => {
|
|
|
346
350
|
const params = {
|
|
347
351
|
conversationId: (0, testUtils_1.generateQualifiedId)('domain'),
|
|
348
352
|
payload: message,
|
|
349
|
-
protocol:
|
|
353
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
350
354
|
targetMode: conversation_2.MessageTargetMode.USERS,
|
|
351
355
|
};
|
|
352
356
|
try {
|
|
@@ -371,7 +375,7 @@ describe('ProteusService', () => {
|
|
|
371
375
|
MockedRecipients.getRecipientsForConversation.mockResolvedValue({});
|
|
372
376
|
jest.spyOn(proteusService['messageService'], 'sendMessage').mockReturnValue(Promise.resolve({}));
|
|
373
377
|
await proteusService.sendMessage({
|
|
374
|
-
protocol:
|
|
378
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
375
379
|
payload: message,
|
|
376
380
|
targetMode: conversation_2.MessageTargetMode.USERS,
|
|
377
381
|
userIds: recipients,
|
|
@@ -398,7 +402,7 @@ describe('ProteusService', () => {
|
|
|
398
402
|
MockedRecipients.getRecipientsForConversation.mockResolvedValue({});
|
|
399
403
|
jest.spyOn(proteusService['messageService'], 'sendMessage').mockResolvedValue({});
|
|
400
404
|
await proteusService.sendMessage({
|
|
401
|
-
protocol:
|
|
405
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
402
406
|
conversationId: { id: 'conv1', domain: 'domain1' },
|
|
403
407
|
payload: message,
|
|
404
408
|
targetMode: conversation_2.MessageTargetMode.USERS,
|
|
@@ -426,7 +430,7 @@ describe('ProteusService', () => {
|
|
|
426
430
|
jest.spyOn(proteusService['messageService'], 'sendMessage').mockReturnValue(Promise.resolve({}));
|
|
427
431
|
await proteusService.sendMessage({
|
|
428
432
|
conversationId: { id: 'conv1', domain: '' },
|
|
429
|
-
protocol:
|
|
433
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
430
434
|
payload: message,
|
|
431
435
|
targetMode: conversation_2.MessageTargetMode.USERS_CLIENTS,
|
|
432
436
|
userIds: recipients,
|
|
@@ -447,7 +451,7 @@ describe('ProteusService', () => {
|
|
|
447
451
|
MockedRecipients.getRecipientsForConversation.mockResolvedValue({});
|
|
448
452
|
jest.spyOn(proteusService['messageService'], 'sendMessage').mockReturnValue(Promise.resolve({}));
|
|
449
453
|
await proteusService.sendMessage({
|
|
450
|
-
protocol:
|
|
454
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
451
455
|
conversationId: { id: 'conv1', domain: 'domain1' },
|
|
452
456
|
payload: message,
|
|
453
457
|
targetMode: conversation_2.MessageTargetMode.USERS_CLIENTS,
|
|
@@ -473,7 +477,7 @@ describe('ProteusService', () => {
|
|
|
473
477
|
deleted: {},
|
|
474
478
|
});
|
|
475
479
|
const result = await proteusService.sendMessage({
|
|
476
|
-
protocol:
|
|
480
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
477
481
|
conversationId: (0, testUtils_1.generateQualifiedId)('domain'),
|
|
478
482
|
payload: message,
|
|
479
483
|
targetMode: conversation_2.MessageTargetMode.USERS_CLIENTS,
|
|
@@ -575,7 +579,7 @@ describe('ProteusService', () => {
|
|
|
575
579
|
status_time: '',
|
|
576
580
|
},
|
|
577
581
|
},
|
|
578
|
-
protocol:
|
|
582
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
579
583
|
};
|
|
580
584
|
it('adds all requested users to a new conversation', async () => {
|
|
581
585
|
const [proteusService, { apiClient }] = await (0, ProteusService_mocks_1.buildProteusService)();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { QualifiedUserClients, MessageSendingStatus,
|
|
1
|
+
import { QualifiedUserClients, MessageSendingStatus, NewConversation } from '@wireapp/api-client/lib/conversation';
|
|
2
|
+
import { CONVERSATION_PROTOCOL } from '@wireapp/api-client/lib/team';
|
|
2
3
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
3
4
|
import { AddUsersParams, MessageSendingOptions, SendCommonParams } from '../../../conversation';
|
|
4
5
|
export interface NewClient {
|
|
@@ -17,7 +18,7 @@ export type SendProteusMessageParams = SendCommonParams & MessageSendingOptions
|
|
|
17
18
|
*/
|
|
18
19
|
userIds?: QualifiedId[] | QualifiedUserClients;
|
|
19
20
|
onClientMismatch?: (status: MessageSendingStatus, wasSent: boolean) => void | boolean | Promise<boolean>;
|
|
20
|
-
protocol:
|
|
21
|
+
protocol: CONVERSATION_PROTOCOL.PROTEUS;
|
|
21
22
|
};
|
|
22
23
|
export type CreateProteusConversationParams = {
|
|
23
24
|
conversationData: NewConversation | string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProteusService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"ProteusService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,oBAAoB,EAAE,oBAAoB,EAAE,eAAe,EAAC,MAAM,sCAAsC,CAAC;AACjH,OAAO,EAAC,qBAAqB,EAAC,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAE,qBAAqB,EAAE,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAE9F,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;CACrB;AACD,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GACrD,qBAAqB,GAAG;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC;IAC/C,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzG,QAAQ,EAAE,qBAAqB,CAAC,OAAO,CAAC;CACzC,CAAC;AAEJ,MAAM,MAAM,+BAA+B,GAAG;IAC5C,gBAAgB,EAAE,eAAe,GAAG,MAAM,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -44,8 +44,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
44
44
|
/* eslint-disable import/order */
|
|
45
45
|
const GenericMessageParams = __importStar(require("../Utility/getGenericMessageParams"));
|
|
46
46
|
const client_1 = require("@wireapp/api-client/lib/client");
|
|
47
|
-
const
|
|
48
|
-
const
|
|
47
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
48
|
+
const conversation_1 = require("../../../conversation");
|
|
49
49
|
const MessageBuilder_1 = require("../../../conversation/message/MessageBuilder");
|
|
50
50
|
const ProteusService_mocks_1 = require("./ProteusService.mocks");
|
|
51
51
|
jest.mock('../Utility/getGenericMessageParams', () => {
|
|
@@ -54,8 +54,10 @@ jest.mock('../Utility/getGenericMessageParams', () => {
|
|
|
54
54
|
};
|
|
55
55
|
});
|
|
56
56
|
const MockedGenericMessageParams = GenericMessageParams;
|
|
57
|
+
const apiClients = [];
|
|
57
58
|
const prepareProteusService = async () => {
|
|
58
59
|
const [proteusService, { apiClient }] = await (0, ProteusService_mocks_1.buildProteusService)();
|
|
60
|
+
apiClients.push(apiClient);
|
|
59
61
|
jest.spyOn(apiClient.api.user, 'postListClients').mockImplementation(() => Promise.resolve({
|
|
60
62
|
qualified_user_map: {
|
|
61
63
|
'test-domain': {
|
|
@@ -74,6 +76,8 @@ const prepareProteusService = async () => {
|
|
|
74
76
|
};
|
|
75
77
|
afterAll(() => {
|
|
76
78
|
jest.clearAllTimers();
|
|
79
|
+
apiClients.forEach(client => client.disconnect());
|
|
80
|
+
(0, ProteusService_mocks_1.cleanupProteusServiceMocks)();
|
|
77
81
|
});
|
|
78
82
|
describe('sendGenericMessage', () => {
|
|
79
83
|
describe('targetted messages', () => {
|
|
@@ -89,9 +93,9 @@ describe('sendGenericMessage', () => {
|
|
|
89
93
|
const payloadBundle = await proteusService.sendMessage({
|
|
90
94
|
payload: message,
|
|
91
95
|
conversationId: { id: 'conv1', domain: '' },
|
|
92
|
-
protocol:
|
|
96
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
93
97
|
});
|
|
94
|
-
expect(payloadBundle.state).toBe(
|
|
98
|
+
expect(payloadBundle.state).toBe(conversation_1.MessageSendingState.CANCELED);
|
|
95
99
|
});
|
|
96
100
|
});
|
|
97
101
|
});
|
|
@@ -28,12 +28,17 @@ const MOCK_BACKEND = {
|
|
|
28
28
|
ws: `wss://${BASE_URL}`,
|
|
29
29
|
};
|
|
30
30
|
const mockedConversationService = {};
|
|
31
|
+
const apiClients = [];
|
|
31
32
|
describe('NotificationService', () => {
|
|
33
|
+
afterAll(() => {
|
|
34
|
+
apiClients.forEach(client => client.disconnect());
|
|
35
|
+
});
|
|
32
36
|
describe('handleEvent', () => {
|
|
33
37
|
it('propagates errors to the outer calling function', async () => {
|
|
34
38
|
const storeEngine = new store_engine_1.MemoryEngine();
|
|
35
39
|
await storeEngine.init('NotificationService.test');
|
|
36
40
|
const apiClient = new api_client_1.APIClient({ urls: MOCK_BACKEND });
|
|
41
|
+
apiClients.push(apiClient);
|
|
37
42
|
const notificationService = new _1.NotificationService(apiClient, storeEngine, mockedConversationService);
|
|
38
43
|
jest.spyOn(notificationService, 'handleEvent').mockImplementation(() => {
|
|
39
44
|
throw new Error('Test error');
|
|
@@ -57,6 +62,7 @@ describe('NotificationService', () => {
|
|
|
57
62
|
const storeEngine = new store_engine_1.MemoryEngine();
|
|
58
63
|
await storeEngine.init('NotificationService.test');
|
|
59
64
|
const apiClient = new api_client_1.APIClient({ urls: MOCK_BACKEND });
|
|
65
|
+
apiClients.push(apiClient);
|
|
60
66
|
const notificationService = new _1.NotificationService(apiClient, storeEngine, mockedConversationService);
|
|
61
67
|
jest.spyOn(notificationService, 'handleEvent').mockReturnValue({});
|
|
62
68
|
const spySetLastNotificationId = jest
|
|
@@ -75,6 +81,7 @@ describe('NotificationService', () => {
|
|
|
75
81
|
const storeEngine = new store_engine_1.MemoryEngine();
|
|
76
82
|
await storeEngine.init('NotificationService.test');
|
|
77
83
|
const apiClient = new api_client_1.APIClient({ urls: MOCK_BACKEND });
|
|
84
|
+
apiClients.push(apiClient);
|
|
78
85
|
const notificationService = new _1.NotificationService(apiClient, storeEngine, mockedConversationService);
|
|
79
86
|
jest.spyOn(notificationService, 'handleEvent').mockReturnValue({});
|
|
80
87
|
const spySetLastNotificationId = jest
|
|
@@ -93,6 +100,7 @@ describe('NotificationService', () => {
|
|
|
93
100
|
const storeEngine = new store_engine_1.MemoryEngine();
|
|
94
101
|
await storeEngine.init('NotificationService.test');
|
|
95
102
|
const apiClient = new api_client_1.APIClient({ urls: MOCK_BACKEND });
|
|
103
|
+
apiClients.push(apiClient);
|
|
96
104
|
const notificationService = new _1.NotificationService(apiClient, storeEngine, mockedConversationService);
|
|
97
105
|
notificationService.on(_1.NotificationService.TOPIC.NOTIFICATION_ERROR, notificationError => {
|
|
98
106
|
expect(notificationError.error.message).toBe('Test error');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConversationProtocol } from '@wireapp/api-client/lib/conversation';
|
|
2
1
|
import { Self } from '@wireapp/api-client/lib/self/';
|
|
2
|
+
import { CONVERSATION_PROTOCOL } from '@wireapp/api-client/lib/team';
|
|
3
3
|
import { APIClient } from '@wireapp/api-client';
|
|
4
4
|
export declare class SelfService {
|
|
5
5
|
private readonly apiClient;
|
|
@@ -16,6 +16,6 @@ export declare class SelfService {
|
|
|
16
16
|
* Update self user's list of supported-protocols
|
|
17
17
|
* @param supportedProtocols The list of supported protocols
|
|
18
18
|
*/
|
|
19
|
-
putSupportedProtocols(supportedProtocols:
|
|
19
|
+
putSupportedProtocols(supportedProtocols: CONVERSATION_PROTOCOL[]): Promise<void>;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=SelfService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelfService.d.ts","sourceRoot":"","sources":["../../src/self/SelfService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"SelfService.d.ts","sourceRoot":"","sources":["../../src/self/SelfService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,IAAI,EAAC,MAAM,+BAA+B,CAAC;AACnD,OAAO,EAAC,qBAAqB,EAAC,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAG9C,qBAAa,WAAW;IAGV,OAAO,CAAC,QAAQ,CAAC,SAAS;IAFtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqD;gBAE/C,SAAS,EAAE,SAAS;IAEpC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKvD,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAMhD,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAK1B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxB,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAKhD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD;;;OAGG;IACU,qBAAqB,CAAC,kBAAkB,EAAE,qBAAqB,EAAE;CAY/E"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
const
|
|
21
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
22
22
|
const api_client_1 = require("@wireapp/api-client");
|
|
23
23
|
const SelfService_1 = require("./SelfService");
|
|
24
24
|
const BASE_URL = 'mock-backend.wire.com';
|
|
@@ -31,9 +31,12 @@ describe('SelfService', () => {
|
|
|
31
31
|
describe('putSupportedProtocols', () => {
|
|
32
32
|
const apiClient = new api_client_1.APIClient({ urls: MOCK_BACKEND });
|
|
33
33
|
apiClient.backendFeatures.supportsMLS = true;
|
|
34
|
+
afterAll(() => {
|
|
35
|
+
apiClient.disconnect();
|
|
36
|
+
});
|
|
34
37
|
it('updates the list of self supported protocols', async () => {
|
|
35
38
|
const selfService = new SelfService_1.SelfService(apiClient);
|
|
36
|
-
const supportedProtocols = [
|
|
39
|
+
const supportedProtocols = [team_1.CONVERSATION_PROTOCOL.PROTEUS, team_1.CONVERSATION_PROTOCOL.MLS];
|
|
37
40
|
jest.spyOn(apiClient.api.self, 'putSupportedProtocols').mockImplementation(jest.fn());
|
|
38
41
|
await selfService.putSupportedProtocols(supportedProtocols);
|
|
39
42
|
expect(apiClient.api.self.putSupportedProtocols).toHaveBeenCalledWith(supportedProtocols);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CONVERSATION_PROTOCOL } from '@wireapp/api-client/lib/team';
|
|
2
2
|
import { QualifiedId, User } from '@wireapp/api-client/lib/user/';
|
|
3
3
|
import { APIClient } from '@wireapp/api-client';
|
|
4
4
|
export declare class UserService {
|
|
@@ -13,6 +13,6 @@ export declare class UserService {
|
|
|
13
13
|
/**
|
|
14
14
|
* Get the list of other user's supported protocols.
|
|
15
15
|
*/
|
|
16
|
-
getUserSupportedProtocols(userId: QualifiedId): Promise<
|
|
16
|
+
getUserSupportedProtocols(userId: QualifiedId): Promise<CONVERSATION_PROTOCOL[]>;
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=UserService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../src/user/UserService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../src/user/UserService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,qBAAqB,EAAC,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAC,WAAW,EAAE,IAAI,EAAC,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAE1B,SAAS,EAAE,SAAS;IAIzB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE;;;;;IAO5C;;OAEG;IACU,yBAAyB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;CAS9F"}
|
package/lib/user/UserService.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.UserService = void 0;
|
|
22
|
-
const
|
|
22
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
23
23
|
class UserService {
|
|
24
24
|
apiClient;
|
|
25
25
|
constructor(apiClient) {
|
|
@@ -40,10 +40,10 @@ class UserService {
|
|
|
40
40
|
async getUserSupportedProtocols(userId) {
|
|
41
41
|
// Clients that uses version below the one supporting MLS, are not aware of user's supported protocols, we default to Proteus in this case.
|
|
42
42
|
if (!this.apiClient.backendFeatures.supportsMLS) {
|
|
43
|
-
return [
|
|
43
|
+
return [team_1.CONVERSATION_PROTOCOL.PROTEUS];
|
|
44
44
|
}
|
|
45
45
|
const supportedProtocols = await this.apiClient.api.user.getUserSupportedProtocols(userId);
|
|
46
|
-
return supportedProtocols.length > 0 ? supportedProtocols : [
|
|
46
|
+
return supportedProtocols.length > 0 ? supportedProtocols : [team_1.CONVERSATION_PROTOCOL.PROTEUS];
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
exports.UserService = UserService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypePredicateUtil.d.ts","sourceRoot":"","sources":["../../src/util/TypePredicateUtil.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"TypePredicateUtil.d.ts","sourceRoot":"","sources":["../../src/util/TypePredicateUtil.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,WAAW,EAAC,MAAM,uCAAuC,CAAC;AAEvH,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAE1D,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,MAAM,EAAE,CAEvD;AAMD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,WAAW,EAAE,CAEjE;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,oBAAoB,CAS5E;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,WAAW,CAM1D;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,YAAY,IAAI,eAAe,CAG7F"}
|
|
@@ -23,7 +23,7 @@ exports.isQualifiedIdArray = isQualifiedIdArray;
|
|
|
23
23
|
exports.isQualifiedUserClients = isQualifiedUserClients;
|
|
24
24
|
exports.isUserClients = isUserClients;
|
|
25
25
|
exports.isMLSConversation = isMLSConversation;
|
|
26
|
-
const
|
|
26
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
27
27
|
function isStringArray(obj) {
|
|
28
28
|
return Array.isArray(obj) && (obj.length === 0 || typeof obj[0] === 'string');
|
|
29
29
|
}
|
|
@@ -52,5 +52,5 @@ function isUserClients(obj) {
|
|
|
52
52
|
}
|
|
53
53
|
function isMLSConversation(conversation) {
|
|
54
54
|
const { protocol, epoch, group_id } = conversation;
|
|
55
|
-
return protocol ===
|
|
55
|
+
return protocol === team_1.CONVERSATION_PROTOCOL.MLS && epoch !== undefined && group_id !== undefined;
|
|
56
56
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@wireapp/api-client": "^27.
|
|
14
|
+
"@wireapp/api-client": "^27.87.1",
|
|
15
15
|
"@wireapp/commons": "^5.4.9",
|
|
16
16
|
"@wireapp/core-crypto": "9.1.0",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"test:coverage": "jest --coverage",
|
|
62
62
|
"watch": "tsc --watch"
|
|
63
63
|
},
|
|
64
|
-
"version": "46.
|
|
65
|
-
"gitHead": "
|
|
64
|
+
"version": "46.45.1",
|
|
65
|
+
"gitHead": "de036306195ee6af235aa1541443b1ffefaa8e26"
|
|
66
66
|
}
|