@wireapp/core 36.5.0 → 37.0.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/Account.d.ts +2 -2
- package/lib/Account.d.ts.map +1 -1
- package/lib/Account.js +8 -3
- package/lib/conversation/ConversationService/ConversationService.d.ts +9 -49
- package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.js +13 -217
- package/lib/conversation/ConversationService/ConversationService.types.d.ts +9 -13
- package/lib/conversation/ConversationService/ConversationService.types.d.ts.map +1 -1
- package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.d.ts +9 -0
- package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.d.ts.map +1 -0
- package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.js +34 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/ConversationEvent.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/ConversationEvent.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/ConversationEvent.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/messageAdd/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/messageAdd/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/messageAdd/messageAdd.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/messageAdd/messageAdd.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/welcomeMessage/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/welcomeMessage/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/ConversationEvent/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/EventHandler.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/EventHandler.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/EventHandler.types.d.ts +2 -2
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.types.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/EventHandler.types.js +1 -1
- package/lib/{mls → messagingProtocols/mls}/EventHandler/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/EventHandler/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/EventHandler/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/MLSService.d.ts +2 -6
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/MLSService.js +4 -4
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts +16 -0
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts.map +1 -0
- package/lib/{mls/types.js → messagingProtocols/mls/MLSService/MLSService.types.js} +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/commitBundleUtil.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/commitBundleUtil.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/commitBundleUtil.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/keyMaterialUpdatesStore/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/stores/keyMaterialUpdatesStore/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/keyMaterialUpdatesStore/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/pendingProposalsStore/index.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/stores/pendingProposalsStore/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/pendingProposalsStore/index.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/pendingProposalsStore/pendingProposalsStore.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/stores/pendingProposalsStore/pendingProposalsStore.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/pendingProposalsStore/pendingProposalsStore.js +0 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/stores.mock.d.ts +0 -0
- package/lib/messagingProtocols/mls/MLSService/stores/stores.mock.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/MLSService/stores/stores.mock.js +0 -0
- package/lib/messagingProtocols/mls/index.d.ts +2 -0
- package/lib/messagingProtocols/mls/index.d.ts.map +1 -0
- package/lib/{mls → messagingProtocols/mls}/index.js +1 -1
- package/lib/{mls → messagingProtocols/mls}/types.d.ts +0 -0
- package/lib/messagingProtocols/mls/types.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/types.js +20 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts +18 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.js +97 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts +25 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.js +20 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/PreKeyBundle.d.ts +24 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/PreKeyBundle.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/PreKeyBundle.js +86 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/Recipients.d.ts +17 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/Recipients.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/Recipients.js +43 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/UserIds.d.ts +12 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/UserIds.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/UserIds.js +38 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/getGenericMessageParams.d.ts +35 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/getGenericMessageParams.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/getGenericMessageParams.js +87 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/index.d.ts +5 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/index.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/Utility/index.js +38 -0
- package/lib/messagingProtocols/proteus/ProteusService/index.d.ts +4 -0
- package/lib/messagingProtocols/proteus/ProteusService/index.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/ProteusService/index.js +37 -0
- package/lib/messagingProtocols/proteus/index.d.ts +2 -0
- package/lib/messagingProtocols/proteus/index.d.ts.map +1 -0
- package/lib/messagingProtocols/proteus/index.js +35 -0
- package/lib/notification/NotificationService.d.ts +1 -1
- package/lib/notification/NotificationService.d.ts.map +1 -1
- package/lib/user/UserService.d.ts +1 -3
- package/lib/user/UserService.d.ts.map +1 -1
- package/lib/user/UserService.js +7 -5
- package/package.json +2 -2
- package/lib/mls/EventHandler/ConversationEvent/ConversationEvent.d.ts.map +0 -1
- package/lib/mls/EventHandler/ConversationEvent/events/index.d.ts.map +0 -1
- package/lib/mls/EventHandler/ConversationEvent/events/messageAdd/index.d.ts.map +0 -1
- package/lib/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.d.ts.map +0 -1
- package/lib/mls/EventHandler/ConversationEvent/events/welcomeMessage/index.d.ts.map +0 -1
- package/lib/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.d.ts.map +0 -1
- package/lib/mls/EventHandler/ConversationEvent/index.d.ts.map +0 -1
- package/lib/mls/EventHandler/EventHandler.d.ts.map +0 -1
- package/lib/mls/EventHandler/EventHandler.types.d.ts.map +0 -1
- package/lib/mls/EventHandler/index.d.ts.map +0 -1
- package/lib/mls/MLSService/MLSService.d.ts.map +0 -1
- package/lib/mls/MLSService/commitBundleUtil.d.ts.map +0 -1
- package/lib/mls/MLSService/index.d.ts.map +0 -1
- package/lib/mls/MLSService/stores/keyMaterialUpdatesStore/index.d.ts.map +0 -1
- package/lib/mls/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.d.ts.map +0 -1
- package/lib/mls/MLSService/stores/pendingProposalsStore/index.d.ts.map +0 -1
- package/lib/mls/MLSService/stores/pendingProposalsStore/pendingProposalsStore.d.ts.map +0 -1
- package/lib/mls/MLSService/stores/stores.mock.d.ts.map +0 -1
- package/lib/mls/index.d.ts +0 -2
- package/lib/mls/index.d.ts.map +0 -1
- package/lib/mls/types.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/index.ts"],"names":[],"mappings":"AAmBA,cAAc,kBAAkB,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"welcomeMessage.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/events/welcomeMessage/welcomeMessage.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,2BAA2B,EAAqB,MAAM,+BAA+B,CAAC;AAG5G,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAEnF,QAAA,MAAM,qBAAqB,UAAW,YAAY,yCACK,CAAC;AAExD,UAAU,0BAA2B,SAAQ,kBAAkB;IAC7D,KAAK,EAAE,2BAA2B,CAAC;CACpC;AACD,QAAA,MAAM,oBAAoB,0BAA+B,0BAA0B,uBASlF,CAAC;AAEF,OAAO,EAAC,qBAAqB,EAAE,oBAAoB,EAAC,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/index.ts"],"names":[],"mappings":"AAmBA,cAAc,qBAAqB,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventHandler.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/EventHandler/EventHandler.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAE5E,QAAA,MAAM,kBAAkB,WAAkB,kBAAkB,uBAAwD,CAAC;AAErH,OAAO,EAAC,kBAAkB,EAAC,CAAC"}
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BackendEvent } from '@wireapp/api-client/lib/event';
|
|
2
|
-
import { PayloadBundleSource } from '
|
|
3
|
-
import { HandledEventPayload } from '
|
|
2
|
+
import { PayloadBundleSource } from '../../../conversation';
|
|
3
|
+
import { HandledEventPayload } from '../../../notification';
|
|
4
4
|
import { MLSService } from '../MLSService/MLSService';
|
|
5
5
|
export { BackendEvent, PayloadBundleSource };
|
|
6
6
|
export declare type EventHandlerResult = Promise<HandledEventPayload | void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventHandler.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/EventHandler/EventHandler.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAC,CAAC;AAC3C,oBAAY,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;AACrE,oBAAY,kBAAkB,GAAG;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC"}
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.PayloadBundleSource = void 0;
|
|
22
|
-
const conversation_1 = require("
|
|
22
|
+
const conversation_1 = require("../../../conversation");
|
|
23
23
|
Object.defineProperty(exports, "PayloadBundleSource", { enumerable: true, get: function () { return conversation_1.PayloadBundleSource; } });
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/EventHandler/index.ts"],"names":[],"mappings":"AAmBA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
|
|
File without changes
|
|
@@ -3,14 +3,11 @@ import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
|
3
3
|
import logdown from 'logdown';
|
|
4
4
|
import { APIClient } from '@wireapp/api-client';
|
|
5
5
|
import { AddProposalArgs, ConversationConfiguration, ConversationId, CoreCrypto, DecryptedMessage, ExternalProposalArgs, ExternalProposalType, ExternalRemoveProposalArgs, Invitee, ProposalArgs, ProposalType, RemoveProposalArgs } from '@wireapp/core-crypto';
|
|
6
|
-
import {
|
|
6
|
+
import { MLSServiceConfig } from './MLSService.types';
|
|
7
|
+
import { QualifiedUsers } from '../../../conversation';
|
|
7
8
|
import { EventHandlerParams, EventHandlerResult } from '../EventHandler';
|
|
8
9
|
import { CommitPendingProposalsParams, HandlePendingProposalsParams, MLSCallbacks } from '../types';
|
|
9
10
|
export declare const optionalToUint8Array: (array: Uint8Array | []) => Uint8Array;
|
|
10
|
-
interface MLSServiceConfig {
|
|
11
|
-
keyingMaterialUpdateThreshold: number;
|
|
12
|
-
nbKeyPackages: number;
|
|
13
|
-
}
|
|
14
11
|
export declare class MLSService {
|
|
15
12
|
private readonly apiClient;
|
|
16
13
|
private readonly coreCryptoClientProvider;
|
|
@@ -116,5 +113,4 @@ export declare class MLSService {
|
|
|
116
113
|
*/
|
|
117
114
|
checkExistingPendingProposals(): Promise<void>;
|
|
118
115
|
}
|
|
119
|
-
export {};
|
|
120
116
|
//# sourceMappingURL=MLSService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.ts"],"names":[],"mappings":"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"}
|
|
@@ -40,10 +40,10 @@ const commons_1 = require("@wireapp/commons");
|
|
|
40
40
|
const commitBundleUtil_1 = require("./commitBundleUtil");
|
|
41
41
|
const keyMaterialUpdatesStore_1 = require("./stores/keyMaterialUpdatesStore");
|
|
42
42
|
const pendingProposalsStore_1 = require("./stores/pendingProposalsStore");
|
|
43
|
-
const messageSender_1 = require("
|
|
44
|
-
const fullyQualifiedClientIdUtils_1 = require("
|
|
45
|
-
const RecurringTaskScheduler_1 = require("
|
|
46
|
-
const TaskScheduler_1 = require("
|
|
43
|
+
const messageSender_1 = require("../../../conversation/message/messageSender");
|
|
44
|
+
const fullyQualifiedClientIdUtils_1 = require("../../../util/fullyQualifiedClientIdUtils");
|
|
45
|
+
const RecurringTaskScheduler_1 = require("../../../util/RecurringTaskScheduler");
|
|
46
|
+
const TaskScheduler_1 = require("../../../util/TaskScheduler");
|
|
47
47
|
const EventHandler_1 = require("../EventHandler");
|
|
48
48
|
//@todo: this function is temporary, we wait for the update from core-crypto side
|
|
49
49
|
//they are returning regular array instead of Uint8Array for commit and welcome messages
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CommitBundle } from '@wireapp/core-crypto/platforms/web/corecrypto';
|
|
2
|
+
export interface UploadCommitOptions {
|
|
3
|
+
/**
|
|
4
|
+
* If uploading the commit fails and we endup in a scenario where a retrial is possible, then this callback will be called to re-generate a new commit bundle
|
|
5
|
+
*/
|
|
6
|
+
regenerateCommitBundle?: () => Promise<CommitBundle>;
|
|
7
|
+
/**
|
|
8
|
+
* Is the current commitBundle an external commit.
|
|
9
|
+
*/
|
|
10
|
+
isExternalCommit?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface MLSServiceConfig {
|
|
13
|
+
keyingMaterialUpdateThreshold: number;
|
|
14
|
+
nbKeyPackages: number;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=MLSService.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MLSService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAC,MAAM,+CAA+C,CAAC;AAE3E,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IAErD;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,6BAA6B,EAAE,MAAM,CAAC;IACtC,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commitBundleUtil.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/commitBundleUtil.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,YAAY,EAAkD,MAAM,sBAAsB,CAAC;AAYnG;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAC,EAAE,YAAY,GAAG,UAAU,CAWpG"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/index.ts"],"names":[],"mappings":"AAmBA,cAAc,cAAc,CAAC"}
|
|
File without changes
|
package/lib/{mls → messagingProtocols/mls}/MLSService/stores/keyMaterialUpdatesStore/index.d.ts
RENAMED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/MLSService/stores/keyMaterialUpdatesStore/index.ts"],"names":[],"mappings":"AAmBA,cAAc,2BAA2B,CAAC"}
|
package/lib/{mls → messagingProtocols/mls}/MLSService/stores/keyMaterialUpdatesStore/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyMaterialUpdatesStore.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/MLSService/stores/keyMaterialUpdatesStore/keyMaterialUpdatesStore.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,oBAAY,2BAA2B,GAAG,SAAS,CAAC;AACpD,MAAM,WAAW,uBAAuB;IACtC,CAAC,OAAO,EAAE,MAAM,GAAG,2BAA2B,CAAC;CAChD;AA+BD,eAAO,MAAM,uBAAuB;6BAnBN,2BAA2B,EAAE;kDAKR,2BAA2B;mDAM1B,SAAS;CAY5D,CAAC"}
|
|
File without changes
|
package/lib/{mls → messagingProtocols/mls}/MLSService/stores/pendingProposalsStore/index.d.ts
RENAMED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/MLSService/stores/pendingProposalsStore/index.ts"],"names":[],"mappings":"AAmBA,cAAc,yBAAyB,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pendingProposalsStore.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/MLSService/stores/pendingProposalsStore/pendingProposalsStore.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,oBAAY,sBAAsB,GAAG;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,SAAS,CAAC;AAmCd,eAAO,MAAM,qBAAqB;uBAnBV,sBAAsB,EAAE;yCAKN,sBAAsB;8BAMjC,SAAS;CAYvC,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stores.mock.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/MLSService/stores/stores.mock.ts"],"names":[],"mappings":"AAmBA,iBAAS,WAAW;mBAIQ,GAAG,SAAS,GAAG;mBAGf,GAAG;sBAGA,GAAG;;aAMZ,GAAG;EAKxB;AAED,OAAO,EAAC,WAAW,EAAC,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/messagingProtocols/mls/index.ts"],"names":[],"mappings":"AAmBA,cAAc,eAAe,CAAC"}
|
|
@@ -32,4 +32,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
32
32
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
__exportStar(require("./MLSService"), exports);
|
|
35
|
+
__exportStar(require("./MLSService/"), exports);
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/messagingProtocols/mls/types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEzD,aAAK,YAAY,CAAC,CAAC,IAAI;IACrB,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,mBAAmB,EAAE,WAAW,GAAG,eAAe,CAAC;IAC5F;;;;;OAKG;IACH,yBAAyB,EAAE,CAAC,cAAc,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACzF;AAED,oBAAY,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,4BAA4B,GAAG;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,SAAS,CAAC;AAEd,oBAAY,4BAA4B,GAAG;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,SAAS,CAAC;AAEd,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,GAAG;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAE/B;;;;OAIG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAE9B,uEAAuE;IACvE,GAAG,CAAC,EAAE;QACJ;;WAEG;QACH,6BAA6B,CAAC,EAAE,MAAM,CAAC;KACxC,CAAC;IAEF,oKAAoK;IACpK,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { APIClient } from '@wireapp/api-client/lib/APIClient';
|
|
2
|
+
import { Conversation } from '@wireapp/api-client/lib/conversation';
|
|
3
|
+
import { AddUsersToProteusConversationParams, CreateProteusConversationParams, ProteusServiceConfig, SendProteusMessageParams } from './ProteusService.types';
|
|
4
|
+
import { SendResult } from '../../../conversation';
|
|
5
|
+
import { CryptographyService } from '../../../cryptography';
|
|
6
|
+
export declare class ProteusService {
|
|
7
|
+
private readonly apiClient;
|
|
8
|
+
private readonly cryptographyService;
|
|
9
|
+
private readonly config;
|
|
10
|
+
private readonly messageService;
|
|
11
|
+
private readonly logger;
|
|
12
|
+
constructor(apiClient: APIClient, cryptographyService: CryptographyService, config: ProteusServiceConfig);
|
|
13
|
+
private isClearFromMismatch;
|
|
14
|
+
createConversation({ conversationData, otherUserIds, }: CreateProteusConversationParams): Promise<Conversation>;
|
|
15
|
+
addUsersToConversation({ conversationId, qualifiedUserIds }: AddUsersToProteusConversationParams): Promise<import("@wireapp/api-client/lib/event").ConversationMemberJoinEvent>;
|
|
16
|
+
sendMessage({ userIds, sendAsProtobuf, conversationId, nativePush, targetMode, payload, onClientMismatch, }: SendProteusMessageParams): Promise<SendResult>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ProteusService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProteusService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAEL,YAAY,EAGb,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,mCAAmC,EACnC,+BAA+B,EAC/B,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAqB,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D,qBAAa,cAAc;IAKvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAG/C,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,oBAAoB;IAK/C,OAAO,CAAC,mBAAmB;IAQd,kBAAkB,CAAC,EAC9B,gBAAgB,EAChB,YAAY,GACb,EAAE,+BAA+B,GAAG,OAAO,CAAC,YAAY,CAAC;IAoB7C,sBAAsB,CAAC,EAAC,cAAc,EAAE,gBAAgB,EAAC,EAAE,mCAAmC;IAI9F,WAAW,CAAC,EACvB,OAAO,EACP,cAAc,EACd,cAAc,EACd,UAAU,EACV,UAAU,EACV,OAAO,EACP,gBAAgB,GACjB,EAAE,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC;CA0ClD"}
|
|
@@ -0,0 +1,97 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.ProteusService = void 0;
|
|
25
|
+
const logdown_1 = __importDefault(require("logdown"));
|
|
26
|
+
const getGenericMessageParams_1 = require("./Utility/getGenericMessageParams");
|
|
27
|
+
const conversation_1 = require("../../../conversation");
|
|
28
|
+
const MessageService_1 = require("../../../conversation/message/MessageService");
|
|
29
|
+
class ProteusService {
|
|
30
|
+
constructor(apiClient, cryptographyService, config) {
|
|
31
|
+
this.apiClient = apiClient;
|
|
32
|
+
this.cryptographyService = cryptographyService;
|
|
33
|
+
this.config = config;
|
|
34
|
+
this.logger = (0, logdown_1.default)('@wireapp/core/ProteusService');
|
|
35
|
+
this.messageService = new MessageService_1.MessageService(this.apiClient, this.cryptographyService);
|
|
36
|
+
}
|
|
37
|
+
isClearFromMismatch(mismatch) {
|
|
38
|
+
const hasMissing = Object.keys(mismatch.missing || {}).length > 0;
|
|
39
|
+
const hasDeleted = Object.keys(mismatch.deleted || {}).length > 0;
|
|
40
|
+
const hasRedundant = Object.keys(mismatch.redundant || {}).length > 0;
|
|
41
|
+
const hasFailed = Object.keys(mismatch.failed_to_send || {}).length > 0;
|
|
42
|
+
return !hasMissing && !hasDeleted && !hasRedundant && !hasFailed;
|
|
43
|
+
}
|
|
44
|
+
async createConversation({ conversationData, otherUserIds, }) {
|
|
45
|
+
const isNewConversation = (conversationData) => conversationData && (conversationData === null || conversationData === void 0 ? void 0 : conversationData.name) && (conversationData === null || conversationData === void 0 ? void 0 : conversationData.users);
|
|
46
|
+
let payload;
|
|
47
|
+
if (isNewConversation(conversationData)) {
|
|
48
|
+
payload = Object.assign({}, conversationData);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
const users = otherUserIds ? (Array.isArray(otherUserIds) ? otherUserIds : [otherUserIds]) : [];
|
|
52
|
+
const payloadName = conversationData && typeof conversationData === 'string' ? conversationData : undefined;
|
|
53
|
+
payload = {
|
|
54
|
+
name: payloadName,
|
|
55
|
+
receipt_mode: null,
|
|
56
|
+
users,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return this.apiClient.api.conversation.postConversation(payload);
|
|
60
|
+
}
|
|
61
|
+
async addUsersToConversation({ conversationId, qualifiedUserIds }) {
|
|
62
|
+
return this.apiClient.api.conversation.postMembers(conversationId, qualifiedUserIds);
|
|
63
|
+
}
|
|
64
|
+
async sendMessage({ userIds, sendAsProtobuf, conversationId, nativePush, targetMode, payload, onClientMismatch, }) {
|
|
65
|
+
const messageParams = await (0, getGenericMessageParams_1.getGenericMessageParams)({
|
|
66
|
+
apiClient: this.apiClient,
|
|
67
|
+
sendingClientId: this.apiClient.validatedClientId,
|
|
68
|
+
conversationId,
|
|
69
|
+
genericMessage: payload,
|
|
70
|
+
useQualifiedIds: this.config.useQualifiedIds,
|
|
71
|
+
options: {
|
|
72
|
+
userIds,
|
|
73
|
+
sendAsProtobuf,
|
|
74
|
+
nativePush,
|
|
75
|
+
targetMode,
|
|
76
|
+
onClientMismatch,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
const { federated, sendingClientId, recipients, plainText, options } = messageParams;
|
|
80
|
+
const response = federated
|
|
81
|
+
? await this.messageService.sendFederatedMessage(sendingClientId, recipients, plainText, Object.assign(Object.assign({}, options), { onClientMismatch: mismatch => onClientMismatch === null || onClientMismatch === void 0 ? void 0 : onClientMismatch(mismatch, false) }))
|
|
82
|
+
: await this.messageService.sendMessage(sendingClientId, recipients, plainText, Object.assign(Object.assign({}, options), { sendAsProtobuf, onClientMismatch: mismatch => onClientMismatch === null || onClientMismatch === void 0 ? void 0 : onClientMismatch(mismatch, false) }));
|
|
83
|
+
if (!response.errored) {
|
|
84
|
+
if (!this.isClearFromMismatch(response)) {
|
|
85
|
+
// We warn the consumer that there is a mismatch that did not prevent message sending
|
|
86
|
+
await (onClientMismatch === null || onClientMismatch === void 0 ? void 0 : onClientMismatch(response, true));
|
|
87
|
+
}
|
|
88
|
+
this.logger.log(`Successfully sent Proteus message to conversation '${conversationId.id}'`);
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
id: payload.messageId,
|
|
92
|
+
sentAt: response.time,
|
|
93
|
+
state: response.errored ? conversation_1.PayloadBundleState.CANCELLED : conversation_1.PayloadBundleState.OUTGOING_SENT,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.ProteusService = ProteusService;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UserClients, QualifiedUserClients, ClientMismatch, MessageSendingStatus, ConversationProtocol, NewConversation } from '@wireapp/api-client/lib/conversation';
|
|
2
|
+
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
3
|
+
import { AddUsersParams, MessageSendingOptions, SendCommonParams } from '../../../conversation';
|
|
4
|
+
export declare type ProteusServiceConfig = {
|
|
5
|
+
useQualifiedIds: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare type SendProteusMessageParams = SendCommonParams & MessageSendingOptions & {
|
|
8
|
+
conversationId: QualifiedId;
|
|
9
|
+
/**
|
|
10
|
+
* Can be either a QualifiedId[], string[], UserClients or QualfiedUserClients. The type has some effect on the behavior of the method. (Needed only for Proteus)
|
|
11
|
+
* When given a QualifiedId[] or string[] 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
|
|
12
|
+
* When given a QualifiedUserClients or UserClients the method will only send to the clients listed in the userIds. This could lead to ClientMismatch (since the given list of devices might not be the freshest one and new clients could have been created)
|
|
13
|
+
* When given a QualifiedId[] or QualifiedUserClients the method will send the message through the federated API endpoint
|
|
14
|
+
* When given a string[] or UserClients the method will send the message through the old API endpoint
|
|
15
|
+
*/
|
|
16
|
+
userIds?: string[] | QualifiedId[] | UserClients | QualifiedUserClients;
|
|
17
|
+
onClientMismatch?: (status: ClientMismatch | MessageSendingStatus, wasSent: boolean) => void | boolean | Promise<boolean>;
|
|
18
|
+
protocol: ConversationProtocol.PROTEUS;
|
|
19
|
+
};
|
|
20
|
+
export declare type CreateProteusConversationParams = {
|
|
21
|
+
conversationData?: NewConversation | string;
|
|
22
|
+
otherUserIds?: string | string[];
|
|
23
|
+
};
|
|
24
|
+
export declare type AddUsersToProteusConversationParams = Omit<AddUsersParams, 'groupId'>;
|
|
25
|
+
//# sourceMappingURL=ProteusService.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProteusService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAE,qBAAqB,EAAE,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAE9F,oBAAY,oBAAoB,GAAG;IACjC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,oBAAY,wBAAwB,GAAG,gBAAgB,GACrD,qBAAqB,GAAG;IACtB,cAAc,EAAE,WAAW,CAAC;IAE5B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,WAAW,GAAG,oBAAoB,CAAC;IACxE,gBAAgB,CAAC,EAAE,CACjB,MAAM,EAAE,cAAc,GAAG,oBAAoB,EAC7C,OAAO,EAAE,OAAO,KACb,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC,OAAO,CAAC;CACxC,CAAC;AAEJ,oBAAY,+BAA+B,GAAG;IAC5C,gBAAgB,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAClC,CAAC;AAEF,oBAAY,mCAAmC,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { APIClient } from '@wireapp/api-client/lib/APIClient';
|
|
2
|
+
import { QualifiedUserClients, UserClients } from '@wireapp/api-client/lib/conversation';
|
|
3
|
+
import { QualifiedId, QualifiedUserPreKeyBundleMap, UserPreKeyBundleMap } from '@wireapp/api-client/lib/user';
|
|
4
|
+
interface GetPreKeyBundleMapParams {
|
|
5
|
+
apiClient: APIClient;
|
|
6
|
+
conversationId: QualifiedId;
|
|
7
|
+
userIds?: string[] | QualifiedId[] | UserClients;
|
|
8
|
+
}
|
|
9
|
+
declare const getPreKeyBundleMap: ({ apiClient, conversationId, userIds, }: GetPreKeyBundleMapParams) => Promise<UserPreKeyBundleMap>;
|
|
10
|
+
/**
|
|
11
|
+
* Will generate a prekey bundle for specific users.
|
|
12
|
+
* If a QualifiedId array is given the bundle will contain all the clients from those users fetched from the server.
|
|
13
|
+
* If a QualifiedUserClients is provided then only the clients in the payload will be targeted (which could generate a ClientMismatch when sending messages)
|
|
14
|
+
*
|
|
15
|
+
* @param {QualifiedId[]|QualifiedUserClients} userIds - Targeted users.
|
|
16
|
+
* @returns {Promise<QualifiedUserPreKeyBundleMap}
|
|
17
|
+
*/
|
|
18
|
+
interface GetQualifiedPreKeyBundleMapParams {
|
|
19
|
+
apiClient: APIClient;
|
|
20
|
+
userIds?: QualifiedId[] | QualifiedUserClients;
|
|
21
|
+
}
|
|
22
|
+
declare const getQualifiedPreKeyBundle: ({ apiClient, userIds, }: GetQualifiedPreKeyBundleMapParams) => Promise<QualifiedUserPreKeyBundleMap>;
|
|
23
|
+
export { getPreKeyBundleMap, getQualifiedPreKeyBundle };
|
|
24
|
+
//# sourceMappingURL=PreKeyBundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreKeyBundle.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/Utility/PreKeyBundle.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,oBAAoB,EAAE,WAAW,EAAC,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAC,WAAW,EAAE,4BAA4B,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AAI5G,UAAU,wBAAwB;IAChC,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,WAAW,CAAC;CAClD;AACD,QAAA,MAAM,kBAAkB,4CAIrB,wBAAwB,KAAG,QAAQ,mBAAmB,CA+BxD,CAAC;AAEF;;;;;;;GAOG;AACH,UAAU,iCAAiC;IACzC,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC;CAChD;AACD,QAAA,MAAM,wBAAwB,4BAG3B,iCAAiC,KAAG,QAAQ,4BAA4B,CAoC1E,CAAC;AAEF,OAAO,EAAC,kBAAkB,EAAE,wBAAwB,EAAC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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.getQualifiedPreKeyBundle = exports.getPreKeyBundleMap = void 0;
|
|
22
|
+
const util_1 = require("../../../../util");
|
|
23
|
+
const getPreKeyBundleMap = async ({ apiClient, conversationId, userIds = [], }) => {
|
|
24
|
+
let members = [];
|
|
25
|
+
if (userIds) {
|
|
26
|
+
if ((0, util_1.isStringArray)(userIds)) {
|
|
27
|
+
members = userIds;
|
|
28
|
+
}
|
|
29
|
+
else if ((0, util_1.isUserClients)(userIds)) {
|
|
30
|
+
members = Object.keys(userIds);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (!members.length) {
|
|
34
|
+
const conversation = await apiClient.api.conversation.getConversation(conversationId);
|
|
35
|
+
/*
|
|
36
|
+
* If you are sending a message to a conversation, you have to include
|
|
37
|
+
* yourself in the list of users if you want to sync a message also to your
|
|
38
|
+
* other clients.
|
|
39
|
+
*/
|
|
40
|
+
members = conversation.members.others.map(member => member.id).concat(conversation.members.self.id);
|
|
41
|
+
}
|
|
42
|
+
const preKeys = await Promise.all(members.map(member => apiClient.api.user.getUserPreKeys(member)));
|
|
43
|
+
return preKeys.reduce((bundleMap, bundle) => {
|
|
44
|
+
const userId = bundle.user;
|
|
45
|
+
bundleMap[userId] || (bundleMap[userId] = {});
|
|
46
|
+
for (const client of bundle.clients) {
|
|
47
|
+
bundleMap[userId][client.client] = client.prekey;
|
|
48
|
+
}
|
|
49
|
+
return bundleMap;
|
|
50
|
+
}, {});
|
|
51
|
+
};
|
|
52
|
+
exports.getPreKeyBundleMap = getPreKeyBundleMap;
|
|
53
|
+
const getQualifiedPreKeyBundle = async ({ apiClient, userIds, }) => {
|
|
54
|
+
let targets = [];
|
|
55
|
+
if (userIds) {
|
|
56
|
+
if ((0, util_1.isQualifiedIdArray)(userIds)) {
|
|
57
|
+
targets = userIds.map(id => ({ id }));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
targets = Object.entries(userIds).reduce((accumulator, [domain, userClients]) => {
|
|
61
|
+
for (const userId in userClients) {
|
|
62
|
+
accumulator.push({ id: { id: userId, domain }, clients: userClients[userId] });
|
|
63
|
+
}
|
|
64
|
+
return accumulator;
|
|
65
|
+
}, []);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const preKeys = await Promise.all(targets.map(async ({ id: userId, clients }) => {
|
|
69
|
+
const prekeyBundle = await apiClient.api.user.getUserPreKeys(userId);
|
|
70
|
+
// We filter the clients that should not receive the message (if a QualifiedUserClients was given as parameter)
|
|
71
|
+
const userClients = clients
|
|
72
|
+
? prekeyBundle.clients.filter(client => clients.includes(client.client))
|
|
73
|
+
: prekeyBundle.clients;
|
|
74
|
+
return { user: userId, clients: userClients };
|
|
75
|
+
}));
|
|
76
|
+
return preKeys.reduce((bundleMap, qualifiedPrekey) => {
|
|
77
|
+
var _a, _b, _c;
|
|
78
|
+
bundleMap[_a = qualifiedPrekey.user.domain] || (bundleMap[_a] = {});
|
|
79
|
+
for (const client of qualifiedPrekey.clients) {
|
|
80
|
+
(_b = bundleMap[qualifiedPrekey.user.domain])[_c = qualifiedPrekey.user.id] || (_b[_c] = {});
|
|
81
|
+
bundleMap[qualifiedPrekey.user.domain][qualifiedPrekey.user.id][client.client] = client.prekey;
|
|
82
|
+
}
|
|
83
|
+
return bundleMap;
|
|
84
|
+
}, {});
|
|
85
|
+
};
|
|
86
|
+
exports.getQualifiedPreKeyBundle = getQualifiedPreKeyBundle;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { APIClient } from '@wireapp/api-client/lib/APIClient';
|
|
2
|
+
import { QualifiedUserClients, UserClients } from '@wireapp/api-client/lib/conversation';
|
|
3
|
+
import { QualifiedId, QualifiedUserPreKeyBundleMap, UserPreKeyBundleMap } from '@wireapp/api-client/lib/user';
|
|
4
|
+
interface GetRecipientsForConversationQualifiedParams {
|
|
5
|
+
apiClient: APIClient;
|
|
6
|
+
conversationId: QualifiedId;
|
|
7
|
+
userIds?: QualifiedId[] | QualifiedUserClients;
|
|
8
|
+
}
|
|
9
|
+
declare const getQualifiedRecipientsForConversation: ({ apiClient, conversationId, userIds, }: GetRecipientsForConversationQualifiedParams) => Promise<QualifiedUserClients | QualifiedUserPreKeyBundleMap>;
|
|
10
|
+
interface GetRecipientsForConversationParams {
|
|
11
|
+
apiClient: APIClient;
|
|
12
|
+
conversationId: QualifiedId;
|
|
13
|
+
userIds?: string[] | UserClients;
|
|
14
|
+
}
|
|
15
|
+
declare const getRecipientsForConversation: ({ apiClient, conversationId, userIds, }: GetRecipientsForConversationParams) => Promise<UserClients | UserPreKeyBundleMap>;
|
|
16
|
+
export { getQualifiedRecipientsForConversation, getRecipientsForConversation };
|
|
17
|
+
//# sourceMappingURL=Recipients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Recipients.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/proteus/ProteusService/Utility/Recipients.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,oBAAoB,EAAE,WAAW,EAAC,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAC,WAAW,EAAE,4BAA4B,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AAO5G,UAAU,2CAA2C;IACnD,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC;CAChD;AAED,QAAA,MAAM,qCAAqC,4CAIxC,2CAA2C,KAAG,QAAQ,oBAAoB,GAAG,4BAA4B,CAO3G,CAAC;AAEF,UAAU,kCAAkC;IAC1C,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;CAClC;AACD,QAAA,MAAM,4BAA4B,4CAI/B,kCAAkC,KAAG,QAAQ,WAAW,GAAG,mBAAmB,CAShF,CAAC;AAEF,OAAO,EAAC,qCAAqC,EAAE,4BAA4B,EAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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.getRecipientsForConversation = exports.getQualifiedRecipientsForConversation = void 0;
|
|
22
|
+
const PreKeyBundle_1 = require("./PreKeyBundle");
|
|
23
|
+
const getConversationQualifiedMembers_1 = require("../../../../conversation/ConversationService/Utility/getConversationQualifiedMembers");
|
|
24
|
+
const util_1 = require("../../../../util");
|
|
25
|
+
const getQualifiedRecipientsForConversation = async ({ apiClient, conversationId, userIds, }) => {
|
|
26
|
+
if ((0, util_1.isQualifiedUserClients)(userIds)) {
|
|
27
|
+
return userIds;
|
|
28
|
+
}
|
|
29
|
+
const recipientIds = userIds || (await (0, getConversationQualifiedMembers_1.getConversationQualifiedMembers)({ apiClient: apiClient, conversationId }));
|
|
30
|
+
return (0, PreKeyBundle_1.getQualifiedPreKeyBundle)({ apiClient, userIds: recipientIds });
|
|
31
|
+
};
|
|
32
|
+
exports.getQualifiedRecipientsForConversation = getQualifiedRecipientsForConversation;
|
|
33
|
+
const getRecipientsForConversation = async ({ apiClient, conversationId, userIds, }) => {
|
|
34
|
+
if ((0, util_1.isUserClients)(userIds)) {
|
|
35
|
+
return userIds;
|
|
36
|
+
}
|
|
37
|
+
return (0, PreKeyBundle_1.getPreKeyBundleMap)({
|
|
38
|
+
apiClient: apiClient,
|
|
39
|
+
conversationId,
|
|
40
|
+
userIds,
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
exports.getRecipientsForConversation = getRecipientsForConversation;
|