@wireapp/core 46.0.16 → 46.0.17

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 (116) hide show
  1. package/lib/Account.js +43 -56
  2. package/lib/account/AccountService.js +1 -0
  3. package/lib/broadcast/BroadcastService.js +3 -0
  4. package/lib/client/ClientBackendRepository.js +1 -0
  5. package/lib/client/ClientDatabaseRepository.js +16 -7
  6. package/lib/client/ClientService.d.ts.map +1 -1
  7. package/lib/client/ClientService.js +14 -13
  8. package/lib/connection/ConnectionService.js +1 -0
  9. package/lib/conversation/AssetService/AssetService.d.ts +0 -1
  10. package/lib/conversation/AssetService/AssetService.d.ts.map +1 -1
  11. package/lib/conversation/AssetService/AssetService.js +13 -6
  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 +90 -80
  15. package/lib/conversation/ConversationService/ConversationService.test.js +12 -5
  16. package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.d.ts.map +1 -1
  17. package/lib/conversation/MessageTimer/MessageTimer.js +2 -0
  18. package/lib/conversation/SubconversationService/SubconversationService.d.ts.map +1 -1
  19. package/lib/conversation/SubconversationService/SubconversationService.js +23 -17
  20. package/lib/conversation/content/AssetContent.d.ts +0 -1
  21. package/lib/conversation/content/AssetContent.d.ts.map +1 -1
  22. package/lib/conversation/content/ContentType.js +18 -19
  23. package/lib/conversation/content/FileContent.d.ts +0 -1
  24. package/lib/conversation/content/FileContent.d.ts.map +1 -1
  25. package/lib/conversation/content/ImageContent.d.ts +0 -1
  26. package/lib/conversation/content/ImageContent.d.ts.map +1 -1
  27. package/lib/conversation/message/MessageBuilder.js +22 -23
  28. package/lib/conversation/message/MessageService.js +5 -4
  29. package/lib/conversation/message/MessageService.test.js +20 -9
  30. package/lib/conversation/message/MessageToProtoMapper.js +2 -2
  31. package/lib/conversation/message/RecipientsHelper.js +1 -2
  32. package/lib/conversation/message/TextContentBuilder.js +3 -2
  33. package/lib/conversation/message/UserClientsUtil.js +2 -3
  34. package/lib/conversation/message/messageSender.js +5 -6
  35. package/lib/cryptography/AssetCryptography/AssetCryptography.d.ts.map +1 -1
  36. package/lib/cryptography/GenericMessageMapper.js +74 -22
  37. package/lib/cryptography/MessageHashService.d.ts +0 -1
  38. package/lib/cryptography/MessageHashService.d.ts.map +1 -1
  39. package/lib/cryptography/MessageHashService.js +2 -0
  40. package/lib/errors/DecryptionError.js +2 -0
  41. package/lib/errors/FederatedBackendsError.js +3 -2
  42. package/lib/giphy/GiphyService.js +1 -0
  43. package/lib/linkPreview/LinkPreviewService.js +2 -12
  44. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts +4 -4
  45. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.js +9 -8
  46. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.d.ts +8 -8
  47. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.js +33 -3
  48. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.test.js +11 -11
  49. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.js +15 -5
  50. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Account.d.ts.map +1 -1
  51. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Account.js +1 -1
  52. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.d.ts +1 -1
  53. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.d.ts.map +1 -1
  54. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.js +2 -3
  55. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Certificate.js +1 -1
  56. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.d.ts.map +1 -1
  57. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.js +2 -2
  58. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.d.ts.map +1 -1
  59. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.js +1 -2
  60. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.schema.d.ts +4 -4
  61. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/IncomingMesssagesQueue.d.ts.map +1 -1
  62. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.d.ts.map +1 -1
  63. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.js +1 -1
  64. package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.d.ts.map +1 -1
  65. package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.js +1 -1
  66. package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.test.js +7 -3
  67. package/lib/messagingProtocols/mls/MLSService/ClientMLSError.js +1 -0
  68. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.d.ts.map +1 -1
  69. package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
  70. package/lib/messagingProtocols/mls/MLSService/MLSService.js +109 -114
  71. package/lib/messagingProtocols/mls/MLSService/MLSService.test.js +28 -9
  72. package/lib/messagingProtocols/mls/MLSService/commitBundleUtil.js +1 -2
  73. package/lib/messagingProtocols/mls/conversationRejoinQueue.js +3 -4
  74. package/lib/messagingProtocols/mls/utils/MLSId.js +2 -3
  75. package/lib/messagingProtocols/proteus/EventHandler/events/otrMessageAdd/otrMessageAdd.d.ts.map +1 -1
  76. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.js +6 -2
  77. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/PrekeysTracker/PrekeysTracker.js +3 -0
  78. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/PrekeysTracker/PrekeysTracker.store.js +1 -1
  79. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoboxWrapper.js +5 -4
  80. package/lib/messagingProtocols/proteus/ProteusService/DecryptionErrorGenerator/DecryptionErrorGenerator.js +1 -2
  81. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.js +17 -14
  82. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.d.ts +4 -7
  83. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.d.ts.map +1 -1
  84. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.test.js +15 -15
  85. package/lib/messagingProtocols/proteus/ProteusService/cryptoMigrationStateStore.js +1 -1
  86. package/lib/messagingProtocols/proteus/ProteusService/identityClearer.js +1 -2
  87. package/lib/messagingProtocols/proteus/ProteusService/sessionIdMigrator.js +2 -3
  88. package/lib/messagingProtocols/proteus/ProteusService/userDomainFilters.js +1 -2
  89. package/lib/messagingProtocols/proteus/Utility/Recipients.d.ts.map +1 -1
  90. package/lib/messagingProtocols/proteus/Utility/SessionHandler/SessionHandler.d.ts.map +1 -1
  91. package/lib/messagingProtocols/proteus/Utility/SessionHandler/SessionHandler.js +14 -14
  92. package/lib/messagingProtocols/proteus/Utility/SessionHandler/SessionHandler.test.js +5 -2
  93. package/lib/messagingProtocols/proteus/Utility/getGenericMessageParams.d.ts.map +1 -1
  94. package/lib/notification/NotificationBackendRepository.d.ts +1 -1
  95. package/lib/notification/NotificationBackendRepository.js +1 -0
  96. package/lib/notification/NotificationDatabaseRepository.js +1 -0
  97. package/lib/notification/NotificationService.js +38 -49
  98. package/lib/secretStore/encryptedStore.js +10 -22
  99. package/lib/secretStore/secretKeyGenerator.js +2 -2
  100. package/lib/secretStore/secretKeyGenerator.test.js +1 -1
  101. package/lib/self/SelfService.js +2 -1
  102. package/lib/storage/CoreDB.js +2 -3
  103. package/lib/team/TeamService.js +1 -0
  104. package/lib/test/PayloadHelper.js +3 -4
  105. package/lib/testUtils/index.js +2 -3
  106. package/lib/user/UserService.d.ts +2 -2
  107. package/lib/user/UserService.js +1 -0
  108. package/lib/util/LocalStorageStore/index.d.ts.map +1 -1
  109. package/lib/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.js +4 -6
  110. package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.d.ts.map +1 -1
  111. package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.js +34 -33
  112. package/lib/util/TaskScheduler/TaskScheduler.d.ts +1 -1
  113. package/lib/util/TaskScheduler/TaskScheduler.d.ts.map +1 -1
  114. package/lib/util/TypePredicateUtil.js +7 -10
  115. package/lib/util/fullyQualifiedClientIdUtils.js +1 -2
  116. package/package.json +3 -3
package/lib/Account.js CHANGED
@@ -40,13 +40,6 @@ 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
- };
50
43
  var __importDefault = (this && this.__importDefault) || function (mod) {
51
44
  return (mod && mod.__esModule) ? mod : { "default": mod };
52
45
  };
@@ -110,6 +103,19 @@ const coreDefaultClient = {
110
103
  model: '@wireapp/core',
111
104
  };
112
105
  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;
113
119
  /**
114
120
  * @param apiClient The apiClient instance to use in the core (will create a new new one if undefined)
115
121
  * @param accountOptions
@@ -117,29 +123,19 @@ class Account extends commons_1.TypedEventEmitter {
117
123
  constructor(apiClient = new api_client_1.APIClient(), options = { nbPrekeys: 100 }) {
118
124
  super();
119
125
  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
- };
127
126
  this.apiClient = apiClient;
128
127
  this.backendFeatures = this.apiClient.backendFeatures;
129
128
  this.coreCryptoConfig = options.coreCryptoConfig;
130
129
  this.recurringTaskScheduler = new RecurringTaskScheduler_1.RecurringTaskScheduler({
131
130
  get: async (key) => {
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;
131
+ const task = await this.db?.get('recurringTasks', key);
132
+ return task?.firingDate;
135
133
  },
136
134
  set: async (key, timestamp) => {
137
- var _a;
138
- await ((_a = this.db) === null || _a === void 0 ? void 0 : _a.put('recurringTasks', { key, firingDate: timestamp }, key));
135
+ await this.db?.put('recurringTasks', { key, firingDate: timestamp }, key);
139
136
  },
140
137
  delete: async (key) => {
141
- var _a;
142
- await ((_a = this.db) === null || _a === void 0 ? void 0 : _a.delete('recurringTasks', key));
138
+ await this.db?.delete('recurringTasks', key);
143
139
  },
144
140
  });
145
141
  apiClient.on(api_client_1.APIClient.TOPIC.COOKIE_REFRESH, async (cookie) => {
@@ -179,13 +175,12 @@ class Account extends commons_1.TypedEventEmitter {
179
175
  return storeEngine.updateOrCreate(auth_1.AUTH_TABLE_NAME, auth_1.AUTH_COOKIE_KEY, entity);
180
176
  }
181
177
  async enrollE2EI({ displayName, handle, teamId, discoveryUrl, getOAuthToken, certificateTtl = 90 * (TimeUtil_1.TimeInMillis.DAY / 1000), }) {
182
- var _a, _b, _c, _d;
183
178
  const context = this.apiClient.context;
184
- const domain = (_a = context === null || context === void 0 ? void 0 : context.domain) !== null && _a !== void 0 ? _a : '';
179
+ const domain = context?.domain ?? '';
185
180
  if (!this.currentClient) {
186
181
  throw new Error('Client has not been initialized - please login first');
187
182
  }
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)) {
183
+ if (!this.service?.mls?.isEnabled || !this.service?.e2eIdentity) {
189
184
  throw new Error('MLS not initialized, unable to enroll E2EI');
190
185
  }
191
186
  const user = {
@@ -256,8 +251,7 @@ class Account extends commons_1.TypedEventEmitter {
256
251
  return client;
257
252
  }
258
253
  getLocalClient() {
259
- var _a;
260
- return (_a = this.service) === null || _a === void 0 ? void 0 : _a.client.loadClient();
254
+ return this.service?.client.loadClient();
261
255
  }
262
256
  /**
263
257
  * Will initiate all the cryptographic material of the given registered device and setup all the background tasks.
@@ -297,7 +291,11 @@ class Account extends commons_1.TypedEventEmitter {
297
291
  const coreCryptoConfig = this.coreCryptoConfig;
298
292
  if (coreCryptoConfig) {
299
293
  const { buildClient } = await Promise.resolve().then(() => __importStar(require('./messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper')));
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 }) }));
294
+ const client = await buildClient(storeEngine, {
295
+ ...baseConfig,
296
+ ...coreCryptoConfig,
297
+ generateSecretKey: keyId => (0, secretKeyGenerator_1.generateSecretKey)({ keyId, keySize: 16, secretsDb: encryptedStore }),
298
+ });
301
299
  return [CryptoClient_1.CryptoClientType.CORE_CRYPTO, client];
302
300
  }
303
301
  const { buildClient } = await Promise.resolve().then(() => __importStar(require('./messagingProtocols/proteus/ProteusService/CryptoClient/CryptoboxWrapper')));
@@ -375,9 +373,8 @@ class Account extends commons_1.TypedEventEmitter {
375
373
  * @param clearData if set to `true` will completely wipe any database that was created by the Account
376
374
  */
377
375
  async logout(clearData = false) {
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();
376
+ this.db?.close();
377
+ this.encryptedDb?.close();
381
378
  if (clearData) {
382
379
  await this.wipe();
383
380
  }
@@ -388,19 +385,17 @@ class Account extends commons_1.TypedEventEmitter {
388
385
  * Will delete the identity of the current user
389
386
  */
390
387
  async wipe() {
391
- var _a, _b;
392
- await ((_a = this.service) === null || _a === void 0 ? void 0 : _a.proteus.wipe(this.storeEngine));
388
+ await this.service?.proteus.wipe(this.storeEngine);
393
389
  if (this.db) {
394
390
  await (0, CoreDB_1.deleteDB)(this.db);
395
391
  }
396
- await ((_b = this.encryptedDb) === null || _b === void 0 ? void 0 : _b.wipe());
392
+ await this.encryptedDb?.wipe();
397
393
  }
398
394
  /**
399
395
  * return true if the current user has a MLS device that is initialized and ready to use
400
396
  */
401
397
  get hasMLSDevice() {
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);
398
+ return !!this.service?.mls?.isEnabled;
404
399
  }
405
400
  /**
406
401
  * Will download and handle the notification stream since last stored notification id.
@@ -415,7 +410,7 @@ class Account extends commons_1.TypedEventEmitter {
415
410
  }
416
411
  const handleEvent = async (payload, source) => {
417
412
  const { event } = payload;
418
- switch (event === null || event === void 0 ? void 0 : event.type) {
413
+ switch (event?.type) {
419
414
  case event_1.CONVERSATION_EVENT.MESSAGE_TIMER_UPDATE: {
420
415
  const { data: { message_timer }, conversation, } = event;
421
416
  const expireAfterMillis = Number(message_timer);
@@ -426,23 +421,10 @@ class Account extends commons_1.TypedEventEmitter {
426
421
  await onEvent(payload, source);
427
422
  };
428
423
  const handleNotification = async (notification, source) => {
429
- var _a, e_1, _b, _c;
430
424
  try {
431
425
  const messages = this.service.notification.handleNotification(notification, source, dryRun);
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; }
426
+ for await (const message of messages) {
427
+ await handleEvent(message, source);
446
428
  }
447
429
  }
448
430
  catch (error) {
@@ -511,16 +493,15 @@ class Account extends commons_1.TypedEventEmitter {
511
493
  }
512
494
  async initEngine(context, encryptedStore) {
513
495
  const dbName = this.generateDbName(context);
514
- this.logger.log(`Initialising store with name "${dbName}"...`);
496
+ this.logger.debug(`Initialising store with name "${dbName}"...`);
515
497
  const openDb = async () => {
516
- var _a, _b;
517
498
  const dbKey = await (0, secretKeyGenerator_1.generateSecretKey)({ keyId: 'db-key', keySize: 32, secretsDb: encryptedStore });
518
- const initializedDb = await ((_b = (_a = this.options).createStore) === null || _b === void 0 ? void 0 : _b.call(_a, dbName, dbKey.key));
499
+ const initializedDb = await this.options.createStore?.(dbName, dbKey.key);
519
500
  if (initializedDb) {
520
- this.logger.info(`Initialized store with existing engine "${dbName}".`);
501
+ this.logger.debug(`Initialized store with existing engine "${dbName}".`);
521
502
  return initializedDb;
522
503
  }
523
- this.logger.info(`Initialized store with new memory engine "${dbName}".`);
504
+ this.logger.debug(`Initialized store with new memory engine "${dbName}".`);
524
505
  const memoryEngine = new store_engine_1.MemoryEngine();
525
506
  await memoryEngine.init(dbName);
526
507
  return memoryEngine;
@@ -532,5 +513,11 @@ class Account extends commons_1.TypedEventEmitter {
532
513
  }
533
514
  return storeEngine;
534
515
  }
516
+ groupIdFromConversationId = async (conversationId, subconversationId) => {
517
+ if (!subconversationId) {
518
+ return this.coreCallbacks?.groupIdFromConversationId(conversationId);
519
+ }
520
+ return this.service?.subconversation.getSubconversationGroupId(conversationId, subconversationId);
521
+ };
535
522
  }
536
523
  exports.Account = Account;
@@ -21,6 +21,7 @@ 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;
24
25
  constructor(apiClient) {
25
26
  this.apiClient = apiClient;
26
27
  }
@@ -24,6 +24,9 @@ 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;
27
30
  constructor(apiClient, proteusService) {
28
31
  this.apiClient = apiClient;
29
32
  this.proteusService = proteusService;
@@ -20,6 +20,7 @@
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.ClientBackendRepository = void 0;
22
22
  class ClientBackendRepository {
23
+ apiClient;
23
24
  constructor(apiClient) {
24
25
  this.apiClient = apiClient;
25
26
  }
@@ -25,6 +25,11 @@ 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
+ };
28
33
  constructor(storeEngine) {
29
34
  this.storeEngine = storeEngine;
30
35
  }
@@ -74,21 +79,25 @@ class ClientDatabaseRepository {
74
79
  return transformedClient;
75
80
  }
76
81
  transformClient(userId, client) {
77
- return Object.assign(Object.assign({}, client), { domain: userId.domain, meta: {
82
+ return {
83
+ ...client,
84
+ domain: userId.domain,
85
+ meta: {
78
86
  is_verified: false,
79
87
  is_mls_verified: false,
80
88
  primary_key: (0, SessionHandler_1.constructSessionId)({
81
89
  userId,
82
90
  clientId: client.id,
83
91
  }),
84
- } });
92
+ },
93
+ };
85
94
  }
86
95
  transformLocalClient(client, domain) {
87
- return Object.assign(Object.assign({}, client), { domain, meta: { is_verified: true, is_mls_verified: false, primary_key: ClientDatabaseRepository.KEYS.LOCAL_IDENTITY } });
96
+ return {
97
+ ...client,
98
+ domain,
99
+ meta: { is_verified: true, is_mls_verified: false, primary_key: ClientDatabaseRepository.KEYS.LOCAL_IDENTITY },
100
+ };
88
101
  }
89
102
  }
90
103
  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+B,CAAC;AAClE,OAAO,EAAC,cAAc,EAAC,MAAM,2DAA2D,CAAC;AAEzF,OAAO,EAAC,UAAU,EAAoD,MAAM,IAAI,CAAC;AAEjF,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QACJ,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zB;;;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,14 +28,19 @@ 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
+ });
31
40
  constructor(apiClient, proteusService, storeEngine) {
32
41
  this.apiClient = apiClient;
33
42
  this.proteusService = proteusService;
34
43
  this.storeEngine = storeEngine;
35
- this.logger = (0, logdown_1.default)('@wireapp/core/Client', {
36
- logger: console,
37
- markdown: false,
38
- });
39
44
  this.database = new _1.ClientDatabaseRepository(this.storeEngine);
40
45
  this.backend = new _1.ClientBackendRepository(this.apiClient);
41
46
  }
@@ -60,8 +65,7 @@ class ClientService {
60
65
  * @param password? Password of the owning user. Can be omitted for temporary devices
61
66
  */
62
67
  async deleteLocalClient(password) {
63
- var _a;
64
- const localClientId = (_a = this.apiClient.context) === null || _a === void 0 ? void 0 : _a.clientId;
68
+ const localClientId = this.apiClient.context?.clientId;
65
69
  if (!localClientId) {
66
70
  throw new Error('Trying to delete local client, but local client has not been set');
67
71
  }
@@ -85,7 +89,6 @@ class ClientService {
85
89
  * @return the loaded client or undefined
86
90
  */
87
91
  async loadClient() {
88
- var _a;
89
92
  const loadedClient = await this.getLocalClient();
90
93
  if (!loadedClient) {
91
94
  return undefined;
@@ -95,16 +98,15 @@ class ClientService {
95
98
  return this.database.updateLocalClient(remoteClient);
96
99
  }
97
100
  catch (error) {
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;
101
+ const notFoundOnBackend = axios_1.default.isAxiosError(error) ? error.response?.status === http_status_codes_1.StatusCodes.NOT_FOUND : false;
99
102
  if (notFoundOnBackend && this.storeEngine) {
100
- this.logger.log('Could not find valid client on backend');
101
103
  const shouldDeleteWholeDatabase = loadedClient.type === client_1.ClientType.TEMPORARY;
102
- this.logger.log('Deleting previous identity');
103
104
  await this.proteusService.wipe(this.storeEngine);
104
105
  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);
108
110
  }
109
111
  }
110
112
  return undefined;
@@ -117,10 +119,9 @@ class ClientService {
117
119
  * @param currentClient - the id of the current client (to be excluded from the list)
118
120
  */
119
121
  async synchronizeClients(currentClient) {
120
- var _a;
121
122
  const registeredClients = await this.backend.getClients();
122
123
  const filteredClients = registeredClients.filter(client => client.id !== currentClient);
123
- return this.database.createClientList({ id: this.apiClient.context.userId, domain: (_a = this.apiClient.context.domain) !== null && _a !== void 0 ? _a : '' }, filteredClients);
124
+ return this.database.createClientList({ id: this.apiClient.context.userId, domain: this.apiClient.context.domain ?? '' }, filteredClients);
124
125
  }
125
126
  // TODO: Split functionality into "create" and "register" client
126
127
  async register(loginData, clientInfo, { prekeys, lastPrekey }) {
@@ -21,6 +21,7 @@ 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;
24
25
  constructor(apiClient) {
25
26
  this.apiClient = apiClient;
26
27
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { AssetOptions, AssetResponse } from '@wireapp/api-client/lib/asset';
3
2
  import { ProgressCallback, RequestCancelable } from '@wireapp/api-client/lib/http';
4
3
  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,EAAE,CAAC,CAAC;CACZ;AAED,OAAO,EAAC,gBAAgB,EAAC,CAAC;AAC1B,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;AAEjF,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EA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AAE,OAAO,CAAC,aAAa,CAAC,CAAC;QAAC,MAAM,EAAE,MAAM,IAAI,CAAA;KAAC;CAgB1D"}
@@ -21,6 +21,7 @@ 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;
24
25
  constructor(apiClient) {
25
26
  this.apiClient = apiClient;
26
27
  }
@@ -67,11 +68,13 @@ class AssetService {
67
68
  async uploadAsset(plainText, options, progressCallback) {
68
69
  const { cipherText, keyBytes, sha256 } = await (0, AssetCryptography_1.encryptAsset)({
69
70
  plainText,
70
- algorithm: options === null || options === void 0 ? void 0 : options.algorithm,
71
- hash: options === null || options === void 0 ? void 0 : options.hash,
71
+ algorithm: options?.algorithm,
72
+ hash: options?.hash,
72
73
  });
73
74
  const request = this.uploadRawAsset(cipherText, options, progressCallback);
74
- return Object.assign(Object.assign({}, request), { response: request.response.then(response => {
75
+ return {
76
+ ...request,
77
+ response: request.response.then(response => {
75
78
  const { key, token, domain } = response;
76
79
  return {
77
80
  cipherText,
@@ -81,7 +84,8 @@ class AssetService {
81
84
  sha256,
82
85
  token,
83
86
  };
84
- }) });
87
+ }),
88
+ };
85
89
  }
86
90
  decryptAsset(asset) {
87
91
  return (0, AssetCryptography_1.decryptAsset)(asset);
@@ -97,11 +101,14 @@ class AssetService {
97
101
  const request = this.downloadRawAsset(assetData, progressCallback);
98
102
  const { response } = request;
99
103
  return {
100
- response: response.then(async (response) => (Object.assign(Object.assign({}, response), { buffer: await (0, AssetCryptography_1.decryptAsset)({
104
+ response: response.then(async (response) => ({
105
+ ...response,
106
+ buffer: await (0, AssetCryptography_1.decryptAsset)({
101
107
  cipherText: new Uint8Array(response.buffer),
102
108
  keyBytes: otrKey,
103
109
  sha256: sha256,
104
- }) }))),
110
+ }),
111
+ })),
105
112
  cancel: request.cancel,
106
113
  };
107
114
  }
@@ -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 === null || progressCallback === void 0 ? void 0 : progressCallback(1);
66
+ 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,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,C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O,EACP,cAAc,EACd,gBAAgB,GACjB,EAAE,iBAAiB,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAoBhD,oBAAoB,CAAC,cAAc,EAAE,WAAW;IAI7D;;;OAGG;IACU,qBAAqB,CAAC,OAAO,EAAE,MAAM;IAIlD;;;;OAIG;IACU,4BAA4B,CAAC,OAAO,EAAE,MAAM;IAI5C,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAIlD,YAAY;IAYb,gCAAgC;IAe7C;;;OAGG;YACW,kCAAkC;IA2BhD;;;OAGG;YACW,+BAA+B;IAqB7C;;;;;;;OAOG;YACW,gBAAgB;IAQ9B;;;OAGG;IACG,sBAAsB,CAAC,MAAM,EAAE,WAAW;IAIhD;;;;;;;OAOG;IACH,SAAgB,4BAA4B,YACjC,MAAM,YACL;QAAC,IAAI,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,eAChC,WAAW,4BAEvB,QAAQ,eAAe,CAAC,CAqDzB;IAEF;;;;;;;;OAQG;IACU,uBAAuB,CAAC,EACnC,OAAO,EACP,cAAc,EACd,UAAU,EACV,cAAc,GACf,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,WAAW,CAAC;QAC5B,UAAU,EAAE,WAAW,CAAC;QACxB,cAAc,EAAE,WAAW,EAAE,CAAC;KAC/B,GAAG,OAAO,CAAC,IAAI,CAAC;YA4BH,wBAAwB;YAsBxB,gCAAgC;YAyBhC,4BAA4B;YA0B5B,wBAAwB;YAIxB,yBAAyB;IAKvC;;;;OAIG;IACU,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,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