@wireapp/core 36.4.4 → 36.6.0
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 +5 -5
- package/lib/Account.d.ts.map +1 -1
- package/lib/Account.js +13 -6
- package/lib/conversation/ConversationService/ConversationService.d.ts +8 -40
- package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.js +9 -201
- package/lib/conversation/ConversationService/ConversationService.types.d.ts +9 -13
- package/lib/conversation/ConversationService/ConversationService.types.d.ts.map +1 -1
- package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.d.ts +9 -0
- package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.d.ts.map +1 -0
- package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.js +34 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/ConversationEvent.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/ConversationEvent.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/ConversationEvent.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/messageAdd/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/messageAdd/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/messageAdd/messageAdd.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/messageAdd/messageAdd.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/welcomeMessage/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/welcomeMessage/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/EventHandler.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/EventHandler.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/EventHandler.types.d.ts +2 -2
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.types.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/EventHandler.types.js +1 -1
- package/lib/{mls → messagingProtocols/mls}/EventHandler/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/MLSService.d.ts +2 -6
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/MLSService.js +4 -4
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts +16 -0
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts.map +1 -0
- package/lib/{mls/types.js → messagingProtocols/mls/MLSService/MLSService.types.js} +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/commitBundleUtil.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/commitBundleUtil.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/commitBundleUtil.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/keyMaterialUpdatesStore/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/stores/keyMaterialUpdatesStore/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/keyMaterialUpdatesStore/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/pendingProposalsStore/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/stores/pendingProposalsStore/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/pendingProposalsStore/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/pendingProposalsStore/pendingProposalsStore.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/stores/pendingProposalsStore/pendingProposalsStore.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/pendingProposalsStore/pendingProposalsStore.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/stores.mock.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/stores/stores.mock.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/stores.mock.js +0 -0
- package/lib/messagingProtocols/mls/index.d.ts +2 -0
- package/lib/messagingProtocols/mls/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/index.js +1 -1
- package/lib/{mls → messagingProtocols/mls}/types.d.ts +0 -0
- package/lib/messagingProtocols/mls/types.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/types.js +20 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts +15 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.js +77 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts +20 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.js +20 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/PreKeyBundle.d.ts +24 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/PreKeyBundle.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/PreKeyBundle.js +86 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/Recipients.d.ts +17 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/Recipients.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/Recipients.js +43 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/UserIds.d.ts +12 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/UserIds.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/UserIds.js +38 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/getGenericMessageParams.d.ts +35 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/getGenericMessageParams.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/getGenericMessageParams.js +87 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/index.d.ts +5 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/index.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/index.js +38 -0
- package/lib/messagingProtocols/proteus/ProteusService/index.d.ts +4 -0
- package/lib/messagingProtocols/proteus/ProteusService/index.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/index.js +37 -0
- package/lib/messagingProtocols/proteus/index.d.ts +2 -0
- package/lib/messagingProtocols/proteus/index.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/index.js +35 -0
- package/lib/notification/NotificationService.d.ts +1 -1
- package/lib/notification/NotificationService.d.ts.map +1 -1
- package/lib/user/UserService.d.ts +1 -3
- package/lib/user/UserService.d.ts.map +1 -1
- package/lib/user/UserService.js +7 -5
- package/package.json +3 -3
- package/lib/mls/EventHandler/ConversationEvent/ConversationEvent.d.ts.map +0 -1
- package/lib/mls/EventHandler/ConversationEvent/events/index.d.ts.map +0 -1
- package/lib/mls/EventHandler/ConversationEvent/events/messageAdd/index.d.ts.map +0 -1
- package/lib/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.d.ts.map +0 -1
- package/lib/mls/EventHandler/ConversationEvent/events/welcomeMessage/index.d.ts.map +0 -1
- package/lib/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.d.ts.map +0 -1
- package/lib/mls/EventHandler/ConversationEvent/index.d.ts.map +0 -1
- package/lib/mls/EventHandler/EventHandler.d.ts.map +0 -1
- package/lib/mls/EventHandler/EventHandler.types.d.ts.map +0 -1
- package/lib/mls/EventHandler/index.d.ts.map +0 -1
- package/lib/mls/MLSService/MLSService.d.ts.map +0 -1
- package/lib/mls/MLSService/commitBundleUtil.d.ts.map +0 -1
- package/lib/mls/MLSService/index.d.ts.map +0 -1
- package/lib/mls/MLSService/stores/keyMaterialUpdatesStore/index.d.ts.map +0 -1
- package/lib/mls/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.d.ts.map +0 -1
- package/lib/mls/MLSService/stores/pendingProposalsStore/index.d.ts.map +0 -1
- package/lib/mls/MLSService/stores/pendingProposalsStore/pendingProposalsStore.d.ts.map +0 -1
- package/lib/mls/MLSService/stores/stores.mock.d.ts.map +0 -1
- package/lib/mls/index.d.ts +0 -2
- package/lib/mls/index.d.ts.map +0 -1
- package/lib/mls/types.d.ts.map +0 -1
package/lib/Account.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ import { CoreError } from './CoreError';
|
|
|
16
16
|
import { CryptographyService, SessionId } from './cryptography/';
|
|
17
17
|
import { GiphyService } from './giphy/';
|
|
18
18
|
import { LinkPreviewService } from './linkPreview';
|
|
19
|
-
import { MLSService } from './mls';
|
|
20
|
-
import { MLSCallbacks, CryptoProtocolConfig } from './mls/types';
|
|
19
|
+
import { MLSService } from './messagingProtocols/mls';
|
|
20
|
+
import { MLSCallbacks, CryptoProtocolConfig } from './messagingProtocols/mls/types';
|
|
21
21
|
import { HandledEventPayload, NotificationService } from './notification/';
|
|
22
22
|
import { SelfService } from './self/';
|
|
23
23
|
import { TeamService } from './team/';
|
|
@@ -148,7 +148,7 @@ export declare class Account<T = any> extends EventEmitter {
|
|
|
148
148
|
*/
|
|
149
149
|
register(registration: RegisterData, clientType: ClientType): Promise<Context>;
|
|
150
150
|
/**
|
|
151
|
-
* Will init the core with an
|
|
151
|
+
* Will init the core with an already existing client (both on backend and local)
|
|
152
152
|
* Will fail if local client cannot be found
|
|
153
153
|
*
|
|
154
154
|
* @param clientType The type of client the user is using (temporary or permanent)
|
|
@@ -166,7 +166,7 @@ export declare class Account<T = any> extends EventEmitter {
|
|
|
166
166
|
/**
|
|
167
167
|
* Will try to get the load the local client from local DB.
|
|
168
168
|
* If clientInfo are provided, will also create the client on backend and DB
|
|
169
|
-
* If clientInfo are not
|
|
169
|
+
* If clientInfo are not provided, the method will fail if local client cannot be found
|
|
170
170
|
*
|
|
171
171
|
* @param loginData User's credentials
|
|
172
172
|
* @param clientInfo Will allow creating the client if the local client cannot be found (else will fail if local client is not found)
|
|
@@ -217,7 +217,7 @@ export declare class Account<T = any> extends EventEmitter {
|
|
|
217
217
|
total: number;
|
|
218
218
|
}) => void;
|
|
219
219
|
/**
|
|
220
|
-
* called when the connection
|
|
220
|
+
* called when the connection state with the backend has changed
|
|
221
221
|
*/
|
|
222
222
|
onConnectionStateChanged?: (state: ConnectionState) => void;
|
|
223
223
|
/**
|
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,EACV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAuB,UAAU,EAAE,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACnG,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AASxD,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAG/D,OAAO,EAAC,UAAU,EAA0C,MAAM,uBAAuB,CAAC;AAE1F,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,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAE1G,OAAO,KAAK,UAAU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AC,KAAK,EAAE,MAAM,CAAA;SAAC,KAAK,IAAI,CAAC;QAEtF;;WAEG;QACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;QAE5D;;;;;;WAMG;QACH,qBAAqB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;QAEzD;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;KACb,GAAG,MAAM,IAAI;IAoFnB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,qBAAqB;YAIf,UAAU;CAqBzB"}
|
package/lib/Account.js
CHANGED
|
@@ -75,7 +75,8 @@ const messageSender_1 = require("./conversation/message/messageSender");
|
|
|
75
75
|
const cryptography_1 = require("./cryptography/");
|
|
76
76
|
const giphy_1 = require("./giphy/");
|
|
77
77
|
const linkPreview_1 = require("./linkPreview");
|
|
78
|
-
const mls_1 = require("./mls");
|
|
78
|
+
const mls_1 = require("./messagingProtocols/mls");
|
|
79
|
+
const proteus_1 = require("./messagingProtocols/proteus");
|
|
79
80
|
const notification_1 = require("./notification/");
|
|
80
81
|
const self_1 = require("./self/");
|
|
81
82
|
const team_1 = require("./team/");
|
|
@@ -166,7 +167,7 @@ class Account extends events_1.EventEmitter {
|
|
|
166
167
|
return context;
|
|
167
168
|
}
|
|
168
169
|
/**
|
|
169
|
-
* Will init the core with an
|
|
170
|
+
* Will init the core with an already existing client (both on backend and local)
|
|
170
171
|
* Will fail if local client cannot be found
|
|
171
172
|
*
|
|
172
173
|
* @param clientType The type of client the user is using (temporary or permanent)
|
|
@@ -191,7 +192,9 @@ class Account extends events_1.EventEmitter {
|
|
|
191
192
|
});
|
|
192
193
|
// Assumption: client gets only initialized once
|
|
193
194
|
if (initClient) {
|
|
194
|
-
await this.initClient({ clientType });
|
|
195
|
+
const { localClient } = await this.initClient({ clientType });
|
|
196
|
+
//call /access endpoint with client_id after client initialisation
|
|
197
|
+
await this.apiClient.transport.http.associateClientWithSession(localClient.id);
|
|
195
198
|
if (((_a = this.cryptoProtocolConfig) === null || _a === void 0 ? void 0 : _a.mls) && this.backendFeatures.supportsMLS) {
|
|
196
199
|
// initialize schedulers for pending mls proposals once client is initialized
|
|
197
200
|
await ((_b = this.service) === null || _b === void 0 ? void 0 : _b.mls.checkExistingPendingProposals());
|
|
@@ -224,7 +227,7 @@ class Account extends events_1.EventEmitter {
|
|
|
224
227
|
/**
|
|
225
228
|
* Will try to get the load the local client from local DB.
|
|
226
229
|
* If clientInfo are provided, will also create the client on backend and DB
|
|
227
|
-
* If clientInfo are not
|
|
230
|
+
* If clientInfo are not provided, the method will fail if local client cannot be found
|
|
228
231
|
*
|
|
229
232
|
* @param loginData User's credentials
|
|
230
233
|
* @param clientInfo Will allow creating the client if the local client cannot be found (else will fail if local client is not found)
|
|
@@ -298,6 +301,10 @@ class Account extends events_1.EventEmitter {
|
|
|
298
301
|
});
|
|
299
302
|
const clientService = new client_2.ClientService(this.apiClient, this.storeEngine, cryptographyService);
|
|
300
303
|
const mlsService = new mls_1.MLSService(this.apiClient, () => this.coreCryptoClient, Object.assign(Object.assign({}, (_a = this.cryptoProtocolConfig) === null || _a === void 0 ? void 0 : _a.mls), { nbKeyPackages: this.nbPrekeys }));
|
|
304
|
+
const proteusService = new proteus_1.ProteusService(this.apiClient, cryptographyService, {
|
|
305
|
+
// We can use qualified ids to send messages as long as the backend supports federated endpoints
|
|
306
|
+
useQualifiedIds: this.backendFeatures.federationEndpoints,
|
|
307
|
+
});
|
|
301
308
|
const connectionService = new connection_1.ConnectionService(this.apiClient);
|
|
302
309
|
const giphyService = new giphy_1.GiphyService(this.apiClient);
|
|
303
310
|
const linkPreviewService = new linkPreview_1.LinkPreviewService(assetService);
|
|
@@ -305,11 +312,11 @@ class Account extends events_1.EventEmitter {
|
|
|
305
312
|
const conversationService = new conversation_1.ConversationService(this.apiClient, cryptographyService, {
|
|
306
313
|
// We can use qualified ids to send messages as long as the backend supports federated endpoints
|
|
307
314
|
useQualifiedIds: this.backendFeatures.federationEndpoints,
|
|
308
|
-
}, mlsService);
|
|
315
|
+
}, mlsService, proteusService);
|
|
309
316
|
const selfService = new self_1.SelfService(this.apiClient);
|
|
310
317
|
const teamService = new team_1.TeamService(this.apiClient);
|
|
311
318
|
const broadcastService = new broadcast_1.BroadcastService(this.apiClient, cryptographyService);
|
|
312
|
-
const userService = new user_1.UserService(this.apiClient, broadcastService,
|
|
319
|
+
const userService = new user_1.UserService(this.apiClient, broadcastService, connectionService);
|
|
313
320
|
this.service = {
|
|
314
321
|
mls: mlsService,
|
|
315
322
|
account: accountService,
|
|
@@ -1,54 +1,25 @@
|
|
|
1
1
|
import { Conversation, DefaultConversationRoleName, MutedStatus, NewConversation, QualifiedUserClients, UserClients } from '@wireapp/api-client/lib/conversation';
|
|
2
2
|
import { ConversationMemberLeaveEvent } from '@wireapp/api-client/lib/event';
|
|
3
|
-
import { QualifiedId
|
|
3
|
+
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
4
4
|
import { XOR } from '@wireapp/commons/lib/util/TypeUtil';
|
|
5
5
|
import { APIClient } from '@wireapp/api-client';
|
|
6
|
-
import { AddUsersParams, MLSReturnType, SendMlsMessageParams,
|
|
7
|
-
import { MessageTimer,
|
|
6
|
+
import { AddUsersParams, MLSReturnType, SendMlsMessageParams, SendResult } from './ConversationService.types';
|
|
7
|
+
import { MessageTimer, RemoveUsersParams } from '../../conversation/';
|
|
8
8
|
import { CryptographyService } from '../../cryptography/';
|
|
9
|
-
import { MLSService } from '../../mls';
|
|
9
|
+
import { MLSService } from '../../messagingProtocols/mls';
|
|
10
|
+
import { ProteusService } from '../../messagingProtocols/proteus';
|
|
11
|
+
import { SendProteusMessageParams } from '../../messagingProtocols/proteus/ProteusService/ProteusService.types';
|
|
10
12
|
import { RemoteData } from '../content';
|
|
11
|
-
declare type SendResult = {
|
|
12
|
-
/** The id of the message sent */
|
|
13
|
-
id: string;
|
|
14
|
-
/** the ISO formatted date at which the message was received by the backend */
|
|
15
|
-
sentAt: string;
|
|
16
|
-
/** The sending state of the payload (has the payload been succesfully sent or canceled) */
|
|
17
|
-
state: PayloadBundleState;
|
|
18
|
-
};
|
|
19
13
|
export declare class ConversationService {
|
|
20
14
|
private readonly apiClient;
|
|
21
15
|
private readonly config;
|
|
22
16
|
private readonly mlsService;
|
|
17
|
+
private readonly proteusService;
|
|
23
18
|
readonly messageTimer: MessageTimer;
|
|
24
19
|
private readonly messageService;
|
|
25
20
|
constructor(apiClient: APIClient, cryptographyService: CryptographyService, config: {
|
|
26
21
|
useQualifiedIds?: boolean;
|
|
27
|
-
}, mlsService: MLSService);
|
|
28
|
-
private getConversationQualifiedMembers;
|
|
29
|
-
/**
|
|
30
|
-
* Will generate a prekey bundle for specific users.
|
|
31
|
-
* If a QualifiedId array is given the bundle will contain all the clients from those users fetched from the server.
|
|
32
|
-
* If a QualifiedUserClients is provided then only the clients in the payload will be targeted (which could generate a ClientMismatch when sending messages)
|
|
33
|
-
*
|
|
34
|
-
* @param {QualifiedId[]|QualifiedUserClients} userIds - Targeted users.
|
|
35
|
-
* @returns {Promise<QualifiedUserPreKeyBundleMap}
|
|
36
|
-
*/
|
|
37
|
-
private getQualifiedPreKeyBundle;
|
|
38
|
-
getPreKeyBundleMap(conversationId: QualifiedId, userIds?: string[] | UserClients): Promise<UserPreKeyBundleMap>;
|
|
39
|
-
private getQualifiedRecipientsForConversation;
|
|
40
|
-
private getRecipientsForConversation;
|
|
41
|
-
/**
|
|
42
|
-
* Sends a message to a conversation
|
|
43
|
-
*
|
|
44
|
-
* @param sendingClientId The clientId from which the message is sent
|
|
45
|
-
* @param conversationId The conversation in which to send the message
|
|
46
|
-
* @param genericMessage The payload of the message to send
|
|
47
|
-
* @return Resolves with the message sending status from backend
|
|
48
|
-
*/
|
|
49
|
-
private sendGenericMessage;
|
|
50
|
-
private extractUserIds;
|
|
51
|
-
private extractQualifiedUserIds;
|
|
22
|
+
}, mlsService: MLSService, proteusService: ProteusService);
|
|
52
23
|
/**
|
|
53
24
|
* Get a fresh list from backend of clients for all the participants of the conversation.
|
|
54
25
|
* This is a hacky way of getting all the clients for a conversation.
|
|
@@ -91,7 +62,6 @@ export declare class ConversationService {
|
|
|
91
62
|
getUnencryptedAsset(assetId: string, assetToken?: string): Promise<ArrayBuffer>;
|
|
92
63
|
addUsersToProteusConversation({ conversationId, qualifiedUserIds }: Omit<AddUsersParams, 'groupId'>): Promise<import("@wireapp/api-client/lib/event").ConversationMemberJoinEvent>;
|
|
93
64
|
removeUserFromConversation(conversationId: QualifiedId, userId: QualifiedId): Promise<ConversationMemberLeaveEvent>;
|
|
94
|
-
private sendProteusMessage;
|
|
95
65
|
/**
|
|
96
66
|
* Sends a message to a conversation
|
|
97
67
|
* @return resolves with the sending status
|
|
@@ -102,7 +72,6 @@ export declare class ConversationService {
|
|
|
102
72
|
setConversationMutedStatus(conversationId: string, status: MutedStatus, muteTimestamp: number | Date): Promise<void>;
|
|
103
73
|
toggleArchiveConversation(conversationId: string, archived: boolean, archiveTimestamp?: number | Date): Promise<void>;
|
|
104
74
|
setMemberConversationRole(conversationId: string, userId: string, conversationRole: DefaultConversationRoleName | string): Promise<void>;
|
|
105
|
-
private isClearFromMismatch;
|
|
106
75
|
/**
|
|
107
76
|
* ###############################################
|
|
108
77
|
* ################ MLS Functions ################
|
|
@@ -123,5 +92,4 @@ export declare class ConversationService {
|
|
|
123
92
|
isMLSConversationEstablished(groupId: string): Promise<boolean>;
|
|
124
93
|
wipeMLSConversation(groupId: Uint8Array): Promise<void>;
|
|
125
94
|
}
|
|
126
|
-
export {};
|
|
127
95
|
//# sourceMappingURL=ConversationService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAEL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,WAAW,EAGZ,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAC,4BAA4B,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAEL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,WAAW,EAGZ,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAC,4BAA4B,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,GAAG,EAAC,MAAM,oCAAoC,CAAC;AAGvD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAI9C,OAAO,EAAC,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAE5G,OAAO,EAAC,YAAY,EAAsB,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAC,UAAU,EAAuB,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAkC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AACjG,OAAO,EAAC,wBAAwB,EAAC,MAAM,sEAAsE,CAAC;AAE9G,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AAItC,qBAAa,mBAAmB;IAK5B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAE1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IARjC,SAAgB,YAAY,EAAE,YAAY,CAAC;IAC3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;gBAG7B,SAAS,EAAE,SAAS,EACrC,mBAA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 = require("bazinga64");
|
|
25
25
|
const core_crypto_1 = require("@wireapp/core-crypto");
|
|
26
26
|
const protocol_messaging_1 = require("@wireapp/protocol-messaging");
|
|
27
|
-
const ConversationService_types_1 = require("./ConversationService.types");
|
|
28
27
|
const conversation_2 = require("../../conversation/");
|
|
29
28
|
const AssetCryptography_1 = require("../../cryptography/AssetCryptography");
|
|
30
|
-
const mls_1 = require("../../mls");
|
|
29
|
+
const mls_1 = require("../../messagingProtocols/mls");
|
|
30
|
+
const proteus_1 = require("../../messagingProtocols/proteus");
|
|
31
31
|
const fullyQualifiedClientIdUtils_1 = require("../../util/fullyQualifiedClientIdUtils");
|
|
32
|
-
const TypePredicateUtil_1 = require("../../util/TypePredicateUtil");
|
|
33
32
|
const messageSender_1 = require("../message/messageSender");
|
|
34
33
|
const MessageService_1 = require("../message/MessageService");
|
|
35
34
|
class ConversationService {
|
|
36
|
-
constructor(apiClient, cryptographyService, config, mlsService) {
|
|
35
|
+
constructor(apiClient, cryptographyService, config, mlsService, proteusService) {
|
|
37
36
|
this.apiClient = apiClient;
|
|
38
37
|
this.config = config;
|
|
39
38
|
this.mlsService = mlsService;
|
|
39
|
+
this.proteusService = proteusService;
|
|
40
40
|
this.messageTimer = new conversation_2.MessageTimer();
|
|
41
41
|
this.messageService = new MessageService_1.MessageService(this.apiClient, cryptographyService);
|
|
42
42
|
}
|
|
43
|
-
async getConversationQualifiedMembers(conversationId) {
|
|
44
|
-
const conversation = await this.apiClient.api.conversation.getConversation(conversationId);
|
|
45
|
-
/*
|
|
46
|
-
* If you are sending a message to a conversation, you have to include
|
|
47
|
-
* yourself in the list of users if you want to sync a message also to your
|
|
48
|
-
* other clients.
|
|
49
|
-
*/
|
|
50
|
-
return conversation.members.others
|
|
51
|
-
.filter(member => !!member.qualified_id)
|
|
52
|
-
.map(member => member.qualified_id)
|
|
53
|
-
.concat(conversation.members.self.qualified_id);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Will generate a prekey bundle for specific users.
|
|
57
|
-
* If a QualifiedId array is given the bundle will contain all the clients from those users fetched from the server.
|
|
58
|
-
* If a QualifiedUserClients is provided then only the clients in the payload will be targeted (which could generate a ClientMismatch when sending messages)
|
|
59
|
-
*
|
|
60
|
-
* @param {QualifiedId[]|QualifiedUserClients} userIds - Targeted users.
|
|
61
|
-
* @returns {Promise<QualifiedUserPreKeyBundleMap}
|
|
62
|
-
*/
|
|
63
|
-
async getQualifiedPreKeyBundle(userIds) {
|
|
64
|
-
let targets = [];
|
|
65
|
-
if (userIds) {
|
|
66
|
-
if ((0, TypePredicateUtil_1.isQualifiedIdArray)(userIds)) {
|
|
67
|
-
targets = userIds.map(id => ({ id }));
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
targets = Object.entries(userIds).reduce((accumulator, [domain, userClients]) => {
|
|
71
|
-
for (const userId in userClients) {
|
|
72
|
-
accumulator.push({ id: { id: userId, domain }, clients: userClients[userId] });
|
|
73
|
-
}
|
|
74
|
-
return accumulator;
|
|
75
|
-
}, []);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
const preKeys = await Promise.all(targets.map(async ({ id: userId, clients }) => {
|
|
79
|
-
const prekeyBundle = await this.apiClient.api.user.getUserPreKeys(userId);
|
|
80
|
-
// We filter the clients that should not receive the message (if a QualifiedUserClients was given as parameter)
|
|
81
|
-
const userClients = clients
|
|
82
|
-
? prekeyBundle.clients.filter(client => clients.includes(client.client))
|
|
83
|
-
: prekeyBundle.clients;
|
|
84
|
-
return { user: userId, clients: userClients };
|
|
85
|
-
}));
|
|
86
|
-
return preKeys.reduce((bundleMap, qualifiedPrekey) => {
|
|
87
|
-
var _a, _b, _c;
|
|
88
|
-
bundleMap[_a = qualifiedPrekey.user.domain] || (bundleMap[_a] = {});
|
|
89
|
-
for (const client of qualifiedPrekey.clients) {
|
|
90
|
-
(_b = bundleMap[qualifiedPrekey.user.domain])[_c = qualifiedPrekey.user.id] || (_b[_c] = {});
|
|
91
|
-
bundleMap[qualifiedPrekey.user.domain][qualifiedPrekey.user.id][client.client] = client.prekey;
|
|
92
|
-
}
|
|
93
|
-
return bundleMap;
|
|
94
|
-
}, {});
|
|
95
|
-
}
|
|
96
|
-
async getPreKeyBundleMap(conversationId, userIds) {
|
|
97
|
-
let members = [];
|
|
98
|
-
if (userIds) {
|
|
99
|
-
if ((0, TypePredicateUtil_1.isStringArray)(userIds)) {
|
|
100
|
-
members = userIds;
|
|
101
|
-
}
|
|
102
|
-
else if ((0, TypePredicateUtil_1.isUserClients)(userIds)) {
|
|
103
|
-
members = Object.keys(userIds);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (!members.length) {
|
|
107
|
-
const conversation = await this.apiClient.api.conversation.getConversation(conversationId);
|
|
108
|
-
/*
|
|
109
|
-
* If you are sending a message to a conversation, you have to include
|
|
110
|
-
* yourself in the list of users if you want to sync a message also to your
|
|
111
|
-
* other clients.
|
|
112
|
-
*/
|
|
113
|
-
members = conversation.members.others.map(member => member.id).concat(conversation.members.self.id);
|
|
114
|
-
}
|
|
115
|
-
const preKeys = await Promise.all(members.map(member => this.apiClient.api.user.getUserPreKeys(member)));
|
|
116
|
-
return preKeys.reduce((bundleMap, bundle) => {
|
|
117
|
-
const userId = bundle.user;
|
|
118
|
-
bundleMap[userId] || (bundleMap[userId] = {});
|
|
119
|
-
for (const client of bundle.clients) {
|
|
120
|
-
bundleMap[userId][client.client] = client.prekey;
|
|
121
|
-
}
|
|
122
|
-
return bundleMap;
|
|
123
|
-
}, {});
|
|
124
|
-
}
|
|
125
|
-
async getQualifiedRecipientsForConversation(conversationId, userIds) {
|
|
126
|
-
if ((0, TypePredicateUtil_1.isQualifiedUserClients)(userIds)) {
|
|
127
|
-
return userIds;
|
|
128
|
-
}
|
|
129
|
-
const recipientIds = userIds || (await this.getConversationQualifiedMembers(conversationId));
|
|
130
|
-
return this.getQualifiedPreKeyBundle(recipientIds);
|
|
131
|
-
}
|
|
132
|
-
async getRecipientsForConversation(conversationId, userIds) {
|
|
133
|
-
if ((0, TypePredicateUtil_1.isUserClients)(userIds)) {
|
|
134
|
-
return userIds;
|
|
135
|
-
}
|
|
136
|
-
return this.getPreKeyBundleMap(conversationId, userIds);
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Sends a message to a conversation
|
|
140
|
-
*
|
|
141
|
-
* @param sendingClientId The clientId from which the message is sent
|
|
142
|
-
* @param conversationId The conversation in which to send the message
|
|
143
|
-
* @param genericMessage The payload of the message to send
|
|
144
|
-
* @return Resolves with the message sending status from backend
|
|
145
|
-
*/
|
|
146
|
-
async sendGenericMessage(conversationId, sendingClientId, genericMessage, { userIds, nativePush, sendAsProtobuf, onClientMismatch, targetMode = ConversationService_types_1.MessageTargetMode.NONE, } = {}) {
|
|
147
|
-
const plainText = protocol_messaging_1.GenericMessage.encode(genericMessage).finish();
|
|
148
|
-
if (targetMode !== ConversationService_types_1.MessageTargetMode.NONE && !userIds) {
|
|
149
|
-
throw new Error('Cannot send targetted message when no userIds are given');
|
|
150
|
-
}
|
|
151
|
-
if (conversationId.domain && this.config.useQualifiedIds) {
|
|
152
|
-
if ((0, TypePredicateUtil_1.isStringArray)(userIds) || (0, TypePredicateUtil_1.isUserClients)(userIds)) {
|
|
153
|
-
throw new Error('Invalid userIds option for sending to federated backend');
|
|
154
|
-
}
|
|
155
|
-
const recipients = await this.getQualifiedRecipientsForConversation(conversationId, userIds);
|
|
156
|
-
let reportMissing;
|
|
157
|
-
if (targetMode === ConversationService_types_1.MessageTargetMode.NONE) {
|
|
158
|
-
reportMissing = (0, TypePredicateUtil_1.isQualifiedUserClients)(userIds); // we want to check mismatch in case the consumer gave an exact list of users/devices
|
|
159
|
-
}
|
|
160
|
-
else if (targetMode === ConversationService_types_1.MessageTargetMode.USERS) {
|
|
161
|
-
reportMissing = this.extractQualifiedUserIds(userIds);
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
// in case the message is fully targetted at user/client pairs, we do not want to report the missing clients or users at all
|
|
165
|
-
reportMissing = false;
|
|
166
|
-
}
|
|
167
|
-
return this.messageService.sendFederatedMessage(sendingClientId, recipients, plainText, {
|
|
168
|
-
conversationId,
|
|
169
|
-
nativePush,
|
|
170
|
-
reportMissing,
|
|
171
|
-
onClientMismatch: mismatch => onClientMismatch === null || onClientMismatch === void 0 ? void 0 : onClientMismatch(mismatch, false),
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
if ((0, TypePredicateUtil_1.isQualifiedIdArray)(userIds) || (0, TypePredicateUtil_1.isQualifiedUserClients)(userIds)) {
|
|
175
|
-
throw new Error('Invalid userIds option for sending');
|
|
176
|
-
}
|
|
177
|
-
const recipients = await this.getRecipientsForConversation(conversationId, userIds);
|
|
178
|
-
let reportMissing;
|
|
179
|
-
if (targetMode === ConversationService_types_1.MessageTargetMode.NONE) {
|
|
180
|
-
reportMissing = (0, TypePredicateUtil_1.isUserClients)(userIds); // we want to check mismatch in case the consumer gave an exact list of users/devices
|
|
181
|
-
}
|
|
182
|
-
else if (targetMode === ConversationService_types_1.MessageTargetMode.USERS) {
|
|
183
|
-
reportMissing = this.extractUserIds(userIds);
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
// in case the message is fully targetted at user/client pairs, we do not want to report the missing clients or users at all
|
|
187
|
-
reportMissing = false;
|
|
188
|
-
}
|
|
189
|
-
return this.messageService.sendMessage(sendingClientId, recipients, plainText, {
|
|
190
|
-
conversationId,
|
|
191
|
-
sendAsProtobuf,
|
|
192
|
-
nativePush,
|
|
193
|
-
reportMissing,
|
|
194
|
-
onClientMismatch: mistmatch => onClientMismatch === null || onClientMismatch === void 0 ? void 0 : onClientMismatch(mistmatch, false),
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
extractUserIds(userIds) {
|
|
198
|
-
if ((0, TypePredicateUtil_1.isUserClients)(userIds)) {
|
|
199
|
-
return Object.keys(userIds);
|
|
200
|
-
}
|
|
201
|
-
return userIds;
|
|
202
|
-
}
|
|
203
|
-
extractQualifiedUserIds(userIds) {
|
|
204
|
-
if ((0, TypePredicateUtil_1.isQualifiedUserClients)(userIds)) {
|
|
205
|
-
return Object.entries(userIds).reduce((ids, [domain, userClients]) => {
|
|
206
|
-
return ids.concat(Object.keys(userClients).map(userId => ({ domain, id: userId })));
|
|
207
|
-
}, []);
|
|
208
|
-
}
|
|
209
|
-
return userIds;
|
|
210
|
-
}
|
|
211
43
|
/**
|
|
212
44
|
* Get a fresh list from backend of clients for all the participants of the conversation.
|
|
213
45
|
* This is a hacky way of getting all the clients for a conversation.
|
|
@@ -250,7 +82,10 @@ class ConversationService {
|
|
|
250
82
|
* @param {string} conversationDomain? - If given will send the message to the new qualified endpoint
|
|
251
83
|
*/
|
|
252
84
|
async fetchAllParticipantsClients(conversationId, conversationDomain) {
|
|
253
|
-
const qualifiedMembers = await
|
|
85
|
+
const qualifiedMembers = await (0, proteus_1.getConversationQualifiedMembers)({
|
|
86
|
+
apiClient: this.apiClient,
|
|
87
|
+
conversationId: conversationDomain ? { id: conversationId, domain: conversationDomain } : conversationId,
|
|
88
|
+
});
|
|
254
89
|
const allClients = await this.apiClient.api.user.postListClients({ qualified_users: qualifiedMembers });
|
|
255
90
|
const qualifiedUserClients = {};
|
|
256
91
|
Object.entries(allClients.qualified_user_map).map(([domain, userClientMap]) => Object.entries(userClientMap).map(async ([userId, clients]) => {
|
|
@@ -302,26 +137,6 @@ class ConversationService {
|
|
|
302
137
|
async removeUserFromConversation(conversationId, userId) {
|
|
303
138
|
return this.apiClient.api.conversation.deleteMember(conversationId, userId);
|
|
304
139
|
}
|
|
305
|
-
async sendProteusMessage({ userIds, sendAsProtobuf, conversationId, nativePush, targetMode, payload, onClientMismatch, }) {
|
|
306
|
-
const response = await this.sendGenericMessage(conversationId, this.apiClient.validatedClientId, payload, {
|
|
307
|
-
userIds,
|
|
308
|
-
sendAsProtobuf,
|
|
309
|
-
nativePush,
|
|
310
|
-
targetMode,
|
|
311
|
-
onClientMismatch,
|
|
312
|
-
});
|
|
313
|
-
if (!response.errored) {
|
|
314
|
-
if (!this.isClearFromMismatch(response)) {
|
|
315
|
-
// We warn the consumer that there is a mismatch that did not prevent message sending
|
|
316
|
-
await (onClientMismatch === null || onClientMismatch === void 0 ? void 0 : onClientMismatch(response, true));
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
return {
|
|
320
|
-
id: payload.messageId,
|
|
321
|
-
sentAt: response.time,
|
|
322
|
-
state: response.errored ? conversation_2.PayloadBundleState.CANCELLED : conversation_2.PayloadBundleState.OUTGOING_SENT,
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
140
|
/**
|
|
326
141
|
* Sends a message to a conversation
|
|
327
142
|
* @return resolves with the sending status
|
|
@@ -330,7 +145,7 @@ class ConversationService {
|
|
|
330
145
|
function isMLS(params) {
|
|
331
146
|
return params.protocol === conversation_1.ConversationProtocol.MLS;
|
|
332
147
|
}
|
|
333
|
-
return (0, messageSender_1.sendMessage)(() =>
|
|
148
|
+
return (0, messageSender_1.sendMessage)(() => isMLS(params) ? this.sendMLSMessage(params) : this.proteusService.sendProteusMessage(params));
|
|
334
149
|
}
|
|
335
150
|
sendTypingStart(conversationId) {
|
|
336
151
|
return this.apiClient.api.conversation.postTyping(conversationId, { status: data_1.CONVERSATION_TYPING.STARTED });
|
|
@@ -363,13 +178,6 @@ class ConversationService {
|
|
|
363
178
|
conversation_role: conversationRole,
|
|
364
179
|
});
|
|
365
180
|
}
|
|
366
|
-
isClearFromMismatch(mismatch) {
|
|
367
|
-
const hasMissing = Object.keys(mismatch.missing || {}).length > 0;
|
|
368
|
-
const hasDeleted = Object.keys(mismatch.deleted || {}).length > 0;
|
|
369
|
-
const hasRedundant = Object.keys(mismatch.redundant || {}).length > 0;
|
|
370
|
-
const hasFailed = Object.keys(mismatch.failed_to_send || {}).length > 0;
|
|
371
|
-
return !hasMissing && !hasDeleted && !hasRedundant && !hasFailed;
|
|
372
|
-
}
|
|
373
181
|
/**
|
|
374
182
|
* ###############################################
|
|
375
183
|
* ################ MLS Functions ################
|
|
@@ -2,6 +2,7 @@ import { QualifiedUserClients, ClientMismatch, ConversationProtocol, MessageSend
|
|
|
2
2
|
import { MlsEvent } from '@wireapp/api-client/lib/conversation/data/MlsEventData';
|
|
3
3
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
4
4
|
import { GenericMessage } from '@wireapp/protocol-messaging';
|
|
5
|
+
import { PayloadBundleState } from '..';
|
|
5
6
|
export declare enum MessageTargetMode {
|
|
6
7
|
NONE = 0,
|
|
7
8
|
USERS = 1,
|
|
@@ -59,19 +60,6 @@ export declare type ProtocolParam = {
|
|
|
59
60
|
export declare type SendCommonParams = ProtocolParam & {
|
|
60
61
|
payload: GenericMessage;
|
|
61
62
|
};
|
|
62
|
-
export declare type SendProteusMessageParams = SendCommonParams & MessageSendingOptions & {
|
|
63
|
-
conversationId: QualifiedId;
|
|
64
|
-
/**
|
|
65
|
-
* Can be either a QualifiedId[], string[], UserClients or QualfiedUserClients. The type has some effect on the behavior of the method. (Needed only for Proteus)
|
|
66
|
-
* When given a QualifiedId[] or string[] the method will fetch the freshest list of devices for those users (since they are not given by the consumer). As a consequence no ClientMismatch error will trigger and we will ignore missing clients when sending
|
|
67
|
-
* When given a QualifiedUserClients or UserClients the method will only send to the clients listed in the userIds. This could lead to ClientMismatch (since the given list of devices might not be the freshest one and new clients could have been created)
|
|
68
|
-
* When given a QualifiedId[] or QualifiedUserClients the method will send the message through the federated API endpoint
|
|
69
|
-
* When given a string[] or UserClients the method will send the message through the old API endpoint
|
|
70
|
-
*/
|
|
71
|
-
userIds?: string[] | QualifiedId[] | UserClients | QualifiedUserClients;
|
|
72
|
-
onClientMismatch?: (status: ClientMismatch | MessageSendingStatus, wasSent: boolean) => void | boolean | Promise<boolean>;
|
|
73
|
-
protocol: ConversationProtocol.PROTEUS;
|
|
74
|
-
};
|
|
75
63
|
export declare type SendMlsMessageParams = SendCommonParams & {
|
|
76
64
|
/**
|
|
77
65
|
* The groupId of the conversation to send the message to (Needed only for MLS)
|
|
@@ -96,4 +84,12 @@ export declare type MLSReturnType = {
|
|
|
96
84
|
events: MlsEvent[];
|
|
97
85
|
conversation: Conversation;
|
|
98
86
|
};
|
|
87
|
+
export declare type SendResult = {
|
|
88
|
+
/** The id of the message sent */
|
|
89
|
+
id: string;
|
|
90
|
+
/** the ISO formatted date at which the message was received by the backend */
|
|
91
|
+
sentAt: string;
|
|
92
|
+
/** The sending state of the payload (has the payload been succesfully sent or canceled) */
|
|
93
|
+
state: PayloadBundleState;
|
|
94
|
+
};
|
|
99
95
|
//# sourceMappingURL=ConversationService.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.types.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,wDAAwD,CAAC;AAChF,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAE3D,oBAAY,iBAAiB;IAC3B,IAAI,IAAA;IACJ,KAAK,IAAA;IACL,aAAa,IAAA;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,WAAW,GAAG,oBAAoB,CAAC;IAExE;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,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,CACjB,MAAM,EAAE,cAAc,GAAG,oBAAoB,EAC7C,OAAO,EAAE,OAAO,KACb,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxC;AAED;;;;GAIG;AAEH;;GAEG;AACH,oBAAY,aAAa,GAAG;IAC1B,QAAQ,EAAE,oBAAoB,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,oBAAY,gBAAgB,GAAG,aAAa,GAAG;IAC7C,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConversationService.types.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,wDAAwD,CAAC;AAChF,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAC,kBAAkB,EAAC,MAAM,IAAI,CAAC;AAEtC,oBAAY,iBAAiB;IAC3B,IAAI,IAAA;IACJ,KAAK,IAAA;IACL,aAAa,IAAA;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,WAAW,GAAG,oBAAoB,CAAC;IAExE;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,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,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/api-client/lib/APIClient';
|
|
2
|
+
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
3
|
+
interface Params {
|
|
4
|
+
apiClient: APIClient;
|
|
5
|
+
conversationId: string | QualifiedId;
|
|
6
|
+
}
|
|
7
|
+
declare const getConversationQualifiedMembers: ({ apiClient, conversationId }: Params) => Promise<QualifiedId[]>;
|
|
8
|
+
export { getConversationQualifiedMembers };
|
|
9
|
+
//# sourceMappingURL=getConversationQualifiedMembers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getConversationQualifiedMembers.d.ts","sourceRoot":"","sources":["../../../../src/conversation/ConversationService/Utility/getConversationQualifiedMembers.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,UAAU,MAAM;IACd,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,MAAM,GAAG,WAAW,CAAC;CACtC;AACD,QAAA,MAAM,+BAA+B,kCAAuC,MAAM,KAAG,QAAQ,WAAW,EAAE,CAWzG,CAAC;AAEF,OAAO,EAAC,+BAA+B,EAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2022 Wire Swiss GmbH
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This program is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.getConversationQualifiedMembers = void 0;
|
|
22
|
+
const getConversationQualifiedMembers = async ({ apiClient, conversationId }) => {
|
|
23
|
+
const conversation = await apiClient.api.conversation.getConversation(conversationId);
|
|
24
|
+
/*
|
|
25
|
+
* If you are sending a message to a conversation, you have to include
|
|
26
|
+
* yourself in the list of users if you want to sync a message also to your
|
|
27
|
+
* other clients.
|
|
28
|
+
*/
|
|
29
|
+
return conversation.members.others
|
|
30
|
+
.filter(member => !!member.qualified_id)
|
|
31
|
+
.map(member => member.qualified_id)
|
|
32
|
+
.concat(conversation.members.self.qualified_id);
|
|
33
|
+
};
|
|
34
|
+
exports.getConversationQualifiedMembers = getConversationQualifiedMembers;
|
package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/ConversationEvent.d.ts
RENAMED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConversationEvent.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/ConversationEvent.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,IAAI,CAAC;AAI1D,QAAA,MAAM,uBAAuB,WAAkB,kBAAkB,uBAQhE,CAAC;AAEF,OAAO,EAAC,uBAAuB,EAAC,CAAC"}
|
package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/ConversationEvent.js
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/events/index.ts"],"names":[],"mappings":"AAmBA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
|
|
File without changes
|
|
File without changes
|
package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/index.ts"],"names":[],"mappings":"AAmBA,cAAc,cAAc,CAAC"}
|
package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/messageAdd/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageAdd.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,8BAA8B,EAAqB,MAAM,+BAA+B,CAAC;AAE/G,OAAO,OAAO,MAAM,SAAS,CAAC;AAK9B,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAEnF,QAAA,MAAM,oBAAoB,UAAW,YAAY,4CACE,CAAC;AAEpD,UAAU,yBAA0B,SAAQ,kBAAkB;IAC5D,KAAK,EAAE,8BAA8B,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;CACxB;AACD,QAAA,MAAM,mBAAmB,kCAAuC,yBAAyB,uBAgDxF,CAAC;AAEF,OAAO,EAAC,oBAAoB,EAAE,mBAAmB,EAAC,CAAC"}
|