@wireapp/core 46.34.9 → 46.34.11
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.d.ts +28 -28
- package/lib/Account.d.ts.map +1 -1
- package/lib/Account.js +48 -15
- package/lib/client/ClientService.d.ts.map +1 -1
- package/lib/client/ClientService.js +4 -4
- package/package.json +5 -5
package/lib/Account.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export declare const AccountLocalStorageStore: {
|
|
|
74
74
|
has: (key: string) => boolean;
|
|
75
75
|
};
|
|
76
76
|
export declare class Account extends TypedEventEmitter<Events> {
|
|
77
|
-
private options;
|
|
77
|
+
private readonly options;
|
|
78
78
|
private readonly apiClient;
|
|
79
79
|
private readonly logger;
|
|
80
80
|
/** this is the client the consumer is currently using. Will be set as soon as `initClient` is called and will be rest upon logout */
|
|
@@ -84,7 +84,7 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
84
84
|
private encryptedDb?;
|
|
85
85
|
private coreCallbacks?;
|
|
86
86
|
private connectionState;
|
|
87
|
-
private notificationProcessingQueue;
|
|
87
|
+
private readonly notificationProcessingQueue;
|
|
88
88
|
service?: {
|
|
89
89
|
mls?: MLSService;
|
|
90
90
|
e2eIdentity?: E2EIServiceExternal;
|
|
@@ -123,7 +123,7 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
123
123
|
* @return The highest version that is both supported by client and backend
|
|
124
124
|
*/
|
|
125
125
|
useAPIVersion: (min: number, max: number, allowDev?: boolean) => Promise<BackendFeatures>;
|
|
126
|
-
private persistCookie;
|
|
126
|
+
private readonly persistCookie;
|
|
127
127
|
enrollE2EI: ({ displayName, handle, teamId, discoveryUrl, getOAuthToken, getAllConversations, certificateTtl, }: {
|
|
128
128
|
/** display name of the user (should match the identity provider) */
|
|
129
129
|
displayName: string;
|
|
@@ -164,7 +164,7 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
164
164
|
/**
|
|
165
165
|
* Will register a new client for the current user
|
|
166
166
|
*/
|
|
167
|
-
registerClient: (loginData: LoginData,
|
|
167
|
+
registerClient: (loginData: LoginData, useLegacyNotificationStream: boolean, entropyData?: Uint8Array, clientInfo?: ClientInfo) => Promise<RegisteredClient>;
|
|
168
168
|
getLocalClient(): Promise<import("./client/ClientService").MetaClient | undefined> | undefined;
|
|
169
169
|
/**
|
|
170
170
|
* Will initiate all the cryptographic material of the given registered device and setup all the background tasks.
|
|
@@ -172,7 +172,7 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
172
172
|
* @returns The local existing client or undefined if the client does not exist or is not valid (non existing on backend)
|
|
173
173
|
*/
|
|
174
174
|
initClient: (client: RegisteredClient, mlsConfig?: InitClientOptions) => Promise<RegisteredClient>;
|
|
175
|
-
private buildCryptoClient;
|
|
175
|
+
private readonly buildCryptoClient;
|
|
176
176
|
/**
|
|
177
177
|
* In order to be able to send MLS messages, the core needs a few information from the consumer.
|
|
178
178
|
* Namely:
|
|
@@ -181,8 +181,8 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
181
181
|
* @param coreCallbacks
|
|
182
182
|
*/
|
|
183
183
|
configureCoreCallbacks: (coreCallbacks: CoreCallbacks) => void;
|
|
184
|
-
private initServices;
|
|
185
|
-
private resetContext;
|
|
184
|
+
private readonly initServices;
|
|
185
|
+
private readonly resetContext;
|
|
186
186
|
/**
|
|
187
187
|
* Will logout the current user
|
|
188
188
|
* @param clearData if set to `true` will completely wipe any database that was created by the Account
|
|
@@ -191,16 +191,16 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
191
191
|
clearAllData?: boolean;
|
|
192
192
|
clearCryptoData?: boolean;
|
|
193
193
|
}) => Promise<void>;
|
|
194
|
-
private wipeCommonData;
|
|
194
|
+
private readonly wipeCommonData;
|
|
195
195
|
/**
|
|
196
196
|
* Will delete the identity and history of the current user
|
|
197
197
|
*/
|
|
198
|
-
private wipeAllData;
|
|
198
|
+
private readonly wipeAllData;
|
|
199
199
|
/**
|
|
200
200
|
* Will delete the cryptography and client of the current user
|
|
201
201
|
* Will keep the history intact
|
|
202
202
|
*/
|
|
203
|
-
private wipeCryptoData;
|
|
203
|
+
private readonly wipeCryptoData;
|
|
204
204
|
/**
|
|
205
205
|
* return true if the current user has a MLS device that is initialized and ready to use
|
|
206
206
|
*/
|
|
@@ -244,25 +244,25 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
244
244
|
*/
|
|
245
245
|
dryRun?: boolean;
|
|
246
246
|
}) => Promise<() => void>;
|
|
247
|
-
private createConnectionStateChangedHandler;
|
|
247
|
+
private readonly createConnectionStateChangedHandler;
|
|
248
248
|
/**
|
|
249
249
|
* Creates the event handler that is invoked for each decrypted event from the backend.
|
|
250
250
|
* Responsible for handling specific event types like `MESSAGE_TIMER_UPDATE`, and then
|
|
251
251
|
* forwarding the event to the consumer via the `onEvent` callback.
|
|
252
252
|
*/
|
|
253
|
-
private createEventHandler;
|
|
253
|
+
private readonly createEventHandler;
|
|
254
254
|
/**
|
|
255
255
|
* @deprecated This method is used to handle legacy notifications from the backend.
|
|
256
256
|
* It processes notifications from the legacy system, decrypts them, and emits events.
|
|
257
257
|
* It can be replaced with the new notification handling system using `ConsumableNotification`
|
|
258
258
|
* when all clients are capable of handling consumable notifications.
|
|
259
259
|
*/
|
|
260
|
-
private createLegacyNotificationHandler;
|
|
261
|
-
private createNotificationHandler;
|
|
262
|
-
private handleNotificationQueueError;
|
|
263
|
-
private acknowledgeSynchronizationNotification;
|
|
264
|
-
private handleSynchronizationNotification;
|
|
265
|
-
private decryptAckEmitNotification;
|
|
260
|
+
private readonly createLegacyNotificationHandler;
|
|
261
|
+
private readonly createNotificationHandler;
|
|
262
|
+
private readonly handleNotificationQueueError;
|
|
263
|
+
private readonly acknowledgeSynchronizationNotification;
|
|
264
|
+
private readonly handleSynchronizationNotification;
|
|
265
|
+
private readonly decryptAckEmitNotification;
|
|
266
266
|
getNotificationEventTime: (backendEvent: Events.BackendEvent) => string | null;
|
|
267
267
|
/**
|
|
268
268
|
* Returns a function to handle missed notifications — i.e., when the backend indicates
|
|
@@ -273,7 +273,7 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
273
273
|
* It should be replaced with the new notification handling system using `ConsumableNotification`.
|
|
274
274
|
* when all clients are capable of handling consumable notifications.
|
|
275
275
|
*/
|
|
276
|
-
private createLegacyMissedNotificationsHandler;
|
|
276
|
+
private readonly createLegacyMissedNotificationsHandler;
|
|
277
277
|
/**
|
|
278
278
|
* Returns a processor function for the notification stream (legacy sync).
|
|
279
279
|
* It pauses message sending and MLS rejoining during stream handling to prevent race conditions,
|
|
@@ -285,14 +285,14 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
285
285
|
*
|
|
286
286
|
* @param handlers Various logic handlers wired to notification callbacks
|
|
287
287
|
*/
|
|
288
|
-
private createLegacyNotificationStreamProcessor;
|
|
288
|
+
private readonly createLegacyNotificationStreamProcessor;
|
|
289
289
|
/**
|
|
290
290
|
* In case of a closed connection, we flush the notification processing queue.
|
|
291
291
|
* As we are not acknowledging them before decryption is done
|
|
292
292
|
* they will be resent next time the connection is opened
|
|
293
293
|
* this is to avoid duplicate decryption of notifications
|
|
294
294
|
*/
|
|
295
|
-
private pauseAndFlushNotificationQueue;
|
|
295
|
+
private readonly pauseAndFlushNotificationQueue;
|
|
296
296
|
/**
|
|
297
297
|
* Sets up WebSocket event listeners for:
|
|
298
298
|
* - Incoming backend messages
|
|
@@ -300,7 +300,7 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
300
300
|
* On each new backend message, we pass it to the notification handler.
|
|
301
301
|
* On state changes, we map raw socket states to public connection states and emit them.
|
|
302
302
|
*/
|
|
303
|
-
private setupWebSocketListeners;
|
|
303
|
+
private readonly setupWebSocketListeners;
|
|
304
304
|
/**
|
|
305
305
|
* Handles logic for reacting to a missed notification event.
|
|
306
306
|
*
|
|
@@ -322,14 +322,14 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
322
322
|
* the WebSocket transport, unblocking the backend so it resumes sending updates
|
|
323
323
|
* then we remove the flag.
|
|
324
324
|
*/
|
|
325
|
-
private reactToMissedNotification;
|
|
325
|
+
private readonly reactToMissedNotification;
|
|
326
326
|
getClientCapabilities: () => ClientCapability[];
|
|
327
327
|
checkIsConsumable: (notification: Notification | ConsumableNotification) => notification is ConsumableNotification;
|
|
328
|
-
private generateDbName;
|
|
329
|
-
private generateCoreDbName;
|
|
330
|
-
private generateEncryptedDbName;
|
|
331
|
-
private initEngine;
|
|
332
|
-
private groupIdFromConversationId;
|
|
328
|
+
private readonly generateDbName;
|
|
329
|
+
private readonly generateCoreDbName;
|
|
330
|
+
private readonly generateEncryptedDbName;
|
|
331
|
+
private readonly initEngine;
|
|
332
|
+
private readonly groupIdFromConversationId;
|
|
333
333
|
isMLSActiveForClient: () => Promise<boolean>;
|
|
334
334
|
}
|
|
335
335
|
export {};
|
package/lib/Account.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../src/Account.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EAGZ,OAAO,EACP,MAAM,EAEN,SAAS,EAEV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAC,gBAAgB,EAAwB,UAAU,EAAE,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAErH,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AAExD,OAAO,EAAC,YAAY,EAAC,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAEL,sBAAsB,EAGvB,MAAM,6DAA6D,CAAC;AAQrE,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAa,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAC,UAAU,EAAe,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAE1C,OAAO,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EjC;IAEF,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAEtC;IAEF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAqBzB;IAEF,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CASxC;IAEK,oBAAoB,QAAa,OAAO,CAAC,OAAO,CAAC,CActD;CACH"}
|
package/lib/Account.js
CHANGED
|
@@ -117,7 +117,10 @@ class Account extends commons_1.TypedEventEmitter {
|
|
|
117
117
|
encryptedDb;
|
|
118
118
|
coreCallbacks;
|
|
119
119
|
connectionState = ConnectionState.CLOSED;
|
|
120
|
-
notificationProcessingQueue = new promise_queue_1.PromiseQueue({
|
|
120
|
+
notificationProcessingQueue = new promise_queue_1.PromiseQueue({
|
|
121
|
+
name: 'notification-processing-queue',
|
|
122
|
+
paused: true,
|
|
123
|
+
});
|
|
121
124
|
service;
|
|
122
125
|
backendFeatures;
|
|
123
126
|
recurringTaskScheduler;
|
|
@@ -239,9 +242,9 @@ class Account extends commons_1.TypedEventEmitter {
|
|
|
239
242
|
/**
|
|
240
243
|
* Will register a new client for the current user
|
|
241
244
|
*/
|
|
242
|
-
registerClient = async (loginData,
|
|
245
|
+
registerClient = async (loginData, useLegacyNotificationStream,
|
|
243
246
|
/** will add extra manual entropy to the client's identity being created */
|
|
244
|
-
entropyData) => {
|
|
247
|
+
entropyData, clientInfo = coreDefaultClient) => {
|
|
245
248
|
if (!this.service || !this.apiClient.context || !this.storeEngine) {
|
|
246
249
|
throw new Error('Services are not set or context not initialized.');
|
|
247
250
|
}
|
|
@@ -392,22 +395,47 @@ class Account extends commons_1.TypedEventEmitter {
|
|
|
392
395
|
this.resetContext();
|
|
393
396
|
};
|
|
394
397
|
wipeCommonData = async () => {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
+
try {
|
|
399
|
+
await this.service?.client.deleteLocalClient();
|
|
400
|
+
}
|
|
401
|
+
catch (error) {
|
|
402
|
+
this.logger.error('Failed to delete local client during logout cleanup:', error);
|
|
403
|
+
}
|
|
404
|
+
try {
|
|
405
|
+
if (this.storeEngine) {
|
|
406
|
+
await (0, CoreCryptoWrapper_1.wipeCoreCryptoDb)(this.storeEngine);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
catch (error) {
|
|
410
|
+
this.logger.error('Failed to wipe crypto database during logout cleanup:', error);
|
|
411
|
+
}
|
|
412
|
+
try {
|
|
413
|
+
// needs to be wiped last
|
|
414
|
+
await this.encryptedDb?.wipe();
|
|
415
|
+
}
|
|
416
|
+
catch (error) {
|
|
417
|
+
this.logger.error('Failed to delete encrypted database during logout cleanup:', error);
|
|
398
418
|
}
|
|
399
|
-
// needs to be wiped last
|
|
400
|
-
await this.encryptedDb?.wipe();
|
|
401
419
|
};
|
|
402
420
|
/**
|
|
403
421
|
* Will delete the identity and history of the current user
|
|
404
422
|
*/
|
|
405
423
|
wipeAllData = async () => {
|
|
406
|
-
|
|
407
|
-
|
|
424
|
+
try {
|
|
425
|
+
if (this.storeEngine) {
|
|
426
|
+
await (0, identityClearer_1.deleteIdentity)(this.storeEngine, false);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
catch (error) {
|
|
430
|
+
this.logger.error('Failed to delete identity during logout cleanup:', error);
|
|
408
431
|
}
|
|
409
|
-
|
|
410
|
-
|
|
432
|
+
try {
|
|
433
|
+
if (this.db) {
|
|
434
|
+
await (0, CoreDB_1.deleteDB)(this.db);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
catch (error) {
|
|
438
|
+
this.logger.error('Failed to delete database during logout cleanup:', error);
|
|
411
439
|
}
|
|
412
440
|
await this.wipeCommonData();
|
|
413
441
|
};
|
|
@@ -416,8 +444,13 @@ class Account extends commons_1.TypedEventEmitter {
|
|
|
416
444
|
* Will keep the history intact
|
|
417
445
|
*/
|
|
418
446
|
wipeCryptoData = async () => {
|
|
419
|
-
|
|
420
|
-
|
|
447
|
+
try {
|
|
448
|
+
if (this.storeEngine) {
|
|
449
|
+
await (0, identityClearer_1.deleteIdentity)(this.storeEngine, true);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
catch (error) {
|
|
453
|
+
this.logger.error('Failed to delete identity during logout cleanup:', error);
|
|
421
454
|
}
|
|
422
455
|
await this.wipeCommonData();
|
|
423
456
|
};
|
|
@@ -664,7 +697,7 @@ class Account extends commons_1.TypedEventEmitter {
|
|
|
664
697
|
createLegacyMissedNotificationsHandler = (onMissedNotifications) => {
|
|
665
698
|
return async (notificationId) => {
|
|
666
699
|
if (this.hasMLSDevice) {
|
|
667
|
-
(0, conversationRejoinQueue_1.queueConversationRejoin)('all-conversations', () => this.service.conversation.handleConversationsEpochMismatch());
|
|
700
|
+
void (0, conversationRejoinQueue_1.queueConversationRejoin)('all-conversations', () => this.service.conversation.handleConversationsEpochMismatch());
|
|
668
701
|
}
|
|
669
702
|
return onMissedNotifications(notificationId);
|
|
670
703
|
};
|
|
@@ -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,EAEL,oBAAoB,EAGpB,gBAAgB,EACjB,MAAM,iCAAiC,CAAC;AAKzC,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,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,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,WAAW,EAAE,MA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{
|
|
65
65
|
const localClientId = this.apiClient.context?.clientId;
|
|
66
66
|
if (!localClientId) {
|
|
67
|
-
|
|
67
|
+
// No client in context -> there's nothing to delete on backend, just drop local state
|
|
68
|
+
this.logger.warn('No local client id in context; deleting local client data from DB only.');
|
|
69
|
+
return this.database.deleteLocalClient();
|
|
68
70
|
}
|
|
69
71
|
try {
|
|
70
72
|
await this.backend.deleteClient(localClientId, password);
|
|
@@ -72,9 +74,7 @@ class ClientService {
|
|
|
72
74
|
catch (error) {
|
|
73
75
|
this.logger.warn('Failed to delete client on backend', error);
|
|
74
76
|
}
|
|
75
|
-
|
|
76
|
-
return this.database.deleteLocalClient();
|
|
77
|
-
}
|
|
77
|
+
return this.database.deleteLocalClient();
|
|
78
78
|
}
|
|
79
79
|
async getLocalClient() {
|
|
80
80
|
try {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@wireapp/api-client": "^27.75.
|
|
14
|
+
"@wireapp/api-client": "^27.75.7",
|
|
15
15
|
"@wireapp/commons": "^5.4.4",
|
|
16
16
|
"@wireapp/core-crypto": "7.0.2",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@wireapp/promise-queue": "^2.4.4",
|
|
20
20
|
"@wireapp/protocol-messaging": "1.53.0",
|
|
21
21
|
"@wireapp/store-engine": "^5.1.11",
|
|
22
|
-
"axios": "1.
|
|
22
|
+
"axios": "1.12.2",
|
|
23
23
|
"bazinga64": "^6.5.1",
|
|
24
24
|
"deepmerge-ts": "6.0.0",
|
|
25
25
|
"hash.js": "1.1.7",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/long": "^5.0.0",
|
|
39
39
|
"@types/tough-cookie": "4.0.5",
|
|
40
40
|
"@types/uuid": "9.0.8",
|
|
41
|
-
"commander": "14.0.
|
|
41
|
+
"commander": "14.0.1",
|
|
42
42
|
"cross-env": "10.0.0",
|
|
43
43
|
"dotenv-defaults": "5.0.2",
|
|
44
44
|
"fake-indexeddb": "^5.0.2",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"test:coverage": "jest --coverage",
|
|
62
62
|
"watch": "tsc --watch"
|
|
63
63
|
},
|
|
64
|
-
"version": "46.34.
|
|
65
|
-
"gitHead": "
|
|
64
|
+
"version": "46.34.11",
|
|
65
|
+
"gitHead": "d79e8ed6859116c166663e1596b4130a8ab48aa3"
|
|
66
66
|
}
|