@wireapp/core 31.1.0 → 31.1.3

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.
Files changed (227) hide show
  1. package/package.json +7 -7
  2. package/src/main/Account.d.ts +0 -214
  3. package/src/main/Account.js +0 -463
  4. package/src/main/CoreError.d.ts +0 -9
  5. package/src/main/CoreError.js +0 -26
  6. package/src/main/account/AccountService.d.ts +0 -7
  7. package/src/main/account/AccountService.js +0 -33
  8. package/src/main/account/AccountService.js.map +0 -1
  9. package/src/main/account/index.d.ts +0 -1
  10. package/src/main/account/index.js +0 -36
  11. package/src/main/account/index.js.map +0 -1
  12. package/src/main/auth/LoginSanitizer.d.ts +0 -5
  13. package/src/main/auth/LoginSanitizer.js +0 -41
  14. package/src/main/auth/index.d.ts +0 -1
  15. package/src/main/auth/index.js +0 -36
  16. package/src/main/broadcast/AvailabilityType.d.ts +0 -2
  17. package/src/main/broadcast/AvailabilityType.js +0 -21
  18. package/src/main/broadcast/BroadcastService.d.ts +0 -24
  19. package/src/main/broadcast/BroadcastService.js +0 -74
  20. package/src/main/broadcast/index.d.ts +0 -2
  21. package/src/main/broadcast/index.js +0 -37
  22. package/src/main/client/ClientBackendRepository.d.ts +0 -11
  23. package/src/main/client/ClientBackendRepository.js +0 -43
  24. package/src/main/client/ClientDatabaseRepository.d.ts +0 -27
  25. package/src/main/client/ClientDatabaseRepository.js +0 -85
  26. package/src/main/client/ClientInfo.d.ts +0 -8
  27. package/src/main/client/ClientInfo.js +0 -21
  28. package/src/main/client/ClientService.d.ts +0 -40
  29. package/src/main/client/ClientService.js +0 -103
  30. package/src/main/client/index.d.ts +0 -4
  31. package/src/main/client/index.js +0 -39
  32. package/src/main/connection/ConnectionService.d.ts +0 -11
  33. package/src/main/connection/ConnectionService.js +0 -45
  34. package/src/main/connection/index.d.ts +0 -1
  35. package/src/main/connection/index.js +0 -36
  36. package/src/main/conversation/AbortReason.d.ts +0 -2
  37. package/src/main/conversation/AbortReason.js +0 -21
  38. package/src/main/conversation/AssetService/AssetService.d.ts +0 -62
  39. package/src/main/conversation/AssetService/AssetService.js +0 -88
  40. package/src/main/conversation/AssetService/index.d.ts +0 -1
  41. package/src/main/conversation/AssetService/index.js +0 -36
  42. package/src/main/conversation/AssetTransferState.d.ts +0 -4
  43. package/src/main/conversation/AssetTransferState.js +0 -27
  44. package/src/main/conversation/ClientActionType.d.ts +0 -1
  45. package/src/main/conversation/ClientActionType.js +0 -24
  46. package/src/main/conversation/ConversationMapper/ConversationMapper.d.ts +0 -6
  47. package/src/main/conversation/ConversationMapper/ConversationMapper.js +0 -57
  48. package/src/main/conversation/ConversationMapper/index.d.ts +0 -1
  49. package/src/main/conversation/ConversationMapper/index.js +0 -36
  50. package/src/main/conversation/ConversationService/ConversationService.d.ts +0 -149
  51. package/src/main/conversation/ConversationService/ConversationService.js +0 -584
  52. package/src/main/conversation/ConversationService/ConversationService.types.d.ts +0 -110
  53. package/src/main/conversation/ConversationService/ConversationService.types.js +0 -28
  54. package/src/main/conversation/ConversationService/index.d.ts +0 -2
  55. package/src/main/conversation/ConversationService/index.js +0 -37
  56. package/src/main/conversation/ConversationService/messageGenerator.d.ts +0 -9
  57. package/src/main/conversation/ConversationService/messageGenerator.js +0 -313
  58. package/src/main/conversation/GenericMessageType.d.ts +0 -25
  59. package/src/main/conversation/GenericMessageType.js +0 -49
  60. package/src/main/conversation/MessageTimer/MessageTimer.d.ts +0 -10
  61. package/src/main/conversation/MessageTimer/MessageTimer.js +0 -54
  62. package/src/main/conversation/MessageTimer/index.d.ts +0 -1
  63. package/src/main/conversation/MessageTimer/index.js +0 -36
  64. package/src/main/conversation/ReactionType.d.ts +0 -4
  65. package/src/main/conversation/ReactionType.js +0 -27
  66. package/src/main/conversation/content/AssetContent.d.ts +0 -42
  67. package/src/main/conversation/content/AssetContent.js +0 -21
  68. package/src/main/conversation/content/ButtonActionConfirmationContent.d.ts +0 -2
  69. package/src/main/conversation/content/ButtonActionConfirmationContent.js +0 -21
  70. package/src/main/conversation/content/ButtonActionContent.d.ts +0 -2
  71. package/src/main/conversation/content/ButtonActionContent.js +0 -21
  72. package/src/main/conversation/content/CallingContent.d.ts +0 -1
  73. package/src/main/conversation/content/CallingContent.js +0 -21
  74. package/src/main/conversation/content/ClearedContent.d.ts +0 -2
  75. package/src/main/conversation/content/ClearedContent.js +0 -21
  76. package/src/main/conversation/content/ClientActionContent.d.ts +0 -2
  77. package/src/main/conversation/content/ClientActionContent.js +0 -21
  78. package/src/main/conversation/content/ClientAddContent.d.ts +0 -4
  79. package/src/main/conversation/content/ClientAddContent.js +0 -21
  80. package/src/main/conversation/content/ClientRemoveContent.d.ts +0 -6
  81. package/src/main/conversation/content/ClientRemoveContent.js +0 -21
  82. package/src/main/conversation/content/CompositeContent.d.ts +0 -2
  83. package/src/main/conversation/content/CompositeContent.js +0 -21
  84. package/src/main/conversation/content/ConfirmationContent.d.ts +0 -2
  85. package/src/main/conversation/content/ConfirmationContent.js +0 -21
  86. package/src/main/conversation/content/ContentType.d.ts +0 -21
  87. package/src/main/conversation/content/ContentType.js +0 -94
  88. package/src/main/conversation/content/ConversationContent.d.ts +0 -3
  89. package/src/main/conversation/content/ConversationContent.js +0 -21
  90. package/src/main/conversation/content/DeletedContent.d.ts +0 -2
  91. package/src/main/conversation/content/DeletedContent.js +0 -21
  92. package/src/main/conversation/content/EditedTextContent.d.ts +0 -11
  93. package/src/main/conversation/content/EditedTextContent.js +0 -21
  94. package/src/main/conversation/content/FileContent.d.ts +0 -13
  95. package/src/main/conversation/content/FileContent.js +0 -21
  96. package/src/main/conversation/content/HiddenContent.d.ts +0 -2
  97. package/src/main/conversation/content/HiddenContent.js +0 -21
  98. package/src/main/conversation/content/ImageContent.d.ts +0 -7
  99. package/src/main/conversation/content/ImageContent.js +0 -21
  100. package/src/main/conversation/content/KnockContent.d.ts +0 -2
  101. package/src/main/conversation/content/KnockContent.js +0 -21
  102. package/src/main/conversation/content/LinkPreviewContent.d.ts +0 -10
  103. package/src/main/conversation/content/LinkPreviewContent.js +0 -21
  104. package/src/main/conversation/content/LocationContent.d.ts +0 -9
  105. package/src/main/conversation/content/LocationContent.js +0 -21
  106. package/src/main/conversation/content/MentionContent.d.ts +0 -2
  107. package/src/main/conversation/content/MentionContent.js +0 -21
  108. package/src/main/conversation/content/QuoteContent.d.ts +0 -7
  109. package/src/main/conversation/content/QuoteContent.js +0 -21
  110. package/src/main/conversation/content/ReactionContent.d.ts +0 -7
  111. package/src/main/conversation/content/ReactionContent.js +0 -21
  112. package/src/main/conversation/content/TextContent.d.ts +0 -9
  113. package/src/main/conversation/content/TextContent.js +0 -21
  114. package/src/main/conversation/content/TweetContent.d.ts +0 -2
  115. package/src/main/conversation/content/TweetContent.js +0 -21
  116. package/src/main/conversation/content/index.d.ts +0 -28
  117. package/src/main/conversation/content/index.js +0 -76
  118. package/src/main/conversation/index.d.ts +0 -9
  119. package/src/main/conversation/index.js +0 -44
  120. package/src/main/conversation/message/CompositeContentBuilder.d.ts +0 -14
  121. package/src/main/conversation/message/CompositeContentBuilder.js +0 -54
  122. package/src/main/conversation/message/Message.d.ts +0 -4
  123. package/src/main/conversation/message/Message.js +0 -21
  124. package/src/main/conversation/message/MessageBuilder.d.ts +0 -96
  125. package/src/main/conversation/message/MessageBuilder.js +0 -125
  126. package/src/main/conversation/message/MessageService.d.ts +0 -67
  127. package/src/main/conversation/message/MessageService.js +0 -293
  128. package/src/main/conversation/message/MessageToProtoMapper.d.ts +0 -7
  129. package/src/main/conversation/message/MessageToProtoMapper.js +0 -99
  130. package/src/main/conversation/message/OtrMessage.d.ts +0 -80
  131. package/src/main/conversation/message/OtrMessage.js +0 -21
  132. package/src/main/conversation/message/PayloadBundle.d.ts +0 -76
  133. package/src/main/conversation/message/PayloadBundle.js +0 -81
  134. package/src/main/conversation/message/TeamMessage.d.ts +0 -31
  135. package/src/main/conversation/message/TeamMessage.js +0 -21
  136. package/src/main/conversation/message/TextContentBuilder.d.ts +0 -13
  137. package/src/main/conversation/message/TextContentBuilder.js +0 -75
  138. package/src/main/conversation/message/UserClientsUtil.d.ts +0 -22
  139. package/src/main/conversation/message/UserClientsUtil.js +0 -38
  140. package/src/main/conversation/message/UserMessage.d.ts +0 -43
  141. package/src/main/conversation/message/UserMessage.js +0 -21
  142. package/src/main/conversation/message/messageSender.d.ts +0 -4
  143. package/src/main/conversation/message/messageSender.js +0 -36
  144. package/src/main/cryptography/AssetCryptography/EncryptedAsset.d.ts +0 -11
  145. package/src/main/cryptography/AssetCryptography/EncryptedAsset.js +0 -21
  146. package/src/main/cryptography/AssetCryptography/crypto.browser.d.ts +0 -2
  147. package/src/main/cryptography/AssetCryptography/crypto.browser.js +0 -46
  148. package/src/main/cryptography/AssetCryptography/crypto.node.d.ts +0 -2
  149. package/src/main/cryptography/AssetCryptography/crypto.node.js +0 -72
  150. package/src/main/cryptography/AssetCryptography/index.d.ts +0 -8
  151. package/src/main/cryptography/AssetCryptography/index.js +0 -53
  152. package/src/main/cryptography/AssetCryptography/interfaces.d.ts +0 -9
  153. package/src/main/cryptography/AssetCryptography/interfaces.js +0 -21
  154. package/src/main/cryptography/CryptographyDatabaseRepository.d.ts +0 -16
  155. package/src/main/cryptography/CryptographyDatabaseRepository.js +0 -44
  156. package/src/main/cryptography/CryptographyService.d.ts +0 -52
  157. package/src/main/cryptography/CryptographyService.js +0 -205
  158. package/src/main/cryptography/GenericMessageMapper.d.ts +0 -6
  159. package/src/main/cryptography/GenericMessageMapper.js +0 -160
  160. package/src/main/cryptography/MessageHashService.d.ts +0 -16
  161. package/src/main/cryptography/MessageHashService.js +0 -118
  162. package/src/main/cryptography/SessionPayloadBundle.d.ts +0 -4
  163. package/src/main/cryptography/SessionPayloadBundle.js +0 -21
  164. package/src/main/cryptography/index.d.ts +0 -4
  165. package/src/main/cryptography/index.js +0 -39
  166. package/src/main/giphy/GiphyService.d.ts +0 -9
  167. package/src/main/giphy/GiphyService.js +0 -37
  168. package/src/main/giphy/index.d.ts +0 -1
  169. package/src/main/giphy/index.js +0 -36
  170. package/src/main/index.d.ts +0 -17
  171. package/src/main/index.js +0 -59
  172. package/src/main/linkPreview/LinkPreviewService.d.ts +0 -7
  173. package/src/main/linkPreview/LinkPreviewService.js +0 -52
  174. package/src/main/linkPreview/index.d.ts +0 -1
  175. package/src/main/linkPreview/index.js +0 -36
  176. package/src/main/mls/MLSService/MLSService.d.ts +0 -39
  177. package/src/main/mls/MLSService/MLSService.js +0 -181
  178. package/src/main/mls/index.d.ts +0 -1
  179. package/src/main/mls/index.js +0 -36
  180. package/src/main/mls/keyMaterialUpdatesStore/index.d.ts +0 -1
  181. package/src/main/mls/keyMaterialUpdatesStore/index.js +0 -36
  182. package/src/main/mls/keyMaterialUpdatesStore/keyMaterialUpdatesStore.d.ts +0 -9
  183. package/src/main/mls/keyMaterialUpdatesStore/keyMaterialUpdatesStore.js +0 -51
  184. package/src/main/mls/keyPackagesStatusStore/keyPackagesStatusStore.d.ts +0 -7
  185. package/src/main/mls/keyPackagesStatusStore/keyPackagesStatusStore.js +0 -42
  186. package/src/main/mls/types.d.ts +0 -33
  187. package/src/main/mls/types.js +0 -21
  188. package/src/main/notification/NotificationBackendRepository.d.ts +0 -11
  189. package/src/main/notification/NotificationBackendRepository.js +0 -34
  190. package/src/main/notification/NotificationDatabaseRepository.d.ts +0 -42
  191. package/src/main/notification/NotificationDatabaseRepository.js +0 -97
  192. package/src/main/notification/NotificationService.d.ts +0 -129
  193. package/src/main/notification/NotificationService.js +0 -501
  194. package/src/main/notification/index.d.ts +0 -1
  195. package/src/main/notification/index.js +0 -36
  196. package/src/main/notification/types.d.ts +0 -16
  197. package/src/main/notification/types.js +0 -21
  198. package/src/main/self/SelfService.d.ts +0 -13
  199. package/src/main/self/SelfService.js +0 -55
  200. package/src/main/self/index.d.ts +0 -1
  201. package/src/main/self/index.js +0 -36
  202. package/src/main/team/TeamService.d.ts +0 -15
  203. package/src/main/team/TeamService.js +0 -55
  204. package/src/main/team/index.d.ts +0 -1
  205. package/src/main/team/index.js +0 -36
  206. package/src/main/test/CryptographyHelper.d.ts +0 -4
  207. package/src/main/test/CryptographyHelper.js +0 -69
  208. package/src/main/test/PayloadHelper.d.ts +0 -3
  209. package/src/main/test/PayloadHelper.js +0 -66
  210. package/src/main/user/UserMapper.d.ts +0 -5
  211. package/src/main/user/UserMapper.js +0 -88
  212. package/src/main/user/UserService.d.ts +0 -25
  213. package/src/main/user/UserService.js +0 -81
  214. package/src/main/user/index.d.ts +0 -1
  215. package/src/main/user/index.js +0 -36
  216. package/src/main/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.d.ts +0 -21
  217. package/src/main/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.js +0 -62
  218. package/src/main/util/TaskScheduler/TaskScheduler.d.ts +0 -10
  219. package/src/main/util/TaskScheduler/TaskScheduler.js +0 -70
  220. package/src/main/util/TypePredicateUtil.d.ts +0 -7
  221. package/src/main/util/TypePredicateUtil.js +0 -55
  222. package/src/main/util/encryptedStore.d.ts +0 -45
  223. package/src/main/util/encryptedStore.js +0 -116
  224. package/src/main/util/fullyQualifiedClientIdUtils.d.ts +0 -13
  225. package/src/main/util/fullyQualifiedClientIdUtils.js +0 -42
  226. package/src/main/util/index.d.ts +0 -1
  227. package/src/main/util/index.js +0 -36
@@ -1,36 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2018 Wire Swiss GmbH
5
- *
6
- * This program is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see http://www.gnu.org/licenses/.
18
- *
19
- */
20
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- var desc = Object.getOwnPropertyDescriptor(m, k);
23
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
- desc = { enumerable: true, get: function() { return m[k]; } };
25
- }
26
- Object.defineProperty(o, k2, desc);
27
- }) : (function(o, m, k, k2) {
28
- if (k2 === undefined) k2 = k;
29
- o[k2] = m[k];
30
- }));
31
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- __exportStar(require("./LoginSanitizer"), exports);
36
- //# sourceMappingURL=index.js.map
@@ -1,2 +0,0 @@
1
- import { Availability } from '@wireapp/protocol-messaging';
2
- export declare type AvailabilityType = Availability.Type;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2018 Wire Swiss GmbH
5
- *
6
- * This program is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see http://www.gnu.org/licenses/.
18
- *
19
- */
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- //# sourceMappingURL=AvailabilityType.js.map
@@ -1,24 +0,0 @@
1
- import { APIClient } from '@wireapp/api-client';
2
- import { ClientMismatch, MessageSendingStatus, QualifiedUserClients, UserClients } from '@wireapp/api-client/src/conversation';
3
- import { UserPreKeyBundleMap } from '@wireapp/api-client/src/user/';
4
- import { GenericMessage } from '@wireapp/protocol-messaging';
5
- import { CryptographyService } from '../cryptography/';
6
- export declare class BroadcastService {
7
- private readonly apiClient;
8
- private readonly cryptographyService;
9
- private readonly messageService;
10
- constructor(apiClient: APIClient, cryptographyService: CryptographyService);
11
- /**
12
- * Will create a key bundle for all the users of the team
13
- *
14
- * @param teamId
15
- * @param skipOwnClients=false
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
- */
18
- getPreKeyBundlesFromTeam(teamId: string, skipOwnClients?: boolean, onlyDirectConnections?: boolean): Promise<UserPreKeyBundleMap>;
19
- broadcastGenericMessage(genericMessage: GenericMessage, recipients: UserPreKeyBundleMap | UserClients | QualifiedUserClients, sendAsProtobuf?: boolean, onClientMismatch?: (mismatch: ClientMismatch | MessageSendingStatus) => void | boolean | Promise<boolean>): Promise<(MessageSendingStatus & {
20
- errored?: boolean | undefined;
21
- }) | (ClientMismatch & {
22
- errored?: boolean | undefined;
23
- })>;
24
- }
@@ -1,74 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2018 Wire Swiss GmbH
5
- *
6
- * This program is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see http://www.gnu.org/licenses/.
18
- *
19
- */
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.BroadcastService = void 0;
22
- const protocol_messaging_1 = require("@wireapp/protocol-messaging");
23
- const MessageService_1 = require("../conversation/message/MessageService");
24
- const UserClientsUtil_1 = require("../conversation/message/UserClientsUtil");
25
- const util_1 = require("../util");
26
- class BroadcastService {
27
- constructor(apiClient, cryptographyService) {
28
- this.apiClient = apiClient;
29
- this.cryptographyService = cryptographyService;
30
- this.messageService = new MessageService_1.MessageService(this.apiClient, this.cryptographyService);
31
- }
32
- /**
33
- * Will create a key bundle for all the users of the team
34
- *
35
- * @param teamId
36
- * @param skipOwnClients=false
37
- * @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
38
- */
39
- async getPreKeyBundlesFromTeam(teamId, skipOwnClients = false, onlyDirectConnections = false) {
40
- const teamMembers = onlyDirectConnections
41
- ? (await this.apiClient.api.conversation.getConversations()).conversations
42
- .map(({ members }) => members.others.map(user => user.id).concat(members.self.id))
43
- .flat()
44
- : (await this.apiClient.api.teams.member.getAllMembers(teamId)).members.map(({ user }) => user);
45
- let members = Array.from(new Set(teamMembers)).map(member => ({ id: member }));
46
- if (skipOwnClients) {
47
- const selfUser = await this.apiClient.api.self.getSelf();
48
- members = members.filter(member => member.id !== selfUser.id);
49
- }
50
- const preKeys = await Promise.all(members.map(member => this.apiClient.api.user.getUserPreKeys(member.id)));
51
- return preKeys.reduce((bundleMap, bundle) => {
52
- bundleMap[bundle.user] = {};
53
- for (const client of bundle.clients) {
54
- bundleMap[bundle.user][client.client] = client.prekey;
55
- }
56
- return bundleMap;
57
- }, {});
58
- }
59
- async broadcastGenericMessage(genericMessage, recipients, sendAsProtobuf, onClientMismatch) {
60
- const plainTextArray = protocol_messaging_1.GenericMessage.encode(genericMessage).finish();
61
- return (0, util_1.isQualifiedUserClients)(recipients)
62
- ? this.messageService.sendFederatedMessage(this.apiClient.validatedClientId, recipients, plainTextArray, {
63
- reportMissing: (0, UserClientsUtil_1.flattenQualifiedUserClients)(recipients).map(({ userId }) => userId),
64
- onClientMismatch,
65
- })
66
- : this.messageService.sendMessage(this.apiClient.validatedClientId, recipients, plainTextArray, {
67
- sendAsProtobuf,
68
- reportMissing: Object.keys(recipients),
69
- onClientMismatch,
70
- });
71
- }
72
- }
73
- exports.BroadcastService = BroadcastService;
74
- //# sourceMappingURL=BroadcastService.js.map
@@ -1,2 +0,0 @@
1
- export * from './AvailabilityType';
2
- export * from './BroadcastService';
@@ -1,37 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2018 Wire Swiss GmbH
5
- *
6
- * This program is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see http://www.gnu.org/licenses/.
18
- *
19
- */
20
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- var desc = Object.getOwnPropertyDescriptor(m, k);
23
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
- desc = { enumerable: true, get: function() { return m[k]; } };
25
- }
26
- Object.defineProperty(o, k2, desc);
27
- }) : (function(o, m, k, k2) {
28
- if (k2 === undefined) k2 = k;
29
- o[k2] = m[k];
30
- }));
31
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- __exportStar(require("./AvailabilityType"), exports);
36
- __exportStar(require("./BroadcastService"), exports);
37
- //# sourceMappingURL=index.js.map
@@ -1,11 +0,0 @@
1
- import { APIClient } from '@wireapp/api-client';
2
- import { CreateClientPayload, RegisteredClient, UpdateClientPayload } from '@wireapp/api-client/src/client/';
3
- export declare class ClientBackendRepository {
4
- private readonly apiClient;
5
- constructor(apiClient: APIClient);
6
- getClients(): Promise<RegisteredClient[]>;
7
- postClient(client: CreateClientPayload): Promise<RegisteredClient>;
8
- putClient(clientId: string, updates: UpdateClientPayload): Promise<void>;
9
- deleteClient(clientId: string, password?: string): Promise<void>;
10
- uploadMLSKeyPackages(clientId: string, keyPackages: string[]): Promise<void>;
11
- }
@@ -1,43 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2018 Wire Swiss GmbH
5
- *
6
- * This program is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see http://www.gnu.org/licenses/.
18
- *
19
- */
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.ClientBackendRepository = void 0;
22
- class ClientBackendRepository {
23
- constructor(apiClient) {
24
- this.apiClient = apiClient;
25
- }
26
- getClients() {
27
- return this.apiClient.api.client.getClients();
28
- }
29
- postClient(client) {
30
- return this.apiClient.api.client.postClient(client);
31
- }
32
- putClient(clientId, updates) {
33
- return this.apiClient.api.client.putClient(clientId, updates);
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
- }
41
- }
42
- exports.ClientBackendRepository = ClientBackendRepository;
43
- //# sourceMappingURL=ClientBackendRepository.js.map
@@ -1,27 +0,0 @@
1
- import { RegisteredClient } from '@wireapp/api-client/src/client/';
2
- import { CRUDEngine } from '@wireapp/store-engine';
3
- import { CryptographyService } from '../cryptography/';
4
- import { MetaClient } from './ClientService';
5
- export declare enum DatabaseStores {
6
- CLIENTS = "clients"
7
- }
8
- export declare class ClientDatabaseRepository {
9
- private readonly storeEngine;
10
- private readonly cryptographyService;
11
- static readonly STORES: typeof DatabaseStores;
12
- static KEYS: {
13
- LOCAL_IDENTITY: string;
14
- };
15
- constructor(storeEngine: CRUDEngine, cryptographyService: CryptographyService);
16
- getLocalClient(): Promise<MetaClient>;
17
- getClient(sessionId: string): Promise<MetaClient>;
18
- deleteLocalClient(): Promise<string>;
19
- deleteClient(sessionId: string): Promise<string>;
20
- createClientList(userId: string, clientList: RegisteredClient[], domain?: string): Promise<MetaClient[]>;
21
- createLocalClient(client: RegisteredClient, domain?: string): Promise<MetaClient>;
22
- updateLocalClient(client: RegisteredClient, domain?: string): Promise<MetaClient>;
23
- updateClient(userId: string, client: RegisteredClient, domain?: string): Promise<MetaClient>;
24
- createClient(userId: string, client: RegisteredClient, domain?: string): Promise<MetaClient>;
25
- private transformClient;
26
- private transformLocalClient;
27
- }
@@ -1,85 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2018 Wire Swiss GmbH
5
- *
6
- * This program is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see http://www.gnu.org/licenses/.
18
- *
19
- */
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.ClientDatabaseRepository = exports.DatabaseStores = void 0;
22
- var DatabaseStores;
23
- (function (DatabaseStores) {
24
- DatabaseStores["CLIENTS"] = "clients";
25
- })(DatabaseStores = exports.DatabaseStores || (exports.DatabaseStores = {}));
26
- class ClientDatabaseRepository {
27
- constructor(storeEngine, cryptographyService) {
28
- this.storeEngine = storeEngine;
29
- this.cryptographyService = cryptographyService;
30
- }
31
- getLocalClient() {
32
- return this.getClient(ClientDatabaseRepository.KEYS.LOCAL_IDENTITY);
33
- }
34
- getClient(sessionId) {
35
- return this.storeEngine.read(ClientDatabaseRepository.STORES.CLIENTS, sessionId);
36
- }
37
- deleteLocalClient() {
38
- return this.deleteClient(ClientDatabaseRepository.KEYS.LOCAL_IDENTITY);
39
- }
40
- deleteClient(sessionId) {
41
- return this.storeEngine.delete(ClientDatabaseRepository.STORES.CLIENTS, sessionId);
42
- }
43
- createClientList(userId, clientList, domain) {
44
- const createClientTasks = [];
45
- for (const client of clientList) {
46
- createClientTasks.push(this.createClient(userId, client, domain));
47
- }
48
- return Promise.all(createClientTasks);
49
- }
50
- async createLocalClient(client, domain) {
51
- const transformedClient = this.transformLocalClient(client, domain);
52
- await this.storeEngine.create(ClientDatabaseRepository.STORES.CLIENTS, ClientDatabaseRepository.KEYS.LOCAL_IDENTITY, transformedClient);
53
- return transformedClient;
54
- }
55
- async updateLocalClient(client, domain) {
56
- const transformedClient = this.transformLocalClient(client, domain);
57
- await this.storeEngine.update(ClientDatabaseRepository.STORES.CLIENTS, ClientDatabaseRepository.KEYS.LOCAL_IDENTITY, transformedClient);
58
- return transformedClient;
59
- }
60
- async updateClient(userId, client, domain) {
61
- const transformedClient = this.transformClient(userId, client, false, domain);
62
- await this.storeEngine.update(ClientDatabaseRepository.STORES.CLIENTS, this.cryptographyService.constructSessionId(userId, client.id, domain), transformedClient);
63
- return transformedClient;
64
- }
65
- async createClient(userId, client, domain) {
66
- const transformedClient = this.transformClient(userId, client, false, domain);
67
- await this.storeEngine.create(ClientDatabaseRepository.STORES.CLIENTS, this.cryptographyService.constructSessionId(userId, client.id, domain), transformedClient);
68
- return transformedClient;
69
- }
70
- transformClient(userId, client, verified, domain) {
71
- return Object.assign(Object.assign({}, client), { domain, meta: {
72
- is_verified: verified,
73
- primary_key: this.cryptographyService.constructSessionId(userId, client.id, domain),
74
- } });
75
- }
76
- transformLocalClient(client, domain) {
77
- return Object.assign(Object.assign({}, client), { domain, meta: { is_verified: true, primary_key: ClientDatabaseRepository.KEYS.LOCAL_IDENTITY } });
78
- }
79
- }
80
- exports.ClientDatabaseRepository = ClientDatabaseRepository;
81
- ClientDatabaseRepository.STORES = DatabaseStores;
82
- ClientDatabaseRepository.KEYS = {
83
- LOCAL_IDENTITY: 'local_identity',
84
- };
85
- //# sourceMappingURL=ClientDatabaseRepository.js.map
@@ -1,8 +0,0 @@
1
- import { ClientClassification, Location } from '@wireapp/api-client/src/client/';
2
- export interface ClientInfo {
3
- classification: ClientClassification.DESKTOP | ClientClassification.PHONE | ClientClassification.TABLET;
4
- cookieLabel: string;
5
- label?: string;
6
- location?: Location;
7
- model: string;
8
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2018 Wire Swiss GmbH
5
- *
6
- * This program is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see http://www.gnu.org/licenses/.
18
- *
19
- */
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- //# sourceMappingURL=ClientInfo.js.map
@@ -1,40 +0,0 @@
1
- import { APIClient } from '@wireapp/api-client';
2
- import { LoginData } from '@wireapp/api-client/src/auth/';
3
- import { RegisteredClient } from '@wireapp/api-client/src/client/';
4
- import { CRUDEngine } from '@wireapp/store-engine';
5
- import { CryptographyService } from '../cryptography/';
6
- import { ClientInfo } from './';
7
- export interface MetaClient extends RegisteredClient {
8
- domain?: string;
9
- meta: {
10
- is_verified?: boolean;
11
- primary_key: string;
12
- };
13
- }
14
- export declare class ClientService {
15
- private readonly apiClient;
16
- private readonly storeEngine;
17
- private readonly cryptographyService;
18
- private readonly database;
19
- private readonly backend;
20
- constructor(apiClient: APIClient, storeEngine: CRUDEngine, cryptographyService: CryptographyService);
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>;
36
- getLocalClient(): Promise<MetaClient>;
37
- createLocalClient(client: RegisteredClient, domain?: string): Promise<MetaClient>;
38
- synchronizeClients(): Promise<MetaClient[]>;
39
- register(loginData: LoginData, clientInfo: ClientInfo, entropyData?: Uint8Array): Promise<RegisteredClient>;
40
- }
@@ -1,103 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2018 Wire Swiss GmbH
5
- *
6
- * This program is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see http://www.gnu.org/licenses/.
18
- *
19
- */
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.ClientService = void 0;
22
- const client_1 = require("@wireapp/api-client/src/client/");
23
- const _1 = require("./");
24
- class ClientService {
25
- constructor(apiClient, storeEngine, cryptographyService) {
26
- this.apiClient = apiClient;
27
- this.storeEngine = storeEngine;
28
- this.cryptographyService = cryptographyService;
29
- this.database = new _1.ClientDatabaseRepository(this.storeEngine, this.cryptographyService);
30
- this.backend = new _1.ClientBackendRepository(this.apiClient);
31
- }
32
- getClients() {
33
- return this.backend.getClients();
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
- }
61
- getLocalClient() {
62
- return this.database.getLocalClient();
63
- }
64
- createLocalClient(client, domain) {
65
- return this.database.createLocalClient(client, domain);
66
- }
67
- async synchronizeClients() {
68
- var _a;
69
- const registeredClients = await this.backend.getClients();
70
- const filteredClients = registeredClients.filter(client => client.id !== this.apiClient.context.clientId);
71
- return this.database.createClientList(this.apiClient.context.userId, filteredClients, (_a = this.apiClient.context) === null || _a === void 0 ? void 0 : _a.domain);
72
- }
73
- // TODO: Split functionality into "create" and "register" client
74
- async register(loginData, clientInfo, entropyData) {
75
- if (!this.apiClient.context) {
76
- throw new Error('Context is not set.');
77
- }
78
- if (loginData.clientType === client_1.ClientType.NONE) {
79
- throw new Error(`Can't register client of type "${client_1.ClientType.NONE}"`);
80
- }
81
- const serializedPreKeys = await this.cryptographyService.createCryptobox(entropyData);
82
- if (!this.cryptographyService.cryptobox.lastResortPreKey) {
83
- throw new Error('Cryptobox got initialized without a last resort PreKey.');
84
- }
85
- const newClient = {
86
- class: clientInfo.classification,
87
- cookie: clientInfo.cookieLabel,
88
- label: clientInfo.label,
89
- lastkey: this.cryptographyService.cryptobox.serialize_prekey(this.cryptographyService.cryptobox.lastResortPreKey),
90
- location: clientInfo.location,
91
- model: clientInfo.model,
92
- password: loginData.password ? String(loginData.password) : undefined,
93
- verification_code: loginData.verificationCode,
94
- prekeys: serializedPreKeys,
95
- type: loginData.clientType,
96
- };
97
- const client = await this.backend.postClient(newClient);
98
- await this.createLocalClient(client, this.apiClient.context.domain);
99
- return client;
100
- }
101
- }
102
- exports.ClientService = ClientService;
103
- //# sourceMappingURL=ClientService.js.map
@@ -1,4 +0,0 @@
1
- export * from './ClientInfo';
2
- export * from './ClientService';
3
- export * from './ClientBackendRepository';
4
- export * from './ClientDatabaseRepository';
@@ -1,39 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2018 Wire Swiss GmbH
5
- *
6
- * This program is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see http://www.gnu.org/licenses/.
18
- *
19
- */
20
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- var desc = Object.getOwnPropertyDescriptor(m, k);
23
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
- desc = { enumerable: true, get: function() { return m[k]; } };
25
- }
26
- Object.defineProperty(o, k2, desc);
27
- }) : (function(o, m, k, k2) {
28
- if (k2 === undefined) k2 = k;
29
- o[k2] = m[k];
30
- }));
31
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- __exportStar(require("./ClientInfo"), exports);
36
- __exportStar(require("./ClientService"), exports);
37
- __exportStar(require("./ClientBackendRepository"), exports);
38
- __exportStar(require("./ClientDatabaseRepository"), exports);
39
- //# sourceMappingURL=index.js.map
@@ -1,11 +0,0 @@
1
- import { APIClient } from '@wireapp/api-client';
2
- import { Connection } from '@wireapp/api-client/src/connection/';
3
- import { QualifiedId } from '@wireapp/api-client/src/user';
4
- export declare class ConnectionService {
5
- private readonly apiClient;
6
- constructor(apiClient: APIClient);
7
- getConnections(): Promise<Connection[]>;
8
- acceptConnection(userId: string): Promise<Connection>;
9
- ignoreConnection(userId: string): Promise<Connection>;
10
- createConnection(userId: QualifiedId): Promise<Connection>;
11
- }
@@ -1,45 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2018 Wire Swiss GmbH
5
- *
6
- * This program is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see http://www.gnu.org/licenses/.
18
- *
19
- */
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.ConnectionService = void 0;
22
- const connection_1 = require("@wireapp/api-client/src/connection/");
23
- class ConnectionService {
24
- constructor(apiClient) {
25
- this.apiClient = apiClient;
26
- }
27
- getConnections() {
28
- return this.apiClient.api.connection.getAllConnections();
29
- }
30
- acceptConnection(userId) {
31
- return this.apiClient.api.connection.putConnection(userId, {
32
- status: connection_1.ConnectionStatus.ACCEPTED,
33
- });
34
- }
35
- ignoreConnection(userId) {
36
- return this.apiClient.api.connection.putConnection(userId, {
37
- status: connection_1.ConnectionStatus.IGNORED,
38
- });
39
- }
40
- createConnection(userId) {
41
- return this.apiClient.api.connection.postConnection(userId, '');
42
- }
43
- }
44
- exports.ConnectionService = ConnectionService;
45
- //# sourceMappingURL=ConnectionService.js.map
@@ -1 +0,0 @@
1
- export * from './ConnectionService';