@wireapp/core 46.0.19 → 46.1.0-hotfix-1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/lib/Account.js +56 -43
  2. package/lib/account/AccountService.js +0 -1
  3. package/lib/broadcast/BroadcastService.js +0 -3
  4. package/lib/client/ClientBackendRepository.js +0 -1
  5. package/lib/client/ClientDatabaseRepository.js +7 -16
  6. package/lib/client/ClientService.d.ts.map +1 -1
  7. package/lib/client/ClientService.js +13 -14
  8. package/lib/connection/ConnectionService.js +0 -1
  9. package/lib/conversation/AssetService/AssetService.d.ts +1 -0
  10. package/lib/conversation/AssetService/AssetService.d.ts.map +1 -1
  11. package/lib/conversation/AssetService/AssetService.js +6 -13
  12. package/lib/conversation/AssetService/AssetService.test.js +1 -1
  13. package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
  14. package/lib/conversation/ConversationService/ConversationService.js +80 -90
  15. package/lib/conversation/ConversationService/ConversationService.test.js +5 -12
  16. package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.d.ts.map +1 -1
  17. package/lib/conversation/MessageTimer/MessageTimer.js +0 -2
  18. package/lib/conversation/SubconversationService/SubconversationService.d.ts +8 -0
  19. package/lib/conversation/SubconversationService/SubconversationService.d.ts.map +1 -1
  20. package/lib/conversation/SubconversationService/SubconversationService.js +51 -23
  21. package/lib/conversation/content/AssetContent.d.ts +1 -0
  22. package/lib/conversation/content/AssetContent.d.ts.map +1 -1
  23. package/lib/conversation/content/ContentType.js +19 -18
  24. package/lib/conversation/content/FileContent.d.ts +1 -0
  25. package/lib/conversation/content/FileContent.d.ts.map +1 -1
  26. package/lib/conversation/content/ImageContent.d.ts +1 -0
  27. package/lib/conversation/content/ImageContent.d.ts.map +1 -1
  28. package/lib/conversation/message/MessageBuilder.js +23 -22
  29. package/lib/conversation/message/MessageService.js +4 -5
  30. package/lib/conversation/message/MessageService.test.js +9 -20
  31. package/lib/conversation/message/MessageToProtoMapper.js +2 -2
  32. package/lib/conversation/message/RecipientsHelper.js +2 -1
  33. package/lib/conversation/message/TextContentBuilder.js +2 -3
  34. package/lib/conversation/message/UserClientsUtil.js +3 -2
  35. package/lib/conversation/message/messageSender.js +6 -5
  36. package/lib/cryptography/AssetCryptography/AssetCryptography.d.ts.map +1 -1
  37. package/lib/cryptography/GenericMessageMapper.js +22 -74
  38. package/lib/cryptography/MessageHashService.d.ts +1 -0
  39. package/lib/cryptography/MessageHashService.d.ts.map +1 -1
  40. package/lib/cryptography/MessageHashService.js +0 -2
  41. package/lib/errors/DecryptionError.js +0 -2
  42. package/lib/errors/FederatedBackendsError.js +2 -3
  43. package/lib/giphy/GiphyService.js +0 -1
  44. package/lib/linkPreview/LinkPreviewService.js +12 -2
  45. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts +4 -4
  46. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.js +8 -9
  47. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.d.ts +8 -8
  48. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.js +3 -33
  49. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.test.js +11 -11
  50. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.js +5 -15
  51. package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.d.ts.map +1 -1
  52. package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.js +0 -1
  53. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Account.d.ts.map +1 -1
  54. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Account.js +1 -1
  55. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.d.ts +1 -1
  56. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.d.ts.map +1 -1
  57. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.js +3 -2
  58. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Certificate.js +1 -1
  59. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.d.ts.map +1 -1
  60. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.js +2 -2
  61. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.d.ts.map +1 -1
  62. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.js +2 -1
  63. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.schema.d.ts +4 -4
  64. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/IncomingMesssagesQueue.d.ts.map +1 -1
  65. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.d.ts.map +1 -1
  66. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.js +1 -1
  67. package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.d.ts.map +1 -1
  68. package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.js +1 -1
  69. package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.test.js +3 -7
  70. package/lib/messagingProtocols/mls/MLSService/ClientMLSError.js +0 -1
  71. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.d.ts.map +1 -1
  72. package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
  73. package/lib/messagingProtocols/mls/MLSService/MLSService.js +115 -110
  74. package/lib/messagingProtocols/mls/MLSService/MLSService.test.js +9 -31
  75. package/lib/messagingProtocols/mls/MLSService/commitBundleUtil.js +2 -1
  76. package/lib/messagingProtocols/mls/conversationRejoinQueue.js +4 -3
  77. package/lib/messagingProtocols/mls/utils/MLSId.js +3 -2
  78. package/lib/messagingProtocols/proteus/EventHandler/events/otrMessageAdd/otrMessageAdd.d.ts.map +1 -1
  79. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.js +2 -6
  80. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/PrekeysTracker/PrekeysTracker.js +0 -3
  81. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/PrekeysTracker/PrekeysTracker.store.js +1 -1
  82. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoboxWrapper.js +4 -5
  83. package/lib/messagingProtocols/proteus/ProteusService/DecryptionErrorGenerator/DecryptionErrorGenerator.js +2 -1
  84. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts.map +1 -1
  85. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.js +16 -20
  86. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.d.ts +7 -4
  87. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.d.ts.map +1 -1
  88. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.test.js +15 -15
  89. package/lib/messagingProtocols/proteus/ProteusService/cryptoMigrationStateStore.js +1 -1
  90. package/lib/messagingProtocols/proteus/ProteusService/identityClearer.js +2 -1
  91. package/lib/messagingProtocols/proteus/ProteusService/sessionIdMigrator.js +3 -2
  92. package/lib/messagingProtocols/proteus/ProteusService/userDomainFilters.js +2 -1
  93. package/lib/messagingProtocols/proteus/Utility/Recipients.d.ts.map +1 -1
  94. package/lib/messagingProtocols/proteus/Utility/SessionHandler/SessionHandler.d.ts.map +1 -1
  95. package/lib/messagingProtocols/proteus/Utility/SessionHandler/SessionHandler.js +14 -14
  96. package/lib/messagingProtocols/proteus/Utility/SessionHandler/SessionHandler.test.js +2 -5
  97. package/lib/messagingProtocols/proteus/Utility/getGenericMessageParams.d.ts.map +1 -1
  98. package/lib/notification/NotificationBackendRepository.d.ts +1 -1
  99. package/lib/notification/NotificationBackendRepository.js +0 -1
  100. package/lib/notification/NotificationDatabaseRepository.js +0 -1
  101. package/lib/notification/NotificationService.js +49 -38
  102. package/lib/secretStore/encryptedStore.js +22 -10
  103. package/lib/secretStore/secretKeyGenerator.js +2 -2
  104. package/lib/secretStore/secretKeyGenerator.test.js +1 -1
  105. package/lib/self/SelfService.js +1 -2
  106. package/lib/storage/CoreDB.js +3 -2
  107. package/lib/team/TeamService.js +0 -1
  108. package/lib/test/PayloadHelper.js +4 -3
  109. package/lib/testUtils/index.js +3 -2
  110. package/lib/user/UserService.d.ts +2 -2
  111. package/lib/user/UserService.js +0 -1
  112. package/lib/util/LocalStorageStore/index.d.ts.map +1 -1
  113. package/lib/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.js +6 -4
  114. package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.d.ts.map +1 -1
  115. package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.js +33 -34
  116. package/lib/util/TaskScheduler/TaskScheduler.d.ts +1 -1
  117. package/lib/util/TaskScheduler/TaskScheduler.d.ts.map +1 -1
  118. package/lib/util/TypePredicateUtil.js +10 -7
  119. package/lib/util/fullyQualifiedClientIdUtils.js +2 -1
  120. package/package.json +6 -6
