@wireapp/core 37.0.0 → 37.0.2

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.
Files changed (64) hide show
  1. package/lib/Account.d.ts.map +1 -1
  2. package/lib/Account.js +1 -1
  3. package/lib/cryptography/CryptographyService.d.ts +0 -5
  4. package/lib/cryptography/CryptographyService.d.ts.map +1 -1
  5. package/lib/cryptography/CryptographyService.js +2 -26
  6. package/lib/cryptography/Utlility/generateDecryptionError.d.ts +6 -0
  7. package/lib/cryptography/Utlility/generateDecryptionError.d.ts.map +1 -0
  8. package/lib/cryptography/Utlility/generateDecryptionError.js +50 -0
  9. package/lib/errors/DecryptionError.d.ts +6 -0
  10. package/lib/errors/DecryptionError.d.ts.map +1 -0
  11. package/lib/errors/DecryptionError.js +29 -0
  12. package/lib/messagingProtocols/common.types.d.ts +3 -0
  13. package/lib/messagingProtocols/common.types.d.ts.map +1 -0
  14. package/lib/messagingProtocols/common.types.js +20 -0
  15. package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/ConversationEvent.d.ts +2 -1
  16. package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/ConversationEvent.d.ts.map +1 -1
  17. package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.d.ts +2 -1
  18. package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.d.ts.map +1 -1
  19. package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.d.ts +2 -1
  20. package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.d.ts.map +1 -1
  21. package/lib/messagingProtocols/mls/EventHandler/EventHandler.d.ts +2 -1
  22. package/lib/messagingProtocols/mls/EventHandler/EventHandler.d.ts.map +1 -1
  23. package/lib/messagingProtocols/mls/EventHandler/EventHandler.types.d.ts +0 -2
  24. package/lib/messagingProtocols/mls/EventHandler/EventHandler.types.d.ts.map +1 -1
  25. package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +3 -2
  26. package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
  27. package/lib/messagingProtocols/mls/MLSService/MLSService.js +1 -1
  28. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/ConversationEvent.d.ts +5 -0
  29. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/ConversationEvent.d.ts.map +1 -0
  30. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/ConversationEvent.js +29 -0
  31. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/index.d.ts +2 -0
  32. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/index.d.ts.map +1 -0
  33. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/index.js +35 -0
  34. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/index.d.ts +2 -0
  35. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/index.d.ts.map +1 -0
  36. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/index.js +35 -0
  37. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/otrMessageAdd.d.ts +10 -0
  38. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/otrMessageAdd.d.ts.map +1 -0
  39. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/otrMessageAdd.js +47 -0
  40. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/index.d.ts +2 -0
  41. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/index.d.ts.map +1 -0
  42. package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/index.js +35 -0
  43. package/lib/messagingProtocols/proteus/EventHandler/EventHandler.d.ts +5 -0
  44. package/lib/messagingProtocols/proteus/EventHandler/EventHandler.d.ts.map +1 -0
  45. package/lib/messagingProtocols/proteus/EventHandler/EventHandler.js +24 -0
  46. package/lib/messagingProtocols/proteus/EventHandler/EventHandler.types.d.ts +11 -0
  47. package/lib/messagingProtocols/proteus/EventHandler/EventHandler.types.d.ts.map +1 -0
  48. package/lib/messagingProtocols/proteus/EventHandler/EventHandler.types.js +23 -0
  49. package/lib/messagingProtocols/proteus/EventHandler/index.d.ts +3 -0
  50. package/lib/messagingProtocols/proteus/EventHandler/index.d.ts.map +1 -0
  51. package/lib/messagingProtocols/proteus/EventHandler/index.js +36 -0
  52. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts +3 -1
  53. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts.map +1 -1
  54. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.js +5 -7
  55. package/lib/messagingProtocols/proteus/ProteusService/Utility/index.d.ts +1 -0
  56. package/lib/messagingProtocols/proteus/ProteusService/Utility/index.d.ts.map +1 -1
  57. package/lib/messagingProtocols/proteus/ProteusService/Utility/index.js +1 -0
  58. package/lib/messagingProtocols/proteus/ProteusService/Utility/isClearFromMismatch.d.ts +4 -0
  59. package/lib/messagingProtocols/proteus/ProteusService/Utility/isClearFromMismatch.d.ts.map +1 -0
  60. package/lib/messagingProtocols/proteus/ProteusService/Utility/isClearFromMismatch.js +29 -0
  61. package/lib/notification/NotificationService.d.ts +5 -7
  62. package/lib/notification/NotificationService.d.ts.map +1 -1
  63. package/lib/notification/NotificationService.js +13 -24
  64. package/package.json +2 -2
