@wireapp/core 21.0.0 → 22.1.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 +50 -0
- package/package.json +2 -2
- package/src/main/Account.d.ts +4 -4
- package/src/main/Account.js +2 -3
- package/src/main/broadcast/BroadcastService.d.ts +1 -1
- package/src/main/broadcast/BroadcastService.js +2 -1
- package/src/main/conversation/ConversationService.d.ts +5 -3
- package/src/main/conversation/ConversationService.js +7 -5
- package/src/main/cryptography/AssetCryptography/EncryptedAsset.d.ts +3 -4
- package/src/main/cryptography/AssetCryptography/crypto.browser.js +4 -4
- package/src/main/cryptography/AssetCryptography/index.d.ts +2 -3
- package/src/main/cryptography/AssetCryptography/index.js +1 -1
- package/src/main/cryptography/AssetCryptography/interfaces.d.ts +6 -7
- package/src/main/cryptography/CryptographyService.d.ts +4 -6
- package/src/main/cryptography/CryptographyService.js +3 -5
- package/src/main/user/UserService.d.ts +3 -3
- package/src/main/user/UserService.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,56 @@
|
|
|
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
|
+
# [22.1.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@22.0.0...@wireapp/core@22.1.0) (2022-02-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **core:** Enable mismatch hook into broadcast messages ([#4219](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/issues/4219)) ([55d8aad](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/55d8aad4519d708af7ed67a6a591d3f6ccd7f55a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [22.0.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@21.0.2...@wireapp/core@22.0.0) (2022-01-31)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **core:** Remove the need to give a domain to use qualified Ids ([#4217](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/issues/4217)) ([8ce58ea](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/8ce58eae8dcf86f66baccab3acfca7e3ba472e3c))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### BREAKING CHANGES
|
|
26
|
+
|
|
27
|
+
* **core:** If you were using the Account with a federationDomain, you need to replace federationDomain: 'the.domain' to useQualifiedIds: true. The domain will be found automatically by the core
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [21.0.2](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@21.0.1...@wireapp/core@21.0.2) (2022-01-19)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* **core:** Use Uint8Array in place of Buffer ([#4214](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/issues/4214)) ([d9c8692](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/d9c869291e60325411070b87f71d8803561bde49))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## [21.0.1](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@21.0.0...@wireapp/core@21.0.1) (2022-01-18)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* **core:** Improve types for setAvailability ([26da881](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/26da88113adf9eaba987ad22265df758231e5dc1))
|
|
50
|
+
* **core:** Improve types for setAvailability ([dcbada4](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/dcbada4e353296e17307baeac8d4b775158a1436))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
6
56
|
# [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
57
|
|
|
8
58
|
|
package/package.json
CHANGED
|
@@ -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": "22.1.0",
|
|
73
|
+
"gitHead": "97061d487f550a9bcb587ae730a61b9c16fbe074"
|
|
74
74
|
}
|
package/src/main/Account.d.ts
CHANGED
|
@@ -54,10 +54,11 @@ export interface Account {
|
|
|
54
54
|
}
|
|
55
55
|
export declare type StoreEngineProvider = (storeName: string) => Promise<CRUDEngine>;
|
|
56
56
|
declare type AccountConfig = {
|
|
57
|
-
|
|
57
|
+
/** If set to true, will use fully qualified ids and federated endpoints */
|
|
58
|
+
useQualifiedIds?: boolean;
|
|
58
59
|
};
|
|
59
60
|
export declare class Account extends EventEmitter {
|
|
60
|
-
private readonly config
|
|
61
|
+
private readonly config;
|
|
61
62
|
private readonly apiClient;
|
|
62
63
|
private readonly logger;
|
|
63
64
|
private readonly storeEngineProvider;
|
|
@@ -81,9 +82,8 @@ export declare class Account extends EventEmitter {
|
|
|
81
82
|
/**
|
|
82
83
|
* @param apiClient The apiClient instance to use in the core (will create a new new one if undefined)
|
|
83
84
|
* @param storeEngineProvider Used to store info in the database (will create a inMemory engine if undefined)
|
|
84
|
-
* @param config.federationDomain If using a federated backend this will set the default domain for qualified ids. Do not set if using a regular backend
|
|
85
85
|
*/
|
|
86
|
-
constructor(apiClient?: APIClient, storeEngineProvider?: StoreEngineProvider, config?: AccountConfig
|
|
86
|
+
constructor(apiClient?: APIClient, storeEngineProvider?: StoreEngineProvider, config?: AccountConfig);
|
|
87
87
|
private persistCookie;
|
|
88
88
|
get clientId(): string;
|
|
89
89
|
get userId(): string;
|
package/src/main/Account.js
CHANGED
|
@@ -71,9 +71,8 @@ class Account extends events_1.EventEmitter {
|
|
|
71
71
|
/**
|
|
72
72
|
* @param apiClient The apiClient instance to use in the core (will create a new new one if undefined)
|
|
73
73
|
* @param storeEngineProvider Used to store info in the database (will create a inMemory engine if undefined)
|
|
74
|
-
* @param config.federationDomain If using a federated backend this will set the default domain for qualified ids. Do not set if using a regular backend
|
|
75
74
|
*/
|
|
76
|
-
constructor(apiClient = new api_client_1.APIClient(), storeEngineProvider, config) {
|
|
75
|
+
constructor(apiClient = new api_client_1.APIClient(), storeEngineProvider, config = {}) {
|
|
77
76
|
super();
|
|
78
77
|
this.config = config;
|
|
79
78
|
this.handlePayload = async (payload) => {
|
|
@@ -157,7 +156,7 @@ class Account extends events_1.EventEmitter {
|
|
|
157
156
|
const connectionService = new connection_1.ConnectionService(this.apiClient);
|
|
158
157
|
const giphyService = new giphy_1.GiphyService(this.apiClient);
|
|
159
158
|
const linkPreviewService = new linkPreview_1.LinkPreviewService(assetService);
|
|
160
|
-
const conversationService = new conversation_1.ConversationService(this.apiClient, cryptographyService);
|
|
159
|
+
const conversationService = new conversation_1.ConversationService(this.apiClient, cryptographyService, this.config);
|
|
161
160
|
const notificationService = new notification_1.NotificationService(this.apiClient, cryptographyService, storeEngine);
|
|
162
161
|
const selfService = new self_1.SelfService(this.apiClient);
|
|
163
162
|
const teamService = new team_1.TeamService(this.apiClient);
|
|
@@ -16,5 +16,5 @@ export declare class BroadcastService {
|
|
|
16
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
17
|
*/
|
|
18
18
|
getPreKeyBundlesFromTeam(teamId: string, skipOwnClients?: boolean, onlyDirectConnections?: boolean): Promise<UserPreKeyBundleMap>;
|
|
19
|
-
broadcastGenericMessage(genericMessage: GenericMessage, recipients: UserPreKeyBundleMap | UserClients, sendAsProtobuf?: boolean): Promise<ClientMismatch>;
|
|
19
|
+
broadcastGenericMessage(genericMessage: GenericMessage, recipients: UserPreKeyBundleMap | UserClients, sendAsProtobuf?: boolean, onClientMismatch?: (mismatch: ClientMismatch) => void | boolean | Promise<boolean>): Promise<ClientMismatch>;
|
|
20
20
|
}
|
|
@@ -54,11 +54,12 @@ class BroadcastService {
|
|
|
54
54
|
return bundleMap;
|
|
55
55
|
}, {});
|
|
56
56
|
}
|
|
57
|
-
async broadcastGenericMessage(genericMessage, recipients, sendAsProtobuf) {
|
|
57
|
+
async broadcastGenericMessage(genericMessage, recipients, sendAsProtobuf, onClientMismatch) {
|
|
58
58
|
const plainTextArray = protocol_messaging_1.GenericMessage.encode(genericMessage).finish();
|
|
59
59
|
return this.messageService.sendMessage(this.apiClient.validatedClientId, recipients, plainTextArray, {
|
|
60
60
|
sendAsProtobuf,
|
|
61
61
|
reportMissing: Object.keys(recipients),
|
|
62
|
+
onClientMismatch,
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { APIClient } from '@wireapp/api-client';
|
|
3
2
|
import { MessageSendingStatus, Conversation, DefaultConversationRoleName, MutedStatus, QualifiedUserClients, UserClients, ClientMismatch } from '@wireapp/api-client/src/conversation';
|
|
4
3
|
import type { ConversationMemberLeaveEvent } from '@wireapp/api-client/src/event';
|
|
@@ -61,10 +60,13 @@ export interface MessageSendingCallbacks {
|
|
|
61
60
|
}
|
|
62
61
|
export declare class ConversationService {
|
|
63
62
|
private readonly apiClient;
|
|
63
|
+
private readonly config;
|
|
64
64
|
readonly messageTimer: MessageTimer;
|
|
65
65
|
private readonly messageService;
|
|
66
66
|
private selfConversationId?;
|
|
67
|
-
constructor(apiClient: APIClient, cryptographyService: CryptographyService
|
|
67
|
+
constructor(apiClient: APIClient, cryptographyService: CryptographyService, config: {
|
|
68
|
+
useQualifiedIds?: boolean;
|
|
69
|
+
});
|
|
68
70
|
private createEphemeral;
|
|
69
71
|
private getConversationQualifiedMembers;
|
|
70
72
|
/**
|
|
@@ -150,7 +152,7 @@ export declare class ConversationService {
|
|
|
150
152
|
createConversation(name: string, otherUserIds?: string | string[]): Promise<Conversation>;
|
|
151
153
|
getConversations(conversationId: string): Promise<Conversation>;
|
|
152
154
|
getConversations(conversationIds?: string[]): Promise<Conversation[]>;
|
|
153
|
-
getAsset({ assetId, assetToken, otrKey, sha256 }: RemoteData): Promise<
|
|
155
|
+
getAsset({ assetId, assetToken, otrKey, sha256 }: RemoteData): Promise<Uint8Array>;
|
|
154
156
|
getUnencryptedAsset(assetId: string, assetToken?: string): Promise<ArrayBuffer>;
|
|
155
157
|
addUser<T extends string | string[] | QualifiedId | QualifiedId[]>(conversationId: string, userIds: T): Promise<T>;
|
|
156
158
|
removeUser(conversationId: string, userId: string): Promise<string>;
|
|
@@ -35,8 +35,9 @@ var MessageTargetMode;
|
|
|
35
35
|
MessageTargetMode[MessageTargetMode["USERS_CLIENTS"] = 2] = "USERS_CLIENTS";
|
|
36
36
|
})(MessageTargetMode = exports.MessageTargetMode || (exports.MessageTargetMode = {}));
|
|
37
37
|
class ConversationService {
|
|
38
|
-
constructor(apiClient, cryptographyService) {
|
|
38
|
+
constructor(apiClient, cryptographyService, config) {
|
|
39
39
|
this.apiClient = apiClient;
|
|
40
|
+
this.config = config;
|
|
40
41
|
this.messageTimer = new conversation_2.MessageTimer();
|
|
41
42
|
this.messageService = new MessageService_1.MessageService(this.apiClient, cryptographyService);
|
|
42
43
|
}
|
|
@@ -138,7 +139,8 @@ class ConversationService {
|
|
|
138
139
|
if (!this.selfConversationId) {
|
|
139
140
|
const { userId } = this.apiClient.context;
|
|
140
141
|
const { qualified_id, id } = await this.apiClient.conversation.api.getConversation(userId);
|
|
141
|
-
this.
|
|
142
|
+
const domain = this.config.useQualifiedIds ? qualified_id.domain : '';
|
|
143
|
+
this.selfConversationId = { id, domain };
|
|
142
144
|
}
|
|
143
145
|
return this.selfConversationId;
|
|
144
146
|
}
|
|
@@ -633,9 +635,9 @@ class ConversationService {
|
|
|
633
635
|
const request = this.apiClient.asset.api.getAssetV3(assetId, assetToken);
|
|
634
636
|
const encryptedBuffer = (await request.response).buffer;
|
|
635
637
|
return (0, AssetCryptography_1.decryptAsset)({
|
|
636
|
-
cipherText:
|
|
637
|
-
keyBytes:
|
|
638
|
-
sha256:
|
|
638
|
+
cipherText: new Uint8Array(encryptedBuffer),
|
|
639
|
+
keyBytes: otrKey,
|
|
640
|
+
sha256: sha256,
|
|
639
641
|
});
|
|
640
642
|
}
|
|
641
643
|
async getUnencryptedAsset(assetId, assetToken) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
export interface EncryptedAsset {
|
|
3
|
-
cipherText:
|
|
4
|
-
keyBytes:
|
|
2
|
+
cipherText: Uint8Array;
|
|
3
|
+
keyBytes: Uint8Array;
|
|
5
4
|
/** The SHA-256 sum of `cipherText` */
|
|
6
|
-
sha256:
|
|
5
|
+
sha256: Uint8Array;
|
|
7
6
|
}
|
|
8
7
|
export interface EncryptedAssetUploaded extends EncryptedAsset {
|
|
9
8
|
key: string;
|
|
@@ -23,22 +23,22 @@ const cryptoLib = window.crypto;
|
|
|
23
23
|
exports.crypto = {
|
|
24
24
|
async digest(cipherText) {
|
|
25
25
|
const checksum = await cryptoLib.subtle.digest('SHA-256', cipherText);
|
|
26
|
-
return
|
|
26
|
+
return new Uint8Array(checksum);
|
|
27
27
|
},
|
|
28
28
|
async decrypt(cipherText, keyBytes) {
|
|
29
29
|
const key = await cryptoLib.subtle.importKey('raw', keyBytes, 'AES-CBC', false, ['decrypt']);
|
|
30
30
|
const initializationVector = cipherText.slice(0, 16);
|
|
31
31
|
const assetCipherText = cipherText.slice(16);
|
|
32
32
|
const decipher = await cryptoLib.subtle.decrypt({ iv: initializationVector, name: 'AES-CBC' }, key, assetCipherText);
|
|
33
|
-
return
|
|
33
|
+
return new Uint8Array(decipher);
|
|
34
34
|
},
|
|
35
35
|
getRandomValues(size) {
|
|
36
|
-
return
|
|
36
|
+
return cryptoLib.getRandomValues(new Uint8Array(size));
|
|
37
37
|
},
|
|
38
38
|
async encrypt(plainText, keyBytes, initializationVector) {
|
|
39
39
|
const key = await cryptoLib.subtle.importKey('raw', keyBytes, 'AES-CBC', true, ['encrypt']);
|
|
40
40
|
return {
|
|
41
|
-
key:
|
|
41
|
+
key: new Uint8Array(await cryptoLib.subtle.exportKey('raw', key)),
|
|
42
42
|
cipher: await cryptoLib.subtle.encrypt({ iv: initializationVector, name: 'AES-CBC' }, key, plainText),
|
|
43
43
|
};
|
|
44
44
|
},
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { CipherOptions } from '@wireapp/api-client/src/asset';
|
|
3
2
|
import type { EncryptedAsset } from './EncryptedAsset';
|
|
4
3
|
interface EncryptOptions extends CipherOptions {
|
|
5
|
-
plainText:
|
|
4
|
+
plainText: Uint8Array;
|
|
6
5
|
}
|
|
7
|
-
export declare const decryptAsset: ({ cipherText, keyBytes, sha256: referenceSha256, }: EncryptedAsset) => Promise<
|
|
6
|
+
export declare const decryptAsset: ({ cipherText, keyBytes, sha256: referenceSha256, }: EncryptedAsset) => Promise<Uint8Array>;
|
|
8
7
|
export declare const encryptAsset: ({ plainText, algorithm }: EncryptOptions) => Promise<EncryptedAsset>;
|
|
9
8
|
export {};
|
|
@@ -44,7 +44,7 @@ const encryptAsset = async ({ plainText, algorithm = 'AES-256-CBC' }) => {
|
|
|
44
44
|
ivCipherText.set(new Uint8Array(cipher), initializationVector.byteLength);
|
|
45
45
|
const sha256 = await crypto_node_1.crypto.digest(ivCipherText);
|
|
46
46
|
return {
|
|
47
|
-
cipherText:
|
|
47
|
+
cipherText: ivCipherText,
|
|
48
48
|
keyBytes: key,
|
|
49
49
|
sha256,
|
|
50
50
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
export interface Crypto {
|
|
3
|
-
digest(cipherText:
|
|
4
|
-
decrypt(cipherText:
|
|
5
|
-
getRandomValues(size: number):
|
|
6
|
-
encrypt(plainText:
|
|
7
|
-
key:
|
|
8
|
-
cipher:
|
|
2
|
+
digest(cipherText: Uint8Array): Promise<Uint8Array>;
|
|
3
|
+
decrypt(cipherText: Uint8Array, keyBytes: Uint8Array): Promise<Uint8Array>;
|
|
4
|
+
getRandomValues(size: number): Uint8Array;
|
|
5
|
+
encrypt(plainText: Uint8Array, keyBytes: Uint8Array, initializationVector: Uint8Array, algorithm: string): Promise<{
|
|
6
|
+
key: Uint8Array;
|
|
7
|
+
cipher: Uint8Array;
|
|
9
8
|
}>;
|
|
10
9
|
}
|
|
@@ -13,17 +13,16 @@ export interface MetaClient extends RegisteredClient {
|
|
|
13
13
|
primary_key: string;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
declare type CryptographyServiceOptions = {
|
|
17
|
-
federationDomain?: string;
|
|
18
|
-
};
|
|
19
16
|
export declare class CryptographyService {
|
|
20
17
|
readonly apiClient: APIClient;
|
|
21
18
|
private readonly storeEngine;
|
|
22
|
-
private readonly
|
|
19
|
+
private readonly config;
|
|
23
20
|
private readonly logger;
|
|
24
21
|
cryptobox: Cryptobox;
|
|
25
22
|
private readonly database;
|
|
26
|
-
constructor(apiClient: APIClient, storeEngine: CRUDEngine,
|
|
23
|
+
constructor(apiClient: APIClient, storeEngine: CRUDEngine, config?: {
|
|
24
|
+
useQualifiedIds?: boolean;
|
|
25
|
+
});
|
|
27
26
|
static constructSessionId(userId: string, clientId: string, domain: string | null): string;
|
|
28
27
|
static convertArrayRecipientsToBase64(recipients: OTRRecipients<Uint8Array>): OTRRecipients<string>;
|
|
29
28
|
static convertBase64RecipientsToArray(recipients: OTRRecipients<string>): OTRRecipients<Uint8Array>;
|
|
@@ -43,4 +42,3 @@ export declare class CryptographyService {
|
|
|
43
42
|
resetSession(sessionId: string): Promise<void>;
|
|
44
43
|
decodeGenericMessage(otrMessage: ConversationOtrMessageAddEvent, source: PayloadBundleSource): Promise<PayloadBundle>;
|
|
45
44
|
}
|
|
46
|
-
export {};
|
|
@@ -32,17 +32,16 @@ const util_1 = require("../util");
|
|
|
32
32
|
const CryptographyDatabaseRepository_1 = require("./CryptographyDatabaseRepository");
|
|
33
33
|
const GenericMessageMapper_1 = require("./GenericMessageMapper");
|
|
34
34
|
class CryptographyService {
|
|
35
|
-
constructor(apiClient, storeEngine,
|
|
35
|
+
constructor(apiClient, storeEngine, config = {}) {
|
|
36
36
|
this.apiClient = apiClient;
|
|
37
37
|
this.storeEngine = storeEngine;
|
|
38
|
-
this.
|
|
38
|
+
this.config = config;
|
|
39
39
|
this.cryptobox = new cryptobox_1.Cryptobox(this.storeEngine);
|
|
40
40
|
this.database = new CryptographyDatabaseRepository_1.CryptographyDatabaseRepository(this.storeEngine);
|
|
41
41
|
this.logger = (0, logdown_1.default)('@wireapp/core/cryptography/CryptographyService', {
|
|
42
42
|
logger: console,
|
|
43
43
|
markdown: false,
|
|
44
44
|
});
|
|
45
|
-
this.options = options;
|
|
46
45
|
}
|
|
47
46
|
static constructSessionId(userId, clientId, domain) {
|
|
48
47
|
const baseId = `${userId}@${clientId}`;
|
|
@@ -147,9 +146,8 @@ class CryptographyService {
|
|
|
147
146
|
this.logger.log(`Deleted session ID "${sessionId}".`);
|
|
148
147
|
}
|
|
149
148
|
async decodeGenericMessage(otrMessage, source) {
|
|
150
|
-
var _a;
|
|
151
149
|
const { from, qualified_from, data: { sender, text: cipherText }, } = otrMessage;
|
|
152
|
-
const domain =
|
|
150
|
+
const domain = this.config.useQualifiedIds ? qualified_from.domain : null;
|
|
153
151
|
const sessionId = CryptographyService.constructSessionId(from, sender, domain);
|
|
154
152
|
const decryptedMessage = await this.decrypt(sessionId, cipherText);
|
|
155
153
|
const genericMessage = protocol_messaging_1.GenericMessage.decode(decryptedMessage);
|
|
@@ -18,8 +18,8 @@ export declare class UserService {
|
|
|
18
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
19
|
* @param options.sendAsProtobuf=false
|
|
20
20
|
*/
|
|
21
|
-
setAvailability(teamId: string, type: AvailabilityType, { sendAll, sendAsProtobuf }
|
|
22
|
-
sendAll
|
|
23
|
-
sendAsProtobuf?: boolean;
|
|
21
|
+
setAvailability(teamId: string, type: AvailabilityType, { sendAll, sendAsProtobuf }?: {
|
|
22
|
+
sendAll?: boolean | undefined;
|
|
23
|
+
sendAsProtobuf?: boolean | undefined;
|
|
24
24
|
}): Promise<void>;
|
|
25
25
|
}
|
|
@@ -51,7 +51,7 @@ class UserService {
|
|
|
51
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
52
|
* @param options.sendAsProtobuf=false
|
|
53
53
|
*/
|
|
54
|
-
async setAvailability(teamId, type, { sendAll = false, sendAsProtobuf = false }) {
|
|
54
|
+
async setAvailability(teamId, type, { sendAll = false, sendAsProtobuf = false } = {}) {
|
|
55
55
|
// Get pre-key bundles for members of your own team
|
|
56
56
|
const preKeyBundlesFromTeam = await this.broadcastService.getPreKeyBundlesFromTeam(teamId, false, !sendAll);
|
|
57
57
|
// Get pre-key bundles for all of your other 1:1 connections
|