@wireapp/core 46.46.6-beta.14.f6fd03fe6 → 46.46.6

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 (195) hide show
  1. package/lib/Account.d.ts +156 -51
  2. package/lib/Account.d.ts.map +1 -1
  3. package/lib/Account.js +503 -127
  4. package/lib/Account.test.js +158 -147
  5. package/lib/broadcast/AvailabilityType.d.ts +1 -1
  6. package/lib/broadcast/AvailabilityType.d.ts.map +1 -1
  7. package/lib/broadcast/BroadcastService.d.ts +1 -1
  8. package/lib/broadcast/BroadcastService.d.ts.map +1 -1
  9. package/lib/broadcast/BroadcastService.js +1 -1
  10. package/lib/client/ClientService.d.ts +4 -3
  11. package/lib/client/ClientService.d.ts.map +1 -1
  12. package/lib/client/ClientService.js +19 -5
  13. package/lib/conversation/AbortReason.d.ts +1 -1
  14. package/lib/conversation/AbortReason.d.ts.map +1 -1
  15. package/lib/conversation/AssetService/AssetService.d.ts +12 -30
  16. package/lib/conversation/AssetService/AssetService.d.ts.map +1 -1
  17. package/lib/conversation/AssetService/AssetService.js +1 -10
  18. package/lib/conversation/AssetService/AssetService.test.js +8 -3
  19. package/lib/conversation/ClientActionType.d.ts +1 -1
  20. package/lib/conversation/ClientActionType.d.ts.map +1 -1
  21. package/lib/conversation/ClientActionType.js +1 -1
  22. package/lib/conversation/ConversationService/ConversationService.d.ts +98 -14
  23. package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
  24. package/lib/conversation/ConversationService/ConversationService.js +314 -101
  25. package/lib/conversation/ConversationService/ConversationService.test.js +441 -47
  26. package/lib/conversation/ConversationService/ConversationService.types.d.ts +5 -4
  27. package/lib/conversation/ConversationService/ConversationService.types.d.ts.map +1 -1
  28. package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.d.ts.map +1 -1
  29. package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.js +6 -3
  30. package/lib/conversation/SubconversationService/SubconversationService.d.ts.map +1 -1
  31. package/lib/conversation/SubconversationService/SubconversationService.js +158 -11
  32. package/lib/conversation/SubconversationService/SubconversationService.test.js +8 -2
  33. package/lib/conversation/content/AssetContent.d.ts +1 -1
  34. package/lib/conversation/content/AssetContent.d.ts.map +1 -1
  35. package/lib/conversation/content/ButtonActionConfirmationContent.d.ts +1 -1
  36. package/lib/conversation/content/ButtonActionConfirmationContent.d.ts.map +1 -1
  37. package/lib/conversation/content/ButtonActionContent.d.ts +1 -1
  38. package/lib/conversation/content/ButtonActionContent.d.ts.map +1 -1
  39. package/lib/conversation/content/ClearedContent.d.ts +1 -1
  40. package/lib/conversation/content/ClearedContent.d.ts.map +1 -1
  41. package/lib/conversation/content/ClientActionContent.d.ts +1 -1
  42. package/lib/conversation/content/ClientActionContent.d.ts.map +1 -1
  43. package/lib/conversation/content/CompositeContent.d.ts +1 -1
  44. package/lib/conversation/content/CompositeContent.d.ts.map +1 -1
  45. package/lib/conversation/content/ConfirmationContent.d.ts +1 -1
  46. package/lib/conversation/content/ConfirmationContent.d.ts.map +1 -1
  47. package/lib/conversation/content/DeletedContent.d.ts +1 -1
  48. package/lib/conversation/content/DeletedContent.d.ts.map +1 -1
  49. package/lib/conversation/content/HiddenContent.d.ts +1 -1
  50. package/lib/conversation/content/HiddenContent.d.ts.map +1 -1
  51. package/lib/conversation/content/KnockContent.d.ts +1 -1
  52. package/lib/conversation/content/KnockContent.d.ts.map +1 -1
  53. package/lib/conversation/content/LinkPreviewContent.d.ts +1 -1
  54. package/lib/conversation/content/LinkPreviewContent.d.ts.map +1 -1
  55. package/lib/conversation/content/MentionContent.d.ts +1 -1
  56. package/lib/conversation/content/MentionContent.d.ts.map +1 -1
  57. package/lib/conversation/content/MultipartContent.d.ts +1 -1
  58. package/lib/conversation/content/MultipartContent.d.ts.map +1 -1
  59. package/lib/conversation/content/QuoteContent.d.ts +1 -1
  60. package/lib/conversation/content/QuoteContent.d.ts.map +1 -1
  61. package/lib/conversation/content/TweetContent.d.ts +1 -1
  62. package/lib/conversation/content/TweetContent.d.ts.map +1 -1
  63. package/lib/conversation/content/index.d.ts +1 -1
  64. package/lib/conversation/content/index.d.ts.map +1 -1
  65. package/lib/conversation/content/index.js +1 -1
  66. package/lib/conversation/message/MessageBuilder.d.ts +1 -1
  67. package/lib/conversation/message/MessageBuilder.d.ts.map +1 -1
  68. package/lib/conversation/message/MessageBuilder.js +1 -1
  69. package/lib/conversation/message/MessageService.d.ts.map +1 -1
  70. package/lib/conversation/message/MessageService.js +1 -1
  71. package/lib/conversation/message/MessageService.test.js +7 -1
  72. package/lib/conversation/message/MessageToProtoMapper.d.ts +1 -1
  73. package/lib/conversation/message/MessageToProtoMapper.d.ts.map +1 -1
  74. package/lib/conversation/message/MessageToProtoMapper.js +1 -1
  75. package/lib/conversation/message/messageSender.js +2 -2
  76. package/lib/cryptography/AssetCryptography/EncryptedAsset.d.ts +2 -2
  77. package/lib/cryptography/AssetCryptography/EncryptedAsset.d.ts.map +1 -1
  78. package/lib/messagingProtocols/common.types.d.ts +9 -0
  79. package/lib/messagingProtocols/common.types.d.ts.map +1 -1
  80. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts +2 -2
  81. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts.map +1 -1
  82. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.js +2 -1
  83. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts +1 -1
  84. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts.map +1 -1
  85. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.js +13 -11
  86. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.test.js +21 -16
  87. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts +9 -3
  88. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts.map +1 -1
  89. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.js +31 -12
  90. package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.d.ts +6 -0
  91. package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.d.ts.map +1 -1
  92. package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.js +19 -1
  93. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingProposalsQueue/IncomingProposalsQueue.d.ts +7 -0
  94. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingProposalsQueue/IncomingProposalsQueue.d.ts.map +1 -0
  95. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingProposalsQueue/IncomingProposalsQueue.js +48 -0
  96. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingProposalsQueue/index.d.ts +2 -0
  97. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/{IncomingMessagesQueue → IncomingProposalsQueue}/index.d.ts.map +1 -1
  98. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/{IncomingMessagesQueue → IncomingProposalsQueue}/index.js +1 -1
  99. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/index.d.ts +0 -1
  100. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/index.d.ts.map +1 -1
  101. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/index.js +0 -1
  102. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.d.ts.map +1 -1
  103. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.js +23 -14
  104. package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.d.ts.map +1 -1
  105. package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.js +5 -2
  106. package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.test.js +13 -3
  107. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.d.ts +38 -2
  108. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.d.ts.map +1 -1
  109. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.js +41 -6
  110. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.test.d.ts +2 -0
  111. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.test.d.ts.map +1 -0
  112. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.test.js +124 -0
  113. package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +38 -34
  114. package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
  115. package/lib/messagingProtocols/mls/MLSService/MLSService.js +267 -208
  116. package/lib/messagingProtocols/mls/MLSService/MLSService.test.js +157 -160
  117. package/lib/messagingProtocols/mls/MLSService/commitBundleUtil.js +3 -3
  118. package/lib/messagingProtocols/mls/MLSService/commitBundleUtil.test.js +5 -5
  119. package/lib/messagingProtocols/mls/conversationRejoinQueue.js +2 -2
  120. package/lib/messagingProtocols/mls/recovery/MlsErrorMapper.d.ts +78 -0
  121. package/lib/messagingProtocols/mls/recovery/MlsErrorMapper.d.ts.map +1 -0
  122. package/lib/messagingProtocols/mls/recovery/MlsErrorMapper.js +173 -0
  123. package/lib/messagingProtocols/mls/recovery/MlsErrorMapper.test.d.ts +2 -0
  124. package/lib/messagingProtocols/mls/recovery/MlsErrorMapper.test.d.ts.map +1 -0
  125. package/lib/messagingProtocols/mls/recovery/MlsErrorMapper.test.js +117 -0
  126. package/lib/messagingProtocols/mls/recovery/MlsRecoveryOrchestrator.d.ts +167 -0
  127. package/lib/messagingProtocols/mls/recovery/MlsRecoveryOrchestrator.d.ts.map +1 -0
  128. package/lib/messagingProtocols/mls/recovery/MlsRecoveryOrchestrator.js +317 -0
  129. package/lib/messagingProtocols/mls/recovery/MlsRecoveryOrchestrator.test.d.ts +2 -0
  130. package/lib/messagingProtocols/mls/recovery/MlsRecoveryOrchestrator.test.d.ts.map +1 -0
  131. package/lib/messagingProtocols/mls/recovery/MlsRecoveryOrchestrator.test.js +248 -0
  132. package/lib/messagingProtocols/mls/recovery/index.d.ts +5 -0
  133. package/lib/messagingProtocols/mls/recovery/index.d.ts.map +1 -0
  134. package/lib/messagingProtocols/mls/recovery/index.js +28 -0
  135. package/lib/messagingProtocols/mls/types.d.ts +0 -8
  136. package/lib/messagingProtocols/mls/types.d.ts.map +1 -1
  137. package/lib/messagingProtocols/proteus/EventHandler/events/otrMessageAdd/otrMessageAdd.d.ts.map +1 -1
  138. package/lib/messagingProtocols/proteus/EventHandler/events/otrMessageAdd/otrMessageAdd.js +7 -1
  139. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.d.ts +8 -15
  140. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.d.ts.map +1 -1
  141. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.js +97 -62
  142. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoClient.types.d.ts +0 -6
  143. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoClient.types.d.ts.map +1 -1
  144. package/lib/messagingProtocols/proteus/ProteusService/DecryptionErrorGenerator/DecryptionErrorGenerator.d.ts +1 -6
  145. package/lib/messagingProtocols/proteus/ProteusService/DecryptionErrorGenerator/DecryptionErrorGenerator.d.ts.map +1 -1
  146. package/lib/messagingProtocols/proteus/ProteusService/DecryptionErrorGenerator/DecryptionErrorGenerator.js +19 -22
  147. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts +5 -3
  148. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts.map +1 -1
  149. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.js +11 -24
  150. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.d.ts +1 -0
  151. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.d.ts.map +1 -1
  152. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.js +11 -2
  153. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.test.js +13 -9
  154. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts +3 -2
  155. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts.map +1 -1
  156. package/lib/messagingProtocols/proteus/ProteusService/WithMockedGenerics.test.js +11 -4
  157. package/lib/messagingProtocols/proteus/ProteusService/cryptoMigrationStateStore.d.ts +0 -4
  158. package/lib/messagingProtocols/proteus/ProteusService/cryptoMigrationStateStore.d.ts.map +1 -1
  159. package/lib/messagingProtocols/proteus/ProteusService/cryptoMigrationStateStore.js +0 -5
  160. package/lib/messagingProtocols/proteus/ProteusService/identityClearer.d.ts +2 -1
  161. package/lib/messagingProtocols/proteus/ProteusService/identityClearer.d.ts.map +1 -1
  162. package/lib/messagingProtocols/proteus/ProteusService/identityClearer.js +8 -2
  163. package/lib/messagingProtocols/proteus/Utility/SessionHandler/SessionHandler.test.js +4 -0
  164. package/lib/messagingProtocols/proteus/Utility/getGenericMessageParams.d.ts +1 -1
  165. package/lib/messagingProtocols/proteus/Utility/getGenericMessageParams.d.ts.map +1 -1
  166. package/lib/messagingProtocols/proteus/Utility/getGenericMessageParams.js +1 -1
  167. package/lib/notification/NotificationService.d.ts +20 -6
  168. package/lib/notification/NotificationService.d.ts.map +1 -1
  169. package/lib/notification/NotificationService.js +23 -14
  170. package/lib/notification/NotificationService.test.js +8 -0
  171. package/lib/secretStore/secretKeyGenerator.d.ts +1 -0
  172. package/lib/secretStore/secretKeyGenerator.d.ts.map +1 -1
  173. package/lib/secretStore/secretKeyGenerator.js +3 -1
  174. package/lib/self/SelfService.d.ts +2 -2
  175. package/lib/self/SelfService.d.ts.map +1 -1
  176. package/lib/self/SelfService.test.js +5 -2
  177. package/lib/team/TeamService.d.ts +5 -2
  178. package/lib/team/TeamService.d.ts.map +1 -1
  179. package/lib/team/TeamService.js +12 -2
  180. package/lib/test/StoreHelper.d.ts +2 -0
  181. package/lib/test/StoreHelper.d.ts.map +1 -0
  182. package/lib/test/StoreHelper.js +27 -0
  183. package/lib/user/UserService.d.ts +2 -2
  184. package/lib/user/UserService.d.ts.map +1 -1
  185. package/lib/user/UserService.js +3 -3
  186. package/lib/util/TypePredicateUtil.d.ts.map +1 -1
  187. package/lib/util/TypePredicateUtil.js +2 -2
  188. package/package.json +3 -3
  189. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/IncomingMesssagesQueue.d.ts +0 -4
  190. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/IncomingMesssagesQueue.d.ts.map +0 -1
  191. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/IncomingMesssagesQueue.js +0 -69
  192. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/index.d.ts +0 -2
  193. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.test.d.ts +0 -2
  194. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.test.d.ts.map +0 -1
  195. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.test.js +0 -98
