@wireapp/core 25.2.1 → 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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
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
+ # [25.3.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@25.2.1...@wireapp/core@25.3.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/core/issues/4260)) ([d7bf7c1](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/d7bf7c12dfe215e79f57cf99ad91cb7d05b36a12))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [25.2.1](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@25.2.0...@wireapp/core@25.2.1) (2022-05-11)
7
18
 
8
19
  **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": "19.1.1",
8
+ "@wireapp/api-client": "19.2.0",
9
9
  "@wireapp/cryptobox": "12.8.0",
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": "25.2.1",
73
- "gitHead": "3bcb0a0f2c4ddbdb5460827b4eb3b84cee05e939"
72
+ "version": "25.3.0",
73
+ "gitHead": "a8bf270b2a73f44d611bcb9bb2965dc24e6918a1"
74
74
  }
@@ -6,4 +6,6 @@ export declare class ClientBackendRepository {
6
6
  getClients(): Promise<RegisteredClient[]>;
7
7
  postClient(client: CreateClientPayload): Promise<RegisteredClient>;
8
8
  putClient(clientId: string, updates: UpdateClientPayload): Promise<void>;
9
+ deleteClient(clientId: string, password: string): Promise<void>;
10
+ uploadMLSKeyPackages(clientId: string, keyPackages: string[]): Promise<void>;
9
11
  }
@@ -32,6 +32,12 @@ class ClientBackendRepository {
32
32
  putClient(clientId, updates) {
33
33
  return this.apiClient.api.client.putClient(clientId, updates);
34
34
  }
35
+ deleteClient(clientId, password) {
36
+ return this.apiClient.api.client.deleteClient(clientId, password);
37
+ }
38
+ uploadMLSKeyPackages(clientId, keyPackages) {
39
+ return this.apiClient.api.client.uploadMLSKeyPackages(clientId, keyPackages);
40
+ }
35
41
  }
36
42
  exports.ClientBackendRepository = ClientBackendRepository;
37
43
  //# sourceMappingURL=ClientBackendRepository.js.map
@@ -20,6 +20,14 @@ export declare class ClientService {
20
20
  constructor(apiClient: APIClient, storeEngine: CRUDEngine, cryptographyService: CryptographyService);
21
21
  deleteLocalClient(): Promise<string>;
22
22
  getClients(): Promise<RegisteredClient[]>;
23
+ /**
24
+ * Will delete the given client from backend and will also delete it from the local database
25
+ * @param clientId The id of the client to delete
26
+ * @param password Password of the owning user
27
+ * @param isLocalClient Is the client also the client currently used by the app (as opposed to a client the user owns but not currenly in use)
28
+ * @returns Promise
29
+ */
30
+ deleteClient(clientId: string, password: string, isLocalClient?: boolean): Promise<unknown>;
23
31
  getLocalClient(): Promise<MetaClient>;
24
32
  createLocalClient(client: RegisteredClient, domain?: string): Promise<MetaClient>;
25
33
  synchronizeClients(): Promise<MetaClient[]>;
@@ -35,6 +35,20 @@ class ClientService {
35
35
  getClients() {
36
36
  return this.backend.getClients();
37
37
  }
38
+ /**
39
+ * Will delete the given client from backend and will also delete it from the local database
40
+ * @param clientId The id of the client to delete
41
+ * @param password Password of the owning user
42
+ * @param isLocalClient Is the client also the client currently used by the app (as opposed to a client the user owns but not currenly in use)
43
+ * @returns Promise
44
+ */
45
+ async deleteClient(clientId, password, isLocalClient = false) {
46
+ const userId = { id: this.apiClient.userId, domain: this.apiClient.domain || '' };
47
+ await this.backend.deleteClient(clientId, password);
48
+ return isLocalClient
49
+ ? this.database.deleteLocalClient()
50
+ : this.database.deleteClient(this.cryptographyService.constructSessionId(userId, clientId));
51
+ }
38
52
  getLocalClient() {
39
53
  return this.database.getLocalClient();
40
54
  }