@wireapp/core 37.2.0 → 37.2.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/lib/Account.d.ts +3 -31
- package/lib/Account.d.ts.map +1 -1
- package/lib/Account.js +6 -8
- package/lib/conversation/ConversationMapper/ConversationMapper.d.ts +3 -2
- package/lib/conversation/ConversationMapper/ConversationMapper.d.ts.map +1 -1
- package/lib/conversation/ConversationMapper/ConversationMapper.js +2 -1
- package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.js +1 -1
- package/lib/conversation/ConversationService/ConversationService.types.d.ts +2 -2
- package/lib/conversation/ConversationService/ConversationService.types.d.ts.map +1 -1
- package/lib/conversation/index.d.ts +1 -0
- package/lib/conversation/index.d.ts.map +1 -1
- package/lib/conversation/index.js +1 -0
- package/lib/conversation/message/Message.types.d.ts +7 -0
- package/lib/conversation/message/Message.types.d.ts.map +1 -0
- package/lib/conversation/message/Message.types.js +28 -0
- package/lib/conversation/message/MessageService.d.ts.map +1 -1
- package/lib/conversation/message/MessageService.js +1 -2
- package/lib/conversation/message/MessageToProtoMapper.d.ts +2 -3
- package/lib/conversation/message/MessageToProtoMapper.d.ts.map +1 -1
- package/lib/conversation/message/PayloadBundle.d.ts +4 -13
- package/lib/conversation/message/PayloadBundle.d.ts.map +1 -1
- package/lib/conversation/message/PayloadBundle.js +1 -14
- package/lib/conversation/message/TextContentBuilder.d.ts +1 -2
- package/lib/conversation/message/TextContentBuilder.d.ts.map +1 -1
- package/lib/conversation/message/TextContentBuilder.js +1 -12
- package/lib/conversation/message/index.d.ts +2 -0
- package/lib/conversation/message/index.d.ts.map +1 -0
- package/lib/conversation/{ConversationMapper → message}/index.js +1 -1
- package/lib/cryptography/CryptographyService.d.ts +0 -2
- package/lib/cryptography/CryptographyService.d.ts.map +1 -1
- package/lib/cryptography/CryptographyService.js +0 -15
- package/lib/cryptography/GenericMessageMapper.d.ts +3 -2
- package/lib/cryptography/GenericMessageMapper.d.ts.map +1 -1
- package/lib/cryptography/GenericMessageMapper.js +1 -1
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.js +0 -4
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.types.d.ts +3 -3
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.types.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/EventHandler/EventHandler.types.js +0 -3
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/otrMessageAdd.d.ts +1 -1
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/otrMessageAdd.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/EventHandler/ConversationEvent/events/otrMessageAdd/otrMessageAdd.js +1 -2
- package/lib/messagingProtocols/proteus/EventHandler/EventHandler.types.d.ts +3 -3
- package/lib/messagingProtocols/proteus/EventHandler/EventHandler.types.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/EventHandler/EventHandler.types.js +0 -3
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.js +1 -1
- package/lib/notification/NotificationService.d.ts +6 -8
- package/lib/notification/NotificationService.d.ts.map +1 -1
- package/lib/notification/NotificationService.js +6 -63
- package/lib/notification/Notifications.types.d.ts +6 -0
- package/lib/notification/Notifications.types.d.ts.map +1 -0
- package/lib/notification/Notifications.types.js +27 -0
- package/lib/notification/index.d.ts +1 -0
- package/lib/notification/index.d.ts.map +1 -1
- package/lib/notification/index.js +1 -0
- package/lib/user/UserMapper.d.ts +3 -2
- package/lib/user/UserMapper.d.ts.map +1 -1
- package/lib/user/UserMapper.js +4 -4
- package/lib/user/UserService.d.ts.map +1 -1
- package/lib/user/UserService.js +2 -2
- package/package.json +6 -6
- package/lib/conversation/ConversationMapper/index.d.ts +0 -2
- package/lib/conversation/ConversationMapper/index.d.ts.map +0 -1
- package/lib/conversation/message/CompositeContentBuilder.d.ts +0 -15
- package/lib/conversation/message/CompositeContentBuilder.d.ts.map +0 -1
- package/lib/conversation/message/CompositeContentBuilder.js +0 -53
package/lib/Account.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { RegisterData, Context, Cookie, LoginData } from '@wireapp/api-client/lib/auth';
|
|
3
3
|
import { ClientType, RegisteredClient } from '@wireapp/api-client/lib/client/';
|
|
4
|
-
import * as Events from '@wireapp/api-client/lib/event';
|
|
5
4
|
import { EventEmitter } from 'events';
|
|
6
5
|
import { APIClient, BackendFeatures } from '@wireapp/api-client';
|
|
7
6
|
import { CRUDEngine } from '@wireapp/store-engine';
|
|
@@ -9,16 +8,14 @@ import { AccountService } from './account/';
|
|
|
9
8
|
import { BroadcastService } from './broadcast/';
|
|
10
9
|
import { ClientInfo, ClientService } from './client/';
|
|
11
10
|
import { ConnectionService } from './connection/';
|
|
12
|
-
import { AssetService, ConversationService
|
|
13
|
-
import * as OtrMessage from './conversation/message/OtrMessage';
|
|
14
|
-
import * as UserMessage from './conversation/message/UserMessage';
|
|
11
|
+
import { AssetService, ConversationService } from './conversation/';
|
|
15
12
|
import { CoreError } from './CoreError';
|
|
16
13
|
import { CryptographyService, SessionId } from './cryptography/';
|
|
17
14
|
import { GiphyService } from './giphy/';
|
|
18
15
|
import { LinkPreviewService } from './linkPreview';
|
|
19
16
|
import { MLSService } from './messagingProtocols/mls';
|
|
20
17
|
import { MLSCallbacks, CryptoProtocolConfig } from './messagingProtocols/mls/types';
|
|
21
|
-
import { HandledEventPayload, NotificationService } from './notification/';
|
|
18
|
+
import { HandledEventPayload, NotificationService, NotificationSource } from './notification/';
|
|
22
19
|
import { SelfService } from './self/';
|
|
23
20
|
import { TeamService } from './team/';
|
|
24
21
|
import { UserService } from './user/';
|
|
@@ -37,31 +34,6 @@ export declare enum ConnectionState {
|
|
|
37
34
|
LIVE = "live"
|
|
38
35
|
}
|
|
39
36
|
export interface Account {
|
|
40
|
-
on(event: PayloadBundleType.ASSET, listener: (payload: OtrMessage.FileAssetMessage | OtrMessage.ImageAssetMessage) => void): this;
|
|
41
|
-
on(event: PayloadBundleType.BUTTON_ACTION, listener: (payload: OtrMessage.ButtonActionMessage) => void): this;
|
|
42
|
-
on(event: PayloadBundleType.ASSET_ABORT, listener: (payload: OtrMessage.FileAssetAbortMessage) => void): this;
|
|
43
|
-
on(event: PayloadBundleType.ASSET_IMAGE, listener: (payload: OtrMessage.ImageAssetMessage) => void): this;
|
|
44
|
-
on(event: PayloadBundleType.ASSET_META, listener: (payload: OtrMessage.FileAssetMetaDataMessage) => void): this;
|
|
45
|
-
on(event: PayloadBundleType.CALL, listener: (payload: OtrMessage.CallMessage) => void): this;
|
|
46
|
-
on(event: PayloadBundleType.CLIENT_ACTION, listener: (payload: OtrMessage.ResetSessionMessage) => void): this;
|
|
47
|
-
on(event: PayloadBundleType.CLIENT_ADD, listener: (payload: UserMessage.UserClientAddMessage) => void): this;
|
|
48
|
-
on(event: PayloadBundleType.CLIENT_REMOVE, listener: (payload: UserMessage.UserClientRemoveMessage) => void): this;
|
|
49
|
-
on(event: PayloadBundleType.CONFIRMATION, listener: (payload: OtrMessage.ConfirmationMessage) => void): this;
|
|
50
|
-
on(event: PayloadBundleType.CONNECTION_REQUEST, listener: (payload: UserMessage.UserConnectionMessage) => void): this;
|
|
51
|
-
on(event: PayloadBundleType.USER_UPDATE, listener: (payload: UserMessage.UserUpdateMessage) => void): this;
|
|
52
|
-
on(event: PayloadBundleType.CONVERSATION_CLEAR, listener: (payload: OtrMessage.ClearConversationMessage) => void): this;
|
|
53
|
-
on(event: PayloadBundleType.CONVERSATION_RENAME, listener: (payload: Events.ConversationRenameEvent) => void): this;
|
|
54
|
-
on(event: PayloadBundleType.LOCATION, listener: (payload: OtrMessage.LocationMessage) => void): this;
|
|
55
|
-
on(event: PayloadBundleType.MEMBER_JOIN, listener: (payload: Events.TeamMemberJoinEvent) => void): this;
|
|
56
|
-
on(event: PayloadBundleType.MESSAGE_DELETE, listener: (payload: OtrMessage.DeleteMessage) => void): this;
|
|
57
|
-
on(event: PayloadBundleType.MESSAGE_EDIT, listener: (payload: OtrMessage.EditedTextMessage) => void): this;
|
|
58
|
-
on(event: PayloadBundleType.MESSAGE_HIDE, listener: (payload: OtrMessage.HideMessage) => void): this;
|
|
59
|
-
on(event: PayloadBundleType.PING, listener: (payload: OtrMessage.PingMessage) => void): this;
|
|
60
|
-
on(event: PayloadBundleType.REACTION, listener: (payload: OtrMessage.ReactionMessage) => void): this;
|
|
61
|
-
on(event: PayloadBundleType.TEXT, listener: (payload: OtrMessage.TextMessage) => void): this;
|
|
62
|
-
on(event: PayloadBundleType.TIMER_UPDATE, listener: (payload: Events.ConversationMessageTimerUpdateEvent) => void): this;
|
|
63
|
-
on(event: PayloadBundleType.TYPING, listener: (payload: Events.ConversationTypingEvent) => void): this;
|
|
64
|
-
on(event: PayloadBundleType.UNKNOWN, listener: (payload: any) => void): this;
|
|
65
37
|
on(event: TOPIC.ERROR, listener: (payload: CoreError) => void): this;
|
|
66
38
|
}
|
|
67
39
|
export type CreateStoreFn = (storeName: string, context: Context) => undefined | Promise<CRUDEngine | undefined>;
|
|
@@ -208,7 +180,7 @@ export declare class Account<T = any> extends EventEmitter {
|
|
|
208
180
|
* @param payload the payload of the event. Contains the raw event received and the decrypted data (if event was encrypted)
|
|
209
181
|
* @param source where the message comes from (either websocket or notification stream)
|
|
210
182
|
*/
|
|
211
|
-
onEvent?: (payload: HandledEventPayload, source:
|
|
183
|
+
onEvent?: (payload: HandledEventPayload, source: NotificationSource) => void;
|
|
212
184
|
/**
|
|
213
185
|
* During the notification stream processing, this function will be called whenever a new notification has been processed
|
|
214
186
|
*/
|
package/lib/Account.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../src/Account.ts"],"names":[],"mappings":";AAmBA,OAAO,EACL,YAAY,EAGZ,OAAO,EACP,MAAM,EAEN,SAAS,EACV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAuB,UAAU,EAAE,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../src/Account.ts"],"names":[],"mappings":";AAmBA,OAAO,EACL,YAAY,EAGZ,OAAO,EACP,MAAM,EAEN,SAAS,EACV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAuB,UAAU,EAAE,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAWnG,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAG/D,OAAO,EAAC,UAAU,EAA0C,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,WAAW,CAAC;AACpD,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,mBAAmB,EAAE,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AACtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,YAAY,EAAE,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAElF,OAAO,EAAC,m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M,CAAA;SAAC,KAAK,IAAI,CAAC;QAEtF;;WAEG;QACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;QAE5D;;;;;;WAMG;QACH,qBAAqB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;QAEzD;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;KACb,GAAG,MAAM,IAAI;IAiFnB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,qBAAqB;YAIf,UAAU;CAqBzB"}
|
package/lib/Account.js
CHANGED
|
@@ -54,6 +54,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
54
54
|
exports.Account = exports.ConnectionState = void 0;
|
|
55
55
|
const auth_1 = require("@wireapp/api-client/lib/auth");
|
|
56
56
|
const client_1 = require("@wireapp/api-client/lib/client/");
|
|
57
|
+
const event_1 = require("@wireapp/api-client/lib/event");
|
|
57
58
|
const tcp_1 = require("@wireapp/api-client/lib/tcp/");
|
|
58
59
|
const ReconnectingWebsocket_1 = require("@wireapp/api-client/lib/tcp/ReconnectingWebsocket");
|
|
59
60
|
const axios_1 = __importDefault(require("axios"));
|
|
@@ -421,19 +422,16 @@ class Account extends events_1.EventEmitter {
|
|
|
421
422
|
throw new Error('Context is not set - please login first');
|
|
422
423
|
}
|
|
423
424
|
const handleEvent = async (payload, source) => {
|
|
424
|
-
const {
|
|
425
|
-
switch (
|
|
426
|
-
case
|
|
427
|
-
const { data: { message_timer }, conversation, } =
|
|
425
|
+
const { event } = payload;
|
|
426
|
+
switch (event === null || event === void 0 ? void 0 : event.type) {
|
|
427
|
+
case event_1.CONVERSATION_EVENT.MESSAGE_TIMER_UPDATE: {
|
|
428
|
+
const { data: { message_timer }, conversation, } = event;
|
|
428
429
|
const expireAfterMillis = Number(message_timer);
|
|
429
430
|
this.service.conversation.messageTimer.setConversationLevelTimer(conversation, expireAfterMillis);
|
|
430
431
|
break;
|
|
431
432
|
}
|
|
432
433
|
}
|
|
433
434
|
onEvent(payload, source);
|
|
434
|
-
if (mappedEvent) {
|
|
435
|
-
this.emit(mappedEvent.type, payload.mappedEvent);
|
|
436
|
-
}
|
|
437
435
|
};
|
|
438
436
|
const handleNotification = async (notification, source) => {
|
|
439
437
|
var _a, e_1, _b, _c;
|
|
@@ -465,7 +463,7 @@ class Account extends events_1.EventEmitter {
|
|
|
465
463
|
}
|
|
466
464
|
};
|
|
467
465
|
this.apiClient.transport.ws.removeAllListeners(tcp_1.WebSocketClient.TOPIC.ON_MESSAGE);
|
|
468
|
-
this.apiClient.transport.ws.on(tcp_1.WebSocketClient.TOPIC.ON_MESSAGE, notification => handleNotification(notification,
|
|
466
|
+
this.apiClient.transport.ws.on(tcp_1.WebSocketClient.TOPIC.ON_MESSAGE, notification => handleNotification(notification, notification_1.NotificationSource.WEBSOCKET));
|
|
469
467
|
this.apiClient.transport.ws.on(tcp_1.WebSocketClient.TOPIC.ON_STATE_CHANGE, wsState => {
|
|
470
468
|
const mapping = {
|
|
471
469
|
[ReconnectingWebsocket_1.WEBSOCKET_STATE.CLOSED]: ConnectionState.CLOSED,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ConversationEvent } from '@wireapp/api-client/lib/event';
|
|
2
|
-
import {
|
|
2
|
+
import { NotificationSource } from '../../notification';
|
|
3
|
+
import { PayloadBundle } from '../message/PayloadBundle';
|
|
3
4
|
export declare class ConversationMapper {
|
|
4
|
-
static mapConversationEvent(event: ConversationEvent, source:
|
|
5
|
+
static mapConversationEvent(event: ConversationEvent, source: NotificationSource): PayloadBundle;
|
|
5
6
|
private static mapConversationEventType;
|
|
6
7
|
}
|
|
7
8
|
//# sourceMappingURL=ConversationMapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationMapper.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationMapper/ConversationMapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAqB,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"ConversationMapper.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationMapper/ConversationMapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAqB,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAEpF,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAC,aAAa,EAAoB,MAAM,0BAA0B,CAAC;AAC1E,qBAAa,kBAAkB;WACf,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,kBAAkB,GAAG,aAAa;IAgBvG,OAAO,CAAC,MAAM,CAAC,wBAAwB;CAcxC"}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.ConversationMapper = void 0;
|
|
22
22
|
const event_1 = require("@wireapp/api-client/lib/event");
|
|
23
|
+
const message_1 = require("../message");
|
|
23
24
|
const MessageBuilder_1 = require("../message/MessageBuilder");
|
|
24
25
|
const PayloadBundle_1 = require("../message/PayloadBundle");
|
|
25
26
|
class ConversationMapper {
|
|
@@ -33,7 +34,7 @@ class ConversationMapper {
|
|
|
33
34
|
id: (0, MessageBuilder_1.createId)(),
|
|
34
35
|
messageTimer: 0,
|
|
35
36
|
source,
|
|
36
|
-
state:
|
|
37
|
+
state: message_1.MessageSendingState.INCOMING,
|
|
37
38
|
timestamp: new Date(event.time).getTime(),
|
|
38
39
|
type: this.mapConversationEventType(event.type),
|
|
39
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAEL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,WAAW,EAGZ,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAC,4BAA4B,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,GAAG,EAAC,MAAM,oCAAoC,CAAC;AAGvD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAI9C,OAAO,EAAC,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAE5G,OAAO,EAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAEL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,WAAW,EAGZ,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAC,4BAA4B,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,GAAG,EAAC,MAAM,oCAAoC,CAAC;AAGvD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAI9C,OAAO,EAAC,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAE5G,OAAO,EAAC,YAAY,EAAuB,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAC,UAAU,EAAuB,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAkC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AACjG,OAAO,EACL,mCAAmC,EACnC,wBAAwB,EACzB,MAAM,sEAAsE,CAAC;AAE9E,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AAItC,qBAAa,mBAAmB;IAK5B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAE1B,OAAO,CAAC,Q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}
|
|
@@ -222,7 +222,7 @@ class ConversationService {
|
|
|
222
222
|
return {
|
|
223
223
|
id: payload.messageId,
|
|
224
224
|
sentAt,
|
|
225
|
-
state: sentAt ? conversation_2.
|
|
225
|
+
state: sentAt ? conversation_2.MessageSendingState.OUTGOING_SENT : conversation_2.MessageSendingState.CANCELLED,
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
228
|
async addUsersToMLSConversation({ qualifiedUserIds, groupId, conversationId, }) {
|
|
@@ -2,7 +2,7 @@ import { QualifiedUserClients, ClientMismatch, ConversationProtocol, MessageSend
|
|
|
2
2
|
import { MlsEvent } from '@wireapp/api-client/lib/conversation/data/MlsEventData';
|
|
3
3
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
4
4
|
import { GenericMessage } from '@wireapp/protocol-messaging';
|
|
5
|
-
import {
|
|
5
|
+
import { MessageSendingState } from '..';
|
|
6
6
|
export declare enum MessageTargetMode {
|
|
7
7
|
NONE = 0,
|
|
8
8
|
USERS = 1,
|
|
@@ -90,6 +90,6 @@ export type SendResult = {
|
|
|
90
90
|
/** the ISO formatted date at which the message was received by the backend */
|
|
91
91
|
sentAt: string;
|
|
92
92
|
/** The sending state of the payload (has the payload been succesfully sent or canceled) */
|
|
93
|
-
state:
|
|
93
|
+
state: MessageSendingState;
|
|
94
94
|
};
|
|
95
95
|
//# sourceMappingURL=ConversationService.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.types.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,wDAAwD,CAAC;AAChF,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"ConversationService.types.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,wDAAwD,CAAC;AAChF,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,IAAI,CAAC;AAEvC,oBAAY,iBAAiB;IAC3B,IAAI,IAAA;IACJ,KAAK,IAAA;IACL,aAAa,IAAA;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,WAAW,GAAG,oBAAoB,CAAC;IAExE;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,gBAAgB,CAAC,EAAE,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;IAE/D;;;;;OAKG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,CACjB,MAAM,EAAE,cAAc,GAAG,oBAAoB,EAC7C,OAAO,EAAE,OAAO,KACb,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxC;AAED;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,oBAAoB,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG;IACpD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,oBAAoB,CAAC,GAAG,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAE9D,MAAM,MAAM,cAAc,GAAG;IAC3B,cAAc,EAAE,WAAW,CAAC;IAC5B,gBAAgB,EAAE,WAAW,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,WAAW,CAAC;IAC5B,gBAAgB,EAAE,WAAW,EAAE,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;IAAC,YAAY,EAAE,YAAY,CAAA;CAAC,CAAC;AAE7E,MAAM,MAAM,UAAU,GAAG;IACvB,iCAAiC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,KAAK,EAAE,mBAAmB,CAAC;CAC5B,CAAC"}
|
|
@@ -6,5 +6,6 @@ export * from './ConversationService';
|
|
|
6
6
|
export * from './GenericMessageType';
|
|
7
7
|
export * from './MessageTimer';
|
|
8
8
|
export * from './message/PayloadBundle';
|
|
9
|
+
export * from './message/Message.types';
|
|
9
10
|
export * from './ReactionType';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conversation/index.ts"],"names":[],"mappings":"AAmBA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conversation/index.ts"],"names":[],"mappings":"AAmBA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC"}
|
|
@@ -40,4 +40,5 @@ __exportStar(require("./ConversationService"), exports);
|
|
|
40
40
|
__exportStar(require("./GenericMessageType"), exports);
|
|
41
41
|
__exportStar(require("./MessageTimer"), exports);
|
|
42
42
|
__exportStar(require("./message/PayloadBundle"), exports);
|
|
43
|
+
__exportStar(require("./message/Message.types"), exports);
|
|
43
44
|
__exportStar(require("./ReactionType"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message.types.d.ts","sourceRoot":"","sources":["../../../src/conversation/message/Message.types.ts"],"names":[],"mappings":"AAmBA,oBAAY,mBAAmB;IAC7B,QAAQ,aAAa;IACrB,aAAa,kBAAkB;IAC/B,eAAe,oBAAoB;IACnC,SAAS,cAAc;CACxB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.MessageSendingState = void 0;
|
|
22
|
+
var MessageSendingState;
|
|
23
|
+
(function (MessageSendingState) {
|
|
24
|
+
MessageSendingState["INCOMING"] = "INCOMING";
|
|
25
|
+
MessageSendingState["OUTGOING_SENT"] = "OUTGOING_SENT";
|
|
26
|
+
MessageSendingState["OUTGOING_UNSENT"] = "OUTGOING_UNSENT";
|
|
27
|
+
MessageSendingState["CANCELLED"] = "CANCELLED";
|
|
28
|
+
})(MessageSendingState = exports.MessageSendingState || (exports.MessageSendingState = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageService.d.ts","sourceRoot":"","sources":["../../../src/conversation/message/MessageService.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,cAAc,EACd,oBAAoB,EAIpB,oBAAoB,EACpB,WAAW,EACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAE,4BAA4B,EAAE,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AAQ5G,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAO9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AAMvD,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,SAAS;IAAa,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gB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C,EAAE,CAAC,QAAQ,EAAE,oBAAoB,KAAK,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KAC1F,GACA,OAAO,CAAC,oBAAoB,GAAG;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAC,CAAC;YAyBxC,uBAAuB;YAiEvB,cAAc;YAmCd,uBAAuB;IAiBrC,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,qBAAqB;YAIf,sBAAsB;IAmBpC;;;;;;;OAOG;YACW,+BAA+B;YAuB/B,sBAAsB;CAoDrC"}
|
|
@@ -189,14 +189,13 @@ class MessageService {
|
|
|
189
189
|
async generateExternalPayload(plainText) {
|
|
190
190
|
const asset = await (0, AssetCryptography_1.encryptAsset)({ plainText });
|
|
191
191
|
const { cipherText, keyBytes, sha256 } = asset;
|
|
192
|
-
const messageId = (0, MessageBuilder_1.createId)();
|
|
193
192
|
const externalMessage = {
|
|
194
193
|
otrKey: new Uint8Array(keyBytes),
|
|
195
194
|
sha256: new Uint8Array(sha256),
|
|
196
195
|
};
|
|
197
196
|
const genericMessage = protocol_messaging_1.GenericMessage.create({
|
|
198
197
|
[__1.GenericMessageType.EXTERNAL]: externalMessage,
|
|
199
|
-
messageId,
|
|
198
|
+
messageId: (0, MessageBuilder_1.createId)(),
|
|
200
199
|
});
|
|
201
200
|
return { text: protocol_messaging_1.GenericMessage.encode(genericMessage).finish(), cipherText };
|
|
202
201
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { LinkPreview, Text } from '@wireapp/protocol-messaging';
|
|
2
|
-
import {
|
|
3
|
-
import { LinkPreviewUploadedContent } from '../content';
|
|
2
|
+
import { EditedTextContent, LinkPreviewUploadedContent, TextContent } from '../content';
|
|
4
3
|
export declare class MessageToProtoMapper {
|
|
5
4
|
static mapLinkPreviews(linkPreviews: LinkPreviewUploadedContent[]): LinkPreview[];
|
|
6
|
-
static mapText(payloadBundle:
|
|
5
|
+
static mapText(payloadBundle: TextContent | EditedTextContent): Text;
|
|
7
6
|
}
|
|
8
7
|
//# sourceMappingURL=MessageToProtoMapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageToProtoMapper.d.ts","sourceRoot":"","sources":["../../../src/conversation/message/MessageToProtoMapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAiB,WAAW,EAAkB,IAAI,EAAQ,MAAM,6BAA6B,CAAC;AAErG,OAAO,EAAC,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"MessageToProtoMapper.d.ts","sourceRoot":"","sources":["../../../src/conversation/message/MessageToProtoMapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAiB,WAAW,EAAkB,IAAI,EAAQ,MAAM,6BAA6B,CAAC;AAErG,OAAO,EAAC,iBAAiB,EAAE,0BAA0B,EAAE,WAAW,EAAC,MAAM,YAAY,CAAC;AAGtF,qBAAa,oBAAoB;IAC/B,MAAM,CAAC,eAAe,CAAC,YAAY,EAAE,0BAA0B,EAAE,GAAG,WAAW,EAAE;IA+DjF,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,WAAW,GAAG,iBAAiB,GAAG,IAAI;CA0BrE"}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { ConversationEventData, TeamEventData, UserEventData } from '@wireapp/api-client/lib/event/';
|
|
2
2
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
3
3
|
import { Message } from './Message';
|
|
4
|
+
import { MessageSendingState } from './Message.types';
|
|
5
|
+
import { NotificationSource } from '../../notification';
|
|
4
6
|
import { ConversationContent } from '../content';
|
|
5
7
|
export type PayloadBundleContent = ConversationContent | ConversationEventData | TeamEventData | UserEventData;
|
|
6
|
-
export declare enum PayloadBundleSource {
|
|
7
|
-
LOCAL = "PayloadBundleSource.LOCAL",
|
|
8
|
-
NOTIFICATION_STREAM = "PayloadBundleSource.NOTIFICATION_STREAM",
|
|
9
|
-
WEBSOCKET = "PayloadBundleSource.WEBSOCKET"
|
|
10
|
-
}
|
|
11
|
-
export declare enum PayloadBundleState {
|
|
12
|
-
INCOMING = "PayloadBundleState.INCOMING",
|
|
13
|
-
OUTGOING_SENT = "PayloadBundleState.OUTGOING_SENT",
|
|
14
|
-
OUTGOING_UNSENT = "PayloadBundleState.OUTGOING_UNSENT",
|
|
15
|
-
CANCELLED = "PayloadBundleState.CANCELLED"
|
|
16
|
-
}
|
|
17
8
|
export interface BasePayloadBundle {
|
|
18
9
|
content: PayloadBundleContent;
|
|
19
10
|
conversation: string;
|
|
@@ -23,8 +14,8 @@ export interface BasePayloadBundle {
|
|
|
23
14
|
fromClientId?: string;
|
|
24
15
|
id: string;
|
|
25
16
|
messageTimer?: number;
|
|
26
|
-
source:
|
|
27
|
-
state:
|
|
17
|
+
source: NotificationSource;
|
|
18
|
+
state: MessageSendingState;
|
|
28
19
|
timestamp: number;
|
|
29
20
|
type: PayloadBundleType;
|
|
30
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayloadBundle.d.ts","sourceRoot":"","sources":["../../../src/conversation/message/PayloadBundle.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,qBAAqB,EAAE,aAAa,EAAE,aAAa,EAAC,MAAM,gCAAgC,CAAC;AACnG,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"PayloadBundle.d.ts","sourceRoot":"","sources":["../../../src/conversation/message/PayloadBundle.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,qBAAqB,EAAE,aAAa,EAAE,aAAa,EAAC,MAAM,gCAAgC,CAAC;AACnG,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAC,k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vE,WAAW,kCAAkC;IAC7C,gBAAgB,uCAAuC;IACvD,iBAAiB,wCAAwC;IACzD,WAAW,kCAAkC;IAC7C,IAAI,2BAA2B;IAC/B,YAAY,mCAAmC;IAC/C,MAAM,6BAA6B;IACnC,OAAO,8BAA8B;IACrC,aAAa,oCAAoC;IACjD,eAAe,sCAAsC;IACrD,kBAAkB,yCAAyC;IAC3D,eAAe,sCAAsC;IACrD,WAAW,kCAAkC;IAC7C,uBAAuB,8CAA8C;IACrE,sBAAsB,6CAA6C;IACnE,uBAAuB,8CAA8C;IACrE,mBAAmB,0CAA0C;IAC7D,WAAW,kCAAkC;CAC9C"}
|
|
@@ -18,20 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.PayloadBundleType =
|
|
22
|
-
var PayloadBundleSource;
|
|
23
|
-
(function (PayloadBundleSource) {
|
|
24
|
-
PayloadBundleSource["LOCAL"] = "PayloadBundleSource.LOCAL";
|
|
25
|
-
PayloadBundleSource["NOTIFICATION_STREAM"] = "PayloadBundleSource.NOTIFICATION_STREAM";
|
|
26
|
-
PayloadBundleSource["WEBSOCKET"] = "PayloadBundleSource.WEBSOCKET";
|
|
27
|
-
})(PayloadBundleSource = exports.PayloadBundleSource || (exports.PayloadBundleSource = {}));
|
|
28
|
-
var PayloadBundleState;
|
|
29
|
-
(function (PayloadBundleState) {
|
|
30
|
-
PayloadBundleState["INCOMING"] = "PayloadBundleState.INCOMING";
|
|
31
|
-
PayloadBundleState["OUTGOING_SENT"] = "PayloadBundleState.OUTGOING_SENT";
|
|
32
|
-
PayloadBundleState["OUTGOING_UNSENT"] = "PayloadBundleState.OUTGOING_UNSENT";
|
|
33
|
-
PayloadBundleState["CANCELLED"] = "PayloadBundleState.CANCELLED";
|
|
34
|
-
})(PayloadBundleState = exports.PayloadBundleState || (exports.PayloadBundleState = {}));
|
|
21
|
+
exports.PayloadBundleType = void 0;
|
|
35
22
|
var PayloadBundleType;
|
|
36
23
|
(function (PayloadBundleType) {
|
|
37
24
|
PayloadBundleType["ASSET"] = "PayloadBundleType.ASSET";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { QuotableMessage } from './OtrMessage';
|
|
2
1
|
import { EditedTextContent, LegalHoldStatus, LinkPreviewUploadedContent, MentionContent, QuoteContent, TextContent } from '../content';
|
|
3
2
|
export declare class TextContentBuilder<T extends TextContent | EditedTextContent> {
|
|
4
3
|
private readonly content;
|
|
@@ -6,7 +5,7 @@ export declare class TextContentBuilder<T extends TextContent | EditedTextConten
|
|
|
6
5
|
build(): T;
|
|
7
6
|
withLinkPreviews(linkPreviews?: LinkPreviewUploadedContent[]): this;
|
|
8
7
|
withMentions(mentions?: MentionContent[]): this;
|
|
9
|
-
withQuote(quote?:
|
|
8
|
+
withQuote(quote?: QuoteContent): this;
|
|
10
9
|
withReadConfirmation(expectsReadConfirmation?: boolean): this;
|
|
11
10
|
withLegalHoldStatus(legalHoldStatus?: LegalHoldStatus): this;
|
|
12
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextContentBuilder.d.ts","sourceRoot":"","sources":["../../../src/conversation/message/TextContentBuilder.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"TextContentBuilder.d.ts","sourceRoot":"","sources":["../../../src/conversation/message/TextContentBuilder.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,YAAY,EACZ,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,qBAAa,kBAAkB,CAAC,CAAC,SAAS,WAAW,GAAG,iBAAiB;IACvE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAI;gBAEhB,WAAW,EAAE,CAAC;IAI1B,KAAK,IAAI,CAAC;IAIV,gBAAgB,CAAC,YAAY,CAAC,EAAE,0BAA0B,EAAE;IAQ5D,YAAY,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE;IAQxC,SAAS,CAAC,KAAK,CAAC,EAAE,YAAY;IAQ9B,oBAAoB,CAAC,uBAAuB,UAAQ;IAOpD,mBAAmB,CAAC,eAAe,kBAA0B;CAM9D"}
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.TextContentBuilder = void 0;
|
|
22
|
-
const cryptography_1 = require("../../cryptography");
|
|
23
22
|
const content_1 = require("../content");
|
|
24
23
|
class TextContentBuilder {
|
|
25
24
|
constructor(textContent) {
|
|
@@ -42,17 +41,7 @@ class TextContentBuilder {
|
|
|
42
41
|
}
|
|
43
42
|
withQuote(quote) {
|
|
44
43
|
if (quote) {
|
|
45
|
-
|
|
46
|
-
this.content.quote = quote;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
const messageHashService = new cryptography_1.MessageHashService(quote.content, quote.timestamp);
|
|
50
|
-
const messageHashBuffer = messageHashService.getHash();
|
|
51
|
-
this.content.quote = {
|
|
52
|
-
quotedMessageId: quote.id,
|
|
53
|
-
quotedMessageSha256: new Uint8Array(messageHashBuffer),
|
|
54
|
-
};
|
|
55
|
-
}
|
|
44
|
+
this.content.quote = quote;
|
|
56
45
|
}
|
|
57
46
|
return this;
|
|
58
47
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/conversation/message/index.ts"],"names":[],"mappings":"AAmBA,cAAc,iBAAiB,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("./
|
|
35
|
+
__exportStar(require("./Message.types"), exports);
|
|
@@ -7,7 +7,6 @@ import { APIClient } from '@wireapp/api-client';
|
|
|
7
7
|
import { Cryptobox } from '@wireapp/cryptobox';
|
|
8
8
|
import { GenericMessage } from '@wireapp/protocol-messaging';
|
|
9
9
|
import { CRUDEngine } from '@wireapp/store-engine';
|
|
10
|
-
import { PayloadBundle, PayloadBundleSource } from '../conversation';
|
|
11
10
|
export type SessionId = {
|
|
12
11
|
userId: string;
|
|
13
12
|
clientId: string;
|
|
@@ -74,6 +73,5 @@ export declare class CryptographyService {
|
|
|
74
73
|
deleteCryptographyStores(): Promise<boolean[]>;
|
|
75
74
|
resetSession(sessionId: string): Promise<void>;
|
|
76
75
|
decryptMessage(otrMessage: ConversationOtrMessageAddEvent): Promise<GenericMessage>;
|
|
77
|
-
mapGenericMessage(otrMessage: ConversationOtrMessageAddEvent, genericMessage: GenericMessage, source: PayloadBundleSource): PayloadBundle;
|
|
78
76
|
}
|
|
79
77
|
//# sourceMappingURL=CryptographyService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptographyService.d.ts","sourceRoot":"","sources":["../../src/cryptography/CryptographyService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAEL,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAC,8BAA8B,EAAC,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAC,WAAW,EAAE,4BAA4B,EAAE,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;AAI7G,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAmB,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,U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,WAAW,CAAC;QAAC,SAAS,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;KAAC,CAAC;YA2B1D,wBAAwB;IA4BzB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3C;;OAEG;IACI,mBAAmB,IAAI,MAAM;IAIpC;;;;;;OAMG;IACU,oBAAoB,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YAK5F,kBAAkB;IAehC,OAAO,CAAC,aAAa;IAId,wBAAwB,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAIxC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9C,cAAc,CAAC,UAAU,EAAE,8BAA8B,GAAG,OAAO,CAAC,cAAc,CAAC;CAejG"}
|
|
@@ -28,9 +28,7 @@ const cryptobox_1 = require("@wireapp/cryptobox");
|
|
|
28
28
|
const proteus_1 = require("@wireapp/proteus");
|
|
29
29
|
const protocol_messaging_1 = require("@wireapp/protocol-messaging");
|
|
30
30
|
const CryptographyDatabaseRepository_1 = require("./CryptographyDatabaseRepository");
|
|
31
|
-
const GenericMessageMapper_1 = require("./GenericMessageMapper");
|
|
32
31
|
const generateDecryptionError_1 = require("./Utlility/generateDecryptionError");
|
|
33
|
-
const conversation_1 = require("../conversation");
|
|
34
32
|
const util_1 = require("../util");
|
|
35
33
|
class CryptographyService {
|
|
36
34
|
constructor(apiClient, storeEngine, config) {
|
|
@@ -220,18 +218,5 @@ class CryptographyService {
|
|
|
220
218
|
throw (0, generateDecryptionError_1.generateDecryptionError)(otrMessage, error, this.logger);
|
|
221
219
|
}
|
|
222
220
|
}
|
|
223
|
-
mapGenericMessage(otrMessage, genericMessage, source) {
|
|
224
|
-
if (genericMessage.content === conversation_1.GenericMessageType.EPHEMERAL) {
|
|
225
|
-
const unwrappedMessage = GenericMessageMapper_1.GenericMessageMapper.mapGenericMessage(genericMessage.ephemeral, otrMessage, source);
|
|
226
|
-
unwrappedMessage.id = genericMessage.messageId;
|
|
227
|
-
if (genericMessage.ephemeral) {
|
|
228
|
-
const expireAfterMillis = genericMessage.ephemeral.expireAfterMillis;
|
|
229
|
-
unwrappedMessage.messageTimer =
|
|
230
|
-
typeof expireAfterMillis === 'number' ? expireAfterMillis : expireAfterMillis.toNumber();
|
|
231
|
-
}
|
|
232
|
-
return unwrappedMessage;
|
|
233
|
-
}
|
|
234
|
-
return GenericMessageMapper_1.GenericMessageMapper.mapGenericMessage(genericMessage, otrMessage, source);
|
|
235
|
-
}
|
|
236
221
|
}
|
|
237
222
|
exports.CryptographyService = CryptographyService;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ConversationOtrMessageAddEvent } from '@wireapp/api-client/lib/event/';
|
|
2
|
-
import { PayloadBundle
|
|
2
|
+
import { PayloadBundle } from '../conversation';
|
|
3
|
+
import { NotificationSource } from '../notification';
|
|
3
4
|
export declare class GenericMessageMapper {
|
|
4
5
|
private static readonly logger;
|
|
5
|
-
static mapGenericMessage(genericMessage: any, event: ConversationOtrMessageAddEvent, source:
|
|
6
|
+
static mapGenericMessage(genericMessage: any, event: ConversationOtrMessageAddEvent, source: NotificationSource): PayloadBundle;
|
|
6
7
|
}
|
|
7
8
|
//# sourceMappingURL=GenericMessageMapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericMessageMapper.d.ts","sourceRoot":"","sources":["../../src/cryptography/GenericMessageMapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,8BAA8B,EAAC,MAAM,gCAAgC,CAAC;AAG9E,OAAO,
|
|
1
|
+
{"version":3,"file":"GenericMessageMapper.d.ts","sourceRoot":"","sources":["../../src/cryptography/GenericMessageMapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,8BAA8B,EAAC,MAAM,gCAAgC,CAAC;AAG9E,OAAO,EAA0C,aAAa,EAAoB,MAAM,iBAAiB,CAAC;AAa1G,OAAO,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AACnD,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAG3B;WAIW,iBAAiB,CAC7B,cAAc,EAAE,GAAG,EACnB,KAAK,EAAE,8BAA8B,EACrC,MAAM,EAAE,kBAAkB,GACzB,aAAa;CA4NjB"}
|
|
@@ -34,7 +34,7 @@ class GenericMessageMapper {
|
|
|
34
34
|
qualifiedFrom: event.qualified_from,
|
|
35
35
|
fromClientId: event.data.sender,
|
|
36
36
|
from: event.from,
|
|
37
|
-
state: conversation_1.
|
|
37
|
+
state: conversation_1.MessageSendingState.INCOMING,
|
|
38
38
|
timestamp: new Date(event.time).getTime(),
|
|
39
39
|
id: genericMessage.messageId,
|
|
40
40
|
messageTimer: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageAdd.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,8BAA8B,EAAqB,MAAM,+BAA+B,CAAC;AAE/G,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,QAAA,MAAM,oBAAoB,UAAW,YAAY,4CACE,CAAC;AAEpD,UAAU,yBAA0B,SAAQ,kBAAkB;IAC5D,KAAK,EAAE,8BAA8B,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;CACxB;AACD,QAAA,MAAM,mBAAmB,kCAAuC,yBAAyB,
|
|
1
|
+
{"version":3,"file":"messageAdd.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,8BAA8B,EAAqB,MAAM,+BAA+B,CAAC;AAE/G,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,QAAA,MAAM,oBAAoB,UAAW,YAAY,4CACE,CAAC;AAEpD,UAAU,yBAA0B,SAAQ,kBAAkB;IAC5D,KAAK,EAAE,8BAA8B,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;CACxB;AACD,QAAA,MAAM,mBAAmB,kCAAuC,yBAAyB,uBA4CxF,CAAC;AAEF,OAAO,EAAC,oBAAoB,EAAE,mBAAmB,EAAC,CAAC"}
|
package/lib/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.js
CHANGED
|
@@ -54,10 +54,6 @@ const handleMLSMessageAdd = async ({ mlsService, event, logger }) => {
|
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
const decryptedData = protocol_messaging_1.GenericMessage.decode(message);
|
|
57
|
-
/**
|
|
58
|
-
* @todo Find a proper solution to add mappedEvent to this return
|
|
59
|
-
* otherwise event.data will be base64 raw data of the received event
|
|
60
|
-
*/
|
|
61
57
|
return {
|
|
62
58
|
event,
|
|
63
59
|
decryptedData,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BackendEvent } from '@wireapp/api-client/lib/event';
|
|
2
|
-
import {
|
|
2
|
+
import { NotificationSource } from '../../../notification';
|
|
3
3
|
import { MLSService } from '../MLSService/MLSService';
|
|
4
|
-
export { BackendEvent
|
|
4
|
+
export { BackendEvent };
|
|
5
5
|
export type EventHandlerParams = {
|
|
6
6
|
mlsService: MLSService;
|
|
7
7
|
event: BackendEvent;
|
|
8
|
-
source:
|
|
8
|
+
source: NotificationSource;
|
|
9
9
|
dryRun?: boolean;
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=EventHandler.types.d.ts.map
|