@@ -0,0 +1,27 @@
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.createMemoryEngine = createMemoryEngine;
22
+ const { MemoryEngine } = require('@wireapp/store-engine');
23
+ async function createMemoryEngine(storeName = `temp-${Date.now()}`) {
24
+ const engine = new MemoryEngine();
25
+ await engine.init(storeName);
26
+ return engine;
27
+ }
@@ -1,4 +1,4 @@
1
- import { ConversationProtocol } from '@wireapp/api-client/lib/conversation';
1
+ import { CONVERSATION_PROTOCOL } from '@wireapp/api-client/lib/team';
2
2
  import { QualifiedId, User } from '@wireapp/api-client/lib/user/';
3
3
  import { APIClient } from '@wireapp/api-client';
4
4
  export declare class UserService {
@@ -13,6 +13,6 @@ export declare class UserService {
13
13
  /**
14
14
  * Get the list of other user's supported protocols.
15
15
  */
16
- getUserSupportedProtocols(userId: QualifiedId): Promise<ConversationProtocol[]>;
16
+ getUserSupportedProtocols(userId: QualifiedId): Promise<CONVERSATION_PROTOCOL[]>;
17
17
  }
18
18
  //# sourceMappingURL=UserService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../src/user/UserService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,oBAAoB,EAAC,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAC,WAAW,EAAE,IAAI,EAAC,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAE1B,SAAS,EAAE,SAAS;IAIzB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE;;;;;IAO5C;;OAEG;IACU,yBAAyB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;CAS7F"}
1
+ {"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../src/user/UserService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,qBAAqB,EAAC,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAC,WAAW,EAAE,IAAI,EAAC,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAE1B,SAAS,EAAE,SAAS;IAIzB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE;;;;;IAO5C;;OAEG;IACU,yBAAyB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;CAS9F"}
@@ -19,7 +19,7 @@
19
19
  */
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.UserService = void 0;
22
- const conversation_1 = require("@wireapp/api-client/lib/conversation");
22
+ const team_1 = require("@wireapp/api-client/lib/team");
23
23
  class UserService {
24
24
  apiClient;
25
25
  constructor(apiClient) {
@@ -40,10 +40,10 @@ class UserService {
40
40
  async getUserSupportedProtocols(userId) {
41
41
  // Clients that uses version below the one supporting MLS, are not aware of user's supported protocols, we default to Proteus in this case.
42
42
  if (!this.apiClient.backendFeatures.supportsMLS) {
43
- return [conversation_1.ConversationProtocol.PROTEUS];
43
+ return [team_1.CONVERSATION_PROTOCOL.PROTEUS];
44
44
  }
45
45
  const supportedProtocols = await this.apiClient.api.user.getUserSupportedProtocols(userId);
46
- return supportedProtocols.length > 0 ? supportedProtocols : [conversation_1.ConversationProtocol.PROTEUS];
46
+ return supportedProtocols.length > 0 ? supportedProtocols : [team_1.CONVERSATION_PROTOCOL.PROTEUS];
47
47
  }
48
48
  }
49
49
  exports.UserService = UserService;
@@ -1 +1 @@
1
- {"version":3,"file":"TypePredicateUtil.d.ts","sourceRoot":"","sources":["../../src/util/TypePredicateUtil.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EAEZ,eAAe,EACf,oBAAoB,EACpB,WAAW,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAE1D,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,MAAM,EAAE,CAEvD;AAMD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,WAAW,EAAE,CAEjE;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,oBAAoB,CAS5E;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,WAAW,CAM1D;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,YAAY,IAAI,eAAe,CAG7F"}
1
+ {"version":3,"file":"TypePredicateUtil.d.ts","sourceRoot":"","sources":["../../src/util/TypePredicateUtil.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,WAAW,EAAC,MAAM,uCAAuC,CAAC;AAEvH,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAE1D,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,MAAM,EAAE,CAEvD;AAMD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,WAAW,EAAE,CAEjE;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,oBAAoB,CAS5E;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,WAAW,CAM1D;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,YAAY,IAAI,eAAe,CAG7F"}
@@ -23,7 +23,7 @@ exports.isQualifiedIdArray = isQualifiedIdArray;
23
23
  exports.isQualifiedUserClients = isQualifiedUserClients;
24
24
  exports.isUserClients = isUserClients;
25
25
  exports.isMLSConversation = isMLSConversation;
26
- const conversation_1 = require("@wireapp/api-client/lib/conversation/");
26
+ const team_1 = require("@wireapp/api-client/lib/team");
27
27
  function isStringArray(obj) {
28
28
  return Array.isArray(obj) && (obj.length === 0 || typeof obj[0] === 'string');
29
29
  }
@@ -52,5 +52,5 @@ function isUserClients(obj) {
52
52
  }
53
53
  function isMLSConversation(conversation) {
54
54
  const { protocol, epoch, group_id } = conversation;
55
- return protocol === conversation_1.ConversationProtocol.MLS && epoch !== undefined && group_id !== undefined;
55
+ return protocol === team_1.CONVERSATION_PROTOCOL.MLS && epoch !== undefined && group_id !== undefined;
56
56
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
12
12
  },
13
13
  "dependencies": {
14
- "@wireapp/api-client": "^27.90.1-beta.22.f6fd03fe6",
14
+ "@wireapp/api-client": "^27.91.0",
15
15
  "@wireapp/commons": "^5.4.9",
16
16
  "@wireapp/core-crypto": "9.1.2",
17
17
  "@wireapp/cryptobox": "12.8.0",
@@ -61,6 +61,6 @@
61
61
  "test:coverage": "jest --coverage",
62
62
  "watch": "tsc --watch"
63
63
  },
64
- "version": "46.46.6-beta.14.f6fd03fe6",
65
- "gitHead": "f6fd03fe61d83ba1f03786f6d202e1e19478c743"
64
+ "version": "46.46.6",
65
+ "gitHead": "e92cea52e807cc87abcb2f3329d11b41cc2e3bda"
66
66
  }
@@ -1,4 +0,0 @@
1
- export declare const queueIncomingMLSMessage: <EventHandler extends (...args: any[]) => any>(groupId: string, handler: EventHandler) => Promise<ReturnType<EventHandler>>;
2
- export declare const deleteMLSMessagesQueue: (groupId: string) => void;
3
- export declare const withLockedMLSMessagesQueue: <T>(groupId: string, fn: () => Promise<T>) => Promise<T>;
4
- //# sourceMappingURL=IncomingMesssagesQueue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IncomingMesssagesQueue.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/IncomingMesssagesQueue.ts"],"names":[],"mappings":"AA0CA,eAAO,MAAM,uBAAuB,GAAU,YAAY,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,WAC/E,MAAM,WACN,YAAY,KACpB,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAGlC,CAAC;AAEF,eAAO,MAAM,sBAAsB,YAAa,MAAM,SAErD,CAAC;AAcF,eAAO,MAAM,0BAA0B,GAAU,CAAC,WAAW,MAAM,MAAM,MAAM,OAAO,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,CAAC,CAUpG,CAAC"}
@@ -1,69 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2023 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.withLockedMLSMessagesQueue = exports.deleteMLSMessagesQueue = exports.queueIncomingMLSMessage = void 0;
22
- const commons_1 = require("@wireapp/commons");
23
- const promise_queue_1 = require("@wireapp/promise-queue");
24
- const logger = commons_1.LogFactory.getLogger('@wireapp/core/MLSService/IncomingMessagesQueue');
25
- // (groupId string -> queue) map
26
- const queues = new Map();
27
- const getQueue = (groupId) => {
28
- const queue = queues.get(groupId);
29
- if (queue) {
30
- return queue;
31
- }
32
- const newConversationQueue = new promise_queue_1.PromiseQueue({
33
- name: `mls-messages-queue-${groupId}`,
34
- });
35
- queues.set(groupId, newConversationQueue);
36
- return newConversationQueue;
37
- };
38
- const queueIncomingMLSMessage = async (groupId, handler) => {
39
- const conversationQueue = getQueue(groupId);
40
- return conversationQueue.push(handler);
41
- };
42
- exports.queueIncomingMLSMessage = queueIncomingMLSMessage;
43
- const deleteMLSMessagesQueue = (groupId) => {
44
- queues.delete(groupId);
45
- };
46
- exports.deleteMLSMessagesQueue = deleteMLSMessagesQueue;
47
- const lockMLSMessagesQueue = (groupId) => {
48
- logger.info(`Locking incoming MLS messages queue for group ${groupId}`);
49
- const conversationQueue = getQueue(groupId);
50
- conversationQueue.pause(true);
51
- };
52
- const unlockMLSMessagesQueue = (groupId) => {
53
- logger.info(`Unlocking incoming MLS messages queue for group ${groupId}`);
54
- const conversationQueue = getQueue(groupId);
55
- conversationQueue.pause(false);
56
- };
57
- const withLockedMLSMessagesQueue = async (groupId, fn) => {
58
- lockMLSMessagesQueue(groupId);
59
- try {
60
- const result = await fn();
61
- unlockMLSMessagesQueue(groupId);
62
- return result;
63
- }
64
- catch (error) {
65
- unlockMLSMessagesQueue(groupId);
66
- throw error;
67
- }
68
- };
69
- exports.withLockedMLSMessagesQueue = withLockedMLSMessagesQueue;
@@ -1,2 +0,0 @@
1
- export * from './IncomingMesssagesQueue';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=messageAdd.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"messageAdd.test.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.test.ts"],"names":[],"mappings":""}
@@ -1,98 +0,0 @@
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
- const protocol_messaging_1 = require("@pydio/protocol-messaging");
22
- const event_1 = require("@wireapp/api-client/lib/event");
23
- const messageAdd_1 = require("./messageAdd");
24
- const mockedMLSService = {
25
- getGroupIdFromConversationId: jest.fn(),
26
- decryptMessage: jest.fn(),
27
- handlePendingProposals: jest.fn(),
28
- getEpoch: jest.fn(),
29
- emit: jest.fn(),
30
- };
31
- const createMLSMessageAddEventMock = (conversationId) => ({
32
- data: '',
33
- conversation: conversationId.id,
34
- qualified_conversation: conversationId,
35
- from: '',
36
- senderClientId: '',
37
- type: event_1.CONVERSATION_EVENT.MLS_MESSAGE_ADD,
38
- time: '2023-08-21T06:47:43.387Z',
39
- });
40
- const createMockedMessage = () => {
41
- return protocol_messaging_1.GenericMessage.encode(protocol_messaging_1.GenericMessage.create({
42
- messageId: '2d7cb6d8-118f-11e8-b642-0ed5f89f718b',
43
- text: protocol_messaging_1.Text.create({ content: 'Hello, World!' }),
44
- })).finish();
45
- };
46
- describe('handleMLSMessageAdd', () => {
47
- it('does not handle pending proposals if message does not contain proposals', async () => {
48
- const event = createMLSMessageAddEventMock({ id: 'conversationId', domain: 'staging.zinfra.io' });
49
- const mockGroupId = 'AAEAAH87aajaQ011i+rNLmwpy0sAZGl5YS53aXJlLmxpbms=';
50
- const message = createMockedMessage();
51
- jest.spyOn(mockedMLSService, 'decryptMessage').mockResolvedValueOnce({
52
- proposals: [],
53
- commitDelay: undefined,
54
- message,
55
- hasEpochChanged: false,
56
- isActive: true,
57
- });
58
- await (0, messageAdd_1.handleMLSMessageAdd)({ event, mlsService: mockedMLSService, groupId: mockGroupId });
59
- expect(mockedMLSService.handlePendingProposals).not.toHaveBeenCalled();
60
- });
61
- it('handles pending proposals if message includes proposals', async () => {
62
- const event = createMLSMessageAddEventMock({ id: 'conversationId', domain: 'staging.zinfra.io' });
63
- const mockGroupId = 'AAEAAH87aajaQ011i+rNLmwpy0sAZGl5YS53aXJlLmxpbms=';
64
- const message = createMockedMessage();
65
- jest.spyOn(mockedMLSService, 'decryptMessage').mockResolvedValueOnce({
66
- proposals: [{ proposal: new Uint8Array(), proposalRef: new Uint8Array(), crlNewDistributionPoints: [] }],
67
- commitDelay: 2000,
68
- crlNewDistributionPoints: [],
69
- message,
70
- hasEpochChanged: false,
71
- isActive: true,
72
- });
73
- await (0, messageAdd_1.handleMLSMessageAdd)({ event, mlsService: mockedMLSService, groupId: mockGroupId });
74
- expect(mockedMLSService.handlePendingProposals).toHaveBeenCalledWith({
75
- groupId: mockGroupId,
76
- delayInMs: 2000,
77
- eventTime: event.time,
78
- });
79
- });
80
- it('emits "newEpoch" event if incoming message has advanced epoch number', async () => {
81
- const event = createMLSMessageAddEventMock({ id: 'conversationId', domain: 'staging.zinfra.io' });
82
- const mockGroupId = 'AAEAAH87aajaQ011i+rNLmwpy0sAZGl5YS53aXJlLmxpbms=';
83
- const message = createMockedMessage();
84
- jest.spyOn(mockedMLSService, 'decryptMessage').mockResolvedValueOnce({
85
- proposals: [],
86
- message,
87
- hasEpochChanged: true,
88
- isActive: true,
89
- });
90
- const mockedNewEpoch = 5;
91
- jest.spyOn(mockedMLSService, 'getEpoch').mockResolvedValueOnce(mockedNewEpoch);
92
- await (0, messageAdd_1.handleMLSMessageAdd)({ event, mlsService: mockedMLSService, groupId: mockGroupId });
93
- expect(mockedMLSService.emit).toHaveBeenCalledWith('newEpoch', {
94
- groupId: mockGroupId,
95
- epoch: mockedNewEpoch,
96
- });
97
- });
98
- });