@@ -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,CA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,CAAC,YAAY,EAAE,YAAY;IAInC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA0D7C,0BAA0B,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAiB9E,eAAe;YA2Cf,cAAc;IA4B5B,OAAO,CAAC,YAAY;IAKpB;;;OAGG;IACU,MAAM,CAAC,SAAS,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAS9D;;;;;;OAMG;IACI,MAAM,CAAC,EACZ,OAAkB,EAClB,wBAAmC,EACnC,4BAAuC,EACvC,qBAAgC,EAChC,MAAc,GACf,GAAE;QACD;;;;WAIG;QACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;QAE9E;;WAEG;QACH,4BAA4B,CAAC,EAAE,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,EAAE;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,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
@@ -308,7 +308,7 @@ class Account extends events_1.EventEmitter {
308
308
  const connectionService = new connection_1.ConnectionService(this.apiClient);
309
309
  const giphyService = new giphy_1.GiphyService(this.apiClient);
310
310
  const linkPreviewService = new linkPreview_1.LinkPreviewService(assetService);
311
- const notificationService = new notification_1.NotificationService(this.apiClient, cryptographyService, mlsService, this.storeEngine);
311
+ const notificationService = new notification_1.NotificationService(this.apiClient, mlsService, proteusService, this.storeEngine);
312
312
  const conversationService = new conversation_1.ConversationService(this.apiClient, cryptographyService, {
313
313
  // We can use qualified ids to send messages as long as the backend supports federated endpoints
314
314
  useQualifiedIds: this.backendFeatures.federationEndpoints,
@@ -8,10 +8,6 @@ import { Cryptobox } from '@wireapp/cryptobox';
8
8
  import { GenericMessage } from '@wireapp/protocol-messaging';
9
9
  import { CRUDEngine } from '@wireapp/store-engine';
10
10
  import { PayloadBundle, PayloadBundleSource } from '../conversation';
11
- export declare type DecryptionError = {
12
- code: number;
13
- message: string;
14
- };
15
11
  export declare type SessionId = {
16
12
  userId: string;
17
13
  clientId: string;
@@ -79,6 +75,5 @@ export declare class CryptographyService {
79
75
  resetSession(sessionId: string): Promise<void>;
80
76
  decryptMessage(otrMessage: ConversationOtrMessageAddEvent): Promise<GenericMessage>;
81
77
  mapGenericMessage(otrMessage: ConversationOtrMessageAddEvent, genericMessage: GenericMessage, source: PayloadBundleSource): PayloadBundle;
82
- private generateDecryptionError;
83
78
  }
84
79
  //# sourceMappingURL=CryptographyService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CryptographyService.d.ts","sourceRoot":"","sources":["../../src/cryptography/CryptographyService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAEL,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAC,8BAA8B,EAAC,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAC,WAAW,EAAE,4BAA4B,EAAE,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;AAI7G,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAmB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CAAC,UAAU,CAAC;IAMpE,gBAAgB,CAC3B,SAAS,EAAE,UAAU,EACrB,aAAa,EAAE,4BAA4B,GAAG,oBAAoB,GACjE,OAAO,CAAC;QAAC,OAAO,EAAE,oBAAoB,CAAC;QAAC,SAAS,EAAE,sBAAsB,CAAA;KAAC,CAAC;IAgBjE,OAAO,CAClB,SAAS,EAAE,UAAU,EACrB,KAAK,EAAE,mBAAmB,GAAG,WAAW,EACxC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC;QAAC,OAAO,EAAE,WAAW,CAAC;QAAC,SAAS,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;KAAC,CAAC;YA2B1D,wBAAwB;IA4BzB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3C;;OAEG;IACI,mBAAmB,IAAI,MAAM;IAIpC;;;;;;OAMG;IACU,oBAAoB,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YAK5F,kBAAkB;IAehC,OAAO,CAAC,aAAa;IAId,wBAAwB,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAIxC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9C,cAAc,CAAC,UAAU,EAAE,8BAA8B,GAAG,OAAO,CAAC,cAAc,CAAC;IAgBzF,iBAAiB,CACtB,UAAU,EAAE,8BAA8B,EAC1C,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,mBAAmB,GAC1B,aAAa;CAajB"}
@@ -29,6 +29,7 @@ const proteus_1 = require("@wireapp/proteus");
29
29
  const protocol_messaging_1 = require("@wireapp/protocol-messaging");
30
30
  const CryptographyDatabaseRepository_1 = require("./CryptographyDatabaseRepository");
31
31
  const GenericMessageMapper_1 = require("./GenericMessageMapper");
32
+ const generateDecryptionError_1 = require("./Utlility/generateDecryptionError");
32
33
  const conversation_1 = require("../conversation");
33
34
  const util_1 = require("../util");
34
35
  class CryptographyService {
@@ -216,7 +217,7 @@ class CryptographyService {
216
217
  return protocol_messaging_1.GenericMessage.decode(decryptedMessage);
217
218
  }
218
219
  catch (error) {
219
- throw this.generateDecryptionError(otrMessage, error);
220
+ throw (0, generateDecryptionError_1.generateDecryptionError)(otrMessage, error, this.logger);
220
221
  }
221
222
  }
222
223
  mapGenericMessage(otrMessage, genericMessage, source) {
@@ -232,30 +233,5 @@ class CryptographyService {
232
233
  }
233
234
  return GenericMessageMapper_1.GenericMessageMapper.mapGenericMessage(genericMessage, otrMessage, source);
234
235
  }
235
- generateDecryptionError(event, error) {
236
- var _a;
237
- const errorCode = (_a = error.code) !== null && _a !== void 0 ? _a : 999;
238
- let message = 'Unknown decryption error';
239
- const { data: eventData, from: remoteUserId, time: formattedTime } = event;
240
- const remoteClientId = eventData.sender;
241
- const isDuplicateMessage = error instanceof proteus_1.errors.DecryptError.DuplicateMessage;
242
- const isOutdatedMessage = error instanceof proteus_1.errors.DecryptError.OutdatedMessage;
243
- // We don't need to show these message errors to the user
244
- if (isDuplicateMessage || isOutdatedMessage) {
245
- message = `Message from user ID "${remoteUserId}" at "${formattedTime}" will not be handled because it is outdated or a duplicate.`;
246
- }
247
- const isInvalidMessage = error instanceof proteus_1.errors.DecryptError.InvalidMessage;
248
- const isInvalidSignature = error instanceof proteus_1.errors.DecryptError.InvalidSignature;
249
- const isRemoteIdentityChanged = error instanceof proteus_1.errors.DecryptError.RemoteIdentityChanged;
250
- // Session is broken, let's see what's really causing it...
251
- if (isInvalidMessage || isInvalidSignature) {
252
- message = `Session with user '${remoteUserId}' (${remoteClientId}) is broken.\nReset the session for possible fix.`;
253
- }
254
- else if (isRemoteIdentityChanged) {
255
- message = `Remote identity of client '${remoteClientId}' from user '${remoteUserId}' changed`;
256
- }
257
- this.logger.warn(`Failed to decrypt event from client '${remoteClientId}' of user '${remoteUserId}' (${formattedTime}).\nError Code: '${errorCode}'\nError Message: ${error.message}`, error);
258
- return { code: errorCode, message };
259
- }
260
236
  }
261
237
  exports.CryptographyService = CryptographyService;
@@ -0,0 +1,6 @@
1
+ import { ConversationOtrMessageAddEvent } from '@wireapp/api-client/lib/event';
2
+ import logdown from 'logdown';
3
+ import { DecryptionError } from '../../errors/DecryptionError';
4
+ declare const generateDecryptionError: (event: ConversationOtrMessageAddEvent, error: any, logger: logdown.Logger) => DecryptionError;
5
+ export { generateDecryptionError };
6
+ //# sourceMappingURL=generateDecryptionError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateDecryptionError.d.ts","sourceRoot":"","sources":["../../../src/cryptography/Utlility/generateDecryptionError.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,8BAA8B,EAAC,MAAM,+BAA+B,CAAC;AAC7E,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAK7D,QAAA,MAAM,uBAAuB,UACpB,8BAA8B,SAC9B,GAAG,UACF,QAAQ,MAAM,KACrB,eA6BF,CAAC;AAEF,OAAO,EAAC,uBAAuB,EAAC,CAAC"}
@@ -0,0 +1,50 @@
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.generateDecryptionError = void 0;
22
+ const proteus_1 = require("@wireapp/proteus");
23
+ const DecryptionError_1 = require("../../errors/DecryptionError");
24
+ const hasErrorCode = (error) => error && error.code;
25
+ const generateDecryptionError = (event, error, logger) => {
26
+ var _a;
27
+ const errorCode = hasErrorCode(error) ? (_a = error.code) !== null && _a !== void 0 ? _a : 999 : 999;
28
+ let message = 'Unknown decryption error';
29
+ const { data: eventData, from: remoteUserId, time: formattedTime } = event;
30
+ const remoteClientId = eventData.sender;
31
+ const isDuplicateMessage = error instanceof proteus_1.errors.DecryptError.DuplicateMessage;
32
+ const isOutdatedMessage = error instanceof proteus_1.errors.DecryptError.OutdatedMessage;
33
+ // We don't need to show these message errors to the user
34
+ if (isDuplicateMessage || isOutdatedMessage) {
35
+ message = `Message from user ID "${remoteUserId}" at "${formattedTime}" will not be handled because it is outdated or a duplicate.`;
36
+ }
37
+ const isInvalidMessage = error instanceof proteus_1.errors.DecryptError.InvalidMessage;
38
+ const isInvalidSignature = error instanceof proteus_1.errors.DecryptError.InvalidSignature;
39
+ const isRemoteIdentityChanged = error instanceof proteus_1.errors.DecryptError.RemoteIdentityChanged;
40
+ // Session is broken, let's see what's really causing it...
41
+ if (isInvalidMessage || isInvalidSignature) {
42
+ message = `Session with user '${remoteUserId}' (${remoteClientId}) is broken.\nReset the session for possible fix.`;
43
+ }
44
+ else if (isRemoteIdentityChanged) {
45
+ message = `Remote identity of client '${remoteClientId}' from user '${remoteUserId}' changed`;
46
+ }
47
+ logger.warn(`Failed to decrypt event from client '${remoteClientId}' of user '${remoteUserId}' (${formattedTime}).\nError Code: '${errorCode}'\nError Message: ${error.message}`, error);
48
+ return new DecryptionError_1.DecryptionError(message, errorCode);
49
+ };
50
+ exports.generateDecryptionError = generateDecryptionError;
@@ -0,0 +1,6 @@
1
+ export declare class DecryptionError extends Error {
2
+ message: string;
3
+ code?: number;
4
+ constructor(message: string, code?: number);
5
+ }
6
+ //# sourceMappingURL=DecryptionError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecryptionError.d.ts","sourceRoot":"","sources":["../../src/errors/DecryptionError.ts"],"names":[],"mappings":"AAmBA,qBAAa,eAAgB,SAAQ,KAAK;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;gBACF,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAK3C"}
@@ -0,0 +1,29 @@
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.DecryptionError = void 0;
22
+ class DecryptionError extends Error {
23
+ constructor(message, code) {
24
+ super(message);
25
+ this.message = message;
26
+ this.code = code;
27
+ }
28
+ }
29
+ exports.DecryptionError = DecryptionError;
@@ -0,0 +1,3 @@
1
+ import { HandledEventPayload } from '../notification';
2
+ export declare type EventHandlerResult = Promise<HandledEventPayload | void>;
3
+ //# sourceMappingURL=common.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.types.d.ts","sourceRoot":"","sources":["../../src/messagingProtocols/common.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAEpD,oBAAY,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC"}
@@ -0,0 +1,20 @@
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 });
@@ -1,4 +1,5 @@
1
- import { EventHandlerParams, EventHandlerResult } from '..';
1
+ import { EventHandlerParams } from '..';
2
+ import { EventHandlerResult } from '../../../common.types';
2
3
  declare const handleConversationEvent: (params: EventHandlerParams) => EventHandlerResult;
3
4
  export { handleConversationEvent };
4
5
  //# sourceMappingURL=ConversationEvent.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"ConversationEvent.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/ConversationEvent.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,IAAI,CAAC;AACtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAIzD,QAAA,MAAM,uBAAuB,WAAkB,kBAAkB,uBAQhE,CAAC;AAEF,OAAO,EAAC,uBAAuB,EAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { BackendEvent, ConversationMLSMessageAddEvent } from '@wireapp/api-client/lib/event';
2
2
  import logdown from 'logdown';
3
- import { EventHandlerParams, EventHandlerResult } from '../../../EventHandler.types';
3
+ import { EventHandlerResult } from '../../../../../common.types';
4
+ import { EventHandlerParams } from '../../../EventHandler.types';
4
5
  declare const isMLSMessageAddEvent: (event: BackendEvent) => event is ConversationMLSMessageAddEvent;
5
6
  interface HandleMLSMessageAddParams extends EventHandlerParams {
6
7
  event: ConversationMLSMessageAddEvent;
@@ -1 +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"}
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;AAI9B,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,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"}
@@ -1,5 +1,6 @@
1
1
  import { BackendEvent, ConversationMLSWelcomeEvent } from '@wireapp/api-client/lib/event';
2
- import { EventHandlerParams, EventHandlerResult } from '../../../EventHandler.types';
2
+ import { EventHandlerResult } from '../../../../../common.types';
3
+ import { EventHandlerParams } from '../../../EventHandler.types';
3
4
  declare const isWelcomeMessageEvent: (event: BackendEvent) => event is ConversationMLSWelcomeEvent;
4
5
  interface HandleWelcomeMessageParams extends EventHandlerParams {
5
6
  event: ConversationMLSWelcomeEvent;
@@ -1 +1 @@
1
- {"version":3,"file":"welcomeMessage.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,2BAA2B,EAAqB,MAAM,+BAA+B,CAAC;AAG5G,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAEnF,QAAA,MAAM,qBAAqB,UAAW,YAAY,yCACK,CAAC;AAExD,UAAU,0BAA2B,SAAQ,kBAAkB;IAC7D,KAAK,EAAE,2BAA2B,CAAC;CACpC;AACD,QAAA,MAAM,oBAAoB,0BAA+B,0BAA0B,uBASlF,CAAC;AAEF,OAAO,EAAC,qBAAqB,EAAE,oBAAoB,EAAC,CAAC"}
1
+ {"version":3,"file":"welcomeMessage.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,2BAA2B,EAAqB,MAAM,+BAA+B,CAAC;AAG5G,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,QAAA,MAAM,qBAAqB,UAAW,YAAY,yCACK,CAAC;AAExD,UAAU,0BAA2B,SAAQ,kBAAkB;IAC7D,KAAK,EAAE,2BAA2B,CAAC;CACpC;AACD,QAAA,MAAM,oBAAoB,0BAA+B,0BAA0B,uBASlF,CAAC;AAEF,OAAO,EAAC,qBAAqB,EAAE,oBAAoB,EAAC,CAAC"}
@@ -1,4 +1,5 @@
1
- import { EventHandlerResult, EventHandlerParams } from './EventHandler.types';
1
+ import { EventHandlerParams } from './EventHandler.types';
2
+ import { EventHandlerResult } from '../../common.types';
2
3
  declare const handleBackendEvent: (params: EventHandlerParams) => EventHandlerResult;
3
4
  export { handleBackendEvent };
4
5
  //# sourceMappingURL=EventHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EventHandler.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/EventHandler/EventHandler.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAE5E,QAAA,MAAM,kBAAkB,WAAkB,kBAAkB,uBAAwD,CAAC;AAErH,OAAO,EAAC,kBAAkB,EAAC,CAAC"}
1
+ {"version":3,"file":"EventHandler.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/EventHandler/EventHandler.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAEtD,QAAA,MAAM,kBAAkB,WAAkB,kBAAkB,uBAAwD,CAAC;AAErH,OAAO,EAAC,kBAAkB,EAAC,CAAC"}
@@ -1,9 +1,7 @@
1
1
  import { BackendEvent } from '@wireapp/api-client/lib/event';
2
2
  import { PayloadBundleSource } from '../../../conversation';
3
- import { HandledEventPayload } from '../../../notification';
4
3
  import { MLSService } from '../MLSService/MLSService';
5
4
  export { BackendEvent, PayloadBundleSource };
6
- export declare type EventHandlerResult = Promise<HandledEventPayload | void>;
7
5
  export declare type EventHandlerParams = {
8
6
  mlsService: MLSService;
9
7
  event: BackendEvent;
@@ -1 +1 @@
1
- {"version":3,"file":"EventHandler.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/EventHandler/EventHandler.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAC,CAAC;AAC3C,oBAAY,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;AACrE,oBAAY,kBAAkB,GAAG;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC"}
1
+ {"version":3,"file":"EventHandler.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/EventHandler/EventHandler.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAC,CAAC;AAE3C,oBAAY,kBAAkB,GAAG;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC"}
@@ -5,7 +5,8 @@ import { APIClient } from '@wireapp/api-client';
5
5
  import { AddProposalArgs, ConversationConfiguration, ConversationId, CoreCrypto, DecryptedMessage, ExternalProposalArgs, ExternalProposalType, ExternalRemoveProposalArgs, Invitee, ProposalArgs, ProposalType, RemoveProposalArgs } from '@wireapp/core-crypto';
6
6
  import { MLSServiceConfig } from './MLSService.types';
7
7
  import { QualifiedUsers } from '../../../conversation';
8
- import { EventHandlerParams, EventHandlerResult } from '../EventHandler';
8
+ import { EventHandlerResult } from '../../common.types';
9
+ import { EventHandlerParams } from '../EventHandler';
9
10
  import { CommitPendingProposalsParams, HandlePendingProposalsParams, MLSCallbacks } from '../types';
10
11
  export declare const optionalToUint8Array: (array: Uint8Array | []) => Uint8Array;
11
12
  export declare class MLSService {
@@ -82,7 +83,7 @@ export declare class MLSService {
82
83
  uploadMLSPublicKeys(publicKey: Uint8Array, clientId: string): Promise<void>;
83
84
  uploadMLSKeyPackages(keypackages: Uint8Array[], clientId: string): Promise<void>;
84
85
  wipeConversation(conversationId: ConversationId): Promise<void>;
85
- handleMLSEvent(params: Omit<EventHandlerParams, 'mlsService'>): EventHandlerResult;
86
+ handleEvent(params: Omit<EventHandlerParams, 'mlsService'>): EventHandlerResult;
86
87
  /**
87
88
  * If there is a matching conversationId => groupId pair in the database,
88
89
  * we can find the groupId and return it as a string
@@ -1 +1 @@
1
- {"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,sBAAsB,EAAC,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAGzD,OAAO,OAAO,MAAM,SAAS,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,EAAE,SAAS,EAAC,EAAE,4BAA4B;IAoBjG;;;;;OAKG;IACU,sBAAsB,CAAC,EAAC,OAAO,EAAE,UAAkB,EAAC,EAAE,4BAA4B;IAa/F;;;;OAIG;IACU,6BAA6B;CAgB3C"}
@@ -311,7 +311,7 @@ class MLSService {
311
311
  async wipeConversation(conversationId) {
312
312
  return this.coreCryptoClient.wipeConversation(conversationId);
313
313
  }
314
- async handleMLSEvent(params) {
314
+ async handleEvent(params) {
315
315
  return (0, EventHandler_1.handleBackendEvent)(Object.assign(Object.assign({}, params), { mlsService: this }));
316
316
  }
317
317
  /**
@@ -0,0 +1,5 @@
1
+ import { EventHandlerParams } from '..';
2
+ import { EventHandlerResult } from '../../../common.types';
3
+ declare const handleConversationEvent: (params: EventHandlerParams) => EventHandlerResult;
4
+ export { handleConversationEvent };
5
+ //# sourceMappingURL=ConversationEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConversationEvent.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/EventHandler/ConversationEvent/ConversationEvent.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,IAAI,CAAC;AACtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAEzD,QAAA,MAAM,uBAAuB,WAAkB,kBAAkB,uBAKhE,CAAC;AAEF,OAAO,EAAC,uBAAuB,EAAC,CAAC"}
@@ -0,0 +1,29 @@
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.handleConversationEvent = void 0;
22
+ const events_1 = require("./events");
23
+ const handleConversationEvent = async (params) => {
24
+ const { event } = params;
25
+ if ((0, events_1.isOtrMessageAddEvent)(event)) {
26
+ return (0, events_1.handleOtrMessageAdd)(Object.assign(Object.assign({}, params), { event }));
27
+ }
28
+ };
29
+ exports.handleConversationEvent = handleConversationEvent;
@@ -0,0 +1,2 @@
1
+ export * from './otrMessageAdd';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/proteus/EventHandler/ConversationEvent/events/index.ts"],"names":[],"mappings":"AAmBA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,35 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
+ desc = { enumerable: true, get: function() { return m[k]; } };
25
+ }
26
+ Object.defineProperty(o, k2, desc);
27
+ }) : (function(o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ }));
31
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ __exportStar(require("./otrMessageAdd"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './otrMessageAdd';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/index.ts"],"names":[],"mappings":"AAmBA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,35 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
+ desc = { enumerable: true, get: function() { return m[k]; } };
25
+ }
26
+ Object.defineProperty(o, k2, desc);
27
+ }) : (function(o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ }));
31
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ __exportStar(require("./otrMessageAdd"), exports);
@@ -0,0 +1,10 @@
1
+ import { BackendEvent, ConversationOtrMessageAddEvent } from '@wireapp/api-client/lib/event';
2
+ import { EventHandlerResult } from '../../../../../common.types';
3
+ import { EventHandlerParams } from '../../../EventHandler.types';
4
+ declare const isOtrMessageAddEvent: (event: BackendEvent) => event is ConversationOtrMessageAddEvent;
5
+ declare type HandleOtrMessageAddParams = Omit<EventHandlerParams, 'event'> & {
6
+ event: ConversationOtrMessageAddEvent;
7
+ };
8
+ declare const handleOtrMessageAdd: ({ cryptographyService, event, source, dryRun, }: HandleOtrMessageAddParams) => EventHandlerResult;
9
+ export { isOtrMessageAddEvent, handleOtrMessageAdd };
10
+ //# sourceMappingURL=otrMessageAdd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otrMessageAdd.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/otrMessageAdd.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,8BAA8B,EAAqB,MAAM,+BAA+B,CAAC;AAG/G,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,QAAA,MAAM,oBAAoB,UAAW,YAAY,4CACE,CAAC;AAEpD,aAAK,yBAAyB,GAAG,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,GAAG;IACnE,KAAK,EAAE,8BAA8B,CAAC;CACvC,CAAC;AACF,QAAA,MAAM,mBAAmB,oDAKtB,yBAAyB,uBAmB3B,CAAC;AAEF,OAAO,EAAC,oBAAoB,EAAE,mBAAmB,EAAC,CAAC"}
@@ -0,0 +1,47 @@
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.handleOtrMessageAdd = exports.isOtrMessageAddEvent = void 0;
22
+ const event_1 = require("@wireapp/api-client/lib/event");
23
+ const DecryptionError_1 = require("../../../../../../errors/DecryptionError");
24
+ const isOtrMessageAddEvent = (event) => event.type === event_1.CONVERSATION_EVENT.OTR_MESSAGE_ADD;
25
+ exports.isOtrMessageAddEvent = isOtrMessageAddEvent;
26
+ const handleOtrMessageAdd = async ({ cryptographyService, event, source, dryRun = false, }) => {
27
+ if (dryRun) {
28
+ // In case of a dry run, we do not want to decrypt messages
29
+ // We just return the raw event to the caller
30
+ return { event };
31
+ }
32
+ try {
33
+ const decryptedData = await cryptographyService.decryptMessage(event);
34
+ return {
35
+ mappedEvent: cryptographyService.mapGenericMessage(event, decryptedData, source),
36
+ event,
37
+ decryptedData,
38
+ };
39
+ }
40
+ catch (error) {
41
+ if (error instanceof DecryptionError_1.DecryptionError) {
42
+ return { event, decryptionError: error };
43
+ }
44
+ return { event, decryptionError: error };
45
+ }
46
+ };
47
+ exports.handleOtrMessageAdd = handleOtrMessageAdd;
@@ -0,0 +1,2 @@
1
+ export * from './ConversationEvent';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/EventHandler/ConversationEvent/index.ts"],"names":[],"mappings":"AAmBA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,35 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
+ desc = { enumerable: true, get: function() { return m[k]; } };
25
+ }
26
+ Object.defineProperty(o, k2, desc);
27
+ }) : (function(o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ }));
31
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ __exportStar(require("./ConversationEvent"), exports);
@@ -0,0 +1,5 @@
1
+ import { EventHandlerParams } from './EventHandler.types';
2
+ import { EventHandlerResult } from '../../common.types';
3
+ declare const handleBackendEvent: (params: EventHandlerParams) => EventHandlerResult;
4
+ export { handleBackendEvent };
5
+ //# sourceMappingURL=EventHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventHandler.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/EventHandler/EventHandler.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAEtD,QAAA,MAAM,kBAAkB,WAAkB,kBAAkB,uBAAwD,CAAC;AAErH,OAAO,EAAC,kBAAkB,EAAC,CAAC"}
@@ -0,0 +1,24 @@
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.handleBackendEvent = void 0;
22
+ const ConversationEvent_1 = require("./ConversationEvent");
23
+ const handleBackendEvent = async (params) => (0, ConversationEvent_1.handleConversationEvent)(params);
24
+ exports.handleBackendEvent = handleBackendEvent;
@@ -0,0 +1,11 @@
1
+ import { BackendEvent } from '@wireapp/api-client/lib/event';
2
+ import { PayloadBundleSource } from '../../../conversation';
3
+ import { CryptographyService } from '../../../cryptography';
4
+ export { BackendEvent, PayloadBundleSource };
5
+ export declare type EventHandlerParams = {
6
+ dryRun?: boolean;
7
+ event: BackendEvent;
8
+ source: PayloadBundleSource;
9
+ cryptographyService: CryptographyService;
10
+ };
11
+ //# sourceMappingURL=EventHandler.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventHandler.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/EventHandler/EventHandler.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAC,CAAC;AAE3C,oBAAY,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC"}
@@ -0,0 +1,23 @@
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.PayloadBundleSource = void 0;
22
+ const conversation_1 = require("../../../conversation");
23
+ Object.defineProperty(exports, "PayloadBundleSource", { enumerable: true, get: function () { return conversation_1.PayloadBundleSource; } });
@@ -0,0 +1,3 @@
1
+ export * from './EventHandler.types';
2
+ export * from './EventHandler';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/EventHandler/index.ts"],"names":[],"mappings":"AAmBA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,36 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
+ desc = { enumerable: true, get: function() { return m[k]; } };
25
+ }
26
+ Object.defineProperty(o, k2, desc);
27
+ }) : (function(o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ }));
31
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ __exportStar(require("./EventHandler.types"), exports);
36
+ __exportStar(require("./EventHandler"), exports);
@@ -3,6 +3,8 @@ import { Conversation } from '@wireapp/api-client/lib/conversation';
3
3
  import { AddUsersToProteusConversationParams, CreateProteusConversationParams, ProteusServiceConfig, SendProteusMessageParams } from './ProteusService.types';
4
4
  import { SendResult } from '../../../conversation';
5
5
  import { CryptographyService } from '../../../cryptography';
6
+ import { EventHandlerResult } from '../../common.types';
7
+ import { EventHandlerParams } from '../EventHandler';
6
8
  export declare class ProteusService {
7
9
  private readonly apiClient;
8
10
  private readonly cryptographyService;
@@ -10,7 +12,7 @@ export declare class ProteusService {
10
12
  private readonly messageService;
11
13
  private readonly logger;
12
14
  constructor(apiClient: APIClient, cryptographyService: CryptographyService, config: ProteusServiceConfig);
13
- private isClearFromMismatch;
15
+ handleEvent(params: Omit<EventHandlerParams, 'cryptographyService'>): EventHandlerResult;
14
16
  createConversation({ conversationData, otherUserIds, }: CreateProteusConversationParams): Promise<Conversation>;
15
17
  addUsersToConversation({ conversationId, qualifiedUserIds }: AddUsersToProteusConversationParams): Promise<import("@wireapp/api-client/lib/event").ConversationMemberJoinEvent>;
16
18
  sendMessage({ userIds, sendAsProtobuf, conversationId, nativePush, targetMode, payload, onClientMismatch, }: SendProteusMessageParams): Promise<SendResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"ProteusService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAEL,YAAY,EAGb,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,mCAAmC,EACnC,+BAA+B,EAC/B,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAqB,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D,qBAAa,cAAc;IAKvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAG/C,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,oBAAoB;IAK/C,OAAO,CAAC,mBAAmB;IAQd,kBAAkB,CAAC,EAC9B,gBAAgB,EAChB,YAAY,GACb,EAAE,+BAA+B,GAAG,OAAO,CAAC,YAAY,CAAC;IAoB7C,sBAAsB,CAAC,EAAC,cAAc,EAAE,gBAAgB,EAAC,EAAE,mCAAmC;IAI9F,WAAW,CAAC,EACvB,OAAO,EACP,cAAc,EACd,cAAc,EACd,UAAU,EACV,UAAU,EACV,OAAO,EACP,gBAAgB,GACjB,EAAE,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC;CA0ClD"}
1
+ {"version":3,"file":"ProteusService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,YAAY,EAAkB,MAAM,sCAAsC,CAAC;AAGnF,OAAO,EACL,mCAAmC,EACnC,+BAA+B,EAC/B,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAqB,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAqB,MAAM,iBAAiB,CAAC;AAEvE,qBAAa,cAAc;IAKvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAG/C,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,oBAAoB;IAKlC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,kBAAkB;IAIxF,kBAAkB,CAAC,EAC9B,gBAAgB,EAChB,YAAY,GACb,EAAE,+BAA+B,GAAG,OAAO,CAAC,YAAY,CAAC;IAoB7C,sBAAsB,CAAC,EAAC,cAAc,EAAE,gBAAgB,EAAC,EAAE,mCAAmC;IAI9F,WAAW,CAAC,EACvB,OAAO,EACP,cAAc,EACd,cAAc,EACd,UAAU,EACV,UAAU,EACV,OAAO,EACP,gBAAgB,GACjB,EAAE,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC;CA0ClD"}
@@ -23,9 +23,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.ProteusService = void 0;
25
25
  const logdown_1 = __importDefault(require("logdown"));
26
+ const Utility_1 = require("./Utility");
26
27
  const getGenericMessageParams_1 = require("./Utility/getGenericMessageParams");
27
28
  const conversation_1 = require("../../../conversation");
28
29
  const MessageService_1 = require("../../../conversation/message/MessageService");
30
+ const EventHandler_1 = require("../EventHandler");
29
31
  class ProteusService {
30
32
  constructor(apiClient, cryptographyService, config) {
31
33
  this.apiClient = apiClient;
@@ -34,12 +36,8 @@ class ProteusService {
34
36
  this.logger = (0, logdown_1.default)('@wireapp/core/ProteusService');
35
37
  this.messageService = new MessageService_1.MessageService(this.apiClient, this.cryptographyService);
36
38
  }
37
- isClearFromMismatch(mismatch) {
38
- const hasMissing = Object.keys(mismatch.missing || {}).length > 0;
39
- const hasDeleted = Object.keys(mismatch.deleted || {}).length > 0;
40
- const hasRedundant = Object.keys(mismatch.redundant || {}).length > 0;
41
- const hasFailed = Object.keys(mismatch.failed_to_send || {}).length > 0;
42
- return !hasMissing && !hasDeleted && !hasRedundant && !hasFailed;
39
+ async handleEvent(params) {
40
+ return (0, EventHandler_1.handleBackendEvent)(Object.assign(Object.assign({}, params), { cryptographyService: this.cryptographyService }));
43
41
  }
44
42
  async createConversation({ conversationData, otherUserIds, }) {
45
43
  const isNewConversation = (conversationData) => conversationData && (conversationData === null || conversationData === void 0 ? void 0 : conversationData.name) && (conversationData === null || conversationData === void 0 ? void 0 : conversationData.users);
@@ -81,7 +79,7 @@ class ProteusService {
81
79
  ? await this.messageService.sendFederatedMessage(sendingClientId, recipients, plainText, Object.assign(Object.assign({}, options), { onClientMismatch: mismatch => onClientMismatch === null || onClientMismatch === void 0 ? void 0 : onClientMismatch(mismatch, false) }))
82
80
  : await this.messageService.sendMessage(sendingClientId, recipients, plainText, Object.assign(Object.assign({}, options), { sendAsProtobuf, onClientMismatch: mismatch => onClientMismatch === null || onClientMismatch === void 0 ? void 0 : onClientMismatch(mismatch, false) }));
83
81
  if (!response.errored) {
84
- if (!this.isClearFromMismatch(response)) {
82
+ if (!(0, Utility_1.isClearFromMismatch)(response)) {
85
83
  // We warn the consumer that there is a mismatch that did not prevent message sending
86
84
  await (onClientMismatch === null || onClientMismatch === void 0 ? void 0 : onClientMismatch(response, true));
87
85
  }
@@ -2,4 +2,5 @@ export * from './PreKeyBundle';
2
2
  export * from '../../../../conversation/ConversationService/Utility/getConversationQualifiedMembers';
3
3
  export * from './UserIds';
4
4
  export * from './Recipients';
5
+ export * from './isClearFromMismatch';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/Utility/index.ts"],"names":[],"mappings":"AAmBA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sFAAsF,CAAC;AACrG,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/Utility/index.ts"],"names":[],"mappings":"AAmBA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sFAAsF,CAAC;AACrG,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC"}
@@ -36,3 +36,4 @@ __exportStar(require("./PreKeyBundle"), exports);
36
36
  __exportStar(require("../../../../conversation/ConversationService/Utility/getConversationQualifiedMembers"), exports);
37
37
  __exportStar(require("./UserIds"), exports);
38
38
  __exportStar(require("./Recipients"), exports);
39
+ __exportStar(require("./isClearFromMismatch"), exports);
@@ -0,0 +1,4 @@
1
+ import { ClientMismatch, MessageSendingStatus } from '@wireapp/api-client/lib/conversation';
2
+ declare const isClearFromMismatch: (mismatch: ClientMismatch | MessageSendingStatus) => boolean;
3
+ export { isClearFromMismatch };
4
+ //# sourceMappingURL=isClearFromMismatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isClearFromMismatch.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/Utility/isClearFromMismatch.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,cAAc,EAAE,oBAAoB,EAAC,MAAM,sCAAsC,CAAC;AAE1F,QAAA,MAAM,mBAAmB,aAAc,cAAc,GAAG,oBAAoB,KAAG,OAM9E,CAAC;AAEF,OAAO,EAAC,mBAAmB,EAAC,CAAC"}
@@ -0,0 +1,29 @@
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.isClearFromMismatch = void 0;
22
+ const isClearFromMismatch = (mismatch) => {
23
+ const hasMissing = Object.keys(mismatch.missing || {}).length > 0;
24
+ const hasDeleted = Object.keys(mismatch.deleted || {}).length > 0;
25
+ const hasRedundant = Object.keys(mismatch.redundant || {}).length > 0;
26
+ const hasFailed = Object.keys(mismatch.failed_to_send || {}).length > 0;
27
+ return !hasMissing && !hasDeleted && !hasRedundant && !hasFailed;
28
+ };
29
+ exports.isClearFromMismatch = isClearFromMismatch;
@@ -8,16 +8,14 @@ import { GenericMessage } from '@wireapp/protocol-messaging';
8
8
  import { CRUDEngine } from '@wireapp/store-engine';
9
9
  import { PayloadBundle, PayloadBundleSource } from '../conversation';
10
10
  import { NotificationError } from '../CoreError';
11
- import { CryptographyService } from '../cryptography';
11
+ import { DecryptionError } from '../errors/DecryptionError';
12
12
  import { MLSService } from '../messagingProtocols/mls';
13
+ import { ProteusService } from '../messagingProtocols/proteus';
13
14
  export declare type HandledEventPayload = {
14
15
  event: Events.BackendEvent;
15
16
  mappedEvent?: PayloadBundle;
16
17
  decryptedData?: GenericMessage;
17
- decryptionError?: {
18
- code: number;
19
- message: string;
20
- };
18
+ decryptionError?: DecryptionError;
21
19
  };
22
20
  declare enum TOPIC {
23
21
  NOTIFICATION_ERROR = "NotificationService.TOPIC.NOTIFICATION_ERROR"
@@ -31,13 +29,13 @@ export interface NotificationService {
31
29
  }
32
30
  export declare class NotificationService extends EventEmitter {
33
31
  private readonly mlsService;
32
+ private readonly proteusService;
34
33
  private readonly apiClient;
35
34
  private readonly backend;
36
- private readonly cryptographyService;
37
35
  private readonly database;
38
36
  private readonly logger;
39
37
  static readonly TOPIC: typeof TOPIC;
40
- constructor(apiClient: APIClient, cryptographyService: CryptographyService, mlsService: MLSService, storeEngine: CRUDEngine);
38
+ constructor(apiClient: APIClient, mlsService: MLSService, proteusService: ProteusService, storeEngine: CRUDEngine);
41
39
  private getAllNotifications;
42
40
  /** Should only be called with a completely new client. */
43
41
  initializeNotificationStream(): Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationService.d.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AE,mBAAmB,EAC3B,MAAM,GAAE,OAAe,GACtB,cAAc,CAAC,mBAAmB,CAAC;IAsCtC,OAAO,CAAC,oBAAoB;IAmB5B;;;;;;OAMG;YACW,WAAW;CAkD1B"}
@@ -72,15 +72,15 @@ var TOPIC;
72
72
  TOPIC["NOTIFICATION_ERROR"] = "NotificationService.TOPIC.NOTIFICATION_ERROR";
73
73
  })(TOPIC || (TOPIC = {}));
74
74
  class NotificationService extends events_1.EventEmitter {
75
- constructor(apiClient, cryptographyService, mlsService, storeEngine) {
75
+ constructor(apiClient, mlsService, proteusService, storeEngine) {
76
76
  super();
77
77
  this.mlsService = mlsService;
78
+ this.proteusService = proteusService;
78
79
  this.logger = (0, logdown_1.default)('@wireapp/core/NotificationService', {
79
80
  logger: console,
80
81
  markdown: false,
81
82
  });
82
83
  this.apiClient = apiClient;
83
- this.cryptographyService = cryptographyService;
84
84
  this.backend = new NotificationBackendRepository_1.NotificationBackendRepository(this.apiClient);
85
85
  this.database = new NotificationDatabaseRepository_1.NotificationDatabaseRepository(storeEngine);
86
86
  }
@@ -237,31 +237,20 @@ class NotificationService extends events_1.EventEmitter {
237
237
  async handleEvent(event, source, dryRun = false) {
238
238
  var _a;
239
239
  // Handle MLS Events
240
- const result = await this.mlsService.handleMLSEvent({ event, source, dryRun });
241
- if (result) {
242
- return result;
240
+ const mlsResult = await this.mlsService.handleEvent({ event, source, dryRun });
241
+ if (mlsResult) {
242
+ return mlsResult;
243
+ }
244
+ const proteusResult = await this.proteusService.handleEvent({
245
+ event,
246
+ source,
247
+ dryRun,
248
+ });
249
+ if (proteusResult) {
250
+ return proteusResult;
243
251
  }
244
252
  // Fallback to other events
245
253
  switch (event.type) {
246
- // Encrypted Proteus events
247
- case Events.CONVERSATION_EVENT.OTR_MESSAGE_ADD: {
248
- if (dryRun) {
249
- // In case of a dry run, we do not want to decrypt messages
250
- // We just return the raw event to the caller
251
- return { event };
252
- }
253
- try {
254
- const decryptedData = await this.cryptographyService.decryptMessage(event);
255
- return {
256
- mappedEvent: this.cryptographyService.mapGenericMessage(event, decryptedData, source),
257
- event,
258
- decryptedData,
259
- };
260
- }
261
- catch (error) {
262
- return { event, decryptionError: error };
263
- }
264
- }
265
254
  // Meta events
266
255
  case Events.CONVERSATION_EVENT.MEMBER_JOIN:
267
256
  // As of today (07/07/2022) the backend sends `WELCOME` message to the user's own conversation (not the actual conversation that the welcome should be part of)
package/package.json CHANGED
@@ -58,6 +58,6 @@
58
58
  "test:coverage": "jest --coverage",
59
59
  "watch": "tsc --watch"
60
60
  },
61
- "version": "37.0.0",
62
- "gitHead": "efc73ac256384f821b2126bf38442b9f03f14cfa"
61
+ "version": "37.0.2",
62
+ "gitHead": "537ee5dbaa3f8271660568fd52a1086bd4cf0a7c"
63
63
  }