@wireapp/core 38.5.2 → 38.5.4
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 +3 -3
- package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.js +8 -8
- package/lib/messagingProtocols/proteus/ProteusService/sessionIdMigrator.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/sessionIdMigrator.js +7 -9
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Conversation, DefaultConversationRoleName, MutedStatus, NewConversation, QualifiedUserClients, UserClients } from '@wireapp/api-client/lib/conversation';
|
|
1
|
+
import { Conversation, DefaultConversationRoleName, MutedStatus, NewConversation, QualifiedUserClients, UserClients, RemoteConversations } from '@wireapp/api-client/lib/conversation';
|
|
2
2
|
import { ConversationMemberLeaveEvent } from '@wireapp/api-client/lib/event';
|
|
3
3
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
4
4
|
import { XOR } from '@wireapp/commons/lib/util/TypeUtil';
|
|
@@ -49,8 +49,8 @@ export declare class ConversationService {
|
|
|
49
49
|
* @returns Resolves when the conversation was created
|
|
50
50
|
*/
|
|
51
51
|
createProteusConversation(conversationData: NewConversation): Promise<Conversation>;
|
|
52
|
-
|
|
53
|
-
getConversations(conversationIds?:
|
|
52
|
+
getConversation(conversationId: QualifiedId): Promise<Conversation>;
|
|
53
|
+
getConversations(conversationIds?: QualifiedId[]): Promise<RemoteConversations>;
|
|
54
54
|
getAsset({ assetId, assetToken, otrKey, sha256 }: RemoteData): Promise<Uint8Array>;
|
|
55
55
|
getUnencryptedAsset(assetId: string, assetToken?: string): Promise<ArrayBuffer>;
|
|
56
56
|
addUsersToProteusConversation(params: AddUsersToProteusConversationParams): Promise<import("@wireapp/api-client/lib/event").ConversationMemberJoinEvent>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAEL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,WAAW,
|
|
1
|
+
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAEL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,WAAW,EAGX,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAC,4BAA4B,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,GAAG,EAAC,MAAM,oCAAoC,CAAC;AAIvD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAI9C,OAAO,EAAC,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAE5G,OAAO,EAAC,YAAY,EAAuB,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEzF,OAAO,EAAC,UAAU,EAAuB,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAkC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AACjG,OAAO,EACL,mCAAmC,EACnC,wBAAwB,EACzB,MAAM,sEAAsE,CAAC;AAG9E,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AAItC,qBAAa,mBAAmB;IAM5B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IAR/B,SAAgB,YAAY,EAAE,YAAY,CAAC;IAC3C,OAAO,CAAC,QAA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|
|
110
110
|
return this.proteusService.createConversation({ conversationData, otherUserIds });
|
|
111
111
|
}
|
|
112
|
+
async getConversation(conversationId) {
|
|
113
|
+
return this.apiClient.api.conversation.getConversation(conversationId);
|
|
114
|
+
}
|
|
112
115
|
async getConversations(conversationIds) {
|
|
113
|
-
if (!conversationIds
|
|
114
|
-
return this.apiClient.api.conversation.
|
|
115
|
-
}
|
|
116
|
-
if (typeof conversationIds === 'string') {
|
|
117
|
-
return this.apiClient.api.conversation.getConversation(conversationIds);
|
|
116
|
+
if (!conversationIds) {
|
|
117
|
+
return this.apiClient.api.conversation.getConversationList();
|
|
118
118
|
}
|
|
119
|
-
return this.apiClient.api.conversation.
|
|
119
|
+
return this.apiClient.api.conversation.getConversationsByQualifiedIds(conversationIds);
|
|
120
120
|
}
|
|
121
121
|
async getAsset({ assetId, assetToken, otrKey, sha256 }) {
|
|
122
122
|
const request = this.apiClient.api.asset.getAssetV3(assetId, assetToken);
|
|
@@ -241,7 +241,7 @@ class ConversationService {
|
|
|
241
241
|
const groupIdBytes = bazinga64_1.Decoder.fromBase64(groupId).asBytes;
|
|
242
242
|
const coreCryptoKeyPackagesPayload = await this.mlsService.getKeyPackagesPayload([...qualifiedUserIds]);
|
|
243
243
|
const response = await this.mlsService.addUsersToExistingConversation(groupIdBytes, coreCryptoKeyPackagesPayload);
|
|
244
|
-
const conversation = await this.
|
|
244
|
+
const conversation = await this.getConversation(conversationId);
|
|
245
245
|
//We store the info when user was added (and key material was created), so we will know when to renew it
|
|
246
246
|
this.mlsService.resetKeyMaterialRenewal(groupId);
|
|
247
247
|
return {
|
|
@@ -256,7 +256,7 @@ class ConversationService {
|
|
|
256
256
|
const messageResponse = await this.mlsService.removeClientsFromConversation(groupIdBytes, fullyQualifiedClientIds);
|
|
257
257
|
//key material gets updated after removing a user from the group, so we can reset last key update time value in the store
|
|
258
258
|
this.mlsService.resetKeyMaterialRenewal(groupId);
|
|
259
|
-
const conversation = await this.
|
|
259
|
+
const conversation = await this.getConversation(conversationId);
|
|
260
260
|
return {
|
|
261
261
|
events: (messageResponse === null || messageResponse === void 0 ? void 0 : messageResponse.events) || [],
|
|
262
262
|
conversation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionIdMigrator.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/sessionIdMigrator.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"sessionIdMigrator.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/sessionIdMigrator.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AASjD;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAAC,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,iBAgBhG"}
|
|
@@ -32,16 +32,14 @@ async function migrateToQualifiedSessionIds(storeEngine, defaultDomain) {
|
|
|
32
32
|
const updatedSessions = (await storeEngine.readAll(sessionTableName))
|
|
33
33
|
.filter(session => !isFullyQualified.test(session.id))
|
|
34
34
|
.reduce((acc, session) => {
|
|
35
|
-
return {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
return acc.concat({
|
|
36
|
+
oldId: session.id,
|
|
37
|
+
newSession: Object.assign(Object.assign({}, session), { id: `${defaultDomain}@${session.id}` }),
|
|
38
|
+
});
|
|
39
|
+
}, []);
|
|
40
|
+
for (const { oldId, newSession } of updatedSessions) {
|
|
41
|
+
// In order to change primaryKeys, we need to first delete all the record and re-add them with the new key
|
|
42
42
|
await storeEngine.delete(sessionTableName, oldId);
|
|
43
|
-
}
|
|
44
|
-
for (const newSession of updatedSessions.newSessions) {
|
|
45
43
|
await storeEngine.create(sessionTableName, newSession.id, newSession);
|
|
46
44
|
}
|
|
47
45
|
}
|
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": "^22.14.
|
|
14
|
+
"@wireapp/api-client": "^22.14.4",
|
|
15
15
|
"@wireapp/commons": "^5.0.4",
|
|
16
16
|
"@wireapp/core-crypto": "0.6.0-rc.3",
|
|
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": "38.5.
|
|
64
|
-
"gitHead": "
|
|
63
|
+
"version": "38.5.4",
|
|
64
|
+
"gitHead": "4ba3881aaaee1d263400e6a41124c2fee41ecc83"
|
|
65
65
|
}
|