@wireapp/api-client 25.2.3 → 25.3.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/APIClient.js
CHANGED
|
@@ -137,7 +137,7 @@ class APIClient extends events_1.EventEmitter {
|
|
|
137
137
|
domain: (_a = responsePayload === null || responsePayload === void 0 ? void 0 : responsePayload.domain) !== null && _a !== void 0 ? _a : '',
|
|
138
138
|
federationEndpoints: backendVersion > 0,
|
|
139
139
|
isFederated: (responsePayload === null || responsePayload === void 0 ? void 0 : responsePayload.federation) || false,
|
|
140
|
-
supportsMLS: backendVersion >=
|
|
140
|
+
supportsMLS: backendVersion >= 4,
|
|
141
141
|
supportsGuestLinksWithPassword: backendVersion >= 4,
|
|
142
142
|
};
|
|
143
143
|
}
|
|
@@ -49,16 +49,18 @@ export declare class ClientAPI {
|
|
|
49
49
|
* Claim one key package for each client of the given user
|
|
50
50
|
* @param {string} userId The user to claim the key packages for
|
|
51
51
|
* @param {string} userDomain The domain of the user
|
|
52
|
+
* @param {string} ciphersuite Ciphersuite in hex format (e.g. 0xf031)
|
|
52
53
|
* @param {string} skipOwn Do not claim a key package for the given own client id
|
|
53
54
|
* @see https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_mls_key_packages_claim__user_domain___user_
|
|
54
55
|
*/
|
|
55
|
-
claimMLSKeyPackages(userId: string, userDomain: string, skipOwn?: string): Promise<ClaimedKeyPackages>;
|
|
56
|
+
claimMLSKeyPackages(userId: string, userDomain: string, ciphersuite: string, skipOwn?: string): Promise<ClaimedKeyPackages>;
|
|
56
57
|
/**
|
|
57
58
|
* Get the number of unused key packages for the given client
|
|
58
59
|
* @param {string} clientId
|
|
60
|
+
* @param {string} ciphersuite Ciphersuite in hex format (e.g. 0xf031)
|
|
59
61
|
* @see https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/get_mls_key_packages_self__client__count
|
|
60
62
|
*/
|
|
61
|
-
getMLSKeyPackageCount(clientId: string): Promise<number>;
|
|
63
|
+
getMLSKeyPackageCount(clientId: string, ciphersuite: string): Promise<number>;
|
|
62
64
|
/**
|
|
63
65
|
* Get the public keys from the backend, used for removing users from groups.
|
|
64
66
|
* In the future this may be used for other purposes as well.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientAPI.d.ts","sourceRoot":"","sources":["../../src/client/ClientAPI.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAI5D,OAAO,EAAC,mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB,EAAC,MAAM,YAAY,CAAC;AACtF,OAAO,EAAkC,UAAU,EAAC,MAAM,UAAU,CAAC;AAErE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,EAAE;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;CACL,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE;QACP,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,gBAAuB,GAAG;;;;;;;MAOxB;IAEW,UAAU,CAAC,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAWrE,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB9E,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAUnF;;;;OAIG;IACU,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,G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B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAUnF;;;;OAIG;IACU,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYhE,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAUtD,UAAU,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAUzC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAUlE;;;;;OAKG;IACU,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE;IAUzE;;;;;;;OAOG;IACU,mBAAmB,CAC9B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,kBAAkB,CAAC;IAe9B;;;;;OAKG;IACU,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAa1F;;;;OAIG;IACU,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC;CASlD"}
|
package/lib/client/ClientAPI.js
CHANGED
|
@@ -117,13 +117,17 @@ class ClientAPI {
|
|
|
117
117
|
* Claim one key package for each client of the given user
|
|
118
118
|
* @param {string} userId The user to claim the key packages for
|
|
119
119
|
* @param {string} userDomain The domain of the user
|
|
120
|
+
* @param {string} ciphersuite Ciphersuite in hex format (e.g. 0xf031)
|
|
120
121
|
* @param {string} skipOwn Do not claim a key package for the given own client id
|
|
121
122
|
* @see https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_mls_key_packages_claim__user_domain___user_
|
|
122
123
|
*/
|
|
123
|
-
async claimMLSKeyPackages(userId, userDomain, skipOwn) {
|
|
124
|
+
async claimMLSKeyPackages(userId, userDomain, ciphersuite, skipOwn) {
|
|
124
125
|
const config = {
|
|
125
126
|
method: 'POST',
|
|
126
127
|
url: `/${ClientAPI.URL.MLS_CLIENTS}/${ClientAPI.URL.MLS_KEY_PACKAGES}/claim/${userDomain}/${userId}${skipOwn ? `?skip_own=${skipOwn}` : ''}`,
|
|
128
|
+
params: {
|
|
129
|
+
ciphersuite,
|
|
130
|
+
},
|
|
127
131
|
};
|
|
128
132
|
const response = await this.client.sendJSON(config, true);
|
|
129
133
|
return response.data;
|
|
@@ -131,12 +135,16 @@ class ClientAPI {
|
|
|
131
135
|
/**
|
|
132
136
|
* Get the number of unused key packages for the given client
|
|
133
137
|
* @param {string} clientId
|
|
138
|
+
* @param {string} ciphersuite Ciphersuite in hex format (e.g. 0xf031)
|
|
134
139
|
* @see https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/get_mls_key_packages_self__client__count
|
|
135
140
|
*/
|
|
136
|
-
async getMLSKeyPackageCount(clientId) {
|
|
141
|
+
async getMLSKeyPackageCount(clientId, ciphersuite) {
|
|
137
142
|
const config = {
|
|
138
143
|
method: 'GET',
|
|
139
144
|
url: `/${ClientAPI.URL.MLS_CLIENTS}/${ClientAPI.URL.MLS_KEY_PACKAGES}/self/${clientId}/count`,
|
|
145
|
+
params: {
|
|
146
|
+
ciphersuite,
|
|
147
|
+
},
|
|
140
148
|
};
|
|
141
149
|
const response = await this.client.sendJSON(config, true);
|
|
142
150
|
return response.data.count;
|
package/package.json
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"@wireapp/commons": "^5.1.0",
|
|
17
17
|
"@wireapp/priority-queue": "^2.1.1",
|
|
18
18
|
"@wireapp/protocol-messaging": "1.44.0",
|
|
19
|
-
"axios": "1.
|
|
20
|
-
"axios-retry": "3.6.
|
|
19
|
+
"axios": "1.5.0",
|
|
20
|
+
"axios-retry": "3.6.1",
|
|
21
21
|
"http-status-codes": "2.2.0",
|
|
22
22
|
"logdown": "3.3.1",
|
|
23
23
|
"reconnecting-websocket": "4.4.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@wireapp/store-engine": "^5.1.1",
|
|
38
38
|
"@wireapp/store-engine-fs": "^3.1.1",
|
|
39
39
|
"browser-sync": "2.29.3",
|
|
40
|
-
"concurrently": "8.2.
|
|
40
|
+
"concurrently": "8.2.1",
|
|
41
41
|
"cross-env": "7.0.3",
|
|
42
42
|
"dotenv": "16.3.1",
|
|
43
43
|
"jest": "^29.2.1",
|
|
@@ -63,6 +63,6 @@
|
|
|
63
63
|
"watch": "webpack serve --config webpack.browser.js",
|
|
64
64
|
"prepare": "yarn dist"
|
|
65
65
|
},
|
|
66
|
-
"version": "25.
|
|
67
|
-
"gitHead": "
|
|
66
|
+
"version": "25.3.0",
|
|
67
|
+
"gitHead": "8e388941eab6dd435725cf1fe8d72181c20c1813"
|
|
68
68
|
}
|