@wireapp/core 25.2.0 → 25.3.1

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,33 @@
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.1](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@25.3.0...@wireapp/core@25.3.1) (2022-05-16)
7
+
8
+ **Note:** Version bump only for package @wireapp/core
9
+
10
+
11
+
12
+
13
+
14
+ # [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)
15
+
16
+
17
+ ### Features
18
+
19
+ * **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))
20
+
21
+
22
+
23
+
24
+
25
+ ## [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)
26
+
27
+ **Note:** Version bump only for package @wireapp/core
28
+
29
+
30
+
31
+
32
+
6
33
  # [25.2.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@25.1.0...@wireapp/core@25.2.0) (2022-05-11)
7
34
 
8
35
 
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.0",
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.0",
73
- "gitHead": "6b8615b767fff8ff51149bd2014fb9e777327628"
72
+ "version": "25.3.1",
73
+ "gitHead": "53e7ce7b1e5d68e425b128555e19e3203a5292c9"
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
@@ -35,7 +35,7 @@ class ClientDatabaseRepository {
35
35
  return this.storeEngine.read(ClientDatabaseRepository.STORES.CLIENTS, sessionId);
36
36
  }
37
37
  deleteLocalClient() {
38
- return this.storeEngine.delete(ClientDatabaseRepository.STORES.CLIENTS, ClientDatabaseRepository.KEYS.LOCAL_IDENTITY);
38
+ return this.deleteClient(ClientDatabaseRepository.KEYS.LOCAL_IDENTITY);
39
39
  }
40
40
  deleteClient(sessionId) {
41
41
  return this.storeEngine.delete(ClientDatabaseRepository.STORES.CLIENTS, sessionId);
@@ -18,8 +18,21 @@ export declare class ClientService {
18
18
  private readonly database;
19
19
  private readonly backend;
20
20
  constructor(apiClient: APIClient, storeEngine: CRUDEngine, cryptographyService: CryptographyService);
21
- deleteLocalClient(): Promise<string>;
22
21
  getClients(): Promise<RegisteredClient[]>;
22
+ /**
23
+ * Will delete the given client from backend and will also delete it from the local database
24
+ *
25
+ * note: use deleteLocalClient if you wish to delete the client currently used by the user
26
+ *
27
+ * @param clientId The id of the client to delete
28
+ * @param password? Password of the owning user. Can be omitted for temporary devices
29
+ */
30
+ deleteClient(clientId: string, password?: string): Promise<unknown>;
31
+ /**
32
+ * Will delete the local client (client currently in use by the user) from backend and will also delete it from the local database
33
+ * @param password? Password of the owning user. Can be omitted for temporary devices
34
+ */
35
+ deleteLocalClient(password?: string): Promise<string>;
23
36
  getLocalClient(): Promise<MetaClient>;
24
37
  createLocalClient(client: RegisteredClient, domain?: string): Promise<MetaClient>;
25
38
  synchronizeClients(): Promise<MetaClient[]>;
@@ -29,12 +29,35 @@ class ClientService {
29
29
  this.database = new _1.ClientDatabaseRepository(this.storeEngine, this.cryptographyService);
30
30
  this.backend = new _1.ClientBackendRepository(this.apiClient);
31
31
  }
32
- deleteLocalClient() {
33
- return this.database.deleteLocalClient();
34
- }
35
32
  getClients() {
36
33
  return this.backend.getClients();
37
34
  }
35
+ /**
36
+ * Will delete the given client from backend and will also delete it from the local database
37
+ *
38
+ * note: use deleteLocalClient if you wish to delete the client currently used by the user
39
+ *
40
+ * @param clientId The id of the client to delete
41
+ * @param password? Password of the owning user. Can be omitted for temporary devices
42
+ */
43
+ async deleteClient(clientId, password) {
44
+ const userId = { id: this.apiClient.userId, domain: this.apiClient.domain || '' };
45
+ await this.backend.deleteClient(clientId, password);
46
+ return this.database.deleteClient(this.cryptographyService.constructSessionId(userId, clientId));
47
+ }
48
+ /**
49
+ * Will delete the local client (client currently in use by the user) from backend and will also delete it from the local database
50
+ * @param password? Password of the owning user. Can be omitted for temporary devices
51
+ */
52
+ async deleteLocalClient(password) {
53
+ var _a;
54
+ const localClientId = (_a = this.apiClient.context) === null || _a === void 0 ? void 0 : _a.clientId;
55
+ if (!localClientId) {
56
+ throw new Error('Trying to delete local client, but local client has not been set');
57
+ }
58
+ await this.backend.deleteClient(localClientId, password);
59
+ return this.database.deleteLocalClient();
60
+ }
38
61
  getLocalClient() {
39
62
  return this.database.getLocalClient();
40
63
  }