@wireapp/core 37.0.1 → 37.0.3
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/cryptography/CryptographyService.d.ts +0 -5
- package/lib/cryptography/CryptographyService.d.ts.map +1 -1
- package/lib/cryptography/CryptographyService.js +2 -26
- package/lib/cryptography/Utlility/generateDecryptionError.d.ts +6 -0
- package/lib/cryptography/Utlility/generateDecryptionError.d.ts.map +1 -0
- package/lib/cryptography/Utlility/generateDecryptionError.js +50 -0
- package/lib/errors/DecryptionError.d.ts +6 -0
- package/lib/errors/DecryptionError.d.ts.map +1 -0
- package/lib/errors/DecryptionError.js +29 -0
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/otrMessageAdd.js +2 -2
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.js +7 -9
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts.map +1 -1
- package/lib/notification/NotificationService.d.ts +1 -1
- package/lib/notification/NotificationService.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -8,10 +8,6 @@ import { Cryptobox } from '@wireapp/cryptobox';
|
|
|
8
8
|
import { GenericMessage } from '@wireapp/protocol-messaging';
|
|
9
9
|
import { CRUDEngine } from '@wireapp/store-engine';
|
|
10
10
|
import { PayloadBundle, PayloadBundleSource } from '../conversation';
|
|
11
|
-
export declare type DecryptionError = {
|
|
12
|
-
code: number;
|
|
13
|
-
message: string;
|
|
14
|
-
};
|
|
15
11
|
export declare type SessionId = {
|
|
16
12
|
userId: string;
|
|
17
13
|
clientId: string;
|
|
@@ -79,6 +75,5 @@ export declare class CryptographyService {
|
|
|
79
75
|
resetSession(sessionId: string): Promise<void>;
|
|
80
76
|
decryptMessage(otrMessage: ConversationOtrMessageAddEvent): Promise<GenericMessage>;
|
|
81
77
|
mapGenericMessage(otrMessage: ConversationOtrMessageAddEvent, genericMessage: GenericMessage, source: PayloadBundleSource): PayloadBundle;
|
|
82
|
-
private generateDecryptionError;
|
|
83
78
|
}
|
|
84
79
|
//# sourceMappingURL=CryptographyService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptographyService.d.ts","sourceRoot":"","sources":["../../src/cryptography/CryptographyService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAEL,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAC,8BAA8B,EAAC,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAC,WAAW,EAAE,4BAA4B,EAAE,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;AAI7G,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAmB,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"CryptographyService.d.ts","sourceRoot":"","sources":["../../src/cryptography/CryptographyService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAEL,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAC,8BAA8B,EAAC,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAC,WAAW,EAAE,4BAA4B,EAAE,mBAAmB,EAAC,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AAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAIxC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9C,cAAc,CAAC,UAAU,EAAE,8BAA8B,GAAG,OAAO,CAAC,cAAc,CAAC;IAgBzF,iBAAiB,CACtB,UAAU,EAAE,8BAA8B,EAC1C,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,mBAAmB,GAC1B,aAAa;CAajB"}
|
|
@@ -29,6 +29,7 @@ const proteus_1 = require("@wireapp/proteus");
|
|
|
29
29
|
const protocol_messaging_1 = require("@wireapp/protocol-messaging");
|
|
30
30
|
const CryptographyDatabaseRepository_1 = require("./CryptographyDatabaseRepository");
|
|
31
31
|
const GenericMessageMapper_1 = require("./GenericMessageMapper");
|
|
32
|
+
const generateDecryptionError_1 = require("./Utlility/generateDecryptionError");
|
|
32
33
|
const conversation_1 = require("../conversation");
|
|
33
34
|
const util_1 = require("../util");
|
|
34
35
|
class CryptographyService {
|
|
@@ -216,7 +217,7 @@ class CryptographyService {
|
|
|
216
217
|
return protocol_messaging_1.GenericMessage.decode(decryptedMessage);
|
|
217
218
|
}
|
|
218
219
|
catch (error) {
|
|
219
|
-
throw
|
|
220
|
+
throw (0, generateDecryptionError_1.generateDecryptionError)(otrMessage, error, this.logger);
|
|
220
221
|
}
|
|
221
222
|
}
|
|
222
223
|
mapGenericMessage(otrMessage, genericMessage, source) {
|
|
@@ -232,30 +233,5 @@ class CryptographyService {
|
|
|
232
233
|
}
|
|
233
234
|
return GenericMessageMapper_1.GenericMessageMapper.mapGenericMessage(genericMessage, otrMessage, source);
|
|
234
235
|
}
|
|
235
|
-
generateDecryptionError(event, error) {
|
|
236
|
-
var _a;
|
|
237
|
-
const errorCode = (_a = error.code) !== null && _a !== void 0 ? _a : 999;
|
|
238
|
-
let message = 'Unknown decryption error';
|
|
239
|
-
const { data: eventData, from: remoteUserId, time: formattedTime } = event;
|
|
240
|
-
const remoteClientId = eventData.sender;
|
|
241
|
-
const isDuplicateMessage = error instanceof proteus_1.errors.DecryptError.DuplicateMessage;
|
|
242
|
-
const isOutdatedMessage = error instanceof proteus_1.errors.DecryptError.OutdatedMessage;
|
|
243
|
-
// We don't need to show these message errors to the user
|
|
244
|
-
if (isDuplicateMessage || isOutdatedMessage) {
|
|
245
|
-
message = `Message from user ID "${remoteUserId}" at "${formattedTime}" will not be handled because it is outdated or a duplicate.`;
|
|
246
|
-
}
|
|
247
|
-
const isInvalidMessage = error instanceof proteus_1.errors.DecryptError.InvalidMessage;
|
|
248
|
-
const isInvalidSignature = error instanceof proteus_1.errors.DecryptError.InvalidSignature;
|
|
249
|
-
const isRemoteIdentityChanged = error instanceof proteus_1.errors.DecryptError.RemoteIdentityChanged;
|
|
250
|
-
// Session is broken, let's see what's really causing it...
|
|
251
|
-
if (isInvalidMessage || isInvalidSignature) {
|
|
252
|
-
message = `Session with user '${remoteUserId}' (${remoteClientId}) is broken.\nReset the session for possible fix.`;
|
|
253
|
-
}
|
|
254
|
-
else if (isRemoteIdentityChanged) {
|
|
255
|
-
message = `Remote identity of client '${remoteClientId}' from user '${remoteUserId}' changed`;
|
|
256
|
-
}
|
|
257
|
-
this.logger.warn(`Failed to decrypt event from client '${remoteClientId}' of user '${remoteUserId}' (${formattedTime}).\nError Code: '${errorCode}'\nError Message: ${error.message}`, error);
|
|
258
|
-
return { code: errorCode, message };
|
|
259
|
-
}
|
|
260
236
|
}
|
|
261
237
|
exports.CryptographyService = CryptographyService;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ConversationOtrMessageAddEvent } from '@wireapp/api-client/lib/event';
|
|
2
|
+
import logdown from 'logdown';
|
|
3
|
+
import { DecryptionError } from '../../errors/DecryptionError';
|
|
4
|
+
declare const generateDecryptionError: (event: ConversationOtrMessageAddEvent, error: any, logger: logdown.Logger) => DecryptionError;
|
|
5
|
+
export { generateDecryptionError };
|
|
6
|
+
//# sourceMappingURL=generateDecryptionError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateDecryptionError.d.ts","sourceRoot":"","sources":["../../../src/cryptography/Utlility/generateDecryptionError.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,8BAA8B,EAAC,MAAM,+BAA+B,CAAC;AAC7E,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAK7D,QAAA,MAAM,uBAAuB,UACpB,8BAA8B,SAC9B,GAAG,UACF,QAAQ,MAAM,KACrB,eA6BF,CAAC;AAEF,OAAO,EAAC,uBAAuB,EAAC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2022 Wire Swiss GmbH
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This program is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.generateDecryptionError = void 0;
|
|
22
|
+
const proteus_1 = require("@wireapp/proteus");
|
|
23
|
+
const DecryptionError_1 = require("../../errors/DecryptionError");
|
|
24
|
+
const hasErrorCode = (error) => error && error.code;
|
|
25
|
+
const generateDecryptionError = (event, error, logger) => {
|
|
26
|
+
var _a;
|
|
27
|
+
const errorCode = hasErrorCode(error) ? (_a = error.code) !== null && _a !== void 0 ? _a : 999 : 999;
|
|
28
|
+
let message = 'Unknown decryption error';
|
|
29
|
+
const { data: eventData, from: remoteUserId, time: formattedTime } = event;
|
|
30
|
+
const remoteClientId = eventData.sender;
|
|
31
|
+
const isDuplicateMessage = error instanceof proteus_1.errors.DecryptError.DuplicateMessage;
|
|
32
|
+
const isOutdatedMessage = error instanceof proteus_1.errors.DecryptError.OutdatedMessage;
|
|
33
|
+
// We don't need to show these message errors to the user
|
|
34
|
+
if (isDuplicateMessage || isOutdatedMessage) {
|
|
35
|
+
message = `Message from user ID "${remoteUserId}" at "${formattedTime}" will not be handled because it is outdated or a duplicate.`;
|
|
36
|
+
}
|
|
37
|
+
const isInvalidMessage = error instanceof proteus_1.errors.DecryptError.InvalidMessage;
|
|
38
|
+
const isInvalidSignature = error instanceof proteus_1.errors.DecryptError.InvalidSignature;
|
|
39
|
+
const isRemoteIdentityChanged = error instanceof proteus_1.errors.DecryptError.RemoteIdentityChanged;
|
|
40
|
+
// Session is broken, let's see what's really causing it...
|
|
41
|
+
if (isInvalidMessage || isInvalidSignature) {
|
|
42
|
+
message = `Session with user '${remoteUserId}' (${remoteClientId}) is broken.\nReset the session for possible fix.`;
|
|
43
|
+
}
|
|
44
|
+
else if (isRemoteIdentityChanged) {
|
|
45
|
+
message = `Remote identity of client '${remoteClientId}' from user '${remoteUserId}' changed`;
|
|
46
|
+
}
|
|
47
|
+
logger.warn(`Failed to decrypt event from client '${remoteClientId}' of user '${remoteUserId}' (${formattedTime}).\nError Code: '${errorCode}'\nError Message: ${error.message}`, error);
|
|
48
|
+
return new DecryptionError_1.DecryptionError(message, errorCode);
|
|
49
|
+
};
|
|
50
|
+
exports.generateDecryptionError = generateDecryptionError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DecryptionError.d.ts","sourceRoot":"","sources":["../../src/errors/DecryptionError.ts"],"names":[],"mappings":"AAmBA,qBAAa,eAAgB,SAAQ,KAAK;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;gBACF,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAK3C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2022 Wire Swiss GmbH
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This program is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.DecryptionError = void 0;
|
|
22
|
+
class DecryptionError extends Error {
|
|
23
|
+
constructor(message, code) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.message = message;
|
|
26
|
+
this.code = code;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.DecryptionError = DecryptionError;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.handleOtrMessageAdd = exports.isOtrMessageAddEvent = void 0;
|
|
22
22
|
const event_1 = require("@wireapp/api-client/lib/event");
|
|
23
|
-
const
|
|
23
|
+
const DecryptionError_1 = require("../../../../../../errors/DecryptionError");
|
|
24
24
|
const isOtrMessageAddEvent = (event) => event.type === event_1.CONVERSATION_EVENT.OTR_MESSAGE_ADD;
|
|
25
25
|
exports.isOtrMessageAddEvent = isOtrMessageAddEvent;
|
|
26
26
|
const handleOtrMessageAdd = async ({ cryptographyService, event, source, dryRun = false, }) => {
|
|
@@ -38,7 +38,7 @@ const handleOtrMessageAdd = async ({ cryptographyService, event, source, dryRun
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
catch (error) {
|
|
41
|
-
if (error instanceof
|
|
41
|
+
if (error instanceof DecryptionError_1.DecryptionError) {
|
|
42
42
|
return { event, decryptionError: error };
|
|
43
43
|
}
|
|
44
44
|
return { event, decryptionError: error };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProteusService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,YAAY,EAAkB,MAAM,sCAAsC,CAAC;AAGnF,OAAO,EACL,mCAAmC,EACnC,+BAA+B,EAC/B,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAqB,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAqB,MAAM,iBAAiB,CAAC;AAEvE,qBAAa,cAAc;IAKvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAG/C,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,oBA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AAC,cAAc,EAAE,gBAAgB,EAAC,EAAE,mCAAmC;IAI9F,WAAW,CAAC,EACvB,OAAO,EACP,cAAc,EACd,cAAc,EACd,UAAU,EACV,UAAU,EACV,OAAO,EACP,gBAAgB,GACjB,EAAE,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC;CA0ClD"}
|
|
@@ -40,20 +40,18 @@ class ProteusService {
|
|
|
40
40
|
return (0, EventHandler_1.handleBackendEvent)(Object.assign(Object.assign({}, params), { cryptographyService: this.cryptographyService }));
|
|
41
41
|
}
|
|
42
42
|
async createConversation({ conversationData, otherUserIds, }) {
|
|
43
|
-
const isNewConversation = (conversationData) => conversationData && (conversationData === null || conversationData === void 0 ? void 0 : conversationData.name) && (conversationData === null || conversationData === void 0 ? void 0 : conversationData.users);
|
|
44
43
|
let payload;
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
const users = otherUserIds ? (Array.isArray(otherUserIds) ? otherUserIds : [otherUserIds]) : [];
|
|
50
|
-
const payloadName = conversationData && typeof conversationData === 'string' ? conversationData : undefined;
|
|
44
|
+
if (typeof conversationData === 'string') {
|
|
45
|
+
const ids = typeof otherUserIds === 'string' ? [otherUserIds] : otherUserIds;
|
|
51
46
|
payload = {
|
|
52
|
-
name:
|
|
47
|
+
name: conversationData,
|
|
53
48
|
receipt_mode: null,
|
|
54
|
-
users,
|
|
49
|
+
users: ids !== null && ids !== void 0 ? ids : [],
|
|
55
50
|
};
|
|
56
51
|
}
|
|
52
|
+
else {
|
|
53
|
+
payload = conversationData;
|
|
54
|
+
}
|
|
57
55
|
return this.apiClient.api.conversation.postConversation(payload);
|
|
58
56
|
}
|
|
59
57
|
async addUsersToConversation({ conversationId, qualifiedUserIds }) {
|
|
@@ -18,7 +18,7 @@ export declare type SendProteusMessageParams = SendCommonParams & MessageSending
|
|
|
18
18
|
protocol: ConversationProtocol.PROTEUS;
|
|
19
19
|
};
|
|
20
20
|
export declare type CreateProteusConversationParams = {
|
|
21
|
-
conversationData
|
|
21
|
+
conversationData: NewConversation | string;
|
|
22
22
|
otherUserIds?: string | string[];
|
|
23
23
|
};
|
|
24
24
|
export declare type AddUsersToProteusConversationParams = Omit<AddUsersParams, 'groupId'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProteusService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAE,qBAAqB,EAAE,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAE9F,oBAAY,oBAAoB,GAAG;IACjC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,oBAAY,wBAAwB,GAAG,gBAAgB,GACrD,qBAAqB,GAAG;IACtB,cAAc,EAAE,WAAW,CAAC;IAE5B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,WAAW,GAAG,oBAAoB,CAAC;IACxE,gBAAgB,CAAC,EAAE,CACjB,MAAM,EAAE,cAAc,GAAG,oBAAoB,EAC7C,OAAO,EAAE,OAAO,KACb,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC,OAAO,CAAC;CACxC,CAAC;AAEJ,oBAAY,+BAA+B,GAAG;IAC5C,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ProteusService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAE,qBAAqB,EAAE,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAE9F,oBAAY,oBAAoB,GAAG;IACjC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,oBAAY,wBAAwB,GAAG,gBAAgB,GACrD,qBAAqB,GAAG;IACtB,cAAc,EAAE,WAAW,CAAC;IAE5B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,WAAW,GAAG,oBAAoB,CAAC;IACxE,gBAAgB,CAAC,EAAE,CACjB,MAAM,EAAE,cAAc,GAAG,oBAAoB,EAC7C,OAAO,EAAE,OAAO,KACb,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC,OAAO,CAAC;CACxC,CAAC;AAEJ,oBAAY,+BAA+B,GAAG;IAC5C,gBAAgB,EAAE,eAAe,GAAG,MAAM,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAClC,CAAC;AAEF,oBAAY,mCAAmC,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import * as Events from '@wireapp/api-client/lib/event';
|
|
3
3
|
import { Notification } from '@wireapp/api-client/lib/notification/';
|
|
4
4
|
import { AbortHandler } from '@wireapp/api-client/lib/tcp';
|
|
5
|
-
import { DecryptionError } from '@wireapp/cryptobox/src/error';
|
|
6
5
|
import { EventEmitter } from 'events';
|
|
7
6
|
import { APIClient } from '@wireapp/api-client';
|
|
8
7
|
import { GenericMessage } from '@wireapp/protocol-messaging';
|
|
9
8
|
import { CRUDEngine } from '@wireapp/store-engine';
|
|
10
9
|
import { PayloadBundle, PayloadBundleSource } from '../conversation';
|
|
11
10
|
import { NotificationError } from '../CoreError';
|
|
11
|
+
import { DecryptionError } from '../errors/DecryptionError';
|
|
12
12
|
import { MLSService } from '../messagingProtocols/mls';
|
|
13
13
|
import { ProteusService } from '../messagingProtocols/proteus';
|
|
14
14
|
export declare type HandledEventPayload = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationService.d.ts","sourceRoot":"","sources":["../../src/notification/NotificationService.ts"],"names":[],"mappings":";AAmBA,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAC,YAAY,EAAC,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"NotificationService.d.ts","sourceRoot":"","sources":["../../src/notification/NotificationService.ts"],"names":[],"mappings":";AAmBA,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAC,YAAY,EAAC,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAGzD,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,UAAU,EAA4B,MAAM,uBAAuB,CAAC;AAK5E,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAoB,MAAM,iBAAiB,CAAC;AAGtF,OAAO,EAAY,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAG7D,oBAAY,mBAAmB,GAAG;IAChC,KAAK,EA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