@wireapp/core 30.5.1 → 30.5.2

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 (218) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +3 -3
  3. package/src/main/Account.d.ts +0 -204
  4. package/src/main/Account.js +0 -439
  5. package/src/main/CoreError.d.ts +0 -9
  6. package/src/main/CoreError.js +0 -26
  7. package/src/main/account/AccountService.d.ts +0 -7
  8. package/src/main/account/AccountService.js +0 -33
  9. package/src/main/account/AccountService.js.map +0 -1
  10. package/src/main/account/index.d.ts +0 -1
  11. package/src/main/account/index.js +0 -32
  12. package/src/main/account/index.js.map +0 -1
  13. package/src/main/auth/LoginSanitizer.d.ts +0 -5
  14. package/src/main/auth/LoginSanitizer.js +0 -41
  15. package/src/main/auth/index.d.ts +0 -1
  16. package/src/main/auth/index.js +0 -32
  17. package/src/main/broadcast/AvailabilityType.d.ts +0 -2
  18. package/src/main/broadcast/AvailabilityType.js +0 -21
  19. package/src/main/broadcast/BroadcastService.d.ts +0 -24
  20. package/src/main/broadcast/BroadcastService.js +0 -74
  21. package/src/main/broadcast/index.d.ts +0 -2
  22. package/src/main/broadcast/index.js +0 -33
  23. package/src/main/client/ClientBackendRepository.d.ts +0 -11
  24. package/src/main/client/ClientBackendRepository.js +0 -43
  25. package/src/main/client/ClientDatabaseRepository.d.ts +0 -27
  26. package/src/main/client/ClientDatabaseRepository.js +0 -85
  27. package/src/main/client/ClientInfo.d.ts +0 -8
  28. package/src/main/client/ClientInfo.js +0 -21
  29. package/src/main/client/ClientService.d.ts +0 -48
  30. package/src/main/client/ClientService.js +0 -118
  31. package/src/main/client/index.d.ts +0 -4
  32. package/src/main/client/index.js +0 -35
  33. package/src/main/connection/ConnectionService.d.ts +0 -11
  34. package/src/main/connection/ConnectionService.js +0 -45
  35. package/src/main/connection/index.d.ts +0 -1
  36. package/src/main/connection/index.js +0 -32
  37. package/src/main/conversation/AbortReason.d.ts +0 -2
  38. package/src/main/conversation/AbortReason.js +0 -21
  39. package/src/main/conversation/AssetService/AssetService.d.ts +0 -62
  40. package/src/main/conversation/AssetService/AssetService.js +0 -88
  41. package/src/main/conversation/AssetService/index.d.ts +0 -1
  42. package/src/main/conversation/AssetService/index.js +0 -32
  43. package/src/main/conversation/AssetTransferState.d.ts +0 -4
  44. package/src/main/conversation/AssetTransferState.js +0 -27
  45. package/src/main/conversation/ClientActionType.d.ts +0 -1
  46. package/src/main/conversation/ClientActionType.js +0 -24
  47. package/src/main/conversation/ConversationMapper/ConversationMapper.d.ts +0 -6
  48. package/src/main/conversation/ConversationMapper/ConversationMapper.js +0 -57
  49. package/src/main/conversation/ConversationMapper/index.d.ts +0 -1
  50. package/src/main/conversation/ConversationMapper/index.js +0 -32
  51. package/src/main/conversation/ConversationService/ConversationService.d.ts +0 -162
  52. package/src/main/conversation/ConversationService/ConversationService.js +0 -900
  53. package/src/main/conversation/ConversationService/ConversationService.types.d.ts +0 -108
  54. package/src/main/conversation/ConversationService/ConversationService.types.js +0 -28
  55. package/src/main/conversation/ConversationService/index.d.ts +0 -2
  56. package/src/main/conversation/ConversationService/index.js +0 -33
  57. package/src/main/conversation/GenericMessageType.d.ts +0 -25
  58. package/src/main/conversation/GenericMessageType.js +0 -49
  59. package/src/main/conversation/MessageTimer/MessageTimer.d.ts +0 -10
  60. package/src/main/conversation/MessageTimer/MessageTimer.js +0 -54
  61. package/src/main/conversation/MessageTimer/index.d.ts +0 -1
  62. package/src/main/conversation/MessageTimer/index.js +0 -32
  63. package/src/main/conversation/ReactionType.d.ts +0 -4
  64. package/src/main/conversation/ReactionType.js +0 -27
  65. package/src/main/conversation/content/AssetContent.d.ts +0 -42
  66. package/src/main/conversation/content/AssetContent.js +0 -21
  67. package/src/main/conversation/content/ButtonActionConfirmationContent.d.ts +0 -2
  68. package/src/main/conversation/content/ButtonActionConfirmationContent.js +0 -21
  69. package/src/main/conversation/content/ButtonActionContent.d.ts +0 -2
  70. package/src/main/conversation/content/ButtonActionContent.js +0 -21
  71. package/src/main/conversation/content/CallingContent.d.ts +0 -1
  72. package/src/main/conversation/content/CallingContent.js +0 -21
  73. package/src/main/conversation/content/ClearedContent.d.ts +0 -2
  74. package/src/main/conversation/content/ClearedContent.js +0 -21
  75. package/src/main/conversation/content/ClientActionContent.d.ts +0 -2
  76. package/src/main/conversation/content/ClientActionContent.js +0 -21
  77. package/src/main/conversation/content/ClientAddContent.d.ts +0 -4
  78. package/src/main/conversation/content/ClientAddContent.js +0 -21
  79. package/src/main/conversation/content/ClientRemoveContent.d.ts +0 -6
  80. package/src/main/conversation/content/ClientRemoveContent.js +0 -21
  81. package/src/main/conversation/content/CompositeContent.d.ts +0 -2
  82. package/src/main/conversation/content/CompositeContent.js +0 -21
  83. package/src/main/conversation/content/ConfirmationContent.d.ts +0 -2
  84. package/src/main/conversation/content/ConfirmationContent.js +0 -21
  85. package/src/main/conversation/content/ContentType.d.ts +0 -21
  86. package/src/main/conversation/content/ContentType.js +0 -94
  87. package/src/main/conversation/content/ConversationContent.d.ts +0 -3
  88. package/src/main/conversation/content/ConversationContent.js +0 -21
  89. package/src/main/conversation/content/DeletedContent.d.ts +0 -2
  90. package/src/main/conversation/content/DeletedContent.js +0 -21
  91. package/src/main/conversation/content/EditedTextContent.d.ts +0 -11
  92. package/src/main/conversation/content/EditedTextContent.js +0 -21
  93. package/src/main/conversation/content/FileContent.d.ts +0 -13
  94. package/src/main/conversation/content/FileContent.js +0 -21
  95. package/src/main/conversation/content/HiddenContent.d.ts +0 -2
  96. package/src/main/conversation/content/HiddenContent.js +0 -21
  97. package/src/main/conversation/content/ImageContent.d.ts +0 -7
  98. package/src/main/conversation/content/ImageContent.js +0 -21
  99. package/src/main/conversation/content/KnockContent.d.ts +0 -2
  100. package/src/main/conversation/content/KnockContent.js +0 -21
  101. package/src/main/conversation/content/LinkPreviewContent.d.ts +0 -10
  102. package/src/main/conversation/content/LinkPreviewContent.js +0 -21
  103. package/src/main/conversation/content/LocationContent.d.ts +0 -9
  104. package/src/main/conversation/content/LocationContent.js +0 -21
  105. package/src/main/conversation/content/MentionContent.d.ts +0 -2
  106. package/src/main/conversation/content/MentionContent.js +0 -21
  107. package/src/main/conversation/content/QuoteContent.d.ts +0 -7
  108. package/src/main/conversation/content/QuoteContent.js +0 -21
  109. package/src/main/conversation/content/ReactionContent.d.ts +0 -7
  110. package/src/main/conversation/content/ReactionContent.js +0 -21
  111. package/src/main/conversation/content/TextContent.d.ts +0 -9
  112. package/src/main/conversation/content/TextContent.js +0 -21
  113. package/src/main/conversation/content/TweetContent.d.ts +0 -2
  114. package/src/main/conversation/content/TweetContent.js +0 -21
  115. package/src/main/conversation/content/index.d.ts +0 -28
  116. package/src/main/conversation/content/index.js +0 -72
  117. package/src/main/conversation/index.d.ts +0 -9
  118. package/src/main/conversation/index.js +0 -40
  119. package/src/main/conversation/message/CompositeContentBuilder.d.ts +0 -14
  120. package/src/main/conversation/message/CompositeContentBuilder.js +0 -54
  121. package/src/main/conversation/message/Message.d.ts +0 -4
  122. package/src/main/conversation/message/Message.js +0 -21
  123. package/src/main/conversation/message/MessageBuilder.d.ts +0 -87
  124. package/src/main/conversation/message/MessageBuilder.js +0 -119
  125. package/src/main/conversation/message/MessageService.d.ts +0 -67
  126. package/src/main/conversation/message/MessageService.js +0 -293
  127. package/src/main/conversation/message/MessageToProtoMapper.d.ts +0 -7
  128. package/src/main/conversation/message/MessageToProtoMapper.js +0 -99
  129. package/src/main/conversation/message/OtrMessage.d.ts +0 -80
  130. package/src/main/conversation/message/OtrMessage.js +0 -21
  131. package/src/main/conversation/message/PayloadBundle.d.ts +0 -76
  132. package/src/main/conversation/message/PayloadBundle.js +0 -81
  133. package/src/main/conversation/message/TeamMessage.d.ts +0 -31
  134. package/src/main/conversation/message/TeamMessage.js +0 -21
  135. package/src/main/conversation/message/TextContentBuilder.d.ts +0 -13
  136. package/src/main/conversation/message/TextContentBuilder.js +0 -75
  137. package/src/main/conversation/message/UserClientsUtil.d.ts +0 -22
  138. package/src/main/conversation/message/UserClientsUtil.js +0 -38
  139. package/src/main/conversation/message/UserMessage.d.ts +0 -43
  140. package/src/main/conversation/message/UserMessage.js +0 -21
  141. package/src/main/cryptography/AssetCryptography/EncryptedAsset.d.ts +0 -11
  142. package/src/main/cryptography/AssetCryptography/EncryptedAsset.js +0 -21
  143. package/src/main/cryptography/AssetCryptography/crypto.browser.d.ts +0 -2
  144. package/src/main/cryptography/AssetCryptography/crypto.browser.js +0 -46
  145. package/src/main/cryptography/AssetCryptography/crypto.node.d.ts +0 -2
  146. package/src/main/cryptography/AssetCryptography/crypto.node.js +0 -68
  147. package/src/main/cryptography/AssetCryptography/index.d.ts +0 -8
  148. package/src/main/cryptography/AssetCryptography/index.js +0 -53
  149. package/src/main/cryptography/AssetCryptography/interfaces.d.ts +0 -9
  150. package/src/main/cryptography/AssetCryptography/interfaces.js +0 -21
  151. package/src/main/cryptography/CryptographyDatabaseRepository.d.ts +0 -17
  152. package/src/main/cryptography/CryptographyDatabaseRepository.js +0 -45
  153. package/src/main/cryptography/CryptographyService.d.ts +0 -52
  154. package/src/main/cryptography/CryptographyService.js +0 -205
  155. package/src/main/cryptography/GenericMessageMapper.d.ts +0 -6
  156. package/src/main/cryptography/GenericMessageMapper.js +0 -160
  157. package/src/main/cryptography/MessageHashService.d.ts +0 -16
  158. package/src/main/cryptography/MessageHashService.js +0 -114
  159. package/src/main/cryptography/SessionPayloadBundle.d.ts +0 -4
  160. package/src/main/cryptography/SessionPayloadBundle.js +0 -21
  161. package/src/main/cryptography/index.d.ts +0 -4
  162. package/src/main/cryptography/index.js +0 -35
  163. package/src/main/giphy/GiphyService.d.ts +0 -9
  164. package/src/main/giphy/GiphyService.js +0 -37
  165. package/src/main/giphy/index.d.ts +0 -1
  166. package/src/main/giphy/index.js +0 -32
  167. package/src/main/index.d.ts +0 -17
  168. package/src/main/index.js +0 -55
  169. package/src/main/linkPreview/LinkPreviewService.d.ts +0 -7
  170. package/src/main/linkPreview/LinkPreviewService.js +0 -52
  171. package/src/main/linkPreview/index.d.ts +0 -1
  172. package/src/main/linkPreview/index.js +0 -32
  173. package/src/main/mls/MLSService/MLSService.d.ts +0 -26
  174. package/src/main/mls/MLSService/MLSService.js +0 -131
  175. package/src/main/mls/index.d.ts +0 -1
  176. package/src/main/mls/index.js +0 -32
  177. package/src/main/mls/types.d.ts +0 -22
  178. package/src/main/mls/types.js +0 -21
  179. package/src/main/notification/NotificationBackendRepository.d.ts +0 -11
  180. package/src/main/notification/NotificationBackendRepository.js +0 -34
  181. package/src/main/notification/NotificationDatabaseRepository.d.ts +0 -66
  182. package/src/main/notification/NotificationDatabaseRepository.js +0 -136
  183. package/src/main/notification/NotificationService.d.ts +0 -131
  184. package/src/main/notification/NotificationService.js +0 -468
  185. package/src/main/notification/index.d.ts +0 -1
  186. package/src/main/notification/index.js +0 -32
  187. package/src/main/notification/types.d.ts +0 -20
  188. package/src/main/notification/types.js +0 -21
  189. package/src/main/self/SelfService.d.ts +0 -13
  190. package/src/main/self/SelfService.js +0 -55
  191. package/src/main/self/index.d.ts +0 -1
  192. package/src/main/self/index.js +0 -32
  193. package/src/main/team/TeamService.d.ts +0 -15
  194. package/src/main/team/TeamService.js +0 -55
  195. package/src/main/team/index.d.ts +0 -1
  196. package/src/main/team/index.js +0 -32
  197. package/src/main/test/CryptographyHelper.d.ts +0 -4
  198. package/src/main/test/CryptographyHelper.js +0 -65
  199. package/src/main/test/PayloadHelper.d.ts +0 -3
  200. package/src/main/test/PayloadHelper.js +0 -66
  201. package/src/main/user/UserMapper.d.ts +0 -5
  202. package/src/main/user/UserMapper.js +0 -88
  203. package/src/main/user/UserService.d.ts +0 -25
  204. package/src/main/user/UserService.js +0 -81
  205. package/src/main/user/index.d.ts +0 -1
  206. package/src/main/user/index.js +0 -32
  207. package/src/main/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.d.ts +0 -21
  208. package/src/main/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.js +0 -62
  209. package/src/main/util/TaskScheduler/TaskScheduler.d.ts +0 -10
  210. package/src/main/util/TaskScheduler/TaskScheduler.js +0 -70
  211. package/src/main/util/TypePredicateUtil.d.ts +0 -7
  212. package/src/main/util/TypePredicateUtil.js +0 -55
  213. package/src/main/util/encryptedStore.d.ts +0 -45
  214. package/src/main/util/encryptedStore.js +0 -116
  215. package/src/main/util/index.d.ts +0 -1
  216. package/src/main/util/index.js +0 -32
  217. package/src/main/util/mapQualifiedUserClientIdsToFullyQualifiedClientIds.d.ts +0 -8
  218. package/src/main/util/mapQualifiedUserClientIdsToFullyQualifiedClientIds.js +0 -32
@@ -1,32 +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
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
23
- }) : (function(o, m, k, k2) {
24
- if (k2 === undefined) k2 = k;
25
- o[k2] = m[k];
26
- }));
27
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
28
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
29
- };
30
- Object.defineProperty(exports, "__esModule", { value: true });
31
- __exportStar(require("./ConnectionService"), exports);
32
- //# sourceMappingURL=index.js.map
@@ -1,2 +0,0 @@
1
- import type { Asset } from '@wireapp/protocol-messaging';
2
- export declare type AbortReason = Asset.NotUploaded;
@@ -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=AbortReason.js.map
@@ -1,62 +0,0 @@
1
- /// <reference types="node" />
2
- import type { APIClient } from '@wireapp/api-client';
3
- import type { AssetOptions } from '@wireapp/api-client/src/asset';
4
- import type { ProgressCallback, RequestCancelable } from '@wireapp/api-client/src/http';
5
- import type { EncryptedAssetUploaded } from '../../cryptography';
6
- export interface AssetDataV4 {
7
- assetKey: string;
8
- assetToken: string;
9
- assetDomain: string;
10
- forceCaching: boolean;
11
- version: 4;
12
- }
13
- export interface AssetDataV3 {
14
- assetKey: string;
15
- assetToken: string;
16
- forceCaching: boolean;
17
- version: 3;
18
- }
19
- export interface AssetDataV2 {
20
- assetId: string;
21
- conversationId: string;
22
- forceCaching: boolean;
23
- version: 2;
24
- }
25
- export interface AssetDataV1 {
26
- assetId: string;
27
- conversationId: string;
28
- forceCaching: boolean;
29
- version: 1;
30
- }
31
- export declare type AssetUrlData = AssetDataV1 | AssetDataV2 | AssetDataV3 | AssetDataV4;
32
- export declare class AssetService {
33
- private readonly apiClient;
34
- constructor(apiClient: APIClient);
35
- /**
36
- * Will download an asset on the server.
37
- * Will route the request to the right endpoint depending on the asset version
38
- *
39
- * @param assetData The versioned asset data
40
- * @param progressCallback?
41
- * @return Resolves when the asset has been uploaded
42
- */
43
- downloadAsset(assetData: AssetUrlData, progressCallback?: ProgressCallback): RequestCancelable<import("@wireapp/api-client/src/asset").AssetResponse>;
44
- /**
45
- * Uploads a raw asset to the backend without encrypting it
46
- *
47
- * @param plainText The raw content of the asset to upload
48
- * @param options?
49
- * @param progressCallback?
50
- * @return cancellable request that resolves with the uploaded image
51
- */
52
- uploadRawAsset(asset: Buffer | Uint8Array, options?: AssetOptions, progressCallback?: ProgressCallback): RequestCancelable<import("@wireapp/api-client/src/asset").AssetUploadData>;
53
- /**
54
- * Will encrypt and upload an asset to the backend
55
- *
56
- * @param plainText The raw content of the asset to upload
57
- * @param options?
58
- * @param progressCallback?
59
- * @return cancellable request that resolves with the uploaded image and decryption keys
60
- */
61
- uploadAsset(plainText: Buffer | Uint8Array, options?: AssetOptions, progressCallback?: ProgressCallback): Promise<RequestCancelable<EncryptedAssetUploaded>>;
62
- }
@@ -1,88 +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.AssetService = void 0;
22
- const AssetCryptography_1 = require("../../cryptography/AssetCryptography");
23
- class AssetService {
24
- constructor(apiClient) {
25
- this.apiClient = apiClient;
26
- }
27
- /**
28
- * Will download an asset on the server.
29
- * Will route the request to the right endpoint depending on the asset version
30
- *
31
- * @param assetData The versioned asset data
32
- * @param progressCallback?
33
- * @return Resolves when the asset has been uploaded
34
- */
35
- downloadAsset(assetData, progressCallback) {
36
- const { forceCaching } = assetData;
37
- switch (assetData.version) {
38
- case 1:
39
- return this.apiClient.api.asset.getAssetV1(assetData.assetId, assetData.conversationId, forceCaching, progressCallback);
40
- case 2:
41
- return this.apiClient.api.asset.getAssetV2(assetData.assetId, assetData.conversationId, forceCaching, progressCallback);
42
- case 3:
43
- return this.apiClient.api.asset.getAssetV3(assetData.assetKey, assetData.assetToken, forceCaching, progressCallback);
44
- case 4:
45
- return this.apiClient.api.asset.getAssetV4(assetData.assetKey, assetData.assetDomain, assetData.assetToken, forceCaching, progressCallback);
46
- }
47
- }
48
- /**
49
- * Uploads a raw asset to the backend without encrypting it
50
- *
51
- * @param plainText The raw content of the asset to upload
52
- * @param options?
53
- * @param progressCallback?
54
- * @return cancellable request that resolves with the uploaded image
55
- */
56
- uploadRawAsset(asset, options, progressCallback) {
57
- return this.apiClient.api.asset.postAsset(new Uint8Array(asset), options, progressCallback);
58
- }
59
- /**
60
- * Will encrypt and upload an asset to the backend
61
- *
62
- * @param plainText The raw content of the asset to upload
63
- * @param options?
64
- * @param progressCallback?
65
- * @return cancellable request that resolves with the uploaded image and decryption keys
66
- */
67
- async uploadAsset(plainText, options, progressCallback) {
68
- const { cipherText, keyBytes, sha256 } = await (0, AssetCryptography_1.encryptAsset)({
69
- plainText,
70
- algorithm: options === null || options === void 0 ? void 0 : options.algorithm,
71
- hash: options === null || options === void 0 ? void 0 : options.hash,
72
- });
73
- const request = this.uploadRawAsset(cipherText, options, progressCallback);
74
- return Object.assign(Object.assign({}, request), { response: request.response.then(response => {
75
- const { key, token, domain } = response;
76
- return {
77
- cipherText,
78
- domain,
79
- key,
80
- keyBytes,
81
- sha256,
82
- token,
83
- };
84
- }) });
85
- }
86
- }
87
- exports.AssetService = AssetService;
88
- //# sourceMappingURL=AssetService.js.map
@@ -1 +0,0 @@
1
- export * from './AssetService';
@@ -1,32 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2022 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
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
23
- }) : (function(o, m, k, k2) {
24
- if (k2 === undefined) k2 = k;
25
- o[k2] = m[k];
26
- }));
27
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
28
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
29
- };
30
- Object.defineProperty(exports, "__esModule", { value: true });
31
- __exportStar(require("./AssetService"), exports);
32
- //# sourceMappingURL=index.js.map
@@ -1,4 +0,0 @@
1
- export declare enum AssetTransferState {
2
- NOT_UPLOADED = "notUploaded",
3
- UPLOADED = "uploaded"
4
- }
@@ -1,27 +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.AssetTransferState = void 0;
22
- var AssetTransferState;
23
- (function (AssetTransferState) {
24
- AssetTransferState["NOT_UPLOADED"] = "notUploaded";
25
- AssetTransferState["UPLOADED"] = "uploaded";
26
- })(AssetTransferState = exports.AssetTransferState || (exports.AssetTransferState = {}));
27
- //# sourceMappingURL=AssetTransferState.js.map
@@ -1 +0,0 @@
1
- export { ClientAction as ClientActionType } from '@wireapp/protocol-messaging';
@@ -1,24 +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.ClientActionType = void 0;
22
- var protocol_messaging_1 = require("@wireapp/protocol-messaging");
23
- Object.defineProperty(exports, "ClientActionType", { enumerable: true, get: function () { return protocol_messaging_1.ClientAction; } });
24
- //# sourceMappingURL=ClientActionType.js.map
@@ -1,6 +0,0 @@
1
- import { ConversationEvent } from '@wireapp/api-client/src/event';
2
- import { PayloadBundle, PayloadBundleSource } from '../message/PayloadBundle';
3
- export declare class ConversationMapper {
4
- static mapConversationEvent(event: ConversationEvent, source: PayloadBundleSource): PayloadBundle;
5
- private static mapConversationEventType;
6
- }
@@ -1,57 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2019 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.ConversationMapper = void 0;
22
- const event_1 = require("@wireapp/api-client/src/event");
23
- const MessageBuilder_1 = require("../message/MessageBuilder");
24
- const PayloadBundle_1 = require("../message/PayloadBundle");
25
- class ConversationMapper {
26
- static mapConversationEvent(event, source) {
27
- return {
28
- content: event.data,
29
- conversation: event.conversation,
30
- qualifiedConversation: event.qualified_conversation,
31
- qualifiedFrom: event.qualified_from,
32
- from: event.from,
33
- id: MessageBuilder_1.MessageBuilder.createId(),
34
- messageTimer: 0,
35
- source,
36
- state: PayloadBundle_1.PayloadBundleState.INCOMING,
37
- timestamp: new Date(event.time).getTime(),
38
- type: this.mapConversationEventType(event.type),
39
- };
40
- }
41
- static mapConversationEventType(type) {
42
- switch (type) {
43
- case event_1.CONVERSATION_EVENT.MEMBER_JOIN:
44
- return PayloadBundle_1.PayloadBundleType.MEMBER_JOIN;
45
- case event_1.CONVERSATION_EVENT.MESSAGE_TIMER_UPDATE:
46
- return PayloadBundle_1.PayloadBundleType.TIMER_UPDATE;
47
- case event_1.CONVERSATION_EVENT.RENAME:
48
- return PayloadBundle_1.PayloadBundleType.CONVERSATION_RENAME;
49
- case event_1.CONVERSATION_EVENT.TYPING:
50
- return PayloadBundle_1.PayloadBundleType.TYPING;
51
- default:
52
- return PayloadBundle_1.PayloadBundleType.UNKNOWN;
53
- }
54
- }
55
- }
56
- exports.ConversationMapper = ConversationMapper;
57
- //# sourceMappingURL=ConversationMapper.js.map
@@ -1 +0,0 @@
1
- export * from './ConversationMapper';
@@ -1,32 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2022 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
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
23
- }) : (function(o, m, k, k2) {
24
- if (k2 === undefined) k2 = k;
25
- o[k2] = m[k];
26
- }));
27
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
28
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
29
- };
30
- Object.defineProperty(exports, "__esModule", { value: true });
31
- __exportStar(require("./ConversationMapper"), exports);
32
- //# sourceMappingURL=index.js.map
@@ -1,162 +0,0 @@
1
- import type { APIClient } from '@wireapp/api-client';
2
- import { MessageSendingStatus, Conversation, DefaultConversationRoleName, MutedStatus, NewConversation, QualifiedUserClients, UserClients, ClientMismatch } from '@wireapp/api-client/src/conversation';
3
- import type { ConversationMemberLeaveEvent } from '@wireapp/api-client/src/event';
4
- import type { QualifiedId, UserPreKeyBundleMap } from '@wireapp/api-client/src/user';
5
- import { MessageTimer, RemoveUsersParams } from '../../conversation/';
6
- import type { RemoteData } from '../content';
7
- import type { CryptographyService } from '../../cryptography/';
8
- import type { MLSService } from '../../mls';
9
- import type { NotificationService } from '../../notification';
10
- import type { ClearConversationMessage, DeleteMessage, HideMessage, OtrMessage } from '../message/OtrMessage';
11
- import { XOR } from '@wireapp/commons/src/main/util/TypeUtil';
12
- import { AddUsersParams, MessageSendingCallbacks, MessageSendingOptions, MLSReturnType, SendMlsMessageParams, SendProteusMessageParams } from './ConversationService.types';
13
- export declare class ConversationService {
14
- private readonly apiClient;
15
- private readonly config;
16
- private readonly notificationService;
17
- private readonly mlsService;
18
- readonly messageTimer: MessageTimer;
19
- private readonly messageService;
20
- private selfConversationId?;
21
- constructor(apiClient: APIClient, cryptographyService: CryptographyService, config: {
22
- useQualifiedIds?: boolean;
23
- }, notificationService: NotificationService, mlsService: MLSService);
24
- private createEphemeral;
25
- private getConversationQualifiedMembers;
26
- /**
27
- * Will generate a prekey bundle for specific users.
28
- * If a QualifiedId array is given the bundle will contain all the clients from those users fetched from the server.
29
- * If a QualifiedUserClients is provided then only the clients in the payload will be targeted (which could generate a ClientMismatch when sending messages)
30
- *
31
- * @param {QualifiedId[]|QualifiedUserClients} userIds - Targeted users.
32
- * @returns {Promise<QualifiedUserPreKeyBundleMap}
33
- */
34
- private getQualifiedPreKeyBundle;
35
- getPreKeyBundleMap(conversationId: string, userIds?: string[] | UserClients): Promise<UserPreKeyBundleMap>;
36
- private getSelfConversationId;
37
- private getQualifiedRecipientsForConversation;
38
- private getRecipientsForConversation;
39
- /**
40
- * Sends a message to a conversation
41
- *
42
- * @param sendingClientId The clientId from which the message is sent
43
- * @param conversationId The conversation in which to send the message
44
- * @param genericMessage The payload of the message to send
45
- * @return Resolves with the message sending status from backend
46
- */
47
- private sendGenericMessage;
48
- private extractUserIds;
49
- private extractQualifiedUserIds;
50
- private generateButtonActionGenericMessage;
51
- private generateButtonActionConfirmationGenericMessage;
52
- private generateCompositeGenericMessage;
53
- private generateConfirmationGenericMessage;
54
- private generateEditedTextGenericMessage;
55
- private generateFileDataGenericMessage;
56
- private generateFileMetaDataGenericMessage;
57
- private generateFileAbortGenericMessage;
58
- private generateAsset;
59
- private generateImageGenericMessage;
60
- private generateLocationGenericMessage;
61
- private generatePingGenericMessage;
62
- private generateReactionGenericMessage;
63
- private generateSessionResetGenericMessage;
64
- private generateCallGenericMessage;
65
- private generateTextGenericMessage;
66
- clearConversation(conversationId: string, timestamp?: number | Date, messageId?: string, sendAsProtobuf?: boolean): Promise<ClearConversationMessage>;
67
- /**
68
- * Sends a LastRead message to the current user's self conversation.
69
- * This will allow all the user's devices to compute which messages are unread
70
- *
71
- * @param conversationId The conversation which has been read
72
- * @param lastReadTimestamp The timestamp at which the conversation was read
73
- * @param sendingOptions?
74
- * @return Resolves when the message has been sent
75
- */
76
- sendLastRead(conversationId: string, lastReadTimestamp: number, sendingOptions?: MessageSendingOptions): Promise<(MessageSendingStatus & {
77
- errored?: boolean | undefined;
78
- }) | (ClientMismatch & {
79
- errored?: boolean | undefined;
80
- })>;
81
- /**
82
- * Syncs all self user's devices with the countly id
83
- *
84
- * @param countlyId The countly id of the current device
85
- * @param sendingOptions?
86
- * @return Resolves when the message has been sent
87
- */
88
- sendCountlySync(countlyId: string, sendingOptions: MessageSendingOptions): Promise<(MessageSendingStatus & {
89
- errored?: boolean | undefined;
90
- }) | (ClientMismatch & {
91
- errored?: boolean | undefined;
92
- })>;
93
- /**
94
- * Get a fresh list from backend of clients for all the participants of the conversation.
95
- * @param {string} conversationId
96
- * @param {string} conversationDomain? - If given will send the message to the new qualified endpoint
97
- */
98
- getAllParticipantsClients(conversationId: string, conversationDomain?: string): Promise<UserClients | QualifiedUserClients>;
99
- deleteMessageLocal(conversationId: string, messageIdToHide: string, sendAsProtobuf?: boolean, conversationDomain?: string): Promise<HideMessage>;
100
- deleteMessageEveryone(conversationId: string, messageIdToDelete: string, userIds?: string[] | QualifiedId[] | UserClients | QualifiedUserClients, sendAsProtobuf?: boolean, conversationDomain?: string, callbacks?: MessageSendingCallbacks): Promise<DeleteMessage>;
101
- leaveConversation(conversationId: QualifiedId): Promise<ConversationMemberLeaveEvent>;
102
- leaveMLSConversation(conversationId: QualifiedId): Promise<ConversationMemberLeaveEvent>;
103
- /**
104
- * @depricated seems not to be used and is outdated. use leaveConversation instead
105
- */
106
- leaveConversations(conversationIds?: string[]): Promise<ConversationMemberLeaveEvent[]>;
107
- /**
108
- * Create a group conversation.
109
- * @param {string} name
110
- * @param {string|string[]} otherUserIds
111
- * @deprecated
112
- * @returns Promise
113
- */
114
- createProteusConversation(name: string, otherUserIds: string | string[]): Promise<Conversation>;
115
- /**
116
- * Create a group conversation.
117
- *
118
- * @note Do not include yourself as the requestor
119
- * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/conversations/createGroupConversation
120
- *
121
- * @param conversationData Payload object for group creation
122
- * @returns Resolves when the conversation was created
123
- */
124
- createProteusConversation(conversationData: NewConversation): Promise<Conversation>;
125
- getConversations(conversationId: string): Promise<Conversation>;
126
- getConversations(conversationIds?: string[]): Promise<Conversation[]>;
127
- getAsset({ assetId, assetToken, otrKey, sha256 }: RemoteData): Promise<Uint8Array>;
128
- getUnencryptedAsset(assetId: string, assetToken?: string): Promise<ArrayBuffer>;
129
- addUsersToProteusConversation({ conversationId, qualifiedUserIds }: Omit<AddUsersParams, 'groupId'>): Promise<import("@wireapp/api-client/src/event").ConversationMemberJoinEvent>;
130
- removeUserFromProteusConversation(conversationId: QualifiedId, userId: QualifiedId): Promise<ConversationMemberLeaveEvent>;
131
- private sendProteusMessage;
132
- /**
133
- * Sends a message to a conversation
134
- * @return resolves with the sent message
135
- */
136
- send<T extends OtrMessage>(params: XOR<SendMlsMessageParams<T>, SendProteusMessageParams<T>>): Promise<T>;
137
- sendTypingStart(conversationId: string): Promise<void>;
138
- sendTypingStop(conversationId: string): Promise<void>;
139
- setConversationMutedStatus(conversationId: string, status: MutedStatus, muteTimestamp: number | Date): Promise<void>;
140
- toggleArchiveConversation(conversationId: string, archived: boolean, archiveTimestamp?: number | Date): Promise<void>;
141
- setMemberConversationRole(conversationId: string, userId: string, conversationRole: DefaultConversationRoleName | string): Promise<void>;
142
- private isClearFromMismatch;
143
- private generateGenericMessage;
144
- /**
145
- * ###############################################
146
- * ################ MLS Functions ################
147
- * ###############################################
148
- */
149
- createMLSConversation(conversationData: NewConversation): Promise<MLSReturnType>;
150
- private sendMLSMessage;
151
- addUsersToMLSConversation({ qualifiedUserIds, groupId, conversationId, }: Required<AddUsersParams>): Promise<MLSReturnType>;
152
- private storeLastKeyMaterialUpdateDateWithCurrentTime;
153
- removeUsersFromMLSConversation({ groupId, conversationId, qualifiedUserIds, }: RemoveUsersParams): Promise<MLSReturnType>;
154
- /**
155
- * Will send an external proposal for the current device to join a specific conversation.
156
- * In order for the external proposal to be sent correctly, the underlying mls conversation needs to be in a non-established state
157
- * @param conversationGroupId The conversation to join
158
- * @param epoch The current epoch of the local conversation
159
- */
160
- sendExternalJoinProposal(conversationGroupId: string, epoch: number): Promise<void>;
161
- isMLSConversationEstablished(conversationGroupId: string): Promise<boolean>;
162
- }