@@ -18,13 +18,11 @@
18
18
  *
19
19
  */
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.NonFederatingBackendsError = void 0;
22
- exports.isNonFederatingBackendsError = isNonFederatingBackendsError;
21
+ exports.isNonFederatingBackendsError = exports.NonFederatingBackendsError = void 0;
23
22
  /**
24
23
  * This error means we are trying to add users that are parts of 2 backends that are not federating with each other to a new conversation.
25
24
  */
26
25
  class NonFederatingBackendsError extends Error {
27
- backends;
28
26
  constructor(backends) {
29
27
  super('2 backends are not connected');
30
28
  this.backends = backends;
@@ -35,3 +33,4 @@ exports.NonFederatingBackendsError = NonFederatingBackendsError;
35
33
  function isNonFederatingBackendsError(error) {
36
34
  return !!error && typeof error === 'object' && 'name' in error && error.name === 'NonFederatingBackendError';
37
35
  }
36
+ exports.isNonFederatingBackendsError = isNonFederatingBackendsError;
@@ -20,7 +20,6 @@
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.GiphyService = void 0;
22
22
  class GiphyService {
23
- apiClient;
24
23
  constructor(apiClient) {
25
24
  this.apiClient = apiClient;
26
25
  }
@@ -17,15 +17,25 @@
17
17
  * along with this program. If not, see http://www.gnu.org/licenses/.
18
18
  *
19
19
  */
20
+ var __rest = (this && this.__rest) || function (s, e) {
21
+ var t = {};
22
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
23
+ t[p] = s[p];
24
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
25
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
26
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
27
+ t[p[i]] = s[p[i]];
28
+ }
29
+ return t;
30
+ };
20
31
  Object.defineProperty(exports, "__esModule", { value: true });
21
32
  exports.LinkPreviewService = void 0;
22
33
  class LinkPreviewService {
23
- assetService;
24
34
  constructor(assetService) {
25
35
  this.assetService = assetService;
26
36
  }
27
37
  async uploadLinkPreviewImage(linkPreview, domain) {
28
- const { image, ...preview } = linkPreview;
38
+ const { image } = linkPreview, preview = __rest(linkPreview, ["image"]);
29
39
  if (!image) {
30
40
  return preview;
31
41
  }
@@ -26,8 +26,8 @@ export declare class AcmeService {
26
26
  }>>;
27
27
  createNewOrder(url: AcmeDirectory['newOrder'], payload: Uint8Array): Promise<PostJoseRequestReturnValue<{
28
28
  status: string;
29
- authorizations: string[];
30
29
  expires: string;
30
+ authorizations: string[];
31
31
  notBefore: string;
32
32
  notAfter: string;
33
33
  identifiers: {
@@ -38,11 +38,11 @@ export declare class AcmeService {
38
38
  }>>;
39
39
  getAuthorization(url: string, payload: Uint8Array): Promise<PostJoseRequestReturnValue<{
40
40
  status: string;
41
+ expires: string;
41
42
  identifier: {
42
43
  type: string;
43
44
  value: string;
44
45
  };
45
- expires: string;
46
46
  challenges: {
47
47
  type: string;
48
48
  url: string;
@@ -73,8 +73,8 @@ export declare class AcmeService {
73
73
  checkStatusOfOrder(url: string, payload: Uint8Array): Promise<PostJoseRequestReturnValue<{
74
74
  id: string;
75
75
  status: string;
76
- authorizations: string[];
77
76
  expires: string;
77
+ authorizations: string[];
78
78
  notBefore: string;
79
79
  notAfter: string;
80
80
  identifiers: {
@@ -87,8 +87,8 @@ export declare class AcmeService {
87
87
  id: string;
88
88
  certificate: string;
89
89
  status: string;
90
- authorizations: string[];
91
90
  expires: string;
91
+ authorizations: string[];
92
92
  notBefore: string;
93
93
  notAfter: string;
94
94
  identifiers: {
@@ -26,17 +26,16 @@ const axios_1 = __importDefault(require("axios"));
26
26
  const logdown_1 = __importDefault(require("logdown"));
27
27
  const schema_1 = require("./schema");
28
28
  class AcmeService {
29
- discoveryUrl;
30
- logger = (0, logdown_1.default)('@wireapp/core/AcmeService');
31
- axiosInstance = axios_1.default.create();
32
- url = {
33
- ROOTS: '/roots.pem',
34
- CRL: '/crl',
35
- PROXY_CRL: '/proxyCrl',
36
- FEDERATION: '/federation',
37
- };
38
29
  constructor(discoveryUrl) {
39
30
  this.discoveryUrl = discoveryUrl;
31
+ this.logger = (0, logdown_1.default)('@wireapp/core/AcmeService');
32
+ this.axiosInstance = axios_1.default.create();
33
+ this.url = {
34
+ ROOTS: '/roots.pem',
35
+ CRL: '/crl',
36
+ PROXY_CRL: '/proxyCrl',
37
+ FEDERATION: '/federation',
38
+ };
40
39
  }
41
40
  get acmeBaseUrl() {
42
41
  const { origin } = new URL(this.discoveryUrl);
@@ -80,8 +80,8 @@ export declare const NewOrderResponseSchema: z.ZodObject<{
80
80
  finalize: z.ZodString;
81
81
  }, "strip", z.ZodTypeAny, {
82
82
  status: string;
83
- authorizations: string[];
84
83
  expires: string;
84
+ authorizations: string[];
85
85
  notBefore: string;
86
86
  notAfter: string;
87
87
  identifiers: {
@@ -91,8 +91,8 @@ export declare const NewOrderResponseSchema: z.ZodObject<{
91
91
  finalize: string;
92
92
  }, {
93
93
  status: string;
94
- authorizations: string[];
95
94
  expires: string;
95
+ authorizations: string[];
96
96
  notBefore: string;
97
97
  notAfter: string;
98
98
  identifiers: {
@@ -136,11 +136,11 @@ export declare const AuthorizationResponseSchema: z.ZodObject<{
136
136
  }>, "many">;
137
137
  }, "strip", z.ZodTypeAny, {
138
138
  status: string;
139
+ expires: string;
139
140
  identifier: {
140
141
  type: string;
141
142
  value: string;
142
143
  };
143
- expires: string;
144
144
  challenges: {
145
145
  type: string;
146
146
  url: string;
@@ -150,11 +150,11 @@ export declare const AuthorizationResponseSchema: z.ZodObject<{
150
150
  }[];
151
151
  }, {
152
152
  status: string;
153
+ expires: string;
153
154
  identifier: {
154
155
  type: string;
155
156
  value: string;
156
157
  };
157
- expires: string;
158
158
  challenges: {
159
159
  type: string;
160
160
  url: string;
@@ -246,8 +246,8 @@ export declare const CheckStatusOfOrderResponseSchema: z.ZodObject<{
246
246
  }, "strip", z.ZodTypeAny, {
247
247
  id: string;
248
248
  status: string;
249
- authorizations: string[];
250
249
  expires: string;
250
+ authorizations: string[];
251
251
  notBefore: string;
252
252
  notAfter: string;
253
253
  identifiers: {
@@ -258,8 +258,8 @@ export declare const CheckStatusOfOrderResponseSchema: z.ZodObject<{
258
258
  }, {
259
259
  id: string;
260
260
  status: string;
261
- authorizations: string[];
262
261
  expires: string;
262
+ authorizations: string[];
263
263
  notBefore: string;
264
264
  notAfter: string;
265
265
  identifiers: {
@@ -292,8 +292,8 @@ export declare const FinalizeOrderResponseSchema: z.ZodObject<{
292
292
  id: string;
293
293
  certificate: string;
294
294
  status: string;
295
- authorizations: string[];
296
295
  expires: string;
296
+ authorizations: string[];
297
297
  notBefore: string;
298
298
  notAfter: string;
299
299
  identifiers: {
@@ -305,8 +305,8 @@ export declare const FinalizeOrderResponseSchema: z.ZodObject<{
305
305
  id: string;
306
306
  certificate: string;
307
307
  status: string;
308
- authorizations: string[];
309
308
  expires: string;
309
+ authorizations: string[];
310
310
  notBefore: string;
311
311
  notAfter: string;
312
312
  identifiers: {
@@ -31,13 +31,6 @@ const LowPrecisionTaskScheduler_1 = require("../../../util/LowPrecisionTaskSched
31
31
  const qualifiedIdUtil_1 = require("../../../util/qualifiedIdUtil");
32
32
  // This export is meant to be accessible from the outside (e.g the Webapp / UI)
33
33
  class E2EIServiceExternal extends commons_1.TypedEventEmitter {
34
- coreCryptoClient;
35
- coreDatabase;
36
- recurringTaskScheduler;
37
- clientService;
38
- mlsService;
39
- _acmeService;
40
- enrollmentStorage;
41
34
  constructor(coreCryptoClient, coreDatabase, recurringTaskScheduler, clientService, mlsService) {
42
35
  super();
43
36
  this.coreCryptoClient = coreCryptoClient;
@@ -90,31 +83,13 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
90
83
  .map(fullyQualifiedId => (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(fullyQualifiedId));
91
84
  const mappedUserIdentities = new Map();
92
85
  for (const userId of userIds) {
93
- const identities = (userIdentities.get(userId.id) || []).map(identity => ({
94
- ...identity,
95
- deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client,
96
- qualifiedUserId: userId,
97
- }));
86
+ const identities = (userIdentities.get(userId.id) || []).map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, qualifiedUserId: userId })));
98
87
  const basicMLSDevices = allUsersMLSDevices
99
88
  .filter(({ user }) => user === userId.id)
100
89
  // filtering devices that have a valid identity
101
90
  .filter(({ client }) => !identities.map(identity => identity.deviceId).includes(client))
102
91
  // map basic MLS devices to "fake" identity object
103
- .map(id => ({
104
- ...id,
105
- deviceId: id.client,
106
- thumbprint: '',
107
- user: '',
108
- certificate: '',
109
- displayName: '',
110
- handle: '',
111
- notAfter: BigInt(0),
112
- notBefore: BigInt(0),
113
- serialNumber: '',
114
- clientId: id.client,
115
- qualifiedUserId: userId,
116
- credentialType: core_crypto_1.CredentialType.Basic,
117
- }));
92
+ .map(id => (Object.assign(Object.assign({}, id), { deviceId: id.client, thumbprint: '', user: '', certificate: '', displayName: '', handle: '', notAfter: BigInt(0), notBefore: BigInt(0), serialNumber: '', clientId: id.client, qualifiedUserId: userId, credentialType: core_crypto_1.CredentialType.Basic })));
118
93
  mappedUserIdentities.set((0, qualifiedIdUtil_1.stringifyQualifiedId)(userId), [...identities, ...basicMLSDevices]);
119
94
  }
120
95
  return mappedUserIdentities;
@@ -123,12 +98,7 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
123
98
  async getDevicesIdentities(groupId, userClientsMap) {
124
99
  const clientIds = Object.entries(userClientsMap).map(([clientId, userId]) => (0, Helper_1.getE2EIClientId)(clientId, userId.id, userId.domain).asBytes);
125
100
  const deviceIdentities = await this.coreCryptoClient.getDeviceIdentities(bazinga64_1.Decoder.fromBase64(groupId).asBytes, clientIds);
126
- return deviceIdentities.map(identity => ({
127
- ...identity,
128
- deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client,
129
- credentialType: identity.credentialType,
130
- qualifiedUserId: userClientsMap[identity.clientId],
131
- }));
101
+ return deviceIdentities.map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, credentialType: identity.credentialType, qualifiedUserId: userClientsMap[identity.clientId] })));
132
102
  }
133
103
  async isFreshMLSSelfClient() {
134
104
  const client = await this.clientService.loadClient();
@@ -46,7 +46,7 @@ async function buildE2EIService(dbName = 'core-test-db') {
46
46
  };
47
47
  const recurringTaskScheduler = new RecurringTaskScheduler_1.RecurringTaskScheduler({
48
48
  delete: key => mockedDb.delete('recurringTasks', key),
49
- get: async (key) => (await mockedDb.get('recurringTasks', key))?.firingDate,
49
+ get: async (key) => { var _a; return (_a = (await mockedDb.get('recurringTasks', key))) === null || _a === void 0 ? void 0 : _a.firingDate; },
50
50
  set: async (key, timestamp) => {
51
51
  await mockedDb.put('recurringTasks', { key, firingDate: timestamp }, key);
52
52
  },
@@ -78,8 +78,8 @@ describe('E2EIServiceExternal', () => {
78
78
  const userIds = [user1, user2];
79
79
  jest.spyOn(mlsService, 'conversationExists').mockResolvedValue(false);
80
80
  const userIdentities = await service.getUsersIdentities(groupId, userIds);
81
- expect(userIdentities?.get((0, qualifiedIdUtil_1.stringifyQualifiedId)(user1))).toEqual(undefined);
82
- expect(userIdentities?.get((0, qualifiedIdUtil_1.stringifyQualifiedId)(user2))).toEqual(undefined);
81
+ expect(userIdentities === null || userIdentities === void 0 ? void 0 : userIdentities.get((0, qualifiedIdUtil_1.stringifyQualifiedId)(user1))).toEqual(undefined);
82
+ expect(userIdentities === null || userIdentities === void 0 ? void 0 : userIdentities.get((0, qualifiedIdUtil_1.stringifyQualifiedId)(user2))).toEqual(undefined);
83
83
  });
84
84
  it('returns the user identities', async () => {
85
85
  const [service, { coreCrypto, mlsService }] = await buildE2EIService();
@@ -92,8 +92,8 @@ describe('E2EIServiceExternal', () => {
92
92
  ]));
93
93
  jest.spyOn(mlsService, 'conversationExists').mockResolvedValue(true);
94
94
  const userIdentities = await service.getUsersIdentities(groupId, userIds);
95
- expect(userIdentities?.get((0, qualifiedIdUtil_1.stringifyQualifiedId)(user1))).toHaveLength(2);
96
- expect(userIdentities?.get((0, qualifiedIdUtil_1.stringifyQualifiedId)(user2))).toHaveLength(1);
95
+ expect(userIdentities === null || userIdentities === void 0 ? void 0 : userIdentities.get((0, qualifiedIdUtil_1.stringifyQualifiedId)(user1))).toHaveLength(2);
96
+ expect(userIdentities === null || userIdentities === void 0 ? void 0 : userIdentities.get((0, qualifiedIdUtil_1.stringifyQualifiedId)(user2))).toHaveLength(1);
97
97
  });
98
98
  it('returns MLS basic devices with empty identity', async () => {
99
99
  const [service, { coreCrypto, mlsService }] = await buildE2EIService();
@@ -114,8 +114,8 @@ describe('E2EIServiceExternal', () => {
114
114
  coreCrypto.getClientIds.mockResolvedValue(allClients.map(clientId => encoder.encode(clientId)));
115
115
  jest.spyOn(mlsService, 'conversationExists').mockResolvedValue(true);
116
116
  const userIdentities = await service.getUsersIdentities(groupId, userIds);
117
- expect(userIdentities?.get((0, qualifiedIdUtil_1.stringifyQualifiedId)(user1))).toHaveLength(3);
118
- expect(userIdentities?.get((0, qualifiedIdUtil_1.stringifyQualifiedId)(user2))).toHaveLength(1);
117
+ expect(userIdentities === null || userIdentities === void 0 ? void 0 : userIdentities.get((0, qualifiedIdUtil_1.stringifyQualifiedId)(user1))).toHaveLength(3);
118
+ expect(userIdentities === null || userIdentities === void 0 ? void 0 : userIdentities.get((0, qualifiedIdUtil_1.stringifyQualifiedId)(user2))).toHaveLength(1);
119
119
  });
120
120
  });
121
121
  describe('getAllGroupUsersIdentities', () => {
@@ -135,8 +135,8 @@ describe('E2EIServiceExternal', () => {
135
135
  jest.spyOn(mlsService, 'getClientIds').mockResolvedValue(clientIds);
136
136
  jest.spyOn(mlsService, 'conversationExists').mockResolvedValue(false);
137
137
  const userIdentities = await service.getAllGroupUsersIdentities(groupId);
138
- expect(userIdentities?.get((0, qualifiedIdUtil_1.stringifyQualifiedId)({ domain: user1.domain, id: user1.userId }))).toEqual(undefined);
139
- expect(userIdentities?.get((0, qualifiedIdUtil_1.stringifyQualifiedId)({ domain: user2.domain, id: user2.userId }))).toEqual(undefined);
138
+ expect(userIdentities === null || userIdentities === void 0 ? void 0 : userIdentities.get((0, qualifiedIdUtil_1.stringifyQualifiedId)({ domain: user1.domain, id: user1.userId }))).toEqual(undefined);
139
+ expect(userIdentities === null || userIdentities === void 0 ? void 0 : userIdentities.get((0, qualifiedIdUtil_1.stringifyQualifiedId)({ domain: user2.domain, id: user2.userId }))).toEqual(undefined);
140
140
  });
141
141
  it('returns all the user identities of a mls group', async () => {
142
142
  const [service, { coreCrypto, mlsService }] = await buildE2EIService();
@@ -161,8 +161,8 @@ describe('E2EIServiceExternal', () => {
161
161
  [user2.userId, [generateCoreCryptoIdentity({ userId: user2.userId })]],
162
162
  ]));
163
163
  const userIdentities = await service.getAllGroupUsersIdentities(groupId);
164
- expect(userIdentities?.get((0, qualifiedIdUtil_1.stringifyQualifiedId)({ id: user1.userId, domain: user1.domain }))).toHaveLength(2);
165
- expect(userIdentities?.get((0, qualifiedIdUtil_1.stringifyQualifiedId)({ id: user2.userId, domain: user2.domain }))).toHaveLength(1);
164
+ expect(userIdentities === null || userIdentities === void 0 ? void 0 : userIdentities.get((0, qualifiedIdUtil_1.stringifyQualifiedId)({ id: user1.userId, domain: user1.domain }))).toHaveLength(2);
165
+ expect(userIdentities === null || userIdentities === void 0 ? void 0 : userIdentities.get((0, qualifiedIdUtil_1.stringifyQualifiedId)({ id: user2.userId, domain: user2.domain }))).toHaveLength(1);
166
166
  });
167
167
  });
168
168
  describe('initialize', () => {
@@ -33,14 +33,6 @@ const OidcChallenge_1 = require("./Steps/OidcChallenge");
33
33
  const Order_1 = require("./Steps/Order");
34
34
  const E2EIStorage_1 = require("./Storage/E2EIStorage");
35
35
  class E2EIServiceInternal {
36
- coreCryptoClient;
37
- apiClient;
38
- certificateTtl;
39
- keyPackagesAmount;
40
- initialData;
41
- logger = (0, logdown_1.default)('@wireapp/core/E2EIdentityServiceInternal');
42
- acmeService;
43
- enrollmentStorage;
44
36
  constructor(coreDb, coreCryptoClient, apiClient,
45
37
  /** number of seconds the certificate should be valid */
46
38
  certificateTtl, keyPackagesAmount, initialData) {
@@ -49,6 +41,7 @@ class E2EIServiceInternal {
49
41
  this.certificateTtl = certificateTtl;
50
42
  this.keyPackagesAmount = keyPackagesAmount;
51
43
  this.initialData = initialData;
44
+ this.logger = (0, logdown_1.default)('@wireapp/core/E2EIdentityServiceInternal');
52
45
  const { discoveryUrl } = initialData;
53
46
  this.acmeService = new AcmeServer_1.AcmeService(discoveryUrl);
54
47
  this.enrollmentStorage = (0, E2EIStorage_1.createE2EIEnrollmentStorage)(coreDb);
@@ -75,10 +68,7 @@ class E2EIServiceInternal {
75
68
  const challengeData = { challenge: oidcChallenge, keyAuth: keyauth };
76
69
  // store auth data for continuing the flow later on (in case we are redirected to the identity provider)
77
70
  const handle = await this.coreCryptoClient.e2eiEnrollmentStash(identity);
78
- const enrollmentData = {
79
- handle,
80
- ...enrollmentChallenges,
81
- };
71
+ const enrollmentData = Object.assign({ handle }, enrollmentChallenges);
82
72
  await this.enrollmentStorage.savePendingEnrollmentData(enrollmentData);
83
73
  // At this point we might be redirected to the identity provider. We have
84
74
  const oAuthToken = await getOAuthToken(challengeData);
@@ -153,7 +143,7 @@ class E2EIServiceInternal {
153
143
  authzUrls: orderData.authzUrls,
154
144
  nonce: orderData.nonce,
155
145
  });
156
- return { orderUrl: orderData.orderUrl, ...authChallenges };
146
+ return Object.assign({ orderUrl: orderData.orderUrl }, authChallenges);
157
147
  }
158
148
  /**
159
149
  * Continuation of the ACME enrollment flow
@@ -172,7 +162,7 @@ class E2EIServiceInternal {
172
162
  identity,
173
163
  nonce: enrollmentData.nonce,
174
164
  });
175
- this.logger.debug('oidc data', oidcData);
165
+ this.logger.log('oidc data', oidcData);
176
166
  if (!oidcData.data.validated) {
177
167
  throw new Error('Error while trying to continue OAuth flow. OIDC challenge not validated');
178
168
  }
@@ -188,7 +178,7 @@ class E2EIServiceInternal {
188
178
  expirySecs: 30,
189
179
  nonce: oidcData.nonce,
190
180
  });
191
- this.logger.debug('dpop data', dpopData);
181
+ this.logger.log('dpop data', dpopData);
192
182
  if (!(0, Helper_1.isResponseStatusValid)(dpopData.data.status)) {
193
183
  throw new Error('Error while trying to continue OAuth flow. DPOP challenge not validated');
194
184
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Helper/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,yBAAyB,EAAE,gBAAgB,EAAC,MAAM,gCAAgC,CAAC;AAE3F,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAC,kBAAkB,EAAkC,MAAM,8CAA8C,CAAC;AAEjH,eAAO,MAAM,eAAe,SAAU,GAAG,KAAG,UAG3C,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,OAAO,EAAE,UAAU,CAAC;CACrB,CAAC;AACF,eAAO,MAAM,eAAe,aAAc,MAAM,UAAU,MAAM,cAAc,MAAM,KAAG,yBAOtF,CAAC;AAgBF,eAAO,MAAM,mCAAmC,gBAAiB,WAAW,KAAG,yBAE9E,CAAC;AAEF,eAAO,MAAM,WAAW,wBAAuB,gBAAgB,eAAe,WAAW,YAIxF,CAAC;AAEF,eAAO,MAAM,qBAAqB,WAAY,MAAM,GAAG,SAAS,6BAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Helper/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,yBAAyB,EAAE,gBAAgB,EAAC,MAAM,gCAAgC,CAAC;AAE3F,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAC,kBAAkB,EAAkC,MAAM,8CAA8C,CAAC;AAEjH,eAAO,MAAM,eAAe,SAAU,GAAG,KAAG,UAG3C,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,OAAO,EAAE,UAAU,CAAC;CACrB,CAAC;AACF,eAAO,MAAM,eAAe,aAAc,MAAM,UAAU,MAAM,cAAc,MAAM,KAAG,yBAOtF,CAAC;AAeF,eAAO,MAAM,mCAAmC,gBAAiB,WAAW,KAAG,yBAE9E,CAAC;AAEF,eAAO,MAAM,WAAW,wBAAuB,gBAAgB,eAAe,WAAW,YAIxF,CAAC;AAEF,eAAO,MAAM,qBAAqB,WAAY,MAAM,GAAG,SAAS,6BAAiC,CAAC"}
@@ -47,7 +47,6 @@ const ciphersuiteSignatureAlgorithmMap = {
47
47
  [core_crypto_1.Ciphersuite.MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448]: client_1.MLSPublicKeyAlgorithmKeys.ED448,
48
48
  [core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519]: client_1.MLSPublicKeyAlgorithmKeys.ED25519,
49
49
  [core_crypto_1.Ciphersuite.MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519]: client_1.MLSPublicKeyAlgorithmKeys.ED25519,
50
- [core_crypto_1.Ciphersuite.MLS_128_X25519KYBER768DRAFT00_AES128GCM_SHA256_Ed25519]: client_1.MLSPublicKeyAlgorithmKeys.ED25519,
51
50
  };
52
51
  const getSignatureAlgorithmForCiphersuite = (ciphersuite) => {
53
52
  return ciphersuiteSignatureAlgorithmMap[ciphersuite];
@@ -1 +1 @@
1
- {"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Steps/Account.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAC,aAAa,EAAE,cAAc,EAAE,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAG1E,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,cAAc,CAAC;IACzB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AACF,KAAK,2BAA2B,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAElD,eAAO,MAAM,gBAAgB,gDAK1B,sBAAsB,KAAG,2BAU3B,CAAC"}
1
+ {"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Steps/Account.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAC,aAAa,EAAE,cAAc,EAAE,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAG1E,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,cAAc,CAAC;IACzB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AACF,KAAK,2BAA2B,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAElD,eAAO,MAAM,gBAAgB,gDAK1B,sBAAsB,gCAUxB,CAAC"}
@@ -23,7 +23,7 @@ const Helper_1 = require("../Helper");
23
23
  const createNewAccount = async ({ nonce, connection, directory, identity, }) => {
24
24
  const reqBody = await identity.newAccountRequest(nonce);
25
25
  const response = await connection.createNewAccount(directory.newAccount, reqBody);
26
- if (response?.data && !!response.data.status.length && !!response.nonce.length) {
26
+ if ((response === null || response === void 0 ? void 0 : response.data) && !!response.data.status.length && !!response.nonce.length) {
27
27
  await identity.newAccountResponse((0, Helper_1.jsonToByteArray)(response.data));
28
28
  return response.nonce;
29
29
  }
@@ -7,6 +7,6 @@ interface GetAuthorizationParams {
7
7
  identity: E2eiEnrollment;
8
8
  connection: AcmeService;
9
9
  }
10
- export declare const getAuthorizationChallenges: ({ authzUrls, nonce, identity, connection, }: GetAuthorizationParams) => Promise<Pick<EnrollmentFlowData, "authorization" | "nonce">>;
10
+ export declare const getAuthorizationChallenges: ({ authzUrls, nonce, identity, connection, }: GetAuthorizationParams) => Promise<Pick<EnrollmentFlowData, 'authorization' | 'nonce'>>;
11
11
  export {};
12
12
  //# sourceMappingURL=Authorization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Authorization.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,cAAc,EAAgB,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AAEjE,UAAU,sBAAsB;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,cAAc,CAAC;IACzB,UAAU,EAAE,WAAW,CAAC;CACzB;AAED,eAAO,MAAM,0BAA0B,gDAKpC,sBAAsB,KAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,eAAe,GAAG,OAAO,CAAC,CAsCtF,CAAC"}
1
+ {"version":3,"file":"Authorization.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,cAAc,EAAgB,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AAEjE,UAAU,sBAAsB;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,cAAc,CAAC;IACzB,UAAU,EAAE,WAAW,CAAC;CACzB;AAED,eAAO,MAAM,0BAA0B,gDAKpC,sBAAsB,KAAG,QAAQ,KAAK,kBAAkB,EAAE,eAAe,GAAG,OAAO,CAAC,CAsCtF,CAAC"}
@@ -21,6 +21,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.getAuthorizationChallenges = void 0;
22
22
  const Helper_1 = require("../Helper");
23
23
  const getAuthorizationChallenges = async ({ authzUrls, nonce, identity, connection, }) => {
24
+ var _a, _b;
24
25
  const challenges = [];
25
26
  for (const authzUrl of authzUrls) {
26
27
  const reqBody = await identity.newAuthzRequest(authzUrl, nonce);
@@ -31,8 +32,8 @@ const getAuthorizationChallenges = async ({ authzUrls, nonce, identity, connecti
31
32
  challenges.push({ type: backendChallenge.type, challenge });
32
33
  nonce = response.nonce;
33
34
  }
34
- const { challenge: oidcChallenge } = challenges.find(challenge => challenge.type.includes('oidc')) ?? {};
35
- const { challenge: dpopChallenge } = challenges.find(challenge => challenge.type.includes('dpop')) ?? {};
35
+ const { challenge: oidcChallenge } = (_a = challenges.find(challenge => challenge.type.includes('oidc'))) !== null && _a !== void 0 ? _a : {};
36
+ const { challenge: dpopChallenge } = (_b = challenges.find(challenge => challenge.type.includes('dpop'))) !== null && _b !== void 0 ? _b : {};
36
37
  if (!dpopChallenge || !oidcChallenge) {
37
38
  throw new Error('missing dpop or oidc challenge');
38
39
  }
@@ -22,7 +22,7 @@ exports.getCertificate = void 0;
22
22
  const getCertificate = async ({ certificateUrl, connection, identity, nonce }) => {
23
23
  const reqBody = await identity.certificateRequest(nonce);
24
24
  const certificateResponse = await connection.getCertificate(certificateUrl, reqBody);
25
- if (certificateResponse?.data) {
25
+ if (certificateResponse === null || certificateResponse === void 0 ? void 0 : certificateResponse.data) {
26
26
  return {
27
27
  certificate: certificateResponse.data,
28
28
  nonce: certificateResponse.nonce,
@@ -1 +1 @@
1
- {"version":3,"file":"Order.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Steps/Order.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAGxF,KAAK,QAAQ,GAAG,MAAM,CAAC;AAEvB,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,WAAW,CAAC;CACzB;AACD,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,cAAc,gDAKxB,oBAAoB,KAAG,OAAO,CAAC,yBAAyB,CAY1D,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;CACpB;AACD,eAAO,MAAM,aAAa,8CAAmD,mBAAmB;;;EAqB/F,CAAC"}
1
+ {"version":3,"file":"Order.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Steps/Order.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAGxF,KAAK,QAAQ,GAAG,MAAM,CAAC;AAEvB,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,WAAW,CAAC;CACzB;AACD,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,cAAc,gDAKxB,oBAAoB,KAAG,QAAQ,yBAAyB,CAY1D,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;CACpB;AACD,eAAO,MAAM,aAAa,8CAAmD,mBAAmB;;;EAqB/F,CAAC"}
@@ -37,11 +37,11 @@ exports.createNewOrder = createNewOrder;
37
37
  const finalizeOrder = async ({ identity, nonce, orderUrl, connection }) => {
38
38
  const statusReqBody = await identity.checkOrderRequest(orderUrl, nonce);
39
39
  const statusResponse = await connection.checkStatusOfOrder(orderUrl, statusReqBody);
40
- if (statusResponse?.data && !!statusResponse.data.status.length && !!statusResponse.nonce.length) {
40
+ if ((statusResponse === null || statusResponse === void 0 ? void 0 : statusResponse.data) && !!statusResponse.data.status.length && !!statusResponse.nonce.length) {
41
41
  const finalizeUrl = await identity.checkOrderResponse((0, Helper_1.jsonToByteArray)(statusResponse.data));
42
42
  const finalizeReqBody = await identity.finalizeRequest(statusResponse.nonce);
43
43
  const finalizeResponse = await connection.finalizeOrder(finalizeUrl, finalizeReqBody);
44
- if (finalizeResponse?.data && !!finalizeResponse.data.status.length && !!finalizeResponse.nonce.length) {
44
+ if ((finalizeResponse === null || finalizeResponse === void 0 ? void 0 : finalizeResponse.data) && !!finalizeResponse.data.status.length && !!finalizeResponse.nonce.length) {
45
45
  const certificateUrl = await identity.finalizeResponse((0, Helper_1.jsonToByteArray)(finalizeResponse.data));
46
46
  return {
47
47
  certificateUrl,
@@ -1 +1 @@
1
- {"version":3,"file":"E2EIStorage.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAKxD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY;gCAE1B,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;oCAGnC,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;mCAGnC,OAAO,CAAC,IAAI,CAAC;EAIrD"}
1
+ {"version":3,"file":"E2EIStorage.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAKxD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY;gCAE1B,QAAQ,kBAAkB,GAAG,SAAS,CAAC;oCAGnC,kBAAkB,GAAG,QAAQ,IAAI,CAAC;mCAGnC,QAAQ,IAAI,CAAC;EAIrD"}
@@ -18,7 +18,7 @@
18
18
  *
19
19
  */
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.createE2EIEnrollmentStorage = createE2EIEnrollmentStorage;
21
+ exports.createE2EIEnrollmentStorage = void 0;
22
22
  const PENDING_ENROLLMENT_TABLE = 'pendingEnrollmentData';
23
23
  const STORAGE_KEY = 'data';
24
24
  function createE2EIEnrollmentStorage(coreDB) {
@@ -34,3 +34,4 @@ function createE2EIEnrollmentStorage(coreDB) {
34
34
  },
35
35
  };
36
36
  }
37
+ exports.createE2EIEnrollmentStorage = createE2EIEnrollmentStorage;
@@ -102,8 +102,6 @@ export declare const EnrollmentFlowDataSchema: z.ZodObject<{
102
102
  nonce: z.ZodString;
103
103
  }, "strip", z.ZodTypeAny, {
104
104
  nonce: string;
105
- handle: Uint8Array;
106
- orderUrl: string;
107
105
  authorization: {
108
106
  keyauth: string;
109
107
  dpopChallenge: {
@@ -117,10 +115,10 @@ export declare const EnrollmentFlowDataSchema: z.ZodObject<{
117
115
  delegate: Uint8Array;
118
116
  };
119
117
  };
120
- }, {
121
- nonce: string;
122
118
  handle: Uint8Array;
123
119
  orderUrl: string;
120
+ }, {
121
+ nonce: string;
124
122
  authorization: {
125
123
  keyauth: string;
126
124
  dpopChallenge: {
@@ -134,6 +132,8 @@ export declare const EnrollmentFlowDataSchema: z.ZodObject<{
134
132
  delegate: Uint8Array;
135
133
  };
136
134
  };
135
+ handle: Uint8Array;
136
+ orderUrl: string;
137
137
  }>;
138
138
  export type EnrollmentFlowData = z.infer<typeof EnrollmentFlowDataSchema>;
139
139
  export type UnidentifiedEnrollmentFlowData = Omit<EnrollmentFlowData, 'handle'>;
@@ -1 +1 @@
1
- {"version":3,"file":"IncomingMesssagesQueue.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/IncomingMesssagesQueue.ts"],"names":[],"mappings":"AA2CA,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
+ {"version":3,"file":"IncomingMesssagesQueue.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/IncomingMesssagesQueue.ts"],"names":[],"mappings":"AA2CA,eAAO,MAAM,uBAAuB,kCAAyC,GAAG,EAAE,KAAK,GAAG,WAC/E,MAAM,WACN,YAAY,KACpB,QAAQ,WAAW,YAAY,CAAC,CAGlC,CAAC;AAEF,eAAO,MAAM,sBAAsB,YAAa,MAAM,SAErD,CAAC;AAcF,eAAO,MAAM,0BAA0B,eAAsB,MAAM,MAAM,MAAM,QAAQ,CAAC,CAAC,KAAG,QAAQ,CAAC,CAUpG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"messageAdd.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,8BAA8B,EAAC,MAAM,+BAA+B,CAAC;AAK7E,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,UAAU,EAAuB,MAAM,gCAAgC,CAAC;AAEhF,UAAU,yBAAyB;IACjC,KAAK,EAAE,8BAA8B,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,oCAI7B,yBAAyB,KAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAoChE,CAAC"}
1
+ {"version":3,"file":"messageAdd.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,8BAA8B,EAAC,MAAM,+BAA+B,CAAC;AAK7E,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,UAAU,EAAuB,MAAM,gCAAgC,CAAC;AAEhF,UAAU,yBAAyB;IACjC,KAAK,EAAE,8BAA8B,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,oCAI7B,yBAAyB,KAAG,QAAQ,mBAAmB,GAAG,IAAI,CAoChE,CAAC"}
@@ -37,7 +37,7 @@ const handleMLSMessageAdd = async ({ event, groupId, mlsService, }) => {
37
37
  // Those proposals are stored inside of coreCrypto and will be handled after a timeout
38
38
  await mlsService.handlePendingProposals({
39
39
  groupId,
40
- delayInMs: commitDelay ?? 0,
40
+ delayInMs: commitDelay !== null && commitDelay !== void 0 ? commitDelay : 0,
41
41
  eventTime: event.time,
42
42
  });
43
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"welcomeMessage.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAG1E,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,UAAU,0BAA0B;IAClC,KAAK,EAAE,2BAA2B,CAAC;IACnC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,uBAAuB,2BAGjC,0BAA0B,KAAG,OAAO,CAAC,mBAAmB,CAiB1D,CAAC"}
1
+ {"version":3,"file":"welcomeMessage.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAG1E,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,UAAU,0BAA0B;IAClC,KAAK,EAAE,2BAA2B,CAAC;IACnC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,uBAAuB,2BAGjC,0BAA0B,KAAG,QAAQ,mBAAmB,CAiB1D,CAAC"}
@@ -31,7 +31,7 @@ const handleMLSWelcomeMessage = async ({ mlsService, event, }) => {
31
31
  const newEpoch = await mlsService.getEpoch(groupIdStr);
32
32
  mlsService.emit('newEpoch', { groupId: groupIdStr, epoch: newEpoch });
33
33
  return {
34
- event: { ...event, data: groupIdStr },
34
+ event: Object.assign(Object.assign({}, event), { data: groupIdStr }),
35
35
  };
36
36
  };
37
37
  exports.handleMLSWelcomeMessage = handleMLSWelcomeMessage;
@@ -20,19 +20,15 @@
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  const event_1 = require("@wireapp/api-client/lib/event");
22
22
  const welcomeMessage_1 = require("./welcomeMessage");
23
- jest.mock('bazinga64', () => ({
24
- ...jest.requireActual('bazinga64'),
25
- Decoder: {
23
+ jest.mock('bazinga64', () => (Object.assign(Object.assign({}, jest.requireActual('bazinga64')), { Decoder: {
26
24
  fromBase64: jest.fn().mockImplementation((value) => ({
27
25
  asBytes: jest.fn().mockReturnValue(value),
28
26
  })),
29
- },
30
- Encoder: {
27
+ }, Encoder: {
31
28
  toBase64: jest.fn().mockImplementation((value) => ({
32
29
  asString: value,
33
30
  })),
34
- },
35
- }));
31
+ } })));
36
32
  const mockParams = {
37
33
  event: {
38
34
  type: event_1.CONVERSATION_EVENT.MLS_WELCOME_MESSAGE,
@@ -24,7 +24,6 @@ var ClientMLSErrorLabel;
24
24
  ClientMLSErrorLabel["NO_KEY_PACKAGES_AVAILABLE"] = "no-key-packages-available";
25
25
  })(ClientMLSErrorLabel || (exports.ClientMLSErrorLabel = ClientMLSErrorLabel = {}));
26
26
  class ClientMLSError extends Error {
27
- label;
28
27
  constructor(label) {
29
28
  super();
30
29
  this.label = label;
@@ -1 +1 @@
1
- {"version":3,"file":"CoreCryptoMLSError.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/CoreCryptoMLSError.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;CAcrB,CAAC;AAEX,eAAO,MAAM,8BAA8B,UAAW,OAAO,KAAG,OAE/D,CAAC;AAEF,eAAO,MAAM,6CAA6C,UAAW,OAAO,KAAG,OAE9E,CAAC;AAEF,eAAO,MAAM,wCAAwC,UAAW,OAAO,KAAG,OAEzE,CAAC;AAWF,eAAO,MAAM,iCAAiC,UAAW,OAAO,KAAG,KAAK,IAAI,KAE3E,CAAC"}
1
+ {"version":3,"file":"CoreCryptoMLSError.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/CoreCryptoMLSError.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;CAcrB,CAAC;AAEX,eAAO,MAAM,8BAA8B,UAAW,OAAO,KAAG,OAE/D,CAAC;AAEF,eAAO,MAAM,6CAA6C,UAAW,OAAO,KAAG,OAE9E,CAAC;AAEF,eAAO,MAAM,wCAAwC,UAAW,OAAO,KAAG,OAEzE,CAAC;AAWF,eAAO,MAAM,iCAAiC,UAAW,OAAO,mBAE/D,CAAC"}