@wireapp/core 46.0.15 → 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.
- package/lib/Account.js +43 -56
- package/lib/account/AccountService.js +1 -0
- package/lib/broadcast/BroadcastService.js +3 -0
- package/lib/client/ClientBackendRepository.js +1 -0
- package/lib/client/ClientDatabaseRepository.js +16 -7
- package/lib/client/ClientService.d.ts.map +1 -1
- package/lib/client/ClientService.js +14 -13
- package/lib/connection/ConnectionService.js +1 -0
- package/lib/conversation/AssetService/AssetService.d.ts +0 -1
- package/lib/conversation/AssetService/AssetService.d.ts.map +1 -1
- package/lib/conversation/AssetService/AssetService.js +13 -6
- package/lib/conversation/AssetService/AssetService.test.js +1 -1
- package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.js +90 -80
- package/lib/conversation/ConversationService/ConversationService.test.js +12 -5
- package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.d.ts.map +1 -1
- package/lib/conversation/MessageTimer/MessageTimer.js +2 -0
- package/lib/conversation/SubconversationService/SubconversationService.d.ts.map +1 -1
- package/lib/conversation/SubconversationService/SubconversationService.js +23 -17
- package/lib/conversation/content/AssetContent.d.ts +0 -1
- package/lib/conversation/content/AssetContent.d.ts.map +1 -1
- package/lib/conversation/content/ContentType.js +18 -19
- package/lib/conversation/content/FileContent.d.ts +0 -1
- package/lib/conversation/content/FileContent.d.ts.map +1 -1
- package/lib/conversation/content/ImageContent.d.ts +0 -1
- package/lib/conversation/content/ImageContent.d.ts.map +1 -1
- package/lib/conversation/message/MessageBuilder.js +22 -23
- package/lib/conversation/message/MessageService.js +5 -4
- package/lib/conversation/message/MessageService.test.js +20 -9
- package/lib/conversation/message/MessageToProtoMapper.js +2 -2
- package/lib/conversation/message/RecipientsHelper.js +1 -2
- package/lib/conversation/message/TextContentBuilder.js +3 -2
- package/lib/conversation/message/UserClientsUtil.js +2 -3
- package/lib/conversation/message/messageSender.js +5 -6
- package/lib/cryptography/AssetCryptography/AssetCryptography.d.ts.map +1 -1
- package/lib/cryptography/GenericMessageMapper.js +74 -22
- package/lib/cryptography/MessageHashService.d.ts +0 -1
- package/lib/cryptography/MessageHashService.d.ts.map +1 -1
- package/lib/cryptography/MessageHashService.js +2 -0
- package/lib/errors/DecryptionError.js +2 -0
- package/lib/errors/FederatedBackendsError.js +3 -2
- package/lib/giphy/GiphyService.js +1 -0
- package/lib/linkPreview/LinkPreviewService.js +2 -12
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts +4 -4
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.js +9 -8
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.d.ts +8 -8
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.js +33 -3
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.test.js +11 -11
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.js +15 -5
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Account.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Account.js +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.d.ts +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.js +2 -3
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Certificate.js +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.js +2 -2
- package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.js +1 -2
- package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.schema.d.ts +4 -4
- package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/IncomingMesssagesQueue.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.js +1 -1
- package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.js +1 -1
- package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.test.js +7 -3
- package/lib/messagingProtocols/mls/MLSService/ClientMLSError.js +1 -0
- package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.js +109 -114
- package/lib/messagingProtocols/mls/MLSService/MLSService.test.js +28 -9
- package/lib/messagingProtocols/mls/MLSService/commitBundleUtil.js +1 -2
- package/lib/messagingProtocols/mls/conversationRejoinQueue.js +3 -4
- package/lib/messagingProtocols/mls/utils/MLSId.js +2 -3
- package/lib/messagingProtocols/proteus/EventHandler/events/otrMessageAdd/otrMessageAdd.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.js +6 -2
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/PrekeysTracker/PrekeysTracker.js +3 -0
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/PrekeysTracker/PrekeysTracker.store.js +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoboxWrapper.js +5 -4
- package/lib/messagingProtocols/proteus/ProteusService/DecryptionErrorGenerator/DecryptionErrorGenerator.js +1 -2
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.js +17 -14
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.d.ts +4 -7
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.test.js +15 -15
- package/lib/messagingProtocols/proteus/ProteusService/cryptoMigrationStateStore.js +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/identityClearer.js +1 -2
- package/lib/messagingProtocols/proteus/ProteusService/sessionIdMigrator.js +2 -3
- package/lib/messagingProtocols/proteus/ProteusService/userDomainFilters.js +1 -2
- package/lib/messagingProtocols/proteus/Utility/Recipients.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/Utility/SessionHandler/SessionHandler.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/Utility/SessionHandler/SessionHandler.js +14 -14
- package/lib/messagingProtocols/proteus/Utility/SessionHandler/SessionHandler.test.js +5 -2
- package/lib/messagingProtocols/proteus/Utility/getGenericMessageParams.d.ts.map +1 -1
- package/lib/notification/NotificationBackendRepository.d.ts +1 -1
- package/lib/notification/NotificationBackendRepository.js +1 -0
- package/lib/notification/NotificationDatabaseRepository.js +1 -0
- package/lib/notification/NotificationService.js +38 -49
- package/lib/secretStore/encryptedStore.js +10 -22
- package/lib/secretStore/secretKeyGenerator.js +2 -2
- package/lib/secretStore/secretKeyGenerator.test.js +1 -1
- package/lib/self/SelfService.js +2 -1
- package/lib/storage/CoreDB.js +2 -3
- package/lib/team/TeamService.js +1 -0
- package/lib/test/PayloadHelper.js +3 -4
- package/lib/testUtils/index.js +2 -3
- package/lib/user/UserService.d.ts +2 -2
- package/lib/user/UserService.js +1 -0
- package/lib/util/LocalStorageStore/index.d.ts.map +1 -1
- package/lib/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.js +4 -6
- package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.d.ts.map +1 -1
- package/lib/util/RecurringTaskScheduler/RecurringTaskScheduler.js +34 -33
- package/lib/util/TaskScheduler/TaskScheduler.d.ts +1 -1
- package/lib/util/TaskScheduler/TaskScheduler.d.ts.map +1 -1
- package/lib/util/TypePredicateUtil.js +7 -10
- package/lib/util/fullyQualifiedClientIdUtils.js +1 -2
- 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
|
-
|
|
133
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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 (!
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
379
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
433
|
-
|
|
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.
|
|
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
|
|
499
|
+
const initializedDb = await this.options.createStore?.(dbName, dbKey.key);
|
|
519
500
|
if (initializedDb) {
|
|
520
|
-
this.logger.
|
|
501
|
+
this.logger.debug(`Initialized store with existing engine "${dbName}".`);
|
|
521
502
|
return initializedDb;
|
|
522
503
|
}
|
|
523
|
-
this.logger.
|
|
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;
|
|
@@ -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;
|
|
@@ -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
|
|
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
|
|
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,EA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,UAAU,IAAI,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAyBhE,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,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
|
-
|
|
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) ?
|
|
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:
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetService.d.ts","sourceRoot":"","sources":["../../../src/conversation/AssetService/AssetService.ts"],"names":[],"mappings":"
|
|
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;IACn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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
|
|
71
|
-
hash: options
|
|
71
|
+
algorithm: options?.algorithm,
|
|
72
|
+
hash: options?.hash,
|
|
72
73
|
});
|
|
73
74
|
const request = this.uploadRawAsset(cipherText, options, progressCallback);
|
|
74
|
-
return
|
|
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) => (
|
|
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
|
|
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,CAAC;AAExF,KAAK,MAAM,GAAG;IACZ,wBAAwB,EAAE;QAAC,cAAc,EAAE,WAAW,CAAA;KAAC,CAAC;CACzD,CAAC;AAEF,qBAAa,mBAAoB,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IAK9D,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,yBAAyB;IAI1C,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IAZ/B,SAAgB,YAAY,EAAE,YAAY,CAAC;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgD;gBAGpD,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAC1B,yBAAyB,EAAE,CAC1C,cAAc,EAAE,WAAW,EAC3B,iBAAiB,CAAC,EAAE,kBAAkB,KACnC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,EACf,sBAAsB,EAAE,sBAAsB,EAC9C,WAAW,CAAC,
|
|
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,oC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