@wireapp/core 20.6.2 → 21.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/CHANGELOG.md +46 -0
- package/package.json +3 -3
- package/src/main/broadcast/BroadcastService.d.ts +8 -1
- package/src/main/broadcast/BroadcastService.js +14 -3
- package/src/main/conversation/ConversationService.js +1 -0
- package/src/main/conversation/message/MessageToProtoMapper.js +1 -0
- package/src/main/linkPreview/LinkPreviewService.d.ts +1 -1
- package/src/main/linkPreview/LinkPreviewService.js +2 -2
- package/src/main/user/UserService.d.ts +11 -1
- package/src/main/user/UserService.js +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [21.0.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@20.7.2...@wireapp/core@21.0.0) (2022-01-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **core:** Send availability status only to directly connected members ([#4213](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/issues/4213)) ([73bad2f](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/73bad2fb8f75a473b686fa9273b1c03774afd5c7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* **core:** the setAvailability of the user service will by default now only send to directly connected users. To send to absolutely all the users in the team call `setAvailability` with the `{sendAll: true}` option
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [20.7.2](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@20.7.1...@wireapp/core@20.7.2) (2022-01-12)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @wireapp/core
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [20.7.1](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@20.7.0...@wireapp/core@20.7.1) (2022-01-12)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* **core:** Map domain for image asset messages ([d583feb](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/d583feb722a98d35c272fc862346ea7968cf0040))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# [20.7.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@20.6.2...@wireapp/core@20.7.0) (2022-01-12)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Features
|
|
45
|
+
|
|
46
|
+
* **core:** Enable link preview asset upload for federated env ([#4209](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/issues/4209)) ([232adaf](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/232adafa7f76a44889c661ee0750f7ea8f31df79))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
## [20.6.2](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@20.6.1...@wireapp/core@20.6.2) (2022-01-11)
|
|
7
53
|
|
|
8
54
|
**Note:** Version bump only for package @wireapp/core
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@types/long": "4.0.1",
|
|
7
7
|
"@types/node": "~14",
|
|
8
|
-
"@wireapp/api-client": "16.
|
|
8
|
+
"@wireapp/api-client": "16.6.0",
|
|
9
9
|
"@wireapp/cryptobox": "12.7.1",
|
|
10
10
|
"bazinga64": "5.10.0",
|
|
11
11
|
"hash.js": "1.1.7",
|
|
@@ -69,6 +69,6 @@
|
|
|
69
69
|
"test:project": "yarn dist && yarn test",
|
|
70
70
|
"test:node": "nyc jasmine --config=jasmine.json"
|
|
71
71
|
},
|
|
72
|
-
"version": "
|
|
73
|
-
"gitHead": "
|
|
72
|
+
"version": "21.0.0",
|
|
73
|
+
"gitHead": "0c11c749cae20f3a86839385aeb8486170598339"
|
|
74
74
|
}
|
|
@@ -8,6 +8,13 @@ export declare class BroadcastService {
|
|
|
8
8
|
private readonly cryptographyService;
|
|
9
9
|
private readonly messageService;
|
|
10
10
|
constructor(apiClient: APIClient, cryptographyService: CryptographyService);
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Will create a key bundle for all the users of the team
|
|
13
|
+
*
|
|
14
|
+
* @param teamId
|
|
15
|
+
* @param skipOwnClients=false
|
|
16
|
+
* @param onlyDirectConnections=false Will generate a bundle only for directly connected users (users the self user has conversation with). Allows avoiding broadcasting messages to too many people
|
|
17
|
+
*/
|
|
18
|
+
getPreKeyBundlesFromTeam(teamId: string, skipOwnClients?: boolean, onlyDirectConnections?: boolean): Promise<UserPreKeyBundleMap>;
|
|
12
19
|
broadcastGenericMessage(genericMessage: GenericMessage, recipients: UserPreKeyBundleMap | UserClients, sendAsProtobuf?: boolean): Promise<ClientMismatch>;
|
|
13
20
|
}
|
|
@@ -27,9 +27,20 @@ class BroadcastService {
|
|
|
27
27
|
this.cryptographyService = cryptographyService;
|
|
28
28
|
this.messageService = new MessageService_1.MessageService(this.apiClient, this.cryptographyService);
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Will create a key bundle for all the users of the team
|
|
32
|
+
*
|
|
33
|
+
* @param teamId
|
|
34
|
+
* @param skipOwnClients=false
|
|
35
|
+
* @param onlyDirectConnections=false Will generate a bundle only for directly connected users (users the self user has conversation with). Allows avoiding broadcasting messages to too many people
|
|
36
|
+
*/
|
|
37
|
+
async getPreKeyBundlesFromTeam(teamId, skipOwnClients = false, onlyDirectConnections = false) {
|
|
38
|
+
const teamMembers = onlyDirectConnections
|
|
39
|
+
? (await this.apiClient.conversation.api.getConversations()).conversations
|
|
40
|
+
.map(({ members }) => members.others.map(user => user.id).concat(members.self.id))
|
|
41
|
+
.flat()
|
|
42
|
+
: (await this.apiClient.teams.member.api.getAllMembers(teamId)).members.map(({ user }) => user);
|
|
43
|
+
let members = Array.from(new Set(teamMembers)).map(member => ({ id: member }));
|
|
33
44
|
if (skipOwnClients) {
|
|
34
45
|
const selfUser = await this.apiClient.self.api.getSelf();
|
|
35
46
|
members = members.filter(member => member.id !== selfUser.id);
|
|
@@ -3,5 +3,5 @@ import { LinkPreviewContent, LinkPreviewUploadedContent } from '../conversation/
|
|
|
3
3
|
export declare class LinkPreviewService {
|
|
4
4
|
private readonly assetService;
|
|
5
5
|
constructor(assetService: AssetService);
|
|
6
|
-
uploadLinkPreviewImage(linkPreview: LinkPreviewContent): Promise<LinkPreviewUploadedContent>;
|
|
6
|
+
uploadLinkPreviewImage(linkPreview: LinkPreviewContent, domain?: string): Promise<LinkPreviewUploadedContent>;
|
|
7
7
|
}
|
|
@@ -34,13 +34,13 @@ class LinkPreviewService {
|
|
|
34
34
|
constructor(assetService) {
|
|
35
35
|
this.assetService = assetService;
|
|
36
36
|
}
|
|
37
|
-
async uploadLinkPreviewImage(linkPreview) {
|
|
37
|
+
async uploadLinkPreviewImage(linkPreview, domain) {
|
|
38
38
|
const { image } = linkPreview, preview = __rest(linkPreview, ["image"]);
|
|
39
39
|
if (!image) {
|
|
40
40
|
return preview;
|
|
41
41
|
}
|
|
42
42
|
const uploadedLinkPreview = preview;
|
|
43
|
-
const asset = await (await this.assetService.uploadAsset(linkPreview.image.data)).response;
|
|
43
|
+
const asset = await (await this.assetService.uploadAsset(linkPreview.image.data, { domain })).response;
|
|
44
44
|
uploadedLinkPreview.imageUploaded = {
|
|
45
45
|
asset,
|
|
46
46
|
image,
|
|
@@ -11,5 +11,15 @@ export declare class UserService {
|
|
|
11
11
|
constructor(apiClient: APIClient, broadcastService: BroadcastService, conversationService: ConversationService, connectionService: ConnectionService);
|
|
12
12
|
getUser(userId: string | QualifiedId): Promise<User>;
|
|
13
13
|
getUsers(userIds: string[] | QualifiedId[]): Promise<User[]>;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Sends a availability update to members of the same team
|
|
16
|
+
* @param teamId
|
|
17
|
+
* @param type
|
|
18
|
+
* @param options.sendAll=false will broadcast the message to all the members of the team (instead of just direct connections). Should be avoided in a big team
|
|
19
|
+
* @param options.sendAsProtobuf=false
|
|
20
|
+
*/
|
|
21
|
+
setAvailability(teamId: string, type: AvailabilityType, { sendAll, sendAsProtobuf }: {
|
|
22
|
+
sendAll: boolean;
|
|
23
|
+
sendAsProtobuf?: boolean;
|
|
24
|
+
}): Promise<void>;
|
|
15
25
|
}
|
|
@@ -44,9 +44,16 @@ class UserService {
|
|
|
44
44
|
? this.apiClient.user.api.postListUsers({ qualified_ids: userIds })
|
|
45
45
|
: this.apiClient.user.api.getUsers({ ids: userIds });
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Sends a availability update to members of the same team
|
|
49
|
+
* @param teamId
|
|
50
|
+
* @param type
|
|
51
|
+
* @param options.sendAll=false will broadcast the message to all the members of the team (instead of just direct connections). Should be avoided in a big team
|
|
52
|
+
* @param options.sendAsProtobuf=false
|
|
53
|
+
*/
|
|
54
|
+
async setAvailability(teamId, type, { sendAll = false, sendAsProtobuf = false }) {
|
|
48
55
|
// Get pre-key bundles for members of your own team
|
|
49
|
-
const preKeyBundlesFromTeam = await this.broadcastService.getPreKeyBundlesFromTeam(teamId);
|
|
56
|
+
const preKeyBundlesFromTeam = await this.broadcastService.getPreKeyBundlesFromTeam(teamId, false, !sendAll);
|
|
50
57
|
// Get pre-key bundles for all of your other 1:1 connections
|
|
51
58
|
const connections = await this.connectionService.getConnections();
|
|
52
59
|
const acceptedConnections = connections.filter(connection => connection.status === connection_1.ConnectionStatus.ACCEPTED);
|