@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
package/lib/Account.js CHANGED
@@ -40,6 +40,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
40
40
  __setModuleDefault(result, mod);
41
41
  return result;
42
42
  };
43
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
44
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
45
+ var m = o[Symbol.asyncIterator], i;
46
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
47
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
48
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
49
+ };
43
50
  var __importDefault = (this && this.__importDefault) || function (mod) {
44
51
  return (mod && mod.__esModule) ? mod : { "default": mod };
45
52
  };
@@ -103,19 +110,6 @@ const coreDefaultClient = {
103
110
  model: '@wireapp/core',
104
111
  };
105
112
  class Account extends commons_1.TypedEventEmitter {
106
- options;
107
- apiClient;
108
- logger;
109
- coreCryptoConfig;
110
- /** this is the client the consumer is currently using. Will be set as soon as `initClient` is called and will be rest upon logout */
111
- currentClient;
112
- storeEngine;
113
- db;
114
- encryptedDb;
115
- coreCallbacks;
116
- service;
117
- backendFeatures;
118
- recurringTaskScheduler;
119
113
  /**
120
114
  * @param apiClient The apiClient instance to use in the core (will create a new new one if undefined)
121
115
  * @param accountOptions
@@ -123,19 +117,29 @@ class Account extends commons_1.TypedEventEmitter {
123
117
  constructor(apiClient = new api_client_1.APIClient(), options = { nbPrekeys: 100 }) {
124
118
  super();
125
119
  this.options = options;
120
+ this.groupIdFromConversationId = async (conversationId, subconversationId) => {
121
+ var _a, _b;
122
+ if (!subconversationId) {
123
+ return (_a = this.coreCallbacks) === null || _a === void 0 ? void 0 : _a.groupIdFromConversationId(conversationId);
124
+ }
125
+ return (_b = this.service) === null || _b === void 0 ? void 0 : _b.subconversation.getSubconversationGroupId(conversationId, subconversationId);
126
+ };
126
127
  this.apiClient = apiClient;
127
128
  this.backendFeatures = this.apiClient.backendFeatures;
128
129
  this.coreCryptoConfig = options.coreCryptoConfig;
129
130
  this.recurringTaskScheduler = new RecurringTaskScheduler_1.RecurringTaskScheduler({
130
131
  get: async (key) => {
131
- const task = await this.db?.get('recurringTasks', key);
132
- return task?.firingDate;
132
+ var _a;
133
+ const task = await ((_a = this.db) === null || _a === void 0 ? void 0 : _a.get('recurringTasks', key));
134
+ return task === null || task === void 0 ? void 0 : task.firingDate;
133
135
  },
134
136
  set: async (key, timestamp) => {
135
- await this.db?.put('recurringTasks', { key, firingDate: timestamp }, key);
137
+ var _a;
138
+ await ((_a = this.db) === null || _a === void 0 ? void 0 : _a.put('recurringTasks', { key, firingDate: timestamp }, key));
136
139
  },
137
140
  delete: async (key) => {
138
- await this.db?.delete('recurringTasks', key);
141
+ var _a;
142
+ await ((_a = this.db) === null || _a === void 0 ? void 0 : _a.delete('recurringTasks', key));
139
143
  },
140
144
  });
141
145
  apiClient.on(api_client_1.APIClient.TOPIC.COOKIE_REFRESH, async (cookie) => {
@@ -175,12 +179,13 @@ class Account extends commons_1.TypedEventEmitter {
175
179
  return storeEngine.updateOrCreate(auth_1.AUTH_TABLE_NAME, auth_1.AUTH_COOKIE_KEY, entity);
176
180
  }
177
181
  async enrollE2EI({ displayName, handle, teamId, discoveryUrl, getOAuthToken, certificateTtl = 90 * (TimeUtil_1.TimeInMillis.DAY / 1000), }) {
182
+ var _a, _b, _c, _d;
178
183
  const context = this.apiClient.context;
179
- const domain = context?.domain ?? '';
184
+ const domain = (_a = context === null || context === void 0 ? void 0 : context.domain) !== null && _a !== void 0 ? _a : '';
180
185
  if (!this.currentClient) {
181
186
  throw new Error('Client has not been initialized - please login first');
182
187
  }
183
- if (!this.service?.mls?.isEnabled || !this.service?.e2eIdentity) {
188
+ if (!((_c = (_b = this.service) === null || _b === void 0 ? void 0 : _b.mls) === null || _c === void 0 ? void 0 : _c.isEnabled) || !((_d = this.service) === null || _d === void 0 ? void 0 : _d.e2eIdentity)) {
184
189
  throw new Error('MLS not initialized, unable to enroll E2EI');
185
190
  }
186
191
  const user = {
@@ -251,7 +256,8 @@ class Account extends commons_1.TypedEventEmitter {
251
256
  return client;
252
257
  }
253
258
  getLocalClient() {
254
- return this.service?.client.loadClient();
259
+ var _a;
260
+ return (_a = this.service) === null || _a === void 0 ? void 0 : _a.client.loadClient();
255
261
  }
256
262
  /**
257
263
  * Will initiate all the cryptographic material of the given registered device and setup all the background tasks.
@@ -291,11 +297,7 @@ class Account extends commons_1.TypedEventEmitter {
291
297
  const coreCryptoConfig = this.coreCryptoConfig;
292
298
  if (coreCryptoConfig) {
293
299
  const { buildClient } = await Promise.resolve().then(() => __importStar(require('./messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper')));
294
- const client = await buildClient(storeEngine, {
295
- ...baseConfig,
296
- ...coreCryptoConfig,
297
- generateSecretKey: keyId => (0, secretKeyGenerator_1.generateSecretKey)({ keyId, keySize: 16, secretsDb: encryptedStore }),
298
- });
300
+ const client = await buildClient(storeEngine, Object.assign(Object.assign(Object.assign({}, baseConfig), coreCryptoConfig), { generateSecretKey: keyId => (0, secretKeyGenerator_1.generateSecretKey)({ keyId, keySize: 16, secretsDb: encryptedStore }) }));
299
301
  return [CryptoClient_1.CryptoClientType.CORE_CRYPTO, client];
300
302
  }
301
303
  const { buildClient } = await Promise.resolve().then(() => __importStar(require('./messagingProtocols/proteus/ProteusService/CryptoClient/CryptoboxWrapper')));
@@ -373,8 +375,9 @@ class Account extends commons_1.TypedEventEmitter {
373
375
  * @param clearData if set to `true` will completely wipe any database that was created by the Account
374
376
  */
375
377
  async logout(clearData = false) {
376
- this.db?.close();
377
- this.encryptedDb?.close();
378
+ var _a, _b;
379
+ (_a = this.db) === null || _a === void 0 ? void 0 : _a.close();
380
+ (_b = this.encryptedDb) === null || _b === void 0 ? void 0 : _b.close();
378
381
  if (clearData) {
379
382
  await this.wipe();
380
383
  }
@@ -385,17 +388,19 @@ class Account extends commons_1.TypedEventEmitter {
385
388
  * Will delete the identity of the current user
386
389
  */
387
390
  async wipe() {
388
- await this.service?.proteus.wipe(this.storeEngine);
391
+ var _a, _b;
392
+ await ((_a = this.service) === null || _a === void 0 ? void 0 : _a.proteus.wipe(this.storeEngine));
389
393
  if (this.db) {
390
394
  await (0, CoreDB_1.deleteDB)(this.db);
391
395
  }
392
- await this.encryptedDb?.wipe();
396
+ await ((_b = this.encryptedDb) === null || _b === void 0 ? void 0 : _b.wipe());
393
397
  }
394
398
  /**
395
399
  * return true if the current user has a MLS device that is initialized and ready to use
396
400
  */
397
401
  get hasMLSDevice() {
398
- return !!this.service?.mls?.isEnabled;
402
+ var _a, _b;
403
+ return !!((_b = (_a = this.service) === null || _a === void 0 ? void 0 : _a.mls) === null || _b === void 0 ? void 0 : _b.isEnabled);
399
404
  }
400
405
  /**
401
406
  * Will download and handle the notification stream since last stored notification id.
@@ -410,7 +415,7 @@ class Account extends commons_1.TypedEventEmitter {
410
415
  }
411
416
  const handleEvent = async (payload, source) => {
412
417
  const { event } = payload;
413
- switch (event?.type) {
418
+ switch (event === null || event === void 0 ? void 0 : event.type) {
414
419
  case event_1.CONVERSATION_EVENT.MESSAGE_TIMER_UPDATE: {
415
420
  const { data: { message_timer }, conversation, } = event;
416
421
  const expireAfterMillis = Number(message_timer);
@@ -421,10 +426,23 @@ class Account extends commons_1.TypedEventEmitter {
421
426
  await onEvent(payload, source);
422
427
  };
423
428
  const handleNotification = async (notification, source) => {
429
+ var _a, e_1, _b, _c;
424
430
  try {
425
431
  const messages = this.service.notification.handleNotification(notification, source, dryRun);
426
- for await (const message of messages) {
427
- await handleEvent(message, source);
432
+ try {
433
+ for (var _d = true, messages_1 = __asyncValues(messages), messages_1_1; messages_1_1 = await messages_1.next(), _a = messages_1_1.done, !_a; _d = true) {
434
+ _c = messages_1_1.value;
435
+ _d = false;
436
+ const message = _c;
437
+ await handleEvent(message, source);
438
+ }
439
+ }
440
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
441
+ finally {
442
+ try {
443
+ if (!_d && !_a && (_b = messages_1.return)) await _b.call(messages_1);
444
+ }
445
+ finally { if (e_1) throw e_1.error; }
428
446
  }
429
447
  }
430
448
  catch (error) {
@@ -493,15 +511,16 @@ class Account extends commons_1.TypedEventEmitter {
493
511
  }
494
512
  async initEngine(context, encryptedStore) {
495
513
  const dbName = this.generateDbName(context);
496
- this.logger.debug(`Initialising store with name "${dbName}"...`);
514
+ this.logger.log(`Initialising store with name "${dbName}"...`);
497
515
  const openDb = async () => {
516
+ var _a, _b;
498
517
  const dbKey = await (0, secretKeyGenerator_1.generateSecretKey)({ keyId: 'db-key', keySize: 32, secretsDb: encryptedStore });
499
- const initializedDb = await this.options.createStore?.(dbName, dbKey.key);
518
+ const initializedDb = await ((_b = (_a = this.options).createStore) === null || _b === void 0 ? void 0 : _b.call(_a, dbName, dbKey.key));
500
519
  if (initializedDb) {
501
- this.logger.debug(`Initialized store with existing engine "${dbName}".`);
520
+ this.logger.info(`Initialized store with existing engine "${dbName}".`);
502
521
  return initializedDb;
503
522
  }
504
- this.logger.debug(`Initialized store with new memory engine "${dbName}".`);
523
+ this.logger.info(`Initialized store with new memory engine "${dbName}".`);
505
524
  const memoryEngine = new store_engine_1.MemoryEngine();
506
525
  await memoryEngine.init(dbName);
507
526
  return memoryEngine;
@@ -513,11 +532,5 @@ class Account extends commons_1.TypedEventEmitter {
513
532
  }
514
533
  return storeEngine;
515
534
  }
516
- groupIdFromConversationId = async (conversationId, subconversationId) => {
517
- if (!subconversationId) {
518
- return this.coreCallbacks?.groupIdFromConversationId(conversationId);
519
- }
520
- return this.service?.subconversation.getSubconversationGroupId(conversationId, subconversationId);
521
- };
522
535
  }
523
536
  exports.Account = Account;
@@ -21,7 +21,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.AccountService = void 0;
22
22
  const commons_1 = require("@wireapp/commons");
23
23
  class AccountService {
24
- apiClient;
25
24
  constructor(apiClient) {
26
25
  this.apiClient = apiClient;
27
26
  }
@@ -24,9 +24,6 @@ const messageSender_1 = require("../conversation/message/messageSender");
24
24
  const MessageService_1 = require("../conversation/message/MessageService");
25
25
  const UserClientsUtil_1 = require("../conversation/message/UserClientsUtil");
26
26
  class BroadcastService {
27
- apiClient;
28
- proteusService;
29
- messageService;
30
27
  constructor(apiClient, proteusService) {
31
28
  this.apiClient = apiClient;
32
29
  this.proteusService = proteusService;
@@ -20,7 +20,6 @@
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.ClientBackendRepository = void 0;
22
22
  class ClientBackendRepository {
23
- apiClient;
24
23
  constructor(apiClient) {
25
24
  this.apiClient = apiClient;
26
25
  }
@@ -25,11 +25,6 @@ var DatabaseStores;
25
25
  DatabaseStores["CLIENTS"] = "clients";
26
26
  })(DatabaseStores || (exports.DatabaseStores = DatabaseStores = {}));
27
27
  class ClientDatabaseRepository {
28
- storeEngine;
29
- static STORES = DatabaseStores;
30
- static KEYS = {
31
- LOCAL_IDENTITY: 'local_identity',
32
- };
33
28
  constructor(storeEngine) {
34
29
  this.storeEngine = storeEngine;
35
30
  }
@@ -79,25 +74,21 @@ class ClientDatabaseRepository {
79
74
  return transformedClient;
80
75
  }
81
76
  transformClient(userId, client) {
82
- return {
83
- ...client,
84
- domain: userId.domain,
85
- meta: {
77
+ return Object.assign(Object.assign({}, client), { domain: userId.domain, meta: {
86
78
  is_verified: false,
87
79
  is_mls_verified: false,
88
80
  primary_key: (0, SessionHandler_1.constructSessionId)({
89
81
  userId,
90
82
  clientId: client.id,
91
83
  }),
92
- },
93
- };
84
+ } });
94
85
  }
95
86
  transformLocalClient(client, domain) {
96
- return {
97
- ...client,
98
- domain,
99
- meta: { is_verified: true, is_mls_verified: false, primary_key: ClientDatabaseRepository.KEYS.LOCAL_IDENTITY },
100
- };
87
+ return Object.assign(Object.assign({}, client), { domain, meta: { is_verified: true, is_mls_verified: false, primary_key: ClientDatabaseRepository.KEYS.LOCAL_IDENTITY } });
101
88
  }
102
89
  }
103
90
  exports.ClientDatabaseRepository = ClientDatabaseRepository;
91
+ ClientDatabaseRepository.STORES = DatabaseStores;
92
+ ClientDatabaseRepository.KEYS = {
93
+ LOCAL_IDENTITY: 'local_identity',
94
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"ClientService.d.ts","sourceRoot":"","sources":["../../src/client/ClientService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAoD,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAMpH,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAEjD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,+BAA+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AMhF;;;OAGG;IACU,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YASpD,cAAc;IAQ5B;;;;;;;OAOG;IACU,UAAU,IAAI,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IA0BhE,OAAO,CAAC,iBAAiB;IAIzB;;;OAGG;IACU,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAUhE,QAAQ,CACnB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,cAAc,GACpC,OAAO,CAAC,gBAAgB,CAAC;CA6B7B"}
@@ -28,19 +28,14 @@ const http_status_codes_1 = require("http-status-codes");
28
28
  const logdown_1 = __importDefault(require("logdown"));
29
29
  const _1 = require("./");
30
30
  class ClientService {
31
- apiClient;
32
- proteusService;
33
- storeEngine;
34
- database;
35
- backend;
36
- logger = (0, logdown_1.default)('@wireapp/core/Client', {
37
- logger: console,
38
- markdown: false,
39
- });
40
31
  constructor(apiClient, proteusService, storeEngine) {
41
32
  this.apiClient = apiClient;
42
33
  this.proteusService = proteusService;
43
34
  this.storeEngine = storeEngine;
35
+ this.logger = (0, logdown_1.default)('@wireapp/core/Client', {
36
+ logger: console,
37
+ markdown: false,
38
+ });
44
39
  this.database = new _1.ClientDatabaseRepository(this.storeEngine);
45
40
  this.backend = new _1.ClientBackendRepository(this.apiClient);
46
41
  }
@@ -65,7 +60,8 @@ class ClientService {
65
60
  * @param password? Password of the owning user. Can be omitted for temporary devices
66
61
  */
67
62
  async deleteLocalClient(password) {
68
- const localClientId = this.apiClient.context?.clientId;
63
+ var _a;
64
+ const localClientId = (_a = this.apiClient.context) === null || _a === void 0 ? void 0 : _a.clientId;
69
65
  if (!localClientId) {
70
66
  throw new Error('Trying to delete local client, but local client has not been set');
71
67
  }
@@ -89,6 +85,7 @@ class ClientService {
89
85
  * @return the loaded client or undefined
90
86
  */
91
87
  async loadClient() {
88
+ var _a;
92
89
  const loadedClient = await this.getLocalClient();
93
90
  if (!loadedClient) {
94
91
  return undefined;
@@ -98,15 +95,16 @@ class ClientService {
98
95
  return this.database.updateLocalClient(remoteClient);
99
96
  }
100
97
  catch (error) {
101
- const notFoundOnBackend = axios_1.default.isAxiosError(error) ? error.response?.status === http_status_codes_1.StatusCodes.NOT_FOUND : false;
98
+ const notFoundOnBackend = axios_1.default.isAxiosError(error) ? ((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === http_status_codes_1.StatusCodes.NOT_FOUND : false;
102
99
  if (notFoundOnBackend && this.storeEngine) {
100
+ this.logger.log('Could not find valid client on backend');
103
101
  const shouldDeleteWholeDatabase = loadedClient.type === client_1.ClientType.TEMPORARY;
102
+ this.logger.log('Deleting previous identity');
104
103
  await this.proteusService.wipe(this.storeEngine);
105
104
  if (shouldDeleteWholeDatabase) {
105
+ this.logger.log('Last client was temporary - Deleting content database');
106
106
  await this.storeEngine.clearTables();
107
107
  }
108
- const log = `No valid client on backend, deleting identity (deleting content: ${shouldDeleteWholeDatabase ? 'yes' : 'no'})`;
109
- this.logger.warn(log);
110
108
  }
111
109
  }
112
110
  return undefined;
@@ -119,9 +117,10 @@ class ClientService {
119
117
  * @param currentClient - the id of the current client (to be excluded from the list)
120
118
  */
121
119
  async synchronizeClients(currentClient) {
120
+ var _a;
122
121
  const registeredClients = await this.backend.getClients();
123
122
  const filteredClients = registeredClients.filter(client => client.id !== currentClient);
124
- return this.database.createClientList({ id: this.apiClient.context.userId, domain: this.apiClient.context.domain ?? '' }, filteredClients);
123
+ return this.database.createClientList({ id: this.apiClient.context.userId, domain: (_a = this.apiClient.context.domain) !== null && _a !== void 0 ? _a : '' }, filteredClients);
125
124
  }
126
125
  // TODO: Split functionality into "create" and "register" client
127
126
  async register(loginData, clientInfo, { prekeys, lastPrekey }) {
@@ -21,7 +21,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.ConnectionService = void 0;
22
22
  const connection_1 = require("@wireapp/api-client/lib/connection/");
23
23
  class ConnectionService {
24
- apiClient;
25
24
  constructor(apiClient) {
26
25
  this.apiClient = apiClient;
27
26
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import { AssetOptions, AssetResponse } from '@wireapp/api-client/lib/asset';
2
3
  import { ProgressCallback, RequestCancelable } from '@wireapp/api-client/lib/http';
3
4
  import { APIClient } from '@wireapp/api-client';
@@ -1 +1 @@
1
- {"version":3,"file":"AssetService.d.ts","sourceRoot":"","sources":["../../../src/conversation/AssetService/AssetService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAEjF,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAC,cAAc,EAAE,sBAAsB,EAAC,MAAM,oBAAoB,CAAC;AAG1E,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,CAAC,CAAC;CACZ;AACD,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAA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,CAAC,CAAC;IAyB9C,YAAY,CAAC,KAAK,EAAE,cAAc;IAIzC;;;;;;OAMG;IACI,aAAa,CAClB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,gBAAgB,CAAC,EAAE,gBAAgB,GAClC;QAAC,QAAQ,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QAAC,MAAM,EAAE,MAAM,IAAI,CAAA;KAAC;CAgB1D"}
@@ -21,7 +21,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.AssetService = void 0;
22
22
  const AssetCryptography_1 = require("../../cryptography/AssetCryptography/AssetCryptography");
23
23
  class AssetService {
24
- apiClient;
25
24
  constructor(apiClient) {
26
25
  this.apiClient = apiClient;
27
26
  }
@@ -68,13 +67,11 @@ class AssetService {
68
67
  async uploadAsset(plainText, options, progressCallback) {
69
68
  const { cipherText, keyBytes, sha256 } = await (0, AssetCryptography_1.encryptAsset)({
70
69
  plainText,
71
- algorithm: options?.algorithm,
72
- hash: options?.hash,
70
+ algorithm: options === null || options === void 0 ? void 0 : options.algorithm,
71
+ hash: options === null || options === void 0 ? void 0 : options.hash,
73
72
  });
74
73
  const request = this.uploadRawAsset(cipherText, options, progressCallback);
75
- return {
76
- ...request,
77
- response: request.response.then(response => {
74
+ return Object.assign(Object.assign({}, request), { response: request.response.then(response => {
78
75
  const { key, token, domain } = response;
79
76
  return {
80
77
  cipherText,
@@ -84,8 +81,7 @@ class AssetService {
84
81
  sha256,
85
82
  token,
86
83
  };
87
- }),
88
- };
84
+ }) });
89
85
  }
90
86
  decryptAsset(asset) {
91
87
  return (0, AssetCryptography_1.decryptAsset)(asset);
@@ -101,14 +97,11 @@ class AssetService {
101
97
  const request = this.downloadRawAsset(assetData, progressCallback);
102
98
  const { response } = request;
103
99
  return {
104
- response: response.then(async (response) => ({
105
- ...response,
106
- buffer: await (0, AssetCryptography_1.decryptAsset)({
100
+ response: response.then(async (response) => (Object.assign(Object.assign({}, response), { buffer: await (0, AssetCryptography_1.decryptAsset)({
107
101
  cipherText: new Uint8Array(response.buffer),
108
102
  keyBytes: otrKey,
109
103
  sha256: sha256,
110
- }),
111
- })),
104
+ }) }))),
112
105
  cancel: request.cancel,
113
106
  };
114
107
  }
@@ -63,7 +63,7 @@ describe('AssetService', () => {
63
63
  response: Promise.resolve({}),
64
64
  };
65
65
  jest.spyOn(apiClient.api.asset, 'postAsset').mockImplementation((_asset, _options, progressCallback) => {
66
- progressCallback?.(1);
66
+ progressCallback === null || progressCallback === void 0 ? void 0 : progressCallback(1);
67
67
  return apiUpload;
68
68
  });
69
69
  const onProgress = jest.fn();
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EAEpB,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAEnB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,YAAY,EAIZ,4BAA4B,EAE7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,GAAG,EAAC,MAAM,oCAAoC,CAAC;AAIvD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAEL,cAAc,EAEd,6BAA6B,EAC7B,oBAAoB,EACpB,UAAU,EACX,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAC,YAAY,EAAuB,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAC;AAMxD,OAAO,EAAkC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AACjG,OAAO,EACL,mCAA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,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAoB3E"}
1
+ {"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EAEpB,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAEnB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,YAAY,EAIZ,4BAA4B,EAE7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,GAAG,EAAC,MAAM,oCAAoC,CAAC;AAIvD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAEL,cAAc,EAEd,6BAA6B,EAC7B,oBAAoB,EACpB,UAAU,EACX,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAC,YAAY,EAAuB,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAC;AAMxD,OAAO,EAAkC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AACjG,OAAO,EACL,mCAAmC,EACnC,wBAAwB,EACzB,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EAAsB,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAIlD,OAAO,EAAC,sBAAsB,EAAC,MAAM,kDAAkD,CAAC;AAExF,KAAK,MAAM,GAAG;IACZ,wBAAwB,EAAE;QAAC,cAAc,EAAE,WAAW,CAAA;KAAC,CAAC;CACzD,CAAC;AAEF,qBAAa,mBAAoB,SAAQ,iBAAiB,CAAC,MA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