@wireapp/core 42.7.0 → 42.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/conversation/ConversationService/ConversationService.d.ts +2 -1
- package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.js +20 -8
- package/lib/conversation/ConversationService/ConversationService.test.js +33 -0
- package/lib/conversation/ConversationService/ConversationService.types.d.ts +1 -0
- package/lib/conversation/ConversationService/ConversationService.types.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.d.ts +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/MLSService/MLSService.d.ts +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts +0 -1
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -125,9 +125,10 @@ export declare class ConversationService extends TypedEventEmitter<Events> {
|
|
|
125
125
|
client: string;
|
|
126
126
|
}, otherUserId: QualifiedId, shouldRetry?: boolean) => Promise<MLSConversation>;
|
|
127
127
|
private handleMLSMessageAddEvent;
|
|
128
|
+
private recoverMLSConversationFromEpochMismatch;
|
|
128
129
|
private handleMLSWelcomeMessageEvent;
|
|
129
130
|
private handleOtrMessageAddEvent;
|
|
130
|
-
handleEvent(event: BackendEvent): Promise<HandledEventPayload |
|
|
131
|
+
handleEvent(event: BackendEvent): Promise<HandledEventPayload | null>;
|
|
131
132
|
}
|
|
132
133
|
export {};
|
|
133
134
|
//# sourceMappingURL=ConversationService.d.ts.map
|
|
@@ -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,EAChB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,YAAY,EAIZ,4BAA4B,EAE7B,MAAM,+BAA+B,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,EAChB,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;AAInD,OAAO,EAEL,cAAc,EACd,6BAA6B,EAC7B,oBAAoB,EACpB,UAAU,EACX,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAC,YAAY,EAAuB,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEzF,OAAO,EAAC,UAAU,EAAuB,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EAAkC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AACjG,OAAO,EACL,mCAAmC,EACnC,wBAAwB,EACzB,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EAAC,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AAGvD,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AAGtC,KAAK,MAAM,GAAG;IACZ,wBAAwB,EAAE;QAAC,cAAc,EAAE,WAAW,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,IAAI,CAAC;YAIlD,YAAY;IAYb,gCAAgC;IAa7C;;;;;OAKG;YACW,+BAA+B;IA6B7C;;;;;;;OAOG;IACH,SAAgB,4BAA4B,YACjC,MAAM,YACL;QAAC,IAAI,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,eAChC,WAAW,4BAEvB,QAAQ,eAAe,CAAC,CAoDzB;YAEY,wBAAwB;YAoBxB,uCAAuC;YAYvC,4BAA4B;YAI5B,wBAAwB;IAIzB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;CAYnF"}
|
|
@@ -25,6 +25,7 @@ exports.ConversationService = void 0;
|
|
|
25
25
|
const conversation_1 = require("@wireapp/api-client/lib/conversation");
|
|
26
26
|
const data_1 = require("@wireapp/api-client/lib/conversation/data");
|
|
27
27
|
const event_1 = require("@wireapp/api-client/lib/event");
|
|
28
|
+
const http_1 = require("@wireapp/api-client/lib/http");
|
|
28
29
|
const bazinga64_1 = require("bazinga64");
|
|
29
30
|
const logdown_1 = __importDefault(require("logdown"));
|
|
30
31
|
const commons_1 = require("@wireapp/commons");
|
|
@@ -242,8 +243,9 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
242
243
|
: undefined,
|
|
243
244
|
};
|
|
244
245
|
}
|
|
245
|
-
async sendMLSMessage(
|
|
246
|
+
async sendMLSMessage(params, shouldRetry = true) {
|
|
246
247
|
var _a, _b;
|
|
248
|
+
const { payload, groupId, conversationId } = params;
|
|
247
249
|
const groupIdBytes = bazinga64_1.Decoder.fromBase64(groupId).asBytes;
|
|
248
250
|
// immediately execute pending commits before sending the message
|
|
249
251
|
await this.mlsService.commitPendingProposals({ groupId });
|
|
@@ -255,6 +257,13 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
255
257
|
sentAt = ((_a = response.time) === null || _a === void 0 ? void 0 : _a.length) > 0 ? response.time : new Date().toISOString();
|
|
256
258
|
}
|
|
257
259
|
catch (error) {
|
|
260
|
+
const isMLSStaleMessageError = error instanceof http_1.BackendError && error.label === http_1.BackendErrorLabel.MLS_STALE_MESSAGE;
|
|
261
|
+
if (isMLSStaleMessageError) {
|
|
262
|
+
await this.recoverMLSConversationFromEpochMismatch(conversationId);
|
|
263
|
+
if (shouldRetry) {
|
|
264
|
+
return this.sendMLSMessage(params, false);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
258
267
|
throw error;
|
|
259
268
|
}
|
|
260
269
|
const failedToSend = (response === null || response === void 0 ? void 0 : response.failed) || ((_b = response === null || response === void 0 ? void 0 : response.failed_to_send) !== null && _b !== void 0 ? _b : []).length > 0
|
|
@@ -396,16 +405,19 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
396
405
|
if (!conversationId) {
|
|
397
406
|
throw new Error('Qualified conversation id is missing in the event');
|
|
398
407
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
throw new Error('Conversation is not an MLS conversation');
|
|
402
|
-
}
|
|
403
|
-
await this.handleConversationEpochMismatch(mlsConversation, () => this.emit('MLSConversationRecovered', { conversationId }));
|
|
404
|
-
return;
|
|
408
|
+
await this.recoverMLSConversationFromEpochMismatch(conversationId);
|
|
409
|
+
return null;
|
|
405
410
|
}
|
|
406
411
|
throw error;
|
|
407
412
|
}
|
|
408
413
|
}
|
|
414
|
+
async recoverMLSConversationFromEpochMismatch(conversationId) {
|
|
415
|
+
const mlsConversation = await this.apiClient.api.conversation.getConversation(conversationId);
|
|
416
|
+
if (!(0, util_1.isMLSConversation)(mlsConversation)) {
|
|
417
|
+
throw new Error('Conversation is not an MLS conversation');
|
|
418
|
+
}
|
|
419
|
+
return this.handleConversationEpochMismatch(mlsConversation, () => this.emit('MLSConversationRecovered', { conversationId: mlsConversation.qualified_id }));
|
|
420
|
+
}
|
|
409
421
|
async handleMLSWelcomeMessageEvent(event) {
|
|
410
422
|
return this.mlsService.handleMLSWelcomeMessageEvent(event, this.apiClient.validatedClientId);
|
|
411
423
|
}
|
|
@@ -421,7 +433,7 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
421
433
|
case event_1.CONVERSATION_EVENT.OTR_MESSAGE_ADD:
|
|
422
434
|
return this.handleOtrMessageAddEvent(event);
|
|
423
435
|
}
|
|
424
|
-
return
|
|
436
|
+
return null;
|
|
425
437
|
}
|
|
426
438
|
}
|
|
427
439
|
exports.ConversationService = ConversationService;
|
|
@@ -44,6 +44,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
44
44
|
const client_1 = require("@wireapp/api-client/lib/client");
|
|
45
45
|
const conversation_1 = require("@wireapp/api-client/lib/conversation");
|
|
46
46
|
const event_1 = require("@wireapp/api-client/lib/event");
|
|
47
|
+
const http_1 = require("@wireapp/api-client/lib/http");
|
|
48
|
+
const http_status_codes_1 = require("http-status-codes");
|
|
47
49
|
const api_client_1 = require("@wireapp/api-client");
|
|
48
50
|
const __1 = require("..");
|
|
49
51
|
const CoreCryptoMLSError_1 = require("../../messagingProtocols/mls/MLSService/CoreCryptoMLSError");
|
|
@@ -151,11 +153,42 @@ describe('ConversationService', () => {
|
|
|
151
153
|
protocol: conversation_1.ConversationProtocol.MLS,
|
|
152
154
|
groupId,
|
|
153
155
|
payload: message,
|
|
156
|
+
conversationId: { id: '', domain: '' },
|
|
154
157
|
});
|
|
155
158
|
const result = await promise;
|
|
156
159
|
expect(result.state).toBe(__1.MessageSendingState.OUTGOING_SENT);
|
|
157
160
|
});
|
|
158
161
|
});
|
|
162
|
+
it('rejoins a MLS group when failed encrypting MLS message', async () => {
|
|
163
|
+
const [conversationService, { apiClient, mlsService }] = buildConversationService();
|
|
164
|
+
const mockGroupId = 'AAEAAH87aajaQ011i+rNLmwpy0sAZGl5YS53aXJlamxpbms=';
|
|
165
|
+
const mockConversationId = { id: 'mockConversationId', domain: 'staging.zinfra.io' };
|
|
166
|
+
const mockedMessage = MessageBuilder.buildTextMessage({ text: 'test' });
|
|
167
|
+
jest
|
|
168
|
+
.spyOn(apiClient.api.conversation, 'postMlsMessage')
|
|
169
|
+
.mockRejectedValueOnce(new http_1.BackendError('', http_1.BackendErrorLabel.MLS_STALE_MESSAGE, http_status_codes_1.StatusCodes.CONFLICT));
|
|
170
|
+
const remoteEpoch = 5;
|
|
171
|
+
const localEpoch = 4;
|
|
172
|
+
jest.spyOn(mlsService, 'conversationExists').mockResolvedValueOnce(true);
|
|
173
|
+
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
174
|
+
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
175
|
+
qualified_id: mockConversationId,
|
|
176
|
+
protocol: conversation_1.ConversationProtocol.MLS,
|
|
177
|
+
epoch: remoteEpoch,
|
|
178
|
+
group_id: mockGroupId,
|
|
179
|
+
});
|
|
180
|
+
await conversationService.send({
|
|
181
|
+
protocol: conversation_1.ConversationProtocol.MLS,
|
|
182
|
+
groupId: mockGroupId,
|
|
183
|
+
payload: mockedMessage,
|
|
184
|
+
conversationId: mockConversationId,
|
|
185
|
+
});
|
|
186
|
+
expect(conversationService.joinByExternalCommit).toHaveBeenCalledWith(mockConversationId);
|
|
187
|
+
expect(conversationService.emit).toHaveBeenCalledWith('MLSConversationRecovered', {
|
|
188
|
+
conversationId: mockConversationId,
|
|
189
|
+
});
|
|
190
|
+
expect(apiClient.api.conversation.postMlsMessage).toHaveBeenCalledTimes(2);
|
|
191
|
+
});
|
|
159
192
|
});
|
|
160
193
|
describe('handleConversationsEpochMismatch', () => {
|
|
161
194
|
beforeEach(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.types.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAC,iBAAiB,EAAE,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,IAAI,CAAC;AAEvC,oBAAY,iBAAiB;IAC3B,IAAI,IAAA;IACJ,KAAK,IAAA;IACL,aAAa,IAAA;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC;IAE/C,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,gBAAgB,CAAC,EAAE,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;IAE/D;;;;;OAKG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1G;AAED;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,oBAAoB,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,OAAO,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ConversationService.types.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAC,iBAAiB,EAAE,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EA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|
|
6
6
|
mlsService: MLSService;
|
|
7
7
|
}
|
|
8
|
-
export declare const handleMLSMessageAdd: ({ event, mlsService, }: HandleMLSMessageAddParams) => Promise<HandledEventPayload |
|
|
8
|
+
export declare const handleMLSMessageAdd: ({ event, mlsService, }: HandleMLSMessageAddParams) => Promise<HandledEventPayload | null>;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=messageAdd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageAdd.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,8BAA8B,EAAC,MAAM,+BAA+B,CAAC;AAK7E,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,UAAU,EAAuB,MAAM,gCAAgC,CAAC;AAEhF,UAAU,yBAAyB;IACjC,KAAK,EAAE,8BAA8B,CAAC;IACtC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,2BAG7B,yBAAyB,KAAG,QAAQ,mBAAmB,GAAG,
|
|
1
|
+
{"version":3,"file":"messageAdd.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,8BAA8B,EAAC,MAAM,+BAA+B,CAAC;AAK7E,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,UAAU,EAAuB,MAAM,gCAAgC,CAAC;AAEhF,UAAU,yBAAyB;IACjC,KAAK,EAAE,8BAA8B,CAAC;IACtC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,2BAG7B,yBAAyB,KAAG,QAAQ,mBAAmB,GAAG,IAAI,CA+ChE,CAAC"}
|
|
@@ -52,6 +52,6 @@ const handleMLSMessageAdd = async ({ event, mlsService, }) => {
|
|
|
52
52
|
const newEpoch = await mlsService.getEpoch(groupId);
|
|
53
53
|
mlsService.emit('newEpoch', { groupId, epoch: newEpoch });
|
|
54
54
|
}
|
|
55
|
-
return message ? { event, decryptedData: protocol_messaging_1.GenericMessage.decode(message) } :
|
|
55
|
+
return message ? { event, decryptedData: protocol_messaging_1.GenericMessage.decode(message) } : null;
|
|
56
56
|
};
|
|
57
57
|
exports.handleMLSMessageAdd = handleMLSMessageAdd;
|
|
@@ -215,7 +215,7 @@ export declare class MLSService extends TypedEventEmitter<Events> {
|
|
|
215
215
|
clientId: string;
|
|
216
216
|
domain: string;
|
|
217
217
|
}[]>;
|
|
218
|
-
handleMLSMessageAddEvent(event: ConversationMLSMessageAddEvent): Promise<import("../../../notification").HandledEventPayload |
|
|
218
|
+
handleMLSMessageAddEvent(event: ConversationMLSMessageAddEvent): Promise<import("../../../notification").HandledEventPayload | null>;
|
|
219
219
|
handleMLSWelcomeMessageEvent(event: ConversationMLSWelcomeEvent, clientId: string): Promise<import("../../../notification").HandledEventPayload>;
|
|
220
220
|
}
|
|
221
221
|
export {};
|
|
@@ -10,7 +10,6 @@ export type ProteusServiceConfig = {
|
|
|
10
10
|
nbPrekeys: number;
|
|
11
11
|
};
|
|
12
12
|
export type SendProteusMessageParams = SendCommonParams & MessageSendingOptions & {
|
|
13
|
-
conversationId: QualifiedId;
|
|
14
13
|
/**
|
|
15
14
|
* Can be either a QualifiedId[] or QualfiedUserClients. The type has some effect on the behavior of the method. (Needed only for Proteus)
|
|
16
15
|
* When given a QualifiedId[] the method will fetch the freshest list of devices for those users (since they are not given by the consumer). As a consequence no ClientMismatch error will trigger and we will ignore missing clients when sending
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProteusService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,oBAAoB,EACpB,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,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;CACrB;AACD,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GACrD,qBAAqB,GAAG;IACtB
|
|
1
|
+
{"version":3,"file":"ProteusService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,oBAAoB,EACpB,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,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;CACrB;AACD,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GACrD,qBAAqB,GAAG;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC;IAC/C,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzG,QAAQ,EAAE,oBAAoB,CAAC,OAAO,CAAC;CACxC,CAAC;AAEJ,MAAM,MAAM,+BAA+B,GAAG;IAC5C,gBAAgB,EAAE,eAAe,GAAG,MAAM,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC"}
|
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": "^26.2.
|
|
14
|
+
"@wireapp/api-client": "^26.2.3",
|
|
15
15
|
"@wireapp/commons": "^5.2.0",
|
|
16
16
|
"@wireapp/core-crypto": "1.0.0-rc.12",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
"test:coverage": "jest --coverage",
|
|
61
61
|
"watch": "tsc --watch"
|
|
62
62
|
},
|
|
63
|
-
"version": "42.
|
|
64
|
-
"gitHead": "
|
|
63
|
+
"version": "42.8.0",
|
|
64
|
+
"gitHead": "c362ba70f5df8bf0960adec2b6f30799389a7f66"
|
|
65
65
|
}
|