@wireapp/api-client 19.0.0 → 19.2.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
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
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
|
+
# [19.2.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/api-client/compare/@wireapp/api-client@19.1.1...@wireapp/api-client@19.2.0) (2022-05-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **api-client:** Add MLS clients endpoints ([#4260](https://github.com/wireapp/wire-web-packages/tree/main/packages/api-client/issues/4260)) ([d7bf7c1](https://github.com/wireapp/wire-web-packages/tree/main/packages/api-client/commit/d7bf7c12dfe215e79f57cf99ad91cb7d05b36a12))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [19.1.1](https://github.com/wireapp/wire-web-packages/tree/main/packages/api-client/compare/@wireapp/api-client@19.1.0...@wireapp/api-client@19.1.1) (2022-05-11)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* mls key package types ([5d2c02c](https://github.com/wireapp/wire-web-packages/tree/main/packages/api-client/commit/5d2c02cae30ff1e8bf9fc738d66788e1ebe52baa))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# [19.1.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/api-client/compare/@wireapp/api-client@19.0.0...@wireapp/api-client@19.1.0) (2022-05-11)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* Add MLS device creation types ([#4259](https://github.com/wireapp/wire-web-packages/tree/main/packages/api-client/issues/4259)) ([c88ed7c](https://github.com/wireapp/wire-web-packages/tree/main/packages/api-client/commit/c88ed7cf3804828b4fe8e56d842a6207abea4c2d))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
# [19.0.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/api-client/compare/@wireapp/api-client@18.8.3...@wireapp/api-client@19.0.0) (2022-04-21)
|
|
7
40
|
|
|
8
41
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PreKeyBundle } from '../auth/';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CreateClientPayload, RegisteredClient, UpdateClientPayload } from '../client/';
|
|
3
3
|
import { HttpClient } from '../http/';
|
|
4
4
|
import { ClientCapabilityData } from './ClientCapabilityData';
|
|
5
5
|
export declare class ClientAPI {
|
|
@@ -7,14 +7,27 @@ export declare class ClientAPI {
|
|
|
7
7
|
constructor(client: HttpClient);
|
|
8
8
|
static readonly URL: {
|
|
9
9
|
CLIENTS: string;
|
|
10
|
+
MLS_CLIENTS: string;
|
|
11
|
+
MLS_KEY_PACKAGES: string;
|
|
10
12
|
CAPABILITIES: string;
|
|
11
13
|
PREKEYS: string;
|
|
12
14
|
};
|
|
13
|
-
postClient(newClient:
|
|
14
|
-
putClient(clientId: string, updatedClient:
|
|
15
|
+
postClient(newClient: CreateClientPayload): Promise<RegisteredClient>;
|
|
16
|
+
putClient(clientId: string, updatedClient: UpdateClientPayload): Promise<void>;
|
|
15
17
|
getClientCapabilities(clientId: string): Promise<ClientCapabilityData>;
|
|
18
|
+
/**
|
|
19
|
+
* Deletes a client on the backend
|
|
20
|
+
* @param clientId
|
|
21
|
+
* @param password? password can be omitted if the client is a temporary client
|
|
22
|
+
*/
|
|
16
23
|
deleteClient(clientId: string, password?: string): Promise<void>;
|
|
17
24
|
getClient(clientId: string): Promise<RegisteredClient>;
|
|
18
25
|
getClients(): Promise<RegisteredClient[]>;
|
|
19
26
|
getClientPreKeys(clientId: string): Promise<PreKeyBundle>;
|
|
27
|
+
/**
|
|
28
|
+
* Will upload keypackages for an MLS capable client
|
|
29
|
+
* see https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_mls_key_packages_self__client_
|
|
30
|
+
* @param {string} clientId
|
|
31
|
+
*/
|
|
32
|
+
uploadMLSKeyPackages(clientId: string, keyPackages: string[]): Promise<void>;
|
|
20
33
|
}
|
package/src/client/ClientAPI.js
CHANGED
|
@@ -60,6 +60,11 @@ class ClientAPI {
|
|
|
60
60
|
const response = await this.client.sendJSON(config);
|
|
61
61
|
return response.data;
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Deletes a client on the backend
|
|
65
|
+
* @param clientId
|
|
66
|
+
* @param password? password can be omitted if the client is a temporary client
|
|
67
|
+
*/
|
|
63
68
|
async deleteClient(clientId, password) {
|
|
64
69
|
const config = {
|
|
65
70
|
data: {
|
|
@@ -94,10 +99,25 @@ class ClientAPI {
|
|
|
94
99
|
const response = await this.client.sendJSON(config, true);
|
|
95
100
|
return response.data;
|
|
96
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Will upload keypackages for an MLS capable client
|
|
104
|
+
* see https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_mls_key_packages_self__client_
|
|
105
|
+
* @param {string} clientId
|
|
106
|
+
*/
|
|
107
|
+
async uploadMLSKeyPackages(clientId, keyPackages) {
|
|
108
|
+
const config = {
|
|
109
|
+
data: { key_packages: keyPackages },
|
|
110
|
+
method: 'POST',
|
|
111
|
+
url: `/${ClientAPI.URL.MLS_CLIENTS}/${ClientAPI.URL.MLS_KEY_PACKAGES}/self/${clientId}`,
|
|
112
|
+
};
|
|
113
|
+
await this.client.sendJSON(config, true);
|
|
114
|
+
}
|
|
97
115
|
}
|
|
98
116
|
exports.ClientAPI = ClientAPI;
|
|
99
117
|
ClientAPI.URL = {
|
|
100
118
|
CLIENTS: '/clients',
|
|
119
|
+
MLS_CLIENTS: 'mls',
|
|
120
|
+
MLS_KEY_PACKAGES: 'key-packages',
|
|
101
121
|
CAPABILITIES: 'capabilities',
|
|
102
122
|
PREKEYS: 'prekeys',
|
|
103
123
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientAPI.js","sourceRoot":"","sources":["ClientAPI.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAMH,+CAA2D;AAC3D,mCAAqE;AAGrE,MAAa,SAAS;IACpB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"ClientAPI.js","sourceRoot":"","sources":["ClientAPI.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAMH,+CAA2D;AAC3D,mCAAqE;AAGrE,MAAa,SAAS;IACpB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAU5C,KAAK,CAAC,UAAU,CAAC,SAA8B;QACpD,MAAM,MAAM,GAAuB;YACjC,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,OAAO;SAC3B,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAmB,MAAM,CAAC,CAAC;QACtE,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,QAAgB,EAAE,aAAkC;QACzE,MAAM,MAAM,GAAuB;YACjC,IAAI,EAAE,aAAa;YACnB,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,OAAO,IAAI,QAAQ,EAAE;SAC5C,CAAC;QAEF,IAAI;YACF,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;SACpC;QAAC,OAAO,KAAK,EAAE;YACd,QAA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ientCapabilityData } from './ClientCapabilityData';
|
|
4
|
-
|
|
4
|
+
declare type BaseUpdatePayload = ClientCapabilityData & {
|
|
5
|
+
label?: string;
|
|
6
|
+
};
|
|
7
|
+
declare type MLSUpdatePayload = {
|
|
8
|
+
mls_public_keys: {
|
|
9
|
+
ed25519: string;
|
|
10
|
+
};
|
|
11
|
+
} & BaseUpdatePayload;
|
|
12
|
+
declare type ProteusUpdatePayload = {
|
|
5
13
|
label?: string;
|
|
6
14
|
lastkey: PreKey;
|
|
7
15
|
prekeys: PreKey[];
|
|
8
|
-
}
|
|
9
|
-
export
|
|
16
|
+
} & BaseUpdatePayload;
|
|
17
|
+
export declare type UpdateClientPayload = Partial<ProteusUpdatePayload | MLSUpdatePayload>;
|
|
18
|
+
export declare type CreateClientPayload = {
|
|
10
19
|
class: ClientClassification.DESKTOP | ClientClassification.PHONE | ClientClassification.TABLET;
|
|
11
20
|
cookie: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
lastkey: PreKey;
|
|
23
|
+
prekeys: PreKey[];
|
|
12
24
|
location?: Location;
|
|
13
25
|
model?: string;
|
|
14
26
|
password?: string;
|
|
15
27
|
verification_code?: string;
|
|
16
28
|
type: ClientType.PERMANENT | ClientType.TEMPORARY;
|
|
17
|
-
}
|
|
18
|
-
export declare type UpdatedClient = Partial<SharedClientModel & ClientCapabilityData>;
|
|
29
|
+
};
|
|
19
30
|
export {};
|