@wireapp/core 30.5.1 → 30.5.2
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/CHANGELOG.md +8 -0
- package/package.json +3 -3
- package/src/main/Account.d.ts +0 -204
- package/src/main/Account.js +0 -439
- package/src/main/CoreError.d.ts +0 -9
- package/src/main/CoreError.js +0 -26
- package/src/main/account/AccountService.d.ts +0 -7
- package/src/main/account/AccountService.js +0 -33
- package/src/main/account/AccountService.js.map +0 -1
- package/src/main/account/index.d.ts +0 -1
- package/src/main/account/index.js +0 -32
- package/src/main/account/index.js.map +0 -1
- package/src/main/auth/LoginSanitizer.d.ts +0 -5
- package/src/main/auth/LoginSanitizer.js +0 -41
- package/src/main/auth/index.d.ts +0 -1
- package/src/main/auth/index.js +0 -32
- package/src/main/broadcast/AvailabilityType.d.ts +0 -2
- package/src/main/broadcast/AvailabilityType.js +0 -21
- package/src/main/broadcast/BroadcastService.d.ts +0 -24
- package/src/main/broadcast/BroadcastService.js +0 -74
- package/src/main/broadcast/index.d.ts +0 -2
- package/src/main/broadcast/index.js +0 -33
- package/src/main/client/ClientBackendRepository.d.ts +0 -11
- package/src/main/client/ClientBackendRepository.js +0 -43
- package/src/main/client/ClientDatabaseRepository.d.ts +0 -27
- package/src/main/client/ClientDatabaseRepository.js +0 -85
- package/src/main/client/ClientInfo.d.ts +0 -8
- package/src/main/client/ClientInfo.js +0 -21
- package/src/main/client/ClientService.d.ts +0 -48
- package/src/main/client/ClientService.js +0 -118
- package/src/main/client/index.d.ts +0 -4
- package/src/main/client/index.js +0 -35
- package/src/main/connection/ConnectionService.d.ts +0 -11
- package/src/main/connection/ConnectionService.js +0 -45
- package/src/main/connection/index.d.ts +0 -1
- package/src/main/connection/index.js +0 -32
- package/src/main/conversation/AbortReason.d.ts +0 -2
- package/src/main/conversation/AbortReason.js +0 -21
- package/src/main/conversation/AssetService/AssetService.d.ts +0 -62
- package/src/main/conversation/AssetService/AssetService.js +0 -88
- package/src/main/conversation/AssetService/index.d.ts +0 -1
- package/src/main/conversation/AssetService/index.js +0 -32
- package/src/main/conversation/AssetTransferState.d.ts +0 -4
- package/src/main/conversation/AssetTransferState.js +0 -27
- package/src/main/conversation/ClientActionType.d.ts +0 -1
- package/src/main/conversation/ClientActionType.js +0 -24
- package/src/main/conversation/ConversationMapper/ConversationMapper.d.ts +0 -6
- package/src/main/conversation/ConversationMapper/ConversationMapper.js +0 -57
- package/src/main/conversation/ConversationMapper/index.d.ts +0 -1
- package/src/main/conversation/ConversationMapper/index.js +0 -32
- package/src/main/conversation/ConversationService/ConversationService.d.ts +0 -162
- package/src/main/conversation/ConversationService/ConversationService.js +0 -900
- package/src/main/conversation/ConversationService/ConversationService.types.d.ts +0 -108
- package/src/main/conversation/ConversationService/ConversationService.types.js +0 -28
- package/src/main/conversation/ConversationService/index.d.ts +0 -2
- package/src/main/conversation/ConversationService/index.js +0 -33
- package/src/main/conversation/GenericMessageType.d.ts +0 -25
- package/src/main/conversation/GenericMessageType.js +0 -49
- package/src/main/conversation/MessageTimer/MessageTimer.d.ts +0 -10
- package/src/main/conversation/MessageTimer/MessageTimer.js +0 -54
- package/src/main/conversation/MessageTimer/index.d.ts +0 -1
- package/src/main/conversation/MessageTimer/index.js +0 -32
- package/src/main/conversation/ReactionType.d.ts +0 -4
- package/src/main/conversation/ReactionType.js +0 -27
- package/src/main/conversation/content/AssetContent.d.ts +0 -42
- package/src/main/conversation/content/AssetContent.js +0 -21
- package/src/main/conversation/content/ButtonActionConfirmationContent.d.ts +0 -2
- package/src/main/conversation/content/ButtonActionConfirmationContent.js +0 -21
- package/src/main/conversation/content/ButtonActionContent.d.ts +0 -2
- package/src/main/conversation/content/ButtonActionContent.js +0 -21
- package/src/main/conversation/content/CallingContent.d.ts +0 -1
- package/src/main/conversation/content/CallingContent.js +0 -21
- package/src/main/conversation/content/ClearedContent.d.ts +0 -2
- package/src/main/conversation/content/ClearedContent.js +0 -21
- package/src/main/conversation/content/ClientActionContent.d.ts +0 -2
- package/src/main/conversation/content/ClientActionContent.js +0 -21
- package/src/main/conversation/content/ClientAddContent.d.ts +0 -4
- package/src/main/conversation/content/ClientAddContent.js +0 -21
- package/src/main/conversation/content/ClientRemoveContent.d.ts +0 -6
- package/src/main/conversation/content/ClientRemoveContent.js +0 -21
- package/src/main/conversation/content/CompositeContent.d.ts +0 -2
- package/src/main/conversation/content/CompositeContent.js +0 -21
- package/src/main/conversation/content/ConfirmationContent.d.ts +0 -2
- package/src/main/conversation/content/ConfirmationContent.js +0 -21
- package/src/main/conversation/content/ContentType.d.ts +0 -21
- package/src/main/conversation/content/ContentType.js +0 -94
- package/src/main/conversation/content/ConversationContent.d.ts +0 -3
- package/src/main/conversation/content/ConversationContent.js +0 -21
- package/src/main/conversation/content/DeletedContent.d.ts +0 -2
- package/src/main/conversation/content/DeletedContent.js +0 -21
- package/src/main/conversation/content/EditedTextContent.d.ts +0 -11
- package/src/main/conversation/content/EditedTextContent.js +0 -21
- package/src/main/conversation/content/FileContent.d.ts +0 -13
- package/src/main/conversation/content/FileContent.js +0 -21
- package/src/main/conversation/content/HiddenContent.d.ts +0 -2
- package/src/main/conversation/content/HiddenContent.js +0 -21
- package/src/main/conversation/content/ImageContent.d.ts +0 -7
- package/src/main/conversation/content/ImageContent.js +0 -21
- package/src/main/conversation/content/KnockContent.d.ts +0 -2
- package/src/main/conversation/content/KnockContent.js +0 -21
- package/src/main/conversation/content/LinkPreviewContent.d.ts +0 -10
- package/src/main/conversation/content/LinkPreviewContent.js +0 -21
- package/src/main/conversation/content/LocationContent.d.ts +0 -9
- package/src/main/conversation/content/LocationContent.js +0 -21
- package/src/main/conversation/content/MentionContent.d.ts +0 -2
- package/src/main/conversation/content/MentionContent.js +0 -21
- package/src/main/conversation/content/QuoteContent.d.ts +0 -7
- package/src/main/conversation/content/QuoteContent.js +0 -21
- package/src/main/conversation/content/ReactionContent.d.ts +0 -7
- package/src/main/conversation/content/ReactionContent.js +0 -21
- package/src/main/conversation/content/TextContent.d.ts +0 -9
- package/src/main/conversation/content/TextContent.js +0 -21
- package/src/main/conversation/content/TweetContent.d.ts +0 -2
- package/src/main/conversation/content/TweetContent.js +0 -21
- package/src/main/conversation/content/index.d.ts +0 -28
- package/src/main/conversation/content/index.js +0 -72
- package/src/main/conversation/index.d.ts +0 -9
- package/src/main/conversation/index.js +0 -40
- package/src/main/conversation/message/CompositeContentBuilder.d.ts +0 -14
- package/src/main/conversation/message/CompositeContentBuilder.js +0 -54
- package/src/main/conversation/message/Message.d.ts +0 -4
- package/src/main/conversation/message/Message.js +0 -21
- package/src/main/conversation/message/MessageBuilder.d.ts +0 -87
- package/src/main/conversation/message/MessageBuilder.js +0 -119
- package/src/main/conversation/message/MessageService.d.ts +0 -67
- package/src/main/conversation/message/MessageService.js +0 -293
- package/src/main/conversation/message/MessageToProtoMapper.d.ts +0 -7
- package/src/main/conversation/message/MessageToProtoMapper.js +0 -99
- package/src/main/conversation/message/OtrMessage.d.ts +0 -80
- package/src/main/conversation/message/OtrMessage.js +0 -21
- package/src/main/conversation/message/PayloadBundle.d.ts +0 -76
- package/src/main/conversation/message/PayloadBundle.js +0 -81
- package/src/main/conversation/message/TeamMessage.d.ts +0 -31
- package/src/main/conversation/message/TeamMessage.js +0 -21
- package/src/main/conversation/message/TextContentBuilder.d.ts +0 -13
- package/src/main/conversation/message/TextContentBuilder.js +0 -75
- package/src/main/conversation/message/UserClientsUtil.d.ts +0 -22
- package/src/main/conversation/message/UserClientsUtil.js +0 -38
- package/src/main/conversation/message/UserMessage.d.ts +0 -43
- package/src/main/conversation/message/UserMessage.js +0 -21
- package/src/main/cryptography/AssetCryptography/EncryptedAsset.d.ts +0 -11
- package/src/main/cryptography/AssetCryptography/EncryptedAsset.js +0 -21
- package/src/main/cryptography/AssetCryptography/crypto.browser.d.ts +0 -2
- package/src/main/cryptography/AssetCryptography/crypto.browser.js +0 -46
- package/src/main/cryptography/AssetCryptography/crypto.node.d.ts +0 -2
- package/src/main/cryptography/AssetCryptography/crypto.node.js +0 -68
- package/src/main/cryptography/AssetCryptography/index.d.ts +0 -8
- package/src/main/cryptography/AssetCryptography/index.js +0 -53
- package/src/main/cryptography/AssetCryptography/interfaces.d.ts +0 -9
- package/src/main/cryptography/AssetCryptography/interfaces.js +0 -21
- package/src/main/cryptography/CryptographyDatabaseRepository.d.ts +0 -17
- package/src/main/cryptography/CryptographyDatabaseRepository.js +0 -45
- package/src/main/cryptography/CryptographyService.d.ts +0 -52
- package/src/main/cryptography/CryptographyService.js +0 -205
- package/src/main/cryptography/GenericMessageMapper.d.ts +0 -6
- package/src/main/cryptography/GenericMessageMapper.js +0 -160
- package/src/main/cryptography/MessageHashService.d.ts +0 -16
- package/src/main/cryptography/MessageHashService.js +0 -114
- package/src/main/cryptography/SessionPayloadBundle.d.ts +0 -4
- package/src/main/cryptography/SessionPayloadBundle.js +0 -21
- package/src/main/cryptography/index.d.ts +0 -4
- package/src/main/cryptography/index.js +0 -35
- package/src/main/giphy/GiphyService.d.ts +0 -9
- package/src/main/giphy/GiphyService.js +0 -37
- package/src/main/giphy/index.d.ts +0 -1
- package/src/main/giphy/index.js +0 -32
- package/src/main/index.d.ts +0 -17
- package/src/main/index.js +0 -55
- package/src/main/linkPreview/LinkPreviewService.d.ts +0 -7
- package/src/main/linkPreview/LinkPreviewService.js +0 -52
- package/src/main/linkPreview/index.d.ts +0 -1
- package/src/main/linkPreview/index.js +0 -32
- package/src/main/mls/MLSService/MLSService.d.ts +0 -26
- package/src/main/mls/MLSService/MLSService.js +0 -131
- package/src/main/mls/index.d.ts +0 -1
- package/src/main/mls/index.js +0 -32
- package/src/main/mls/types.d.ts +0 -22
- package/src/main/mls/types.js +0 -21
- package/src/main/notification/NotificationBackendRepository.d.ts +0 -11
- package/src/main/notification/NotificationBackendRepository.js +0 -34
- package/src/main/notification/NotificationDatabaseRepository.d.ts +0 -66
- package/src/main/notification/NotificationDatabaseRepository.js +0 -136
- package/src/main/notification/NotificationService.d.ts +0 -131
- package/src/main/notification/NotificationService.js +0 -468
- package/src/main/notification/index.d.ts +0 -1
- package/src/main/notification/index.js +0 -32
- package/src/main/notification/types.d.ts +0 -20
- package/src/main/notification/types.js +0 -21
- package/src/main/self/SelfService.d.ts +0 -13
- package/src/main/self/SelfService.js +0 -55
- package/src/main/self/index.d.ts +0 -1
- package/src/main/self/index.js +0 -32
- package/src/main/team/TeamService.d.ts +0 -15
- package/src/main/team/TeamService.js +0 -55
- package/src/main/team/index.d.ts +0 -1
- package/src/main/team/index.js +0 -32
- package/src/main/test/CryptographyHelper.d.ts +0 -4
- package/src/main/test/CryptographyHelper.js +0 -65
- package/src/main/test/PayloadHelper.d.ts +0 -3
- package/src/main/test/PayloadHelper.js +0 -66
- package/src/main/user/UserMapper.d.ts +0 -5
- package/src/main/user/UserMapper.js +0 -88
- package/src/main/user/UserService.d.ts +0 -25
- package/src/main/user/UserService.js +0 -81
- package/src/main/user/index.d.ts +0 -1
- package/src/main/user/index.js +0 -32
- package/src/main/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.d.ts +0 -21
- package/src/main/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.js +0 -62
- package/src/main/util/TaskScheduler/TaskScheduler.d.ts +0 -10
- package/src/main/util/TaskScheduler/TaskScheduler.js +0 -70
- package/src/main/util/TypePredicateUtil.d.ts +0 -7
- package/src/main/util/TypePredicateUtil.js +0 -55
- package/src/main/util/encryptedStore.d.ts +0 -45
- package/src/main/util/encryptedStore.js +0 -116
- package/src/main/util/index.d.ts +0 -1
- package/src/main/util/index.js +0 -32
- package/src/main/util/mapQualifiedUserClientIdsToFullyQualifiedClientIds.d.ts +0 -8
- package/src/main/util/mapQualifiedUserClientIdsToFullyQualifiedClientIds.js +0 -32
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { TeamConversationCreateData, TeamConversationDeleteData, TeamMemberJoinData, TeamMemberLeaveData, TeamUpdateData } from '@wireapp/api-client/src/team/data';
|
|
2
|
-
import type { BasePayloadBundle, PayloadBundleType } from './PayloadBundle';
|
|
3
|
-
export interface TeamConversationCreateMessage extends BasePayloadBundle {
|
|
4
|
-
content: TeamConversationCreateData;
|
|
5
|
-
type: PayloadBundleType.TEAM_CONVERSATION_CREATE;
|
|
6
|
-
}
|
|
7
|
-
export interface TeamMemberLeaveMessage extends BasePayloadBundle {
|
|
8
|
-
content: TeamMemberLeaveData;
|
|
9
|
-
type: PayloadBundleType.TEAM_MEMBER_LEAVE;
|
|
10
|
-
}
|
|
11
|
-
export interface TeamConversationDeleteMessage extends BasePayloadBundle {
|
|
12
|
-
content: TeamConversationDeleteData;
|
|
13
|
-
type: PayloadBundleType.TEAM_CONVERSATION_DELETE;
|
|
14
|
-
}
|
|
15
|
-
export interface TeamDeleteMessage extends BasePayloadBundle {
|
|
16
|
-
content: null;
|
|
17
|
-
type: PayloadBundleType.TEAM_DELETE;
|
|
18
|
-
}
|
|
19
|
-
export interface TeamMemberJoinMessage extends BasePayloadBundle {
|
|
20
|
-
content: TeamMemberJoinData;
|
|
21
|
-
type: PayloadBundleType.TEAM_MEMBER_JOIN;
|
|
22
|
-
}
|
|
23
|
-
export interface TeamMemberLeaveMesssage extends BasePayloadBundle {
|
|
24
|
-
content: TeamMemberLeaveData;
|
|
25
|
-
type: PayloadBundleType.TEAM_MEMBER_LEAVE;
|
|
26
|
-
}
|
|
27
|
-
export interface TeamUpdateMessage extends BasePayloadBundle {
|
|
28
|
-
content: TeamUpdateData;
|
|
29
|
-
type: PayloadBundleType.TEAM_UPDATE;
|
|
30
|
-
}
|
|
31
|
-
export declare type TeamMessage = TeamConversationCreateMessage | TeamMemberLeaveMessage | TeamConversationDeleteMessage | TeamDeleteMessage | TeamMemberJoinMessage | TeamMemberLeaveMesssage | TeamUpdateMessage;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2019 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
|
-
//# sourceMappingURL=TeamMessage.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LegalHoldStatus, LinkPreviewUploadedContent, MentionContent, QuoteContent } from '../content';
|
|
2
|
-
import type { EditedTextMessage, TextMessage, QuotableMessage } from './OtrMessage';
|
|
3
|
-
export declare class TextContentBuilder {
|
|
4
|
-
private readonly content;
|
|
5
|
-
private readonly payloadBundle;
|
|
6
|
-
constructor(payloadBundle: TextMessage | EditedTextMessage);
|
|
7
|
-
build(): TextMessage | EditedTextMessage;
|
|
8
|
-
withLinkPreviews(linkPreviews?: LinkPreviewUploadedContent[]): TextContentBuilder;
|
|
9
|
-
withMentions(mentions?: MentionContent[]): TextContentBuilder;
|
|
10
|
-
withQuote(quote?: QuotableMessage | QuoteContent): TextContentBuilder;
|
|
11
|
-
withReadConfirmation(expectsReadConfirmation?: boolean): TextContentBuilder;
|
|
12
|
-
withLegalHoldStatus(legalHoldStatus?: LegalHoldStatus): TextContentBuilder;
|
|
13
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2018 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.TextContentBuilder = void 0;
|
|
22
|
-
const cryptography_1 = require("../../cryptography");
|
|
23
|
-
const content_1 = require("../content");
|
|
24
|
-
class TextContentBuilder {
|
|
25
|
-
constructor(payloadBundle) {
|
|
26
|
-
this.payloadBundle = payloadBundle;
|
|
27
|
-
this.content = this.payloadBundle.content;
|
|
28
|
-
}
|
|
29
|
-
build() {
|
|
30
|
-
this.payloadBundle.content = this.content;
|
|
31
|
-
return this.payloadBundle;
|
|
32
|
-
}
|
|
33
|
-
withLinkPreviews(linkPreviews) {
|
|
34
|
-
if (linkPreviews === null || linkPreviews === void 0 ? void 0 : linkPreviews.length) {
|
|
35
|
-
this.content.linkPreviews = linkPreviews;
|
|
36
|
-
}
|
|
37
|
-
return this;
|
|
38
|
-
}
|
|
39
|
-
withMentions(mentions) {
|
|
40
|
-
if (mentions === null || mentions === void 0 ? void 0 : mentions.length) {
|
|
41
|
-
this.content.mentions = mentions;
|
|
42
|
-
}
|
|
43
|
-
return this;
|
|
44
|
-
}
|
|
45
|
-
withQuote(quote) {
|
|
46
|
-
if (quote) {
|
|
47
|
-
if (quote.quotedMessageId) {
|
|
48
|
-
this.content.quote = quote;
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
const messageHashService = new cryptography_1.MessageHashService(quote.content, quote.timestamp);
|
|
52
|
-
const messageHashBuffer = messageHashService.getHash();
|
|
53
|
-
this.content.quote = {
|
|
54
|
-
quotedMessageId: quote.id,
|
|
55
|
-
quotedMessageSha256: new Uint8Array(messageHashBuffer),
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return this;
|
|
60
|
-
}
|
|
61
|
-
withReadConfirmation(expectsReadConfirmation = false) {
|
|
62
|
-
if (typeof expectsReadConfirmation !== 'undefined') {
|
|
63
|
-
this.content.expectsReadConfirmation = expectsReadConfirmation;
|
|
64
|
-
}
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
withLegalHoldStatus(legalHoldStatus = content_1.LegalHoldStatus.UNKNOWN) {
|
|
68
|
-
if (typeof legalHoldStatus !== 'undefined') {
|
|
69
|
-
this.content.legalHoldStatus = legalHoldStatus;
|
|
70
|
-
}
|
|
71
|
-
return this;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.TextContentBuilder = TextContentBuilder;
|
|
75
|
-
//# sourceMappingURL=TextContentBuilder.js.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { QualifiedId } from '@wireapp/api-client/src/user';
|
|
2
|
-
declare type UserClientsContainer<T> = {
|
|
3
|
-
[userId: string]: T;
|
|
4
|
-
};
|
|
5
|
-
declare type QualifiedUserClientsContainer<T> = {
|
|
6
|
-
[domain: string]: UserClientsContainer<T>;
|
|
7
|
-
};
|
|
8
|
-
export declare function flattenUserClients<T>(userClients: UserClientsContainer<T>, domain?: string): {
|
|
9
|
-
data: T;
|
|
10
|
-
userId: QualifiedId;
|
|
11
|
-
}[];
|
|
12
|
-
/**
|
|
13
|
-
* Will flatten a container of users=>clients infos to an array
|
|
14
|
-
*
|
|
15
|
-
* @param userClients The UserClients (qualified or not) to flatten
|
|
16
|
-
* @return An array containing the qualified user Ids and the clients info
|
|
17
|
-
*/
|
|
18
|
-
export declare function flattenQualifiedUserClients<T = unknown>(userClients: QualifiedUserClientsContainer<T>): {
|
|
19
|
-
data: T;
|
|
20
|
-
userId: QualifiedId;
|
|
21
|
-
}[];
|
|
22
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2021 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.flattenQualifiedUserClients = exports.flattenUserClients = void 0;
|
|
22
|
-
function flattenUserClients(userClients, domain = '') {
|
|
23
|
-
return Object.entries(userClients).map(([id, data]) => ({ data, userId: { domain, id } }));
|
|
24
|
-
}
|
|
25
|
-
exports.flattenUserClients = flattenUserClients;
|
|
26
|
-
/**
|
|
27
|
-
* Will flatten a container of users=>clients infos to an array
|
|
28
|
-
*
|
|
29
|
-
* @param userClients The UserClients (qualified or not) to flatten
|
|
30
|
-
* @return An array containing the qualified user Ids and the clients info
|
|
31
|
-
*/
|
|
32
|
-
function flattenQualifiedUserClients(userClients) {
|
|
33
|
-
return Object.entries(userClients).reduce((ids, [domain, userClients]) => {
|
|
34
|
-
return [...ids, ...flattenUserClients(userClients, domain)];
|
|
35
|
-
}, []);
|
|
36
|
-
}
|
|
37
|
-
exports.flattenQualifiedUserClients = flattenQualifiedUserClients;
|
|
38
|
-
//# sourceMappingURL=UserClientsUtil.js.map
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { UserActivateData, UserClientAddData, UserClientRemoveData, UserConnectionData, UserDeleteData, UserLegalHoldDisableData, UserLegalHoldEnableData, UserLegalHoldRequestData, UserPropertiesSetData, UserUpdateData } from '@wireapp/api-client/src/user/data';
|
|
2
|
-
import type { BasePayloadBundle, PayloadBundleType } from './PayloadBundle';
|
|
3
|
-
export interface UserActivateMessage extends BasePayloadBundle {
|
|
4
|
-
content: UserActivateData;
|
|
5
|
-
type: PayloadBundleType.USER_ACTIVATE;
|
|
6
|
-
}
|
|
7
|
-
export interface UserClientAddMessage extends BasePayloadBundle {
|
|
8
|
-
content: UserClientAddData;
|
|
9
|
-
type: PayloadBundleType.USER_CLIENT_ADD;
|
|
10
|
-
}
|
|
11
|
-
export interface UserLegalHoldRequestMessage extends BasePayloadBundle {
|
|
12
|
-
content: UserLegalHoldRequestData;
|
|
13
|
-
type: PayloadBundleType.USER_LEGAL_HOLD_REQUEST;
|
|
14
|
-
}
|
|
15
|
-
export interface UserLegalHoldEnableMessage extends BasePayloadBundle {
|
|
16
|
-
content: UserLegalHoldEnableData;
|
|
17
|
-
type: PayloadBundleType.USER_LEGAL_HOLD_ENABLE;
|
|
18
|
-
}
|
|
19
|
-
export interface UserLegalHoldDisableMessage extends BasePayloadBundle {
|
|
20
|
-
content: UserLegalHoldDisableData;
|
|
21
|
-
type: PayloadBundleType.USER_LEGAL_HOLD_DISABLE;
|
|
22
|
-
}
|
|
23
|
-
export interface UserClientRemoveMessage extends BasePayloadBundle {
|
|
24
|
-
content: UserClientRemoveData;
|
|
25
|
-
type: PayloadBundleType.USER_CLIENT_REMOVE;
|
|
26
|
-
}
|
|
27
|
-
export interface UserConnectionMessage extends BasePayloadBundle {
|
|
28
|
-
content: UserConnectionData;
|
|
29
|
-
type: PayloadBundleType.USER_CONNECTION;
|
|
30
|
-
}
|
|
31
|
-
export interface UserDeleteMessage extends BasePayloadBundle {
|
|
32
|
-
content: UserDeleteData;
|
|
33
|
-
type: PayloadBundleType.USER_DELETE;
|
|
34
|
-
}
|
|
35
|
-
export interface UserPropertiesSetEvent extends BasePayloadBundle {
|
|
36
|
-
content: UserPropertiesSetData;
|
|
37
|
-
type: PayloadBundleType.USER_PROPERTIES_SET;
|
|
38
|
-
}
|
|
39
|
-
export interface UserUpdateMessage extends BasePayloadBundle {
|
|
40
|
-
content: UserUpdateData;
|
|
41
|
-
type: PayloadBundleType.USER_UPDATE;
|
|
42
|
-
}
|
|
43
|
-
export declare type UserMessage = UserActivateMessage | UserClientAddMessage | UserLegalHoldRequestMessage | UserLegalHoldEnableMessage | UserLegalHoldDisableMessage | UserClientRemoveMessage | UserConnectionMessage | UserDeleteMessage | UserPropertiesSetEvent | UserUpdateMessage;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2019 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
|
-
//# sourceMappingURL=UserMessage.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface EncryptedAsset {
|
|
2
|
-
cipherText: Uint8Array;
|
|
3
|
-
keyBytes: Uint8Array;
|
|
4
|
-
/** The SHA-256 sum of `cipherText` */
|
|
5
|
-
sha256: Uint8Array;
|
|
6
|
-
}
|
|
7
|
-
export interface EncryptedAssetUploaded extends EncryptedAsset {
|
|
8
|
-
key: string;
|
|
9
|
-
domain?: string;
|
|
10
|
-
token: string;
|
|
11
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2018 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
|
-
//# sourceMappingURL=EncryptedAsset.js.map
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2021 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.crypto = void 0;
|
|
22
|
-
const cryptoLib = window.crypto;
|
|
23
|
-
exports.crypto = {
|
|
24
|
-
async digest(cipherText) {
|
|
25
|
-
const checksum = await cryptoLib.subtle.digest('SHA-256', cipherText);
|
|
26
|
-
return new Uint8Array(checksum);
|
|
27
|
-
},
|
|
28
|
-
async decrypt(cipherText, keyBytes) {
|
|
29
|
-
const key = await cryptoLib.subtle.importKey('raw', keyBytes, 'AES-CBC', false, ['decrypt']);
|
|
30
|
-
const initializationVector = cipherText.slice(0, 16);
|
|
31
|
-
const assetCipherText = cipherText.slice(16);
|
|
32
|
-
const decipher = await cryptoLib.subtle.decrypt({ iv: initializationVector, name: 'AES-CBC' }, key, assetCipherText);
|
|
33
|
-
return new Uint8Array(decipher);
|
|
34
|
-
},
|
|
35
|
-
getRandomValues(size) {
|
|
36
|
-
return cryptoLib.getRandomValues(new Uint8Array(size));
|
|
37
|
-
},
|
|
38
|
-
async encrypt(plainText, keyBytes, initializationVector) {
|
|
39
|
-
const key = await cryptoLib.subtle.importKey('raw', keyBytes, 'AES-CBC', true, ['encrypt']);
|
|
40
|
-
return {
|
|
41
|
-
key: new Uint8Array(await cryptoLib.subtle.exportKey('raw', key)),
|
|
42
|
-
cipher: await cryptoLib.subtle.encrypt({ iv: initializationVector, name: 'AES-CBC' }, key, plainText),
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=crypto.browser.js.map
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2021 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
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
28
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
29
|
-
}) : function(o, v) {
|
|
30
|
-
o["default"] = v;
|
|
31
|
-
});
|
|
32
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
|
-
if (mod && mod.__esModule) return mod;
|
|
34
|
-
var result = {};
|
|
35
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
36
|
-
__setModuleDefault(result, mod);
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.crypto = void 0;
|
|
41
|
-
const cryptoLib = __importStar(require("crypto"));
|
|
42
|
-
exports.crypto = {
|
|
43
|
-
async digest(cipherText) {
|
|
44
|
-
return cryptoLib.createHash('SHA256').update(cipherText).digest();
|
|
45
|
-
},
|
|
46
|
-
async decrypt(cipherText, keyBytes) {
|
|
47
|
-
const initializationVector = cipherText.slice(0, 16);
|
|
48
|
-
const assetCipherText = cipherText.slice(16);
|
|
49
|
-
const decipher = cryptoLib.createDecipheriv('AES-256-CBC', keyBytes, initializationVector);
|
|
50
|
-
const decipherUpdated = decipher.update(assetCipherText);
|
|
51
|
-
const decipherFinal = decipher.final();
|
|
52
|
-
return Buffer.concat([decipherUpdated, decipherFinal]);
|
|
53
|
-
},
|
|
54
|
-
getRandomValues(size) {
|
|
55
|
-
return cryptoLib.randomBytes(size);
|
|
56
|
-
},
|
|
57
|
-
async encrypt(plainText, keyBytes, initializationVector, algorithm) {
|
|
58
|
-
const cipher = cryptoLib.createCipheriv(algorithm, keyBytes, initializationVector);
|
|
59
|
-
const cipherUpdated = cipher.update(plainText);
|
|
60
|
-
const cipherFinal = cipher.final();
|
|
61
|
-
const cipherText = Buffer.concat([cipherUpdated, cipherFinal]);
|
|
62
|
-
return {
|
|
63
|
-
key: keyBytes,
|
|
64
|
-
cipher: cipherText,
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=crypto.node.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CipherOptions } from '@wireapp/api-client/src/asset';
|
|
2
|
-
import type { EncryptedAsset } from './EncryptedAsset';
|
|
3
|
-
interface EncryptOptions extends CipherOptions {
|
|
4
|
-
plainText: Uint8Array;
|
|
5
|
-
}
|
|
6
|
-
export declare const decryptAsset: ({ cipherText, keyBytes, sha256: referenceSha256, }: EncryptedAsset) => Promise<Uint8Array>;
|
|
7
|
-
export declare const encryptAsset: ({ plainText, algorithm }: EncryptOptions) => Promise<EncryptedAsset>;
|
|
8
|
-
export {};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2021 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.encryptAsset = exports.decryptAsset = void 0;
|
|
22
|
-
const crypto_node_1 = require("./crypto.node");
|
|
23
|
-
const isEqual = (a, b) => {
|
|
24
|
-
const arrayA = new Uint32Array(a);
|
|
25
|
-
const arrayB = new Uint32Array(b);
|
|
26
|
-
const hasSameLength = arrayA.length === arrayB.length;
|
|
27
|
-
const hasSameValues = arrayA.every((value, index) => value === arrayB[index]);
|
|
28
|
-
return hasSameLength && hasSameValues;
|
|
29
|
-
};
|
|
30
|
-
const decryptAsset = async ({ cipherText, keyBytes, sha256: referenceSha256, }) => {
|
|
31
|
-
const computedSha256 = await crypto_node_1.crypto.digest(cipherText);
|
|
32
|
-
if (!isEqual(computedSha256, referenceSha256)) {
|
|
33
|
-
throw new Error('Encrypted asset does not match its SHA-256 hash');
|
|
34
|
-
}
|
|
35
|
-
return crypto_node_1.crypto.decrypt(cipherText, keyBytes);
|
|
36
|
-
};
|
|
37
|
-
exports.decryptAsset = decryptAsset;
|
|
38
|
-
const encryptAsset = async ({ plainText, algorithm = 'AES-256-CBC' }) => {
|
|
39
|
-
const initializationVector = crypto_node_1.crypto.getRandomValues(16);
|
|
40
|
-
const rawKeyBytes = crypto_node_1.crypto.getRandomValues(32);
|
|
41
|
-
const { key, cipher } = await crypto_node_1.crypto.encrypt(plainText, rawKeyBytes, initializationVector, algorithm);
|
|
42
|
-
const ivCipherText = new Uint8Array(cipher.byteLength + initializationVector.byteLength);
|
|
43
|
-
ivCipherText.set(initializationVector, 0);
|
|
44
|
-
ivCipherText.set(new Uint8Array(cipher), initializationVector.byteLength);
|
|
45
|
-
const sha256 = await crypto_node_1.crypto.digest(ivCipherText);
|
|
46
|
-
return {
|
|
47
|
-
cipherText: ivCipherText,
|
|
48
|
-
keyBytes: key,
|
|
49
|
-
sha256,
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
exports.encryptAsset = encryptAsset;
|
|
53
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface Crypto {
|
|
2
|
-
digest(cipherText: Uint8Array): Promise<Uint8Array>;
|
|
3
|
-
decrypt(cipherText: Uint8Array, keyBytes: Uint8Array): Promise<Uint8Array>;
|
|
4
|
-
getRandomValues(size: number): Uint8Array;
|
|
5
|
-
encrypt(plainText: Uint8Array, keyBytes: Uint8Array, initializationVector: Uint8Array, algorithm: string): Promise<{
|
|
6
|
-
key: Uint8Array;
|
|
7
|
-
cipher: Uint8Array;
|
|
8
|
-
}>;
|
|
9
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2021 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
|
-
//# sourceMappingURL=interfaces.js.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CRUDEngine } from '@wireapp/store-engine';
|
|
2
|
-
export declare enum DatabaseStores {
|
|
3
|
-
AMPLIFY = "amplify",
|
|
4
|
-
CLIENTS = "clients",
|
|
5
|
-
KEYS = "keys",
|
|
6
|
-
PRE_KEYS = "prekeys",
|
|
7
|
-
SESSIONS = "sessions",
|
|
8
|
-
GROUP_IDS = "group_ids",
|
|
9
|
-
PENDING_PROPOSALS = "pending_proposals",
|
|
10
|
-
LAST_KEY_MATERIAL_UPDATE_DATES = "last_key_material_update_dates"
|
|
11
|
-
}
|
|
12
|
-
export declare class CryptographyDatabaseRepository {
|
|
13
|
-
private readonly storeEngine;
|
|
14
|
-
static readonly STORES: typeof DatabaseStores;
|
|
15
|
-
constructor(storeEngine: CRUDEngine);
|
|
16
|
-
deleteStores(): Promise<boolean[]>;
|
|
17
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Wire
|
|
4
|
-
* Copyright (C) 2018 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.CryptographyDatabaseRepository = exports.DatabaseStores = void 0;
|
|
22
|
-
var DatabaseStores;
|
|
23
|
-
(function (DatabaseStores) {
|
|
24
|
-
DatabaseStores["AMPLIFY"] = "amplify";
|
|
25
|
-
DatabaseStores["CLIENTS"] = "clients";
|
|
26
|
-
DatabaseStores["KEYS"] = "keys";
|
|
27
|
-
DatabaseStores["PRE_KEYS"] = "prekeys";
|
|
28
|
-
DatabaseStores["SESSIONS"] = "sessions";
|
|
29
|
-
DatabaseStores["GROUP_IDS"] = "group_ids";
|
|
30
|
-
DatabaseStores["PENDING_PROPOSALS"] = "pending_proposals";
|
|
31
|
-
DatabaseStores["LAST_KEY_MATERIAL_UPDATE_DATES"] = "last_key_material_update_dates";
|
|
32
|
-
})(DatabaseStores = exports.DatabaseStores || (exports.DatabaseStores = {}));
|
|
33
|
-
class CryptographyDatabaseRepository {
|
|
34
|
-
constructor(storeEngine) {
|
|
35
|
-
this.storeEngine = storeEngine;
|
|
36
|
-
}
|
|
37
|
-
deleteStores() {
|
|
38
|
-
return Promise.all(
|
|
39
|
-
//make sure we use enum's lowercase values, not uppercase keys
|
|
40
|
-
Object.values(CryptographyDatabaseRepository.STORES).map(store => this.storeEngine.deleteAll(store)));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.CryptographyDatabaseRepository = CryptographyDatabaseRepository;
|
|
44
|
-
CryptographyDatabaseRepository.STORES = DatabaseStores;
|
|
45
|
-
//# sourceMappingURL=CryptographyDatabaseRepository.js.map
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { APIClient } from '@wireapp/api-client';
|
|
2
|
-
import type { PreKey as SerializedPreKey } from '@wireapp/api-client/src/auth/';
|
|
3
|
-
import type { RegisteredClient } from '@wireapp/api-client/src/client/';
|
|
4
|
-
import type { OTRRecipients, QualifiedOTRRecipients, QualifiedUserClients, UserClients } from '@wireapp/api-client/src/conversation/';
|
|
5
|
-
import type { ConversationOtrMessageAddEvent } from '@wireapp/api-client/src/event';
|
|
6
|
-
import type { QualifiedId, QualifiedUserPreKeyBundleMap, UserPreKeyBundleMap } from '@wireapp/api-client/src/user/';
|
|
7
|
-
import { Cryptobox } from '@wireapp/cryptobox';
|
|
8
|
-
import { GenericMessage } from '@wireapp/protocol-messaging';
|
|
9
|
-
import type { CRUDEngine } from '@wireapp/store-engine';
|
|
10
|
-
import { PayloadBundle, PayloadBundleSource } from '../conversation';
|
|
11
|
-
export declare type DecryptionError = {
|
|
12
|
-
code: number;
|
|
13
|
-
message: string;
|
|
14
|
-
};
|
|
15
|
-
export interface MetaClient extends RegisteredClient {
|
|
16
|
-
meta: {
|
|
17
|
-
is_verified?: boolean;
|
|
18
|
-
primary_key: string;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export declare class CryptographyService {
|
|
22
|
-
readonly apiClient: APIClient;
|
|
23
|
-
private readonly storeEngine;
|
|
24
|
-
private readonly config;
|
|
25
|
-
private readonly logger;
|
|
26
|
-
cryptobox: Cryptobox;
|
|
27
|
-
private readonly database;
|
|
28
|
-
constructor(apiClient: APIClient, storeEngine: CRUDEngine, config: {
|
|
29
|
-
useQualifiedIds: boolean;
|
|
30
|
-
nbPrekeys: number;
|
|
31
|
-
});
|
|
32
|
-
constructSessionId(userId: string | QualifiedId, clientId: string, domain?: string): string;
|
|
33
|
-
static convertArrayRecipientsToBase64(recipients: OTRRecipients<Uint8Array>): OTRRecipients<string>;
|
|
34
|
-
static convertBase64RecipientsToArray(recipients: OTRRecipients<string>): OTRRecipients<Uint8Array>;
|
|
35
|
-
createCryptobox(entropyData?: Uint8Array): Promise<SerializedPreKey[]>;
|
|
36
|
-
decrypt(sessionId: string, encodedCiphertext: string): Promise<Uint8Array>;
|
|
37
|
-
encryptQualified(plainText: Uint8Array, preKeyBundles: QualifiedUserPreKeyBundleMap | QualifiedUserClients): Promise<{
|
|
38
|
-
missing: QualifiedUserClients;
|
|
39
|
-
encrypted: QualifiedOTRRecipients;
|
|
40
|
-
}>;
|
|
41
|
-
encrypt(plainText: Uint8Array, users: UserPreKeyBundleMap | UserClients, domain?: string): Promise<{
|
|
42
|
-
missing: UserClients;
|
|
43
|
-
encrypted: OTRRecipients<Uint8Array>;
|
|
44
|
-
}>;
|
|
45
|
-
private encryptPayloadForSession;
|
|
46
|
-
initCryptobox(): Promise<void>;
|
|
47
|
-
deleteCryptographyStores(): Promise<boolean[]>;
|
|
48
|
-
resetSession(sessionId: string): Promise<void>;
|
|
49
|
-
decryptMessage(otrMessage: ConversationOtrMessageAddEvent): Promise<GenericMessage>;
|
|
50
|
-
mapGenericMessage(otrMessage: ConversationOtrMessageAddEvent, genericMessage: GenericMessage, source: PayloadBundleSource): PayloadBundle;
|
|
51
|
-
private generateDecryptionError;
|
|
52
|
-
}
|