@wireapp/core 36.1.0 → 36.1.1
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 +2 -2
- package/lib/Account.js.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.d.ts +1 -3
- package/lib/conversation/ConversationService/ConversationService.js +2 -3
- package/lib/conversation/ConversationService/ConversationService.js.map +1 -1
- package/lib/cryptography/CryptographyDatabaseRepository.d.ts +1 -2
- package/lib/cryptography/CryptographyDatabaseRepository.js +0 -1
- package/lib/cryptography/CryptographyDatabaseRepository.js.map +1 -1
- package/lib/mls/EventHandler/ConversationEvent/ConversationEvent.js +12 -17
- package/lib/mls/EventHandler/ConversationEvent/ConversationEvent.js.map +1 -1
- package/lib/mls/EventHandler/ConversationEvent/events/index.d.ts +2 -0
- package/lib/mls/EventHandler/ConversationEvent/events/index.js +37 -0
- package/lib/mls/EventHandler/ConversationEvent/events/index.js.map +1 -0
- package/lib/mls/EventHandler/ConversationEvent/events/messageAdd/index.d.ts +1 -0
- package/lib/mls/EventHandler/ConversationEvent/events/messageAdd/index.js +36 -0
- package/lib/mls/EventHandler/ConversationEvent/events/messageAdd/index.js.map +1 -0
- package/lib/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.d.ts +10 -0
- package/lib/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.js +67 -0
- package/lib/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.js.map +1 -0
- package/lib/mls/EventHandler/ConversationEvent/events/welcomeMessage/index.d.ts +1 -0
- package/lib/mls/EventHandler/ConversationEvent/events/welcomeMessage/index.js +36 -0
- package/lib/mls/EventHandler/ConversationEvent/events/welcomeMessage/index.js.map +1 -0
- package/lib/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.d.ts +8 -0
- package/lib/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.js +37 -0
- package/lib/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.js.map +1 -0
- package/lib/mls/EventHandler/EventHandler.js +1 -7
- package/lib/mls/EventHandler/EventHandler.js.map +1 -1
- package/lib/mls/EventHandler/EventHandler.types.d.ts +1 -1
- package/lib/mls/MLSService/MLSService.d.ts +34 -4
- package/lib/mls/MLSService/MLSService.js +86 -5
- package/lib/mls/MLSService/MLSService.js.map +1 -1
- package/lib/mls/MLSService/{keyMaterialUpdatesStore → stores/keyMaterialUpdatesStore}/index.d.ts +0 -0
- package/lib/mls/MLSService/{keyMaterialUpdatesStore → stores/keyMaterialUpdatesStore}/index.js +0 -0
- package/lib/mls/MLSService/stores/keyMaterialUpdatesStore/index.js.map +1 -0
- package/lib/mls/MLSService/{keyMaterialUpdatesStore → stores/keyMaterialUpdatesStore}/keyMaterialUpdatesStore.d.ts +2 -1
- package/lib/mls/MLSService/{keyMaterialUpdatesStore → stores/keyMaterialUpdatesStore}/keyMaterialUpdatesStore.js +0 -0
- package/lib/mls/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.js.map +1 -0
- package/lib/mls/MLSService/stores/pendingProposalsStore/index.d.ts +1 -0
- package/lib/mls/MLSService/stores/pendingProposalsStore/index.js +36 -0
- package/lib/mls/MLSService/stores/pendingProposalsStore/index.js.map +1 -0
- package/lib/mls/MLSService/stores/pendingProposalsStore/pendingProposalsStore.d.ts +9 -0
- package/lib/mls/MLSService/stores/pendingProposalsStore/pendingProposalsStore.js +51 -0
- package/lib/mls/MLSService/stores/pendingProposalsStore/pendingProposalsStore.js.map +1 -0
- package/lib/mls/MLSService/stores/stores.mock.d.ts +8 -0
- package/lib/mls/MLSService/stores/stores.mock.js +44 -0
- package/lib/mls/MLSService/stores/stores.mock.js.map +1 -0
- package/lib/mls/types.d.ts +0 -4
- package/lib/notification/NotificationDatabaseRepository.d.ts +0 -22
- package/lib/notification/NotificationDatabaseRepository.js +0 -29
- package/lib/notification/NotificationDatabaseRepository.js.map +1 -1
- package/lib/notification/NotificationService.d.ts +0 -34
- package/lib/notification/NotificationService.js +3 -133
- package/lib/notification/NotificationService.js.map +1 -1
- package/package.json +2 -2
- package/lib/mls/MLSService/keyMaterialUpdatesStore/index.js.map +0 -1
- package/lib/mls/MLSService/keyMaterialUpdatesStore/keyMaterialUpdatesStore.js.map +0 -1
|
@@ -3,8 +3,9 @@ import { PostMlsMessageResponse } from '@wireapp/api-client/lib/conversation';
|
|
|
3
3
|
import { AddProposalArgs, ConversationConfiguration, ConversationId, CoreCrypto, DecryptedMessage, ExternalProposalArgs, ExternalProposalType, ExternalRemoveProposalArgs, Invitee, ProposalArgs, ProposalType, RemoveProposalArgs } from '@wireapp/core-crypto';
|
|
4
4
|
import logdown from 'logdown';
|
|
5
5
|
import { QualifiedUsers } from '../../conversation';
|
|
6
|
-
import { MLSCallbacks } from '../types';
|
|
7
|
-
import {
|
|
6
|
+
import { CommitPendingProposalsParams, HandlePendingProposalsParams, MLSCallbacks } from '../types';
|
|
7
|
+
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
8
|
+
import { EventHandlerParams, EventHandlerResult } from '../EventHandler';
|
|
8
9
|
export declare const optionalToUint8Array: (array: Uint8Array | []) => Uint8Array;
|
|
9
10
|
interface MLSServiceConfig {
|
|
10
11
|
keyingMaterialUpdateThreshold: number;
|
|
@@ -42,7 +43,7 @@ export declare class MLSService {
|
|
|
42
43
|
updateKeyingMaterial(conversationId: ConversationId): Promise<PostMlsMessageResponse | null>;
|
|
43
44
|
createConversation(conversationId: ConversationId, configuration?: ConversationConfiguration): Promise<any>;
|
|
44
45
|
removeClientsFromConversation(conversationId: ConversationId, clientIds: Uint8Array[]): Promise<PostMlsMessageResponse | null>;
|
|
45
|
-
|
|
46
|
+
private commitProposals;
|
|
46
47
|
conversationExists(conversationId: ConversationId): Promise<boolean>;
|
|
47
48
|
clientValidKeypackagesCount(): Promise<number>;
|
|
48
49
|
clientKeypackages(amountRequested: number): Promise<Uint8Array[]>;
|
|
@@ -83,6 +84,35 @@ export declare class MLSService {
|
|
|
83
84
|
uploadMLSPublicKeys(publicKey: Uint8Array, clientId: string): Promise<void>;
|
|
84
85
|
uploadMLSKeyPackages(keypackages: Uint8Array[], clientId: string): Promise<void>;
|
|
85
86
|
wipeConversation(conversationId: ConversationId): Promise<void>;
|
|
86
|
-
handleMLSEvent(
|
|
87
|
+
handleMLSEvent(params: Omit<EventHandlerParams, 'mlsService'>): EventHandlerResult;
|
|
88
|
+
/**
|
|
89
|
+
* If there is a matching conversationId => groupId pair in the database,
|
|
90
|
+
* we can find the groupId and return it as a string
|
|
91
|
+
*
|
|
92
|
+
* @param conversationQualifiedId
|
|
93
|
+
*/
|
|
94
|
+
getGroupIdFromConversationId(conversationQualifiedId: QualifiedId): Promise<string>;
|
|
95
|
+
/**
|
|
96
|
+
* If there are pending proposals, we need to either process them,
|
|
97
|
+
* or save them in the database for later processing
|
|
98
|
+
*
|
|
99
|
+
* @param groupId groupId of the mls conversation
|
|
100
|
+
* @param delayInMs delay in ms before processing proposals
|
|
101
|
+
* @param eventTime time of the event that had the proposals
|
|
102
|
+
*/
|
|
103
|
+
handlePendingProposals({ delayInMs, groupId, eventTime }: HandlePendingProposalsParams): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Commit all pending proposals for a given groupId
|
|
106
|
+
*
|
|
107
|
+
* @param groupId groupId of the conversation
|
|
108
|
+
* @param skipDelete if true, do not delete the pending proposals from the database
|
|
109
|
+
*/
|
|
110
|
+
commitPendingProposals({ groupId, skipDelete }: CommitPendingProposalsParams): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Get all pending proposals from the database and schedule them
|
|
113
|
+
* Function must only be called once, after application start
|
|
114
|
+
*
|
|
115
|
+
*/
|
|
116
|
+
checkExistingPendingProposals(): Promise<void>;
|
|
87
117
|
}
|
|
88
118
|
export {};
|
|
@@ -39,8 +39,10 @@ const messageSender_1 = require("../../conversation/message/messageSender");
|
|
|
39
39
|
const fullyQualifiedClientIdUtils_1 = require("../../util/fullyQualifiedClientIdUtils");
|
|
40
40
|
const commons_1 = require("@wireapp/commons");
|
|
41
41
|
const RecurringTaskScheduler_1 = require("../../util/RecurringTaskScheduler");
|
|
42
|
+
const TaskScheduler_1 = require("../../util/TaskScheduler");
|
|
42
43
|
const EventHandler_1 = require("../EventHandler");
|
|
43
|
-
const keyMaterialUpdatesStore_1 = require("./keyMaterialUpdatesStore");
|
|
44
|
+
const keyMaterialUpdatesStore_1 = require("./stores/keyMaterialUpdatesStore");
|
|
45
|
+
const pendingProposalsStore_1 = require("./stores/pendingProposalsStore");
|
|
44
46
|
//@todo: this function is temporary, we wait for the update from core-crypto side
|
|
45
47
|
//they are returning regular array instead of Uint8Array for commit and welcome messages
|
|
46
48
|
const optionalToUint8Array = (array) => {
|
|
@@ -160,7 +162,7 @@ class MLSService {
|
|
|
160
162
|
*/
|
|
161
163
|
async processCommitAction(groupId, generateCommit) {
|
|
162
164
|
return (0, messageSender_1.sendMessage)(async () => {
|
|
163
|
-
await this.
|
|
165
|
+
await this.commitProposals(groupId);
|
|
164
166
|
const commitBundle = await generateCommit();
|
|
165
167
|
return this.uploadCommitBundle(groupId, commitBundle);
|
|
166
168
|
});
|
|
@@ -174,7 +176,7 @@ class MLSService {
|
|
|
174
176
|
removeClientsFromConversation(conversationId, clientIds) {
|
|
175
177
|
return this.processCommitAction(conversationId, () => this.coreCryptoClient.removeClientsFromConversation(conversationId, clientIds));
|
|
176
178
|
}
|
|
177
|
-
async
|
|
179
|
+
async commitProposals(groupId) {
|
|
178
180
|
const commitBundle = await this.coreCryptoClient.commitPendingProposals(groupId);
|
|
179
181
|
return commitBundle ? void (await this.uploadCommitBundle(groupId, commitBundle)) : undefined;
|
|
180
182
|
}
|
|
@@ -284,8 +286,87 @@ class MLSService {
|
|
|
284
286
|
async wipeConversation(conversationId) {
|
|
285
287
|
return this.coreCryptoClient.wipeConversation(conversationId);
|
|
286
288
|
}
|
|
287
|
-
async handleMLSEvent(
|
|
288
|
-
return (0, EventHandler_1.handleBackendEvent)({
|
|
289
|
+
async handleMLSEvent(params) {
|
|
290
|
+
return (0, EventHandler_1.handleBackendEvent)(Object.assign(Object.assign({}, params), { mlsService: this }));
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* If there is a matching conversationId => groupId pair in the database,
|
|
294
|
+
* we can find the groupId and return it as a string
|
|
295
|
+
*
|
|
296
|
+
* @param conversationQualifiedId
|
|
297
|
+
*/
|
|
298
|
+
async getGroupIdFromConversationId(conversationQualifiedId) {
|
|
299
|
+
var _a;
|
|
300
|
+
const { id: conversationId, domain: conversationDomain } = conversationQualifiedId;
|
|
301
|
+
const groupId = await ((_a = this.groupIdFromConversationId) === null || _a === void 0 ? void 0 : _a.call(this, conversationQualifiedId));
|
|
302
|
+
if (!groupId) {
|
|
303
|
+
throw new Error(`Could not find a group_id for conversation ${conversationId}@${conversationDomain}`);
|
|
304
|
+
}
|
|
305
|
+
return groupId;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* If there are pending proposals, we need to either process them,
|
|
309
|
+
* or save them in the database for later processing
|
|
310
|
+
*
|
|
311
|
+
* @param groupId groupId of the mls conversation
|
|
312
|
+
* @param delayInMs delay in ms before processing proposals
|
|
313
|
+
* @param eventTime time of the event that had the proposals
|
|
314
|
+
*/
|
|
315
|
+
async handlePendingProposals({ delayInMs, groupId, eventTime }) {
|
|
316
|
+
if (delayInMs > 0) {
|
|
317
|
+
const eventDate = new Date(eventTime);
|
|
318
|
+
const firingDate = eventDate.setTime(eventDate.getTime() + delayInMs);
|
|
319
|
+
pendingProposalsStore_1.pendingProposalsStore.storeItem({
|
|
320
|
+
groupId,
|
|
321
|
+
firingDate,
|
|
322
|
+
});
|
|
323
|
+
TaskScheduler_1.TaskScheduler.addTask({
|
|
324
|
+
task: () => this.commitPendingProposals({ groupId }),
|
|
325
|
+
firingDate,
|
|
326
|
+
key: groupId,
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
await this.commitPendingProposals({ groupId, skipDelete: true });
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Commit all pending proposals for a given groupId
|
|
335
|
+
*
|
|
336
|
+
* @param groupId groupId of the conversation
|
|
337
|
+
* @param skipDelete if true, do not delete the pending proposals from the database
|
|
338
|
+
*/
|
|
339
|
+
async commitPendingProposals({ groupId, skipDelete = false }) {
|
|
340
|
+
try {
|
|
341
|
+
await this.commitProposals(bazinga64_1.Decoder.fromBase64(groupId).asBytes);
|
|
342
|
+
if (!skipDelete) {
|
|
343
|
+
TaskScheduler_1.TaskScheduler.cancelTask(groupId);
|
|
344
|
+
pendingProposalsStore_1.pendingProposalsStore.deleteItem({ groupId });
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
catch (error) {
|
|
348
|
+
this.logger.error(`Error while committing pending proposals for groupId ${groupId}`, error);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Get all pending proposals from the database and schedule them
|
|
353
|
+
* Function must only be called once, after application start
|
|
354
|
+
*
|
|
355
|
+
*/
|
|
356
|
+
async checkExistingPendingProposals() {
|
|
357
|
+
try {
|
|
358
|
+
const pendingProposals = pendingProposalsStore_1.pendingProposalsStore.getAllItems();
|
|
359
|
+
if (pendingProposals.length > 0) {
|
|
360
|
+
pendingProposals.forEach(({ groupId, firingDate }) => TaskScheduler_1.TaskScheduler.addTask({
|
|
361
|
+
task: () => this.commitPendingProposals({ groupId }),
|
|
362
|
+
firingDate,
|
|
363
|
+
key: groupId,
|
|
364
|
+
}));
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
this.logger.error('Could not get pending proposals', error);
|
|
369
|
+
}
|
|
289
370
|
}
|
|
290
371
|
}
|
|
291
372
|
exports.MLSService = MLSService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MLSService.js","sourceRoot":"","sources":["../../../src/mls/MLSService/MLSService.ts"],"names":[],"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,KAAK,CAAC,CAAC;SAC7F;IACH,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,6BAA6B;QACxC,IAAI;YACF,MAAM,gBAAgB,GAAG,6CAAqB,CAAC,WAAW,EAAE,CAAC;YAC7D,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC/B,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CACjD,6BAAa,CAAC,OAAO,CAAC;oBACpB,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAAC,OAAO,EAAC,CAAC;oBAClD,UAAU;oBACV,GAAG,EAAE,OAAO;iBACb,CAAC,CACH,CAAC;aACH;SACF;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;SAC7D;IACH,CAAC;CACF;AA7XD,gCA6XC"}
|
package/lib/mls/MLSService/{keyMaterialUpdatesStore → stores/keyMaterialUpdatesStore}/index.d.ts
RENAMED
|
File without changes
|
package/lib/mls/MLSService/{keyMaterialUpdatesStore → stores/keyMaterialUpdatesStore}/index.js
RENAMED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/mls/MLSService/stores/keyMaterialUpdatesStore/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;AAEH,4DAA0C"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CommonMLS
|
|
1
|
+
import { CommonMLS } from '../../../types';
|
|
2
|
+
export declare type LastKeyMaterialUpdateParams = CommonMLS;
|
|
2
3
|
export interface KeyMaterialUpdatesStore {
|
|
3
4
|
[groupId: string]: LastKeyMaterialUpdateParams;
|
|
4
5
|
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyMaterialUpdatesStore.js","sourceRoot":"","sources":["../../../../../src/mls/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AASH,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,MAAM,iBAAiB,GAAG,GAA4B,EAAE;IACtD,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,EAAE,CAAC;KACX;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,GAAkC,EAAE;IAC5D,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAC3C,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,8BAA8B,GAAG,CAAC,EAAC,OAAO,EAA8B,EAAE,EAAE;IAChF,MAAM,WAAW,GAAG,iBAAiB,EAAE,CAAC;IACxC,MAAM,cAAc,mCAAO,WAAW,KAAE,CAAC,OAAO,CAAC,EAAE,EAAC,OAAO,EAAC,GAAC,CAAC;IAC9D,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF,MAAM,+BAA+B,GAAG,CAAC,EAAC,OAAO,EAAY,EAAE,EAAE;IAC/D,MAAM,WAAW,GAAG,iBAAiB,EAAE,CAAC;IACxC,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE;QACxB,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;KAC7B;IACD,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AAChE,CAAC,CAAC;AAEW,QAAA,uBAAuB,GAAG;IACrC,iBAAiB;IACjB,8BAA8B;IAC9B,+BAA+B;CAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './pendingProposalsStore';
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(o, k2, desc);
|
|
27
|
+
}) : (function(o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
}));
|
|
31
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
32
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
__exportStar(require("./pendingProposalsStore"), exports);
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/mls/MLSService/stores/pendingProposalsStore/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;AAEH,0DAAwC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CommonMLS } from '../../../types';
|
|
2
|
+
export declare type PendingProposalsParams = {
|
|
3
|
+
firingDate: number;
|
|
4
|
+
} & CommonMLS;
|
|
5
|
+
export declare const pendingProposalsStore: {
|
|
6
|
+
getAllItems: () => PendingProposalsParams[];
|
|
7
|
+
storeItem: ({ groupId, firingDate }: PendingProposalsParams) => void;
|
|
8
|
+
deleteItem: ({ groupId }: CommonMLS) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
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.pendingProposalsStore = void 0;
|
|
22
|
+
const storageKey = 'pendingProposals';
|
|
23
|
+
const getAllItemsMap = () => {
|
|
24
|
+
const storedState = localStorage.getItem(storageKey);
|
|
25
|
+
if (!storedState) {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
return JSON.parse(storedState);
|
|
29
|
+
};
|
|
30
|
+
const getAllItems = () => {
|
|
31
|
+
const storedStateMap = getAllItemsMap();
|
|
32
|
+
return Object.values(storedStateMap);
|
|
33
|
+
};
|
|
34
|
+
const storeItem = ({ groupId, firingDate }) => {
|
|
35
|
+
const storedState = getAllItemsMap();
|
|
36
|
+
const newStoredState = Object.assign(Object.assign({}, storedState), { [groupId]: { groupId, firingDate } });
|
|
37
|
+
localStorage.setItem(storageKey, JSON.stringify(newStoredState));
|
|
38
|
+
};
|
|
39
|
+
const deleteItem = ({ groupId }) => {
|
|
40
|
+
const storedState = getAllItemsMap();
|
|
41
|
+
if (storedState[groupId]) {
|
|
42
|
+
delete storedState[groupId];
|
|
43
|
+
}
|
|
44
|
+
localStorage.setItem(storageKey, JSON.stringify(storedState));
|
|
45
|
+
};
|
|
46
|
+
exports.pendingProposalsStore = {
|
|
47
|
+
getAllItems,
|
|
48
|
+
storeItem,
|
|
49
|
+
deleteItem,
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=pendingProposalsStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pendingProposalsStore.js","sourceRoot":"","sources":["../../../../../src/mls/MLSService/stores/pendingProposalsStore/pendingProposalsStore.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAYH,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAEtC,MAAM,cAAc,GAAG,GAA0B,EAAE;IACjD,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,EAAE,CAAC;KACX;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,GAA6B,EAAE;IACjD,MAAM,cAAc,GAAG,cAAc,EAAE,CAAC;IACxC,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,EAAC,OAAO,EAAE,UAAU,EAAyB,EAAE,EAAE;IAClE,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,cAAc,mCAAO,WAAW,KAAE,CAAC,OAAO,CAAC,EAAE,EAAC,OAAO,EAAE,UAAU,EAAC,GAAC,CAAC;IAC1E,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,EAAC,OAAO,EAAY,EAAE,EAAE;IAC1C,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE;QACxB,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;KAC7B;IACD,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AAChE,CAAC,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACnC,WAAW;IACX,SAAS;IACT,UAAU;CACX,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.storageMock = void 0;
|
|
22
|
+
function storageMock() {
|
|
23
|
+
const storage = {};
|
|
24
|
+
return {
|
|
25
|
+
setItem: function (key, value) {
|
|
26
|
+
storage[key] = value || '';
|
|
27
|
+
},
|
|
28
|
+
getItem: function (key) {
|
|
29
|
+
return key in storage ? storage[key] : null;
|
|
30
|
+
},
|
|
31
|
+
removeItem: function (key) {
|
|
32
|
+
delete storage[key];
|
|
33
|
+
},
|
|
34
|
+
get length() {
|
|
35
|
+
return Object.keys(storage).length;
|
|
36
|
+
},
|
|
37
|
+
key: function (i) {
|
|
38
|
+
const keys = Object.keys(storage);
|
|
39
|
+
return keys[i] || null;
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
exports.storageMock = storageMock;
|
|
44
|
+
//# sourceMappingURL=stores.mock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stores.mock.js","sourceRoot":"","sources":["../../../../src/mls/MLSService/stores/stores.mock.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,SAAS,WAAW;IAClB,MAAM,OAAO,GAAQ,EAAE,CAAC;IAExB,OAAO;QACL,OAAO,EAAE,UAAU,GAAQ,EAAE,KAAU;YACrC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC;QAC7B,CAAC;QACD,OAAO,EAAE,UAAU,GAAQ;YACzB,OAAO,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,CAAC;QACD,UAAU,EAAE,UAAU,GAAQ;YAC5B,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;QACD,IAAI,MAAM;YACR,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;QACrC,CAAC;QACD,GAAG,EAAE,UAAU,CAAM;YACnB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAClC,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC;AAEO,kCAAW"}
|
package/lib/mls/types.d.ts
CHANGED
|
@@ -23,10 +23,6 @@ export declare type HandlePendingProposalsParams = {
|
|
|
23
23
|
export declare type CommitPendingProposalsParams = {
|
|
24
24
|
skipDelete?: boolean;
|
|
25
25
|
} & CommonMLS;
|
|
26
|
-
export declare type StorePendingProposalsParams = {
|
|
27
|
-
firingDate: number;
|
|
28
|
-
} & CommonMLS;
|
|
29
|
-
export declare type LastKeyMaterialUpdateParams = CommonMLS;
|
|
30
26
|
export interface CryptoProtocolConfig<T = any> {
|
|
31
27
|
/**
|
|
32
28
|
* encrypt/decrypt function pair that will be called before storing/fetching secrets in the secrets database.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BackendEvent } from '@wireapp/api-client/lib/event';
|
|
2
2
|
import { Notification } from '@wireapp/api-client/lib/notification/';
|
|
3
3
|
import { CRUDEngine } from '@wireapp/store-engine';
|
|
4
|
-
import { CommonMLS, StorePendingProposalsParams } from '../mls/types';
|
|
5
4
|
export declare enum DatabaseStores {
|
|
6
5
|
EVENTS = "events"
|
|
7
6
|
}
|
|
@@ -18,25 +17,4 @@ export declare class NotificationDatabaseRepository {
|
|
|
18
17
|
createLastEventDate(eventDate: Date): Promise<Date>;
|
|
19
18
|
getLastNotificationId(): Promise<string>;
|
|
20
19
|
updateLastNotificationId(lastNotification: Notification): Promise<string>;
|
|
21
|
-
/**
|
|
22
|
-
* ## MLS only ##
|
|
23
|
-
* Store groupIds with pending proposals and a delay in the DB until the proposals get committed.
|
|
24
|
-
*
|
|
25
|
-
* @param groupId groupId of the mls conversation
|
|
26
|
-
* @param firingDate date when the pending proposals should be committed
|
|
27
|
-
*/
|
|
28
|
-
storePendingProposal(params: StorePendingProposalsParams): Promise<boolean>;
|
|
29
|
-
/**
|
|
30
|
-
* ## MLS only ##
|
|
31
|
-
* Delete stored entries for pending proposals that have been committed.
|
|
32
|
-
*
|
|
33
|
-
* @param groupId groupId of the mls conversation
|
|
34
|
-
*/
|
|
35
|
-
deletePendingProposal({ groupId }: CommonMLS): Promise<boolean>;
|
|
36
|
-
/**
|
|
37
|
-
* ## MLS only ##
|
|
38
|
-
* Get all stored entries for pending proposals.
|
|
39
|
-
*
|
|
40
|
-
*/
|
|
41
|
-
getStoredPendingProposals(): Promise<StorePendingProposalsParams[]>;
|
|
42
20
|
}
|
|
@@ -63,35 +63,6 @@ class NotificationDatabaseRepository {
|
|
|
63
63
|
});
|
|
64
64
|
return lastNotification.id;
|
|
65
65
|
}
|
|
66
|
-
/**
|
|
67
|
-
* ## MLS only ##
|
|
68
|
-
* Store groupIds with pending proposals and a delay in the DB until the proposals get committed.
|
|
69
|
-
*
|
|
70
|
-
* @param groupId groupId of the mls conversation
|
|
71
|
-
* @param firingDate date when the pending proposals should be committed
|
|
72
|
-
*/
|
|
73
|
-
async storePendingProposal(params) {
|
|
74
|
-
await this.storeEngine.updateOrCreate(STORES.PENDING_PROPOSALS, `${params.groupId}`, params);
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* ## MLS only ##
|
|
79
|
-
* Delete stored entries for pending proposals that have been committed.
|
|
80
|
-
*
|
|
81
|
-
* @param groupId groupId of the mls conversation
|
|
82
|
-
*/
|
|
83
|
-
async deletePendingProposal({ groupId }) {
|
|
84
|
-
await this.storeEngine.delete(STORES.PENDING_PROPOSALS, `${groupId}`);
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* ## MLS only ##
|
|
89
|
-
* Get all stored entries for pending proposals.
|
|
90
|
-
*
|
|
91
|
-
*/
|
|
92
|
-
async getStoredPendingProposals() {
|
|
93
|
-
return this.storeEngine.readAll(STORES.PENDING_PROPOSALS);
|
|
94
|
-
}
|
|
95
66
|
}
|
|
96
67
|
exports.NotificationDatabaseRepository = NotificationDatabaseRepository;
|
|
97
68
|
//# sourceMappingURL=NotificationDatabaseRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationDatabaseRepository.js","sourceRoot":"","sources":["../../src/notification/NotificationDatabaseRepository.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAMH,mGAA8F;
|
|
1
|
+
{"version":3,"file":"NotificationDatabaseRepository.js","sourceRoot":"","sources":["../../src/notification/NotificationDatabaseRepository.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAMH,mGAA8F;AAE9F,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,mCAAiB,CAAA;AACnB,CAAC,EAFW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAEzB;AAED,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+EAA+D,CAAA;IAC/D,2FAA2E,CAAA;AAC7E,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AAED,MAAM,MAAM,qBACP,+DAA8B,CAAC,MAAM,CACzC,CAAC;AAEF,MAAa,8BAA8B;IACzC,YAA6B,WAAuB;QAAvB,gBAAW,GAAX,WAAW,CAAY;IAAG,CAAC;IAEjD,wBAAwB;QAC7B,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAe,cAAc,CAAC,MAAM,CAAC,CAAC;IACvE,CAAC;IAEM,KAAK,CAAC,gBAAgB;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Message } from '@wireapp/protocol-messaging';
|
|
11
11
|
import { AbortHandler } from '@wireapp/api-client/lib/tcp';
|
|
12
|
-
import { CommitPendingProposalsParams } from '../mls/types';
|
|
13
12
|
import { MLSService } from '../mls';
|
|
14
13
|
export declare type HandledEventPayload = {
|
|
15
14
|
event: Events.BackendEvent;
|
|
@@ -70,38 +69,5 @@ export declare class NotificationService extends EventEmitter {
|
|
|
70
69
|
* @return the decrypted payload and the raw event. Returns `undefined` when the payload is a coreCrypto-only system message
|
|
71
70
|
*/
|
|
72
71
|
private handleEvent;
|
|
73
|
-
/**
|
|
74
|
-
* ## MLS only ##
|
|
75
|
-
* If there is a matching conversationId => groupId pair in the database,
|
|
76
|
-
* we can find the groupId and return it as a string
|
|
77
|
-
*
|
|
78
|
-
* @param conversationQualifiedId
|
|
79
|
-
*/
|
|
80
|
-
private getGroupIdFromConversationId;
|
|
81
|
-
/**
|
|
82
|
-
* ## MLS only ##
|
|
83
|
-
* If there are pending proposals, we need to either process them,
|
|
84
|
-
* or save them in the database for later processing
|
|
85
|
-
*
|
|
86
|
-
* @param groupId groupId of the mls conversation
|
|
87
|
-
* @param delayInMs delay in ms before processing proposals
|
|
88
|
-
* @param eventTime time of the event that had the proposals
|
|
89
|
-
*/
|
|
90
|
-
private handlePendingProposals;
|
|
91
|
-
/**
|
|
92
|
-
* ## MLS only ##
|
|
93
|
-
* Commit all pending proposals for a given groupId
|
|
94
|
-
*
|
|
95
|
-
* @param groupId groupId of the conversation
|
|
96
|
-
* @param skipDelete if true, do not delete the pending proposals from the database
|
|
97
|
-
*/
|
|
98
|
-
commitPendingProposals({ groupId, skipDelete }: CommitPendingProposalsParams): Promise<void>;
|
|
99
|
-
/**
|
|
100
|
-
* ## MLS only ##
|
|
101
|
-
* Get all pending proposals from the database and schedule them
|
|
102
|
-
* Function must only be called once, after application start
|
|
103
|
-
*
|
|
104
|
-
*/
|
|
105
|
-
checkExistingPendingProposals(): Promise<void>;
|
|
106
72
|
}
|
|
107
73
|
export {};
|