@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,72 +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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
- Object.defineProperty(o, "default", { enumerable: true, value: v });
29
- }) : function(o, v) {
30
- o["default"] = v;
31
- });
32
- var __importStar = (this && this.__importStar) || function (mod) {
33
- if (mod && mod.__esModule) return mod;
34
- var result = {};
35
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
36
- __setModuleDefault(result, mod);
37
- return result;
38
- };
39
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
40
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
41
- };
42
- Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.ContentType = exports.LegalHoldStatus = void 0;
44
- var protocol_messaging_1 = require("@wireapp/protocol-messaging");
45
- Object.defineProperty(exports, "LegalHoldStatus", { enumerable: true, get: function () { return protocol_messaging_1.LegalHoldStatus; } });
46
- const ContentType = __importStar(require("./ContentType"));
47
- exports.ContentType = ContentType;
48
- __exportStar(require("./AssetContent"), exports);
49
- __exportStar(require("./ButtonActionContent"), exports);
50
- __exportStar(require("./ButtonActionConfirmationContent"), exports);
51
- __exportStar(require("./CallingContent"), exports);
52
- __exportStar(require("./ClearedContent"), exports);
53
- __exportStar(require("./ClientActionContent"), exports);
54
- __exportStar(require("./ClientAddContent"), exports);
55
- __exportStar(require("./ClientRemoveContent"), exports);
56
- __exportStar(require("./CompositeContent"), exports);
57
- __exportStar(require("./ConfirmationContent"), exports);
58
- __exportStar(require("./ConversationContent"), exports);
59
- __exportStar(require("./DeletedContent"), exports);
60
- __exportStar(require("./EditedTextContent"), exports);
61
- __exportStar(require("./FileContent"), exports);
62
- __exportStar(require("./HiddenContent"), exports);
63
- __exportStar(require("./ImageContent"), exports);
64
- __exportStar(require("./KnockContent"), exports);
65
- __exportStar(require("./LinkPreviewContent"), exports);
66
- __exportStar(require("./LocationContent"), exports);
67
- __exportStar(require("./MentionContent"), exports);
68
- __exportStar(require("./QuoteContent"), exports);
69
- __exportStar(require("./ReactionContent"), exports);
70
- __exportStar(require("./TextContent"), exports);
71
- __exportStar(require("./TweetContent"), exports);
72
- //# sourceMappingURL=index.js.map
@@ -1,9 +0,0 @@
1
- export * from './AbortReason';
2
- export * from './AssetService';
3
- export * from './AssetTransferState';
4
- export * from './ClientActionType';
5
- export * from './ConversationService';
6
- export * from './GenericMessageType';
7
- export * from './MessageTimer';
8
- export * from './message/PayloadBundle';
9
- export * from './ReactionType';
@@ -1,40 +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("./AbortReason"), exports);
32
- __exportStar(require("./AssetService"), exports);
33
- __exportStar(require("./AssetTransferState"), exports);
34
- __exportStar(require("./ClientActionType"), exports);
35
- __exportStar(require("./ConversationService"), exports);
36
- __exportStar(require("./GenericMessageType"), exports);
37
- __exportStar(require("./MessageTimer"), exports);
38
- __exportStar(require("./message/PayloadBundle"), exports);
39
- __exportStar(require("./ReactionType"), exports);
40
- //# sourceMappingURL=index.js.map
@@ -1,14 +0,0 @@
1
- import { Text } from '@wireapp/protocol-messaging';
2
- import { LegalHoldStatus } from '../content';
3
- import type { CompositeMessage } from './OtrMessage';
4
- export declare class CompositeContentBuilder {
5
- private readonly content;
6
- private readonly payloadBundle;
7
- private readonly items;
8
- constructor(payloadBundle: CompositeMessage);
9
- build(): CompositeMessage;
10
- withReadConfirmation(expectsReadConfirmation?: boolean): CompositeContentBuilder;
11
- withLegalHoldStatus(legalHoldStatus?: LegalHoldStatus): CompositeContentBuilder;
12
- addText(text: Text): CompositeContentBuilder;
13
- addButton(buttonText: string, id?: string): CompositeContentBuilder;
14
- }
@@ -1,54 +0,0 @@
1
- "use strict";
2
- /*
3
- * Wire
4
- * Copyright (C) 2020 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.CompositeContentBuilder = void 0;
22
- const protocol_messaging_1 = require("@wireapp/protocol-messaging");
23
- const content_1 = require("../content");
24
- const MessageBuilder_1 = require("./MessageBuilder");
25
- class CompositeContentBuilder {
26
- constructor(payloadBundle) {
27
- this.content = {};
28
- this.items = [];
29
- this.payloadBundle = payloadBundle;
30
- }
31
- build() {
32
- this.payloadBundle.content = this.content;
33
- this.payloadBundle.content.items = this.items;
34
- return this.payloadBundle;
35
- }
36
- withReadConfirmation(expectsReadConfirmation = false) {
37
- this.content.expectsReadConfirmation = expectsReadConfirmation;
38
- return this;
39
- }
40
- withLegalHoldStatus(legalHoldStatus = content_1.LegalHoldStatus.UNKNOWN) {
41
- this.content.legalHoldStatus = legalHoldStatus;
42
- return this;
43
- }
44
- addText(text) {
45
- this.items.push(protocol_messaging_1.Composite.Item.create({ text }));
46
- return this;
47
- }
48
- addButton(buttonText, id = MessageBuilder_1.MessageBuilder.createId()) {
49
- this.items.push(protocol_messaging_1.Composite.Item.create({ button: protocol_messaging_1.Button.create({ id, text: buttonText }) }));
50
- return this;
51
- }
52
- }
53
- exports.CompositeContentBuilder = CompositeContentBuilder;
54
- //# sourceMappingURL=CompositeContentBuilder.js.map
@@ -1,4 +0,0 @@
1
- import type { OtrMessage } from './OtrMessage';
2
- import type { TeamMessage } from './TeamMessage';
3
- import type { UserMessage } from './UserMessage';
4
- export declare type Message = OtrMessage | TeamMessage | UserMessage;
@@ -1,21 +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
- //# sourceMappingURL=Message.js.map
@@ -1,87 +0,0 @@
1
- import { Confirmation } from '@wireapp/protocol-messaging';
2
- import { AbortReason } from '..';
3
- import { EncryptedAssetUploaded } from '../../cryptography';
4
- import type { ButtonActionConfirmationContent, ButtonActionContent, CallingContent, FileContent, FileMetaDataContent, ImageContent, KnockContent, LegalHoldStatus, LocationContent, ReactionContent } from '../content';
5
- import { CompositeContentBuilder } from './CompositeContentBuilder';
6
- import type { ButtonActionConfirmationMessage, ButtonActionMessage, CallMessage, ConfirmationMessage, FileAssetAbortMessage, FileAssetMessage, FileAssetMetaDataMessage, ImageAssetMessageOutgoing, LocationMessage, PingMessage, ReactionMessage, ResetSessionMessage } from './OtrMessage';
7
- import { TextContentBuilder } from './TextContentBuilder';
8
- interface BaseOptions {
9
- conversationId: string;
10
- from: string;
11
- messageId?: string;
12
- }
13
- interface CreateImageOptions extends BaseOptions {
14
- expectsReadConfirmation?: boolean;
15
- asset: EncryptedAssetUploaded;
16
- image: ImageContent;
17
- legalHoldStatus?: LegalHoldStatus;
18
- }
19
- interface CreateFileOptions extends BaseOptions {
20
- expectsReadConfirmation?: boolean;
21
- asset: EncryptedAssetUploaded;
22
- file: FileContent;
23
- legalHoldStatus?: LegalHoldStatus;
24
- originalMessageId: string;
25
- }
26
- interface CreateEditedTextOptions extends BaseOptions {
27
- newMessageText: string;
28
- originalMessageId: string;
29
- }
30
- interface CreateFileMetadataOptions extends BaseOptions {
31
- expectsReadConfirmation?: boolean;
32
- legalHoldStatus?: LegalHoldStatus;
33
- metaData: FileMetaDataContent;
34
- }
35
- interface CreateFileAbortOptions {
36
- conversationId: string;
37
- expectsReadConfirmation?: boolean;
38
- from: string;
39
- legalHoldStatus?: LegalHoldStatus;
40
- originalMessageId: string;
41
- reason: AbortReason;
42
- }
43
- interface CreateLocationOptions extends BaseOptions {
44
- location: LocationContent;
45
- }
46
- interface CreateCallOptions extends BaseOptions {
47
- content: CallingContent;
48
- }
49
- interface CreateReactionOptions extends BaseOptions {
50
- reaction: ReactionContent;
51
- }
52
- interface CreateTextOptions extends BaseOptions {
53
- text: string;
54
- }
55
- interface CreateConfirmationOptions extends BaseOptions {
56
- firstMessageId: string;
57
- moreMessageIds?: string[];
58
- type: Confirmation.Type;
59
- }
60
- interface CreatePingOptions extends BaseOptions {
61
- ping?: KnockContent;
62
- }
63
- interface CreateButtonActionConfirmationOptions extends BaseOptions {
64
- content: ButtonActionConfirmationContent;
65
- }
66
- interface CreateActionMessageOptions extends BaseOptions {
67
- content: ButtonActionContent;
68
- }
69
- export declare class MessageBuilder {
70
- static createEditedText(payload: CreateEditedTextOptions): TextContentBuilder;
71
- static createFileData(payload: CreateFileOptions): FileAssetMessage;
72
- static createFileMetadata(payload: CreateFileMetadataOptions): FileAssetMetaDataMessage;
73
- static createFileAbort(payload: CreateFileAbortOptions): FileAssetAbortMessage;
74
- static createImage(payload: CreateImageOptions): ImageAssetMessageOutgoing;
75
- static createLocation(payload: CreateLocationOptions): LocationMessage;
76
- static createCall(payload: CreateCallOptions): CallMessage;
77
- static createReaction(payload: CreateReactionOptions): ReactionMessage;
78
- static createText(payload: CreateTextOptions): TextContentBuilder;
79
- static createConfirmation(payload: CreateConfirmationOptions): ConfirmationMessage;
80
- static createButtonActionMessage(payload: CreateActionMessageOptions): ButtonActionMessage;
81
- static createButtonActionConfirmationMessage(payload: CreateButtonActionConfirmationOptions): ButtonActionConfirmationMessage;
82
- static createComposite(payload: BaseOptions): CompositeContentBuilder;
83
- static createPing(payload: CreatePingOptions): PingMessage;
84
- static createSessionReset(payload: BaseOptions): ResetSessionMessage;
85
- static createId(): string;
86
- }
87
- export {};
@@ -1,119 +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
- var __importDefault = (this && this.__importDefault) || function (mod) {
21
- return (mod && mod.__esModule) ? mod : { "default": mod };
22
- };
23
- Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.MessageBuilder = void 0;
25
- const protocol_messaging_1 = require("@wireapp/protocol-messaging");
26
- const uuidjs_1 = __importDefault(require("uuidjs"));
27
- const __1 = require("..");
28
- const CompositeContentBuilder_1 = require("./CompositeContentBuilder");
29
- const TextContentBuilder_1 = require("./TextContentBuilder");
30
- function createCommonProperties(options) {
31
- return {
32
- id: options.messageId || MessageBuilder.createId(),
33
- conversation: options.conversationId,
34
- from: options.from,
35
- source: __1.PayloadBundleSource.LOCAL,
36
- state: __1.PayloadBundleState.OUTGOING_UNSENT,
37
- timestamp: Date.now(),
38
- };
39
- }
40
- class MessageBuilder {
41
- static createEditedText(payload) {
42
- return new TextContentBuilder_1.TextContentBuilder(Object.assign(Object.assign({}, createCommonProperties(payload)), { content: {
43
- originalMessageId: payload.originalMessageId,
44
- text: payload.newMessageText,
45
- }, type: __1.PayloadBundleType.MESSAGE_EDIT }));
46
- }
47
- static createFileData(payload) {
48
- const { asset, expectsReadConfirmation, file, legalHoldStatus, originalMessageId } = payload;
49
- return Object.assign(Object.assign({}, createCommonProperties(payload)), { content: {
50
- asset,
51
- expectsReadConfirmation,
52
- file,
53
- legalHoldStatus,
54
- }, id: originalMessageId, type: __1.PayloadBundleType.ASSET });
55
- }
56
- static createFileMetadata(payload) {
57
- const { expectsReadConfirmation, legalHoldStatus, metaData } = payload;
58
- return Object.assign(Object.assign({}, createCommonProperties(payload)), { content: {
59
- expectsReadConfirmation,
60
- legalHoldStatus,
61
- metaData,
62
- }, type: __1.PayloadBundleType.ASSET_META });
63
- }
64
- static createFileAbort(payload) {
65
- const { expectsReadConfirmation, legalHoldStatus, reason } = payload;
66
- return Object.assign(Object.assign({}, createCommonProperties(payload)), { content: {
67
- expectsReadConfirmation,
68
- legalHoldStatus,
69
- reason,
70
- }, id: payload.originalMessageId, type: __1.PayloadBundleType.ASSET_ABORT });
71
- }
72
- static createImage(payload) {
73
- const { expectsReadConfirmation, image, asset, legalHoldStatus } = payload;
74
- return Object.assign(Object.assign({}, createCommonProperties(payload)), { content: {
75
- expectsReadConfirmation,
76
- image,
77
- asset,
78
- legalHoldStatus,
79
- }, type: __1.PayloadBundleType.ASSET_IMAGE });
80
- }
81
- static createLocation(payload) {
82
- return Object.assign(Object.assign({}, createCommonProperties(payload)), { content: payload.location, type: __1.PayloadBundleType.LOCATION });
83
- }
84
- static createCall(payload) {
85
- return Object.assign(Object.assign({}, createCommonProperties(payload)), { content: payload.content, type: __1.PayloadBundleType.CALL });
86
- }
87
- static createReaction(payload) {
88
- return Object.assign(Object.assign({}, createCommonProperties(payload)), { content: payload.reaction, type: __1.PayloadBundleType.REACTION });
89
- }
90
- static createText(payload) {
91
- return new TextContentBuilder_1.TextContentBuilder(Object.assign(Object.assign({}, createCommonProperties(payload)), { content: { text: payload.text }, type: __1.PayloadBundleType.TEXT }));
92
- }
93
- static createConfirmation(payload) {
94
- const { firstMessageId, moreMessageIds, type } = payload;
95
- return Object.assign(Object.assign({}, createCommonProperties(payload)), { content: { firstMessageId, moreMessageIds, type }, type: __1.PayloadBundleType.CONFIRMATION });
96
- }
97
- static createButtonActionMessage(payload) {
98
- return Object.assign(Object.assign({}, createCommonProperties(payload)), { content: payload.content, type: __1.PayloadBundleType.BUTTON_ACTION });
99
- }
100
- static createButtonActionConfirmationMessage(payload) {
101
- return Object.assign(Object.assign({}, createCommonProperties(payload)), { content: payload.content, type: __1.PayloadBundleType.BUTTON_ACTION_CONFIRMATION });
102
- }
103
- static createComposite(payload) {
104
- return new CompositeContentBuilder_1.CompositeContentBuilder(Object.assign(Object.assign({}, createCommonProperties(payload)), { content: {}, type: __1.PayloadBundleType.COMPOSITE }));
105
- }
106
- static createPing(payload) {
107
- return Object.assign(Object.assign({}, createCommonProperties(payload)), { content: payload.ping || { hotKnock: false }, type: __1.PayloadBundleType.PING });
108
- }
109
- static createSessionReset(payload) {
110
- return Object.assign(Object.assign({}, createCommonProperties(payload)), { content: {
111
- clientAction: protocol_messaging_1.ClientAction.RESET_SESSION,
112
- }, type: __1.PayloadBundleType.CLIENT_ACTION });
113
- }
114
- static createId() {
115
- return uuidjs_1.default.genV4().toString();
116
- }
117
- }
118
- exports.MessageBuilder = MessageBuilder;
119
- //# sourceMappingURL=MessageBuilder.js.map
@@ -1,67 +0,0 @@
1
- import { APIClient } from '@wireapp/api-client';
2
- import { ClientMismatch, MessageSendingStatus, QualifiedUserClients, UserClients } from '@wireapp/api-client/src/conversation';
3
- import { CryptographyService } from '../../cryptography';
4
- import { QualifiedId, QualifiedUserPreKeyBundleMap, UserPreKeyBundleMap } from '@wireapp/api-client/src/user';
5
- export declare class MessageService {
6
- private readonly apiClient;
7
- private readonly cryptographyService;
8
- constructor(apiClient: APIClient, cryptographyService: CryptographyService);
9
- /**
10
- * Sends a message to a non-federated backend.
11
- *
12
- * @param sendingClientId The clientId of the current user
13
- * @param recipients The list of recipients to send the message to
14
- * @param plainText The plainText data to send
15
- * @param options.conversationId? the conversation to send the message to. Will broadcast if not set
16
- * @param options.reportMissing? trigger a mismatch error when there are missing recipients in the payload
17
- * @param options.sendAsProtobuf?
18
- * @param options.onClientMismatch? Called when a mismatch happens on the server
19
- * @return the ClientMismatch status returned by the backend
20
- */
21
- sendMessage(sendingClientId: string, recipients: UserClients | UserPreKeyBundleMap, plainText: Uint8Array, options?: {
22
- conversationId?: string;
23
- reportMissing?: boolean | string[];
24
- sendAsProtobuf?: boolean;
25
- nativePush?: boolean;
26
- onClientMismatch?: (mismatch: ClientMismatch) => void | boolean | Promise<boolean>;
27
- }): Promise<ClientMismatch & {
28
- errored?: boolean;
29
- }>;
30
- /**
31
- * Sends a message to a federated backend.
32
- *
33
- * @param sendingClientId The clientId of the current user
34
- * @param recipients The list of recipients to send the message to
35
- * @param plainText The plainText data to send
36
- * @param options.conversationId? the conversation to send the message to. Will broadcast if not set
37
- * @param options.reportMissing? trigger a mismatch error when there are missing recipients in the payload
38
- * @param options.sendAsProtobuf?
39
- * @param options.onClientMismatch? Called when a mismatch happens on the server
40
- * @return the MessageSendingStatus returned by the backend
41
- */
42
- sendFederatedMessage(sendingClientId: string, recipients: QualifiedUserClients | QualifiedUserPreKeyBundleMap, plainText: Uint8Array, options: {
43
- assetData?: Uint8Array;
44
- conversationId?: QualifiedId;
45
- reportMissing?: boolean | QualifiedId[];
46
- nativePush?: boolean;
47
- onClientMismatch?: (mismatch: MessageSendingStatus) => void | boolean | Promise<boolean>;
48
- }): Promise<MessageSendingStatus & {
49
- errored?: boolean;
50
- }>;
51
- private sendFederatedOtrMessage;
52
- private sendOTRMessage;
53
- private generateExternalPayload;
54
- private shouldSendAsExternal;
55
- private isClientMismatchError;
56
- private reencryptAfterMismatch;
57
- /**
58
- * Will re-encrypt a message when there were some missing clients in the initial send (typically when the server replies with a client mismatch error)
59
- *
60
- * @param {ProtobufOTR.QualifiedNewOtrMessage} messageData The initial message that was sent
61
- * @param {MessageSendingStatus} messageSendingStatus Info about the missing/deleted clients
62
- * @param {Uint8Array} plainText The text that should be encrypted for the missing clients
63
- * @return resolves with a new message payload that can be sent
64
- */
65
- private reencryptAfterFederatedMismatch;
66
- private sendOTRProtobufMessage;
67
- }