@wireapp/core 17.31.0 → 17.31.4

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 (237) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/package.json +9 -9
  3. package/src/main/Account.js.map +0 -1
  4. package/src/main/Account.test.browser.js +0 -114
  5. package/src/main/Account.test.node.d.ts +0 -1
  6. package/src/main/Account.test.node.js +0 -214
  7. package/src/main/Account.test.node.js.map +0 -1
  8. package/src/main/Account.test.node.ts +0 -236
  9. package/src/main/Account.ts +0 -401
  10. package/src/main/CoreError.js.map +0 -1
  11. package/src/main/CoreError.ts +0 -30
  12. package/src/main/auth/LoginSanitizer.js.map +0 -1
  13. package/src/main/auth/LoginSanitizer.test.node.d.ts +0 -1
  14. package/src/main/auth/LoginSanitizer.test.node.js +0 -56
  15. package/src/main/auth/LoginSanitizer.test.node.js.map +0 -1
  16. package/src/main/auth/LoginSanitizer.test.node.ts +0 -68
  17. package/src/main/auth/LoginSanitizer.ts +0 -44
  18. package/src/main/auth/index.js.map +0 -1
  19. package/src/main/auth/index.ts +0 -20
  20. package/src/main/broadcast/AvailabilityType.js.map +0 -1
  21. package/src/main/broadcast/AvailabilityType.ts +0 -22
  22. package/src/main/broadcast/BroadcastService.js.map +0 -1
  23. package/src/main/broadcast/BroadcastService.ts +0 -66
  24. package/src/main/broadcast/index.js.map +0 -1
  25. package/src/main/broadcast/index.ts +0 -21
  26. package/src/main/client/ClientBackendRepository.js.map +0 -1
  27. package/src/main/client/ClientBackendRepository.ts +0 -33
  28. package/src/main/client/ClientDatabaseRepository.js.map +0 -1
  29. package/src/main/client/ClientDatabaseRepository.ts +0 -130
  30. package/src/main/client/ClientInfo.js.map +0 -1
  31. package/src/main/client/ClientInfo.ts +0 -28
  32. package/src/main/client/ClientService.js.map +0 -1
  33. package/src/main/client/ClientService.ts +0 -116
  34. package/src/main/client/index.js.map +0 -1
  35. package/src/main/client/index.ts +0 -23
  36. package/src/main/connection/ConnectionService.js.map +0 -1
  37. package/src/main/connection/ConnectionService.ts +0 -49
  38. package/src/main/connection/index.js.map +0 -1
  39. package/src/main/connection/index.ts +0 -20
  40. package/src/main/conversation/AbortReason.js.map +0 -1
  41. package/src/main/conversation/AbortReason.ts +0 -22
  42. package/src/main/conversation/AssetService.js.map +0 -1
  43. package/src/main/conversation/AssetService.test.node.d.ts +0 -1
  44. package/src/main/conversation/AssetService.test.node.js +0 -61
  45. package/src/main/conversation/AssetService.test.node.js.map +0 -1
  46. package/src/main/conversation/AssetService.test.node.ts +0 -65
  47. package/src/main/conversation/AssetService.ts +0 -60
  48. package/src/main/conversation/AssetTransferState.js.map +0 -1
  49. package/src/main/conversation/AssetTransferState.ts +0 -23
  50. package/src/main/conversation/ClientActionType.js.map +0 -1
  51. package/src/main/conversation/ClientActionType.ts +0 -20
  52. package/src/main/conversation/ConversationMapper.js.map +0 -1
  53. package/src/main/conversation/ConversationMapper.test.node.d.ts +0 -1
  54. package/src/main/conversation/ConversationMapper.test.node.js +0 -111
  55. package/src/main/conversation/ConversationMapper.test.node.js.map +0 -1
  56. package/src/main/conversation/ConversationMapper.test.node.ts +0 -154
  57. package/src/main/conversation/ConversationMapper.ts +0 -56
  58. package/src/main/conversation/ConversationService.js.map +0 -1
  59. package/src/main/conversation/ConversationService.test.node.d.ts +0 -1
  60. package/src/main/conversation/ConversationService.test.node.js +0 -344
  61. package/src/main/conversation/ConversationService.test.node.js.map +0 -1
  62. package/src/main/conversation/ConversationService.test.node.ts +0 -416
  63. package/src/main/conversation/ConversationService.ts +0 -1024
  64. package/src/main/conversation/GenericMessageType.js.map +0 -1
  65. package/src/main/conversation/GenericMessageType.ts +0 -44
  66. package/src/main/conversation/MessageTimer.js.map +0 -1
  67. package/src/main/conversation/MessageTimer.test.node.d.ts +0 -1
  68. package/src/main/conversation/MessageTimer.test.node.js +0 -88
  69. package/src/main/conversation/MessageTimer.test.node.js.map +0 -1
  70. package/src/main/conversation/MessageTimer.test.node.ts +0 -103
  71. package/src/main/conversation/MessageTimer.ts +0 -56
  72. package/src/main/conversation/ReactionType.js.map +0 -1
  73. package/src/main/conversation/ReactionType.ts +0 -23
  74. package/src/main/conversation/content/AssetContent.js.map +0 -1
  75. package/src/main/conversation/content/AssetContent.ts +0 -71
  76. package/src/main/conversation/content/ButtonActionConfirmationContent.js.map +0 -1
  77. package/src/main/conversation/content/ButtonActionConfirmationContent.ts +0 -21
  78. package/src/main/conversation/content/ButtonActionContent.js.map +0 -1
  79. package/src/main/conversation/content/ButtonActionContent.ts +0 -21
  80. package/src/main/conversation/content/CallingContent.js.map +0 -1
  81. package/src/main/conversation/content/CallingContent.ts +0 -20
  82. package/src/main/conversation/content/ClearedContent.js.map +0 -1
  83. package/src/main/conversation/content/ClearedContent.ts +0 -21
  84. package/src/main/conversation/content/ClientActionContent.js.map +0 -1
  85. package/src/main/conversation/content/ClientActionContent.ts +0 -22
  86. package/src/main/conversation/content/ClientAddContent.js.map +0 -1
  87. package/src/main/conversation/content/ClientAddContent.ts +0 -24
  88. package/src/main/conversation/content/ClientRemoveContent.js.map +0 -1
  89. package/src/main/conversation/content/ClientRemoveContent.ts +0 -25
  90. package/src/main/conversation/content/CompositeContent.js.map +0 -1
  91. package/src/main/conversation/content/CompositeContent.ts +0 -21
  92. package/src/main/conversation/content/ConfirmationContent.js.map +0 -1
  93. package/src/main/conversation/content/ConfirmationContent.ts +0 -21
  94. package/src/main/conversation/content/ContentType.js.map +0 -1
  95. package/src/main/conversation/content/ContentType.ts +0 -112
  96. package/src/main/conversation/content/ConversationContent.js.map +0 -1
  97. package/src/main/conversation/content/ConversationContent.ts +0 -71
  98. package/src/main/conversation/content/DeletedContent.js.map +0 -1
  99. package/src/main/conversation/content/DeletedContent.ts +0 -21
  100. package/src/main/conversation/content/EditedTextContent.js.map +0 -1
  101. package/src/main/conversation/content/EditedTextContent.ts +0 -31
  102. package/src/main/conversation/content/FileContent.js.map +0 -1
  103. package/src/main/conversation/content/FileContent.ts +0 -32
  104. package/src/main/conversation/content/HiddenContent.js.map +0 -1
  105. package/src/main/conversation/content/HiddenContent.ts +0 -21
  106. package/src/main/conversation/content/ImageContent.js.map +0 -1
  107. package/src/main/conversation/content/ImageContent.ts +0 -25
  108. package/src/main/conversation/content/KnockContent.js.map +0 -1
  109. package/src/main/conversation/content/KnockContent.ts +0 -21
  110. package/src/main/conversation/content/LinkPreviewContent.js.map +0 -1
  111. package/src/main/conversation/content/LinkPreviewContent.ts +0 -32
  112. package/src/main/conversation/content/LocationContent.js.map +0 -1
  113. package/src/main/conversation/content/LocationContent.ts +0 -29
  114. package/src/main/conversation/content/MentionContent.js.map +0 -1
  115. package/src/main/conversation/content/MentionContent.ts +0 -21
  116. package/src/main/conversation/content/QuoteContent.js.map +0 -1
  117. package/src/main/conversation/content/QuoteContent.ts +0 -29
  118. package/src/main/conversation/content/ReactionContent.js.map +0 -1
  119. package/src/main/conversation/content/ReactionContent.ts +0 -27
  120. package/src/main/conversation/content/TextContent.js.map +0 -1
  121. package/src/main/conversation/content/TextContent.ts +0 -29
  122. package/src/main/conversation/content/TweetContent.js.map +0 -1
  123. package/src/main/conversation/content/TweetContent.ts +0 -21
  124. package/src/main/conversation/content/index.js.map +0 -1
  125. package/src/main/conversation/content/index.ts +0 -49
  126. package/src/main/conversation/index.js.map +0 -1
  127. package/src/main/conversation/index.ts +0 -28
  128. package/src/main/conversation/message/CompositeContentBuilder.js.map +0 -1
  129. package/src/main/conversation/message/CompositeContentBuilder.ts +0 -60
  130. package/src/main/conversation/message/Message.js.map +0 -1
  131. package/src/main/conversation/message/Message.ts +0 -24
  132. package/src/main/conversation/message/MessageBuilder.js.map +0 -1
  133. package/src/main/conversation/message/MessageBuilder.test.browser.js +0 -27
  134. package/src/main/conversation/message/MessageBuilder.ts +0 -488
  135. package/src/main/conversation/message/MessageService.js.map +0 -1
  136. package/src/main/conversation/message/MessageService.test.node.d.ts +0 -1
  137. package/src/main/conversation/message/MessageService.test.node.js +0 -308
  138. package/src/main/conversation/message/MessageService.test.node.js.map +0 -1
  139. package/src/main/conversation/message/MessageService.test.node.ts +0 -398
  140. package/src/main/conversation/message/MessageService.ts +0 -383
  141. package/src/main/conversation/message/MessageToProtoMapper.js.map +0 -1
  142. package/src/main/conversation/message/MessageToProtoMapper.ts +0 -114
  143. package/src/main/conversation/message/OtrMessage.js.map +0 -1
  144. package/src/main/conversation/message/OtrMessage.ts +0 -160
  145. package/src/main/conversation/message/PayloadBundle.js.map +0 -1
  146. package/src/main/conversation/message/PayloadBundle.ts +0 -101
  147. package/src/main/conversation/message/TeamMessage.js.map +0 -1
  148. package/src/main/conversation/message/TeamMessage.ts +0 -72
  149. package/src/main/conversation/message/TextContentBuilder.js.map +0 -1
  150. package/src/main/conversation/message/TextContentBuilder.ts +0 -88
  151. package/src/main/conversation/message/UserClientsUtil.js.map +0 -1
  152. package/src/main/conversation/message/UserClientsUtil.ts +0 -44
  153. package/src/main/conversation/message/UserClientsUtils.test.node.d.ts +0 -1
  154. package/src/main/conversation/message/UserClientsUtils.test.node.js +0 -42
  155. package/src/main/conversation/message/UserClientsUtils.test.node.js.map +0 -1
  156. package/src/main/conversation/message/UserClientsUtils.test.node.ts +0 -44
  157. package/src/main/conversation/message/UserMessage.js.map +0 -1
  158. package/src/main/conversation/message/UserMessage.ts +0 -95
  159. package/src/main/cryptography/AssetCryptography.browser.js.map +0 -1
  160. package/src/main/cryptography/AssetCryptography.browser.ts +0 -76
  161. package/src/main/cryptography/AssetCryptography.node.js.map +0 -1
  162. package/src/main/cryptography/AssetCryptography.node.ts +0 -85
  163. package/src/main/cryptography/CryptographyDatabaseRepository.js.map +0 -1
  164. package/src/main/cryptography/CryptographyDatabaseRepository.ts +0 -44
  165. package/src/main/cryptography/CryptographyService.js.map +0 -1
  166. package/src/main/cryptography/CryptographyService.test.browser.js +0 -195
  167. package/src/main/cryptography/CryptographyService.test.node.d.ts +0 -1
  168. package/src/main/cryptography/CryptographyService.test.node.js +0 -228
  169. package/src/main/cryptography/CryptographyService.test.node.js.map +0 -1
  170. package/src/main/cryptography/CryptographyService.test.node.ts +0 -246
  171. package/src/main/cryptography/CryptographyService.ts +0 -246
  172. package/src/main/cryptography/EncryptedAsset.js.map +0 -1
  173. package/src/main/cryptography/EncryptedAsset.ts +0 -30
  174. package/src/main/cryptography/GenericMessageMapper.js.map +0 -1
  175. package/src/main/cryptography/GenericMessageMapper.ts +0 -274
  176. package/src/main/cryptography/MessageHashService.js.map +0 -1
  177. package/src/main/cryptography/MessageHashService.test.browser.js +0 -176
  178. package/src/main/cryptography/MessageHashService.test.node.d.ts +0 -1
  179. package/src/main/cryptography/MessageHashService.test.node.js +0 -138
  180. package/src/main/cryptography/MessageHashService.test.node.js.map +0 -1
  181. package/src/main/cryptography/MessageHashService.test.node.ts +0 -176
  182. package/src/main/cryptography/MessageHashService.ts +0 -109
  183. package/src/main/cryptography/SessionPayloadBundle.js.map +0 -1
  184. package/src/main/cryptography/SessionPayloadBundle.ts +0 -23
  185. package/src/main/cryptography/index.js.map +0 -1
  186. package/src/main/cryptography/index.ts +0 -23
  187. package/src/main/giphy/GiphyService.js.map +0 -1
  188. package/src/main/giphy/GiphyService.ts +0 -37
  189. package/src/main/giphy/index.js.map +0 -1
  190. package/src/main/giphy/index.ts +0 -20
  191. package/src/main/index.js.map +0 -1
  192. package/src/main/index.test.browser.js +0 -22
  193. package/src/main/index.ts +0 -34
  194. package/src/main/notification/NotificationBackendRepository.js.map +0 -1
  195. package/src/main/notification/NotificationBackendRepository.ts +0 -33
  196. package/src/main/notification/NotificationDatabaseRepository.js.map +0 -1
  197. package/src/main/notification/NotificationDatabaseRepository.ts +0 -74
  198. package/src/main/notification/NotificationService.js.map +0 -1
  199. package/src/main/notification/NotificationService.test.browser.js +0 -179
  200. package/src/main/notification/NotificationService.test.node.d.ts +0 -1
  201. package/src/main/notification/NotificationService.test.node.js +0 -99
  202. package/src/main/notification/NotificationService.test.node.js.map +0 -1
  203. package/src/main/notification/NotificationService.test.node.ts +0 -124
  204. package/src/main/notification/NotificationService.ts +0 -260
  205. package/src/main/notification/index.js.map +0 -1
  206. package/src/main/notification/index.ts +0 -20
  207. package/src/main/self/SelfService.js.map +0 -1
  208. package/src/main/self/SelfService.ts +0 -59
  209. package/src/main/self/index.js.map +0 -1
  210. package/src/main/self/index.ts +0 -20
  211. package/src/main/team/TeamService.js.map +0 -1
  212. package/src/main/team/TeamService.ts +0 -68
  213. package/src/main/team/index.js.map +0 -1
  214. package/src/main/team/index.ts +0 -20
  215. package/src/main/test/CryptographyHelper.js.map +0 -1
  216. package/src/main/test/CryptographyHelper.ts +0 -57
  217. package/src/main/test/PayloadHelper.js.map +0 -1
  218. package/src/main/test/PayloadHelper.ts +0 -60
  219. package/src/main/user/UserMapper.js.map +0 -1
  220. package/src/main/user/UserMapper.test.node.d.ts +0 -1
  221. package/src/main/user/UserMapper.test.node.js +0 -55
  222. package/src/main/user/UserMapper.test.node.js.map +0 -1
  223. package/src/main/user/UserMapper.test.node.ts +0 -63
  224. package/src/main/user/UserMapper.ts +0 -92
  225. package/src/main/user/UserService.js.map +0 -1
  226. package/src/main/user/UserService.test.node.js +0 -141
  227. package/src/main/user/UserService.ts +0 -98
  228. package/src/main/user/index.js.map +0 -1
  229. package/src/main/user/index.ts +0 -20
  230. package/src/main/util/TypePredicateUtil.js.map +0 -1
  231. package/src/main/util/TypePredicateUtil.test.node.d.ts +0 -1
  232. package/src/main/util/TypePredicateUtil.test.node.js +0 -42
  233. package/src/main/util/TypePredicateUtil.test.node.js.map +0 -1
  234. package/src/main/util/TypePredicateUtil.test.node.ts +0 -44
  235. package/src/main/util/TypePredicateUtil.ts +0 -52
  236. package/src/main/util/index.js.map +0 -1
  237. package/src/main/util/index.ts +0 -20
@@ -1,176 +0,0 @@
1
- /*
2
- * Wire
3
- * Copyright (C) 2018 Wire Swiss GmbH
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see http://www.gnu.org/licenses/.
17
- *
18
- */
19
-
20
- import {AvailableMessageContent, MessageHashService} from './MessageHashService';
21
-
22
- describe('MessageHashService', () => {
23
- describe('"getHash"', () => {
24
- it('correctly identifies the message type.', () => {
25
- const content = {
26
- text: 'Hello!',
27
- };
28
-
29
- const messageHashService = new MessageHashService(content);
30
-
31
- spyOn<any>(messageHashService, 'getTextBytes').and.callThrough();
32
- spyOn<any>(messageHashService, 'getLocationBytes').and.callThrough();
33
-
34
- messageHashService.getHash();
35
-
36
- expect(messageHashService['getTextBytes']).toHaveBeenCalled();
37
- expect(messageHashService['getLocationBytes']).not.toHaveBeenCalled();
38
- });
39
-
40
- it('correctly creates a timestamp bytes buffer.', () => {
41
- const expectedHexValue = '000000005bcdcc09';
42
- const content = {
43
- text: 'Hello!',
44
- };
45
- const timestamp = 1540213769;
46
-
47
- const messageHashService = new MessageHashService(content, timestamp);
48
- const buffer = messageHashService['getTimestampBuffer'](timestamp);
49
-
50
- const hexValue = buffer.toString('hex');
51
- expect(hexValue).toBe(expectedHexValue);
52
- });
53
-
54
- it('correctly creates a markdown text bytes buffer.', () => {
55
- const expectedHashValue = 'f25a925d55116800e66872d2a82d8292adf1d4177195703f976bc884d32b5c94';
56
-
57
- const content = {
58
- text: 'This has **markdown**',
59
- };
60
- const timestamp = 1540213965000;
61
-
62
- const messageHashService = new MessageHashService(content, timestamp);
63
-
64
- const hashValue = messageHashService.getHash().toString('hex');
65
- expect(hashValue).toBe(expectedHashValue);
66
- });
67
-
68
- it('correctly creates an arabic text bytes buffer.', () => {
69
- const expectedHashValue = '5830012f6f14c031bf21aded5b07af6e2d02d01074f137d106d4645e4dc539ca';
70
-
71
- const content = {
72
- text: 'بغداد',
73
- };
74
- const timestamp = 1540213965000;
75
-
76
- const messageHashService = new MessageHashService(content, timestamp);
77
-
78
- const hashValue = messageHashService.getHash().toString('hex');
79
- expect(hashValue).toBe(expectedHashValue);
80
- });
81
-
82
- it('correctly creates an emoji text bytes buffer.', () => {
83
- const expectedHashValue = '4f8ee55a8b71a7eb7447301d1bd0c8429971583b15a91594b45dee16f208afd5';
84
-
85
- const content = {
86
- text: 'Hello 👩‍💻👨‍👩‍👧!',
87
- };
88
- const timestamp = 1540213769000;
89
-
90
- const messageHashService = new MessageHashService(content, timestamp);
91
-
92
- const hashValue = messageHashService.getHash().toString('hex');
93
- expect(hashValue).toBe(expectedHashValue);
94
- });
95
-
96
- it('correctly creates a link text bytes buffer.', () => {
97
- const expectedHashValue = 'ef39934807203191c404ebb3acba0d33ec9dce669f9acec49710d520c365b657';
98
-
99
- const content = {
100
- text: 'https://www.youtube.com/watch?v=DLzxrzFCyOs',
101
- };
102
- const timestamp = 1540213769000;
103
-
104
- const messageHashService = new MessageHashService(content, timestamp);
105
-
106
- const hashValue = messageHashService.getHash().toString('hex');
107
- expect(hashValue).toBe(expectedHashValue);
108
- });
109
-
110
- it('correctly creates a location bytes buffer.', () => {
111
- const expectedHashValue = '56a5fa30081bc16688574fdfbbe96c2eee004d1fb37dc714eec6efb340192816';
112
-
113
- const content = {
114
- latitude: 52.5166667,
115
- longitude: 13.4,
116
- };
117
- const timestamp = 1540213769000;
118
-
119
- const messageHashService = new MessageHashService(content, timestamp);
120
-
121
- const hashValue = messageHashService.getHash().toString('hex');
122
- expect(hashValue).toBe(expectedHashValue);
123
- });
124
-
125
- it('correctly creates another location bytes buffer.', () => {
126
- const expectedHashValue = '803b2698104f58772dbd715ec6ee5853d835df98a4736742b2a676b2217c9499';
127
-
128
- const content = {
129
- latitude: 51.509143,
130
- longitude: -0.117277,
131
- };
132
- const timestamp = 1540213769000;
133
-
134
- const messageHashService = new MessageHashService(content, timestamp);
135
-
136
- const hashValue = messageHashService.getHash().toString('hex');
137
- expect(hashValue).toBe(expectedHashValue);
138
- });
139
-
140
- it('correctly creates an asset bytes buffer.', () => {
141
- const expectedHashValue = 'bf20de149847ae999775b3cc88e5ff0c0382e9fa67b9d382b1702920b8afa1de';
142
-
143
- const content: AvailableMessageContent = {
144
- uploaded: {
145
- assetId: '3-2-1-38d4f5b9',
146
- otrKey: new Uint8Array(),
147
- sha256: new Uint8Array(),
148
- },
149
- };
150
- const timestamp = 1540213769000;
151
-
152
- const messageHashService = new MessageHashService(content, timestamp);
153
-
154
- const hashValue = messageHashService.getHash().toString('hex');
155
- expect(hashValue).toBe(expectedHashValue);
156
- });
157
-
158
- it('correctly creates another asset bytes buffer.', () => {
159
- const expectedHashValue = '2235f5b6c00d9b0917675399d0314c8401f0525457b00aa54a38998ab93b90d6';
160
-
161
- const content: AvailableMessageContent = {
162
- uploaded: {
163
- assetId: '3-3-3-82a62735',
164
- otrKey: new Uint8Array(),
165
- sha256: new Uint8Array(),
166
- },
167
- };
168
- const timestamp = 1540213965000;
169
-
170
- const messageHashService = new MessageHashService(content, timestamp);
171
-
172
- const hashValue = messageHashService.getHash().toString('hex');
173
- expect(hashValue).toBe(expectedHashValue);
174
- });
175
- });
176
- });
@@ -1,109 +0,0 @@
1
- /*
2
- * Wire
3
- * Copyright (C) 2018 Wire Swiss GmbH
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see http://www.gnu.org/licenses/.
17
- *
18
- */
19
-
20
- import * as hash from 'hash.js';
21
- import Long from 'long';
22
-
23
- import {AssetContent, ContentType, ConversationContent, LocationContent, TextContent} from '../conversation/content';
24
-
25
- export type AvailableMessageContent = AssetContent | LocationContent | TextContent;
26
-
27
- export class MessageHashService {
28
- private readonly messageContent: AvailableMessageContent;
29
- private readonly timestamp: number;
30
-
31
- constructor(messageContent: AvailableMessageContent, timestamp: number = Date.now()) {
32
- this.messageContent = messageContent;
33
- const unixTimestamp = new Date(timestamp).getTime();
34
- this.timestamp = Math.floor(unixTimestamp / 1e3);
35
- }
36
-
37
- private createSha256Hash(buffer: Buffer): Buffer {
38
- const hashArray = hash.sha256().update(buffer).digest();
39
- return Buffer.from(hashArray);
40
- }
41
-
42
- private convertToUtf16BE(str: string): Buffer {
43
- const BOMChar = '\uFEFF';
44
-
45
- str = `${BOMChar}${str}`;
46
-
47
- const buffer = Buffer.from(str, 'ucs2');
48
-
49
- for (let index = 0; index < buffer.length; index += 2) {
50
- const tempValue = buffer[index];
51
- buffer[index] = buffer[index + 1];
52
- buffer[index + 1] = tempValue;
53
- }
54
-
55
- return buffer;
56
- }
57
-
58
- private getAssetBytes(content: AssetContent): Buffer {
59
- if (content.uploaded) {
60
- const assetId = content.uploaded.assetId;
61
- return this.convertToUtf16BE(assetId);
62
- }
63
- return Buffer.from([]);
64
- }
65
-
66
- private getTimestampBuffer(timestamp: number): Buffer {
67
- const timestampBytes = Long.fromInt(timestamp).toBytesBE();
68
- return Buffer.from(timestampBytes);
69
- }
70
-
71
- private getLocationBytes(content: LocationContent): Buffer {
72
- const latitudeApproximate = Math.round(content.latitude * 1000);
73
- const longitudeApproximate = Math.round(content.longitude * 1000);
74
-
75
- const latitudeLong = Long.fromInt(latitudeApproximate).toBytesBE();
76
- const longitudeLong = Long.fromInt(longitudeApproximate).toBytesBE();
77
-
78
- const latitudeBuffer = Buffer.from(latitudeLong);
79
- const longitudeBuffer = Buffer.from(longitudeLong);
80
-
81
- return Buffer.concat([latitudeBuffer, longitudeBuffer]);
82
- }
83
-
84
- private getTextBytes(content: TextContent): Buffer {
85
- return this.convertToUtf16BE(content.text);
86
- }
87
-
88
- private getBytes(content: ConversationContent): Buffer {
89
- let bytes: Buffer;
90
-
91
- if (ContentType.isLocationContent(content)) {
92
- bytes = this.getLocationBytes(content);
93
- } else if (ContentType.isTextContent(content)) {
94
- bytes = this.getTextBytes(content);
95
- } else if (ContentType.isAssetContent(content)) {
96
- bytes = this.getAssetBytes(content);
97
- } else {
98
- throw new Error(`Unknown message type. ${content}`);
99
- }
100
-
101
- const timestampBuffer = this.getTimestampBuffer(this.timestamp);
102
- return Buffer.concat([bytes, timestampBuffer]);
103
- }
104
-
105
- getHash(): Buffer {
106
- const buffer = this.getBytes(this.messageContent);
107
- return this.createSha256Hash(buffer);
108
- }
109
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"SessionPayloadBundle.js","sourceRoot":"","sources":["SessionPayloadBundle.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG"}
@@ -1,23 +0,0 @@
1
- /*
2
- * Wire
3
- * Copyright (C) 2018 Wire Swiss GmbH
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see http://www.gnu.org/licenses/.
17
- *
18
- */
19
-
20
- export interface SessionPayloadBundle {
21
- encryptedPayload: Uint8Array;
22
- sessionId: string;
23
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAEH,wDAAsC;AACtC,mDAAiC;AACjC,yDAAuC;AACvC,uDAAqC"}
@@ -1,23 +0,0 @@
1
- /*
2
- * Wire
3
- * Copyright (C) 2018 Wire Swiss GmbH
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see http://www.gnu.org/licenses/.
17
- *
18
- */
19
-
20
- export * from './CryptographyService';
21
- export * from './EncryptedAsset';
22
- export * from './SessionPayloadBundle';
23
- export * from './MessageHashService';
@@ -1 +0,0 @@
1
- {"version":3,"file":"GiphyService.js","sourceRoot":"","sources":["GiphyService.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAKH,MAAa,YAAY;IACvB,YAA6B,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IAAG,CAAC;IAE9C,YAAY,CAAC,GAAY,EAAE,MAAqB;QACrD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,EAAC,MAAM,EAAE,GAAG,EAAC,CAAC,CAAC;IAChE,CAAC;IAEM,cAAc,CAAC,MAAqB;QACzC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAC,MAAM,EAAC,CAAC,CAAC;IAC7D,CAAC;IAEM,SAAS,CAAC,OAA2B;QAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AAdD,oCAcC"}
@@ -1,37 +0,0 @@
1
- /*
2
- * Wire
3
- * Copyright (C) 2018 Wire Swiss GmbH
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see http://www.gnu.org/licenses/.
17
- *
18
- */
19
-
20
- import type {APIClient} from '@wireapp/api-client';
21
- import type {GiphySearchOptions, GiphyMultipleResult, GiphyResult, GIPHY_RATING} from '@wireapp/api-client/src/giphy/';
22
-
23
- export class GiphyService {
24
- constructor(private readonly apiClient: APIClient) {}
25
-
26
- public getRandomGif(tag?: string, rating?: GIPHY_RATING): Promise<GiphyResult> {
27
- return this.apiClient.giphy.api.getGiphyRandom({rating, tag});
28
- }
29
-
30
- public getTrendingGif(rating?: GIPHY_RATING): Promise<GiphyMultipleResult> {
31
- return this.apiClient.giphy.api.getGiphyTrending({rating});
32
- }
33
-
34
- public searchGif(options: GiphySearchOptions): Promise<GiphyMultipleResult> {
35
- return this.apiClient.giphy.api.getGiphySearch(options);
36
- }
37
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAEH,iDAA+B"}
@@ -1,20 +0,0 @@
1
- /*
2
- * Wire
3
- * Copyright (C) 2018 Wire Swiss GmbH
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see http://www.gnu.org/licenses/.
17
- *
18
- */
19
-
20
- export * from './GiphyService';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;;;;;AAEH,uCAAkC;AAClC,8CAAgC;AAChC,8DAAgD;AAChD,2CAAsC;AACtC,8DAAgD;AAChD,6CAA+B;AAE/B,iBAAS;IACP,OAAO,EAAP,iBAAO;IACP,SAAS,EAAT,qBAAS;IACT,IAAI;IACJ,YAAY;IACZ,YAAY;IACZ,IAAI;CACL,CAAC"}
@@ -1,22 +0,0 @@
1
- /*
2
- * Wire
3
- * Copyright (C) 2018 Wire Swiss GmbH
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see http://www.gnu.org/licenses/.
17
- *
18
- */
19
-
20
- // traverse all test files for webpack dependency resolution
21
- const testsContext = require.context('./', true, /test\.browser\.js$/);
22
- testsContext.keys().forEach(testsContext);
package/src/main/index.ts DELETED
@@ -1,34 +0,0 @@
1
- /*
2
- * Wire
3
- * Copyright (C) 2018 Wire Swiss GmbH
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see http://www.gnu.org/licenses/.
17
- *
18
- */
19
-
20
- import {Account} from './Account';
21
- import * as auth from './auth/';
22
- import * as conversation from './conversation/';
23
- import {CoreError} from './CoreError';
24
- import * as cryptography from './cryptography/';
25
- import * as util from './util';
26
-
27
- export = {
28
- Account,
29
- CoreError,
30
- auth,
31
- conversation,
32
- cryptography,
33
- util,
34
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationBackendRepository.js","sourceRoot":"","sources":["NotificationBackendRepository.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAKH,MAAa,6BAA6B;IACxC,YAA6B,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IAAG,CAAC;IAE9C,KAAK,CAAC,mBAAmB,CAAC,QAAiB,EAAE,kBAA2B;QAC7E,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IAC3F,CAAC;IAEM,mBAAmB,CAAC,QAAiB;QAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACvE,CAAC;CACF;AAVD,sEAUC"}
@@ -1,33 +0,0 @@
1
- /*
2
- * Wire
3
- * Copyright (C) 2018 Wire Swiss GmbH
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see http://www.gnu.org/licenses/.
17
- *
18
- */
19
-
20
- import type {APIClient} from '@wireapp/api-client';
21
- import type {Notification} from '@wireapp/api-client/src/notification/';
22
-
23
- export class NotificationBackendRepository {
24
- constructor(private readonly apiClient: APIClient) {}
25
-
26
- public async getAllNotifications(clientId?: string, lastNotificationId?: string): Promise<Notification[]> {
27
- return this.apiClient.notification.api.getAllNotifications(clientId, lastNotificationId);
28
- }
29
-
30
- public getLastNotification(clientId?: string): Promise<Notification> {
31
- return this.apiClient.notification.api.getLastNotification(clientId);
32
- }
33
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationDatabaseRepository.js","sourceRoot":"","sources":["NotificationDatabaseRepository.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAMH,mGAA8F;AAE9F,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,mCAAiB,CAAA;AACnB,CAAC,EAFW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAEzB;AAED,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+EAA+D,CAAA;IAC/D,2FAA2E,CAAA;AAC7E,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AAED,MAAM,aAAa,GAAG,+DAA8B,CAAC,MAAM,CAAC,OAAO,CAAC;AAEpE,MAAa,8BAA8B;IACzC,YAA6B,WAAuB;QAAvB,gBAAW,GAAX,WAAW,CAAY;IAAG,CAAC;IAEjD,wBAAwB;QAC7B,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAe,cAAc,CAAC,MAAM,CAAC,CAAC;IACvE,CAAC;IAEM,KAAK,CAAC,gBAAgB;QAC3B,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAExC,aAAa,EAAE,YAAY,CAAC,sBAAsB,CAAC,CAAC;QACvD,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAAC,SAAe;QAC9C,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,sBAAsB,EAAE,EAAC,KAAK,EAAE,SAAS,CAAC,WAAW,EAAE,EAAC,CAAC,CAAC;QACpH,OAAO,SAAS,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAAC,SAAe;QAC9C,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,sBAAsB,EAAE,EAAC,KAAK,EAAE,SAAS,CAAC,WAAW,EAAE,EAAC,CAAC,CAAC;QACpH,OAAO,SAAS,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,qBAAqB;QAChC,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAExC,aAAa,EAAE,YAAY,CAAC,6BAA6B,CAAC,CAAC;QAC9D,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,KAAK,CAAC,wBAAwB,CAAC,gBAA8B;QAClE,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,aAAa,EAAE,YAAY,CAAC,6BAA6B,EAAE;YAC/F,KAAK,EAAE,gBAAgB,CAAC,EAAE;SAC3B,CAAC,CAAC;QACH,OAAO,gBAAgB,CAAC,EAAE,CAAC;IAC7B,CAAC;CACF;AArCD,wEAqCC"}
@@ -1,74 +0,0 @@
1
- /*
2
- * Wire
3
- * Copyright (C) 2018 Wire Swiss GmbH
4
- *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see http://www.gnu.org/licenses/.
17
- *
18
- */
19
-
20
- import type {BackendEvent} from '@wireapp/api-client/src/event';
21
- import type {Notification} from '@wireapp/api-client/src/notification/';
22
- import type {CRUDEngine} from '@wireapp/store-engine';
23
-
24
- import {CryptographyDatabaseRepository} from '../cryptography/CryptographyDatabaseRepository';
25
-
26
- export enum DatabaseStores {
27
- EVENTS = 'events',
28
- }
29
-
30
- export enum DatabaseKeys {
31
- PRIMARY_KEY_LAST_EVENT = 'z.storage.StorageKey.EVENT.LAST_DATE',
32
- PRIMARY_KEY_LAST_NOTIFICATION = 'z.storage.StorageKey.NOTIFICATION.LAST_ID',
33
- }
34
-
35
- const STORE_AMPLIFY = CryptographyDatabaseRepository.STORES.AMPLIFY;
36
-
37
- export class NotificationDatabaseRepository {
38
- constructor(private readonly storeEngine: CRUDEngine) {}
39
-
40
- public getNotificationEventList(): Promise<BackendEvent[]> {
41
- return this.storeEngine.readAll<BackendEvent>(DatabaseStores.EVENTS);
42
- }
43
-
44
- public async getLastEventDate(): Promise<Date> {
45
- const {value} = await this.storeEngine.read<{
46
- value: string;
47
- }>(STORE_AMPLIFY, DatabaseKeys.PRIMARY_KEY_LAST_EVENT);
48
- return new Date(value);
49
- }
50
-
51
- public async updateLastEventDate(eventDate: Date): Promise<Date> {
52
- await this.storeEngine.update(STORE_AMPLIFY, DatabaseKeys.PRIMARY_KEY_LAST_EVENT, {value: eventDate.toISOString()});
53
- return eventDate;
54
- }
55
-
56
- public async createLastEventDate(eventDate: Date): Promise<Date> {
57
- await this.storeEngine.create(STORE_AMPLIFY, DatabaseKeys.PRIMARY_KEY_LAST_EVENT, {value: eventDate.toISOString()});
58
- return eventDate;
59
- }
60
-
61
- public async getLastNotificationId(): Promise<string> {
62
- const {value} = await this.storeEngine.read<{
63
- value: string;
64
- }>(STORE_AMPLIFY, DatabaseKeys.PRIMARY_KEY_LAST_NOTIFICATION);
65
- return value;
66
- }
67
-
68
- public async updateLastNotificationId(lastNotification: Notification): Promise<string> {
69
- await this.storeEngine.updateOrCreate(STORE_AMPLIFY, DatabaseKeys.PRIMARY_KEY_LAST_NOTIFICATION, {
70
- value: lastNotification.id,
71
- });
72
- return lastNotification.id;
73
- }
74
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationService.js","sourceRoot":"","sources":["NotificationService.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,sEAAwD;AAExD,wDAA4E;AAC5E,mCAAoC;AACpC,sDAA8B;AAC9B,kDAAsF;AAEtF,2EAAsE;AAGtE,4CAA0D;AAE1D,mDAA8C;AAC9C,mFAA8E;AAC9E,qFAAgF;AAEhF,IAAK,KAEJ;AAFD,WAAK,KAAK;IACR,4EAAmE,CAAA;AACrE,CAAC,EAFI,KAAK,KAAL,KAAK,QAET;AAuCD,MAAa,mBAAoB,SAAQ,qBAAY;IAWnD,YAAY,SAAoB,EAAE,mBAAwC,EAAE,WAAuB;QACjG,KAAK,EAAE,CAAC;QAPO,WAAM,GAAG,IAAA,iBAAO,EAAC,gDAAgD,EAAE;YAClF,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,KAAK;SAChB,CAAC,CAAC;QAqEa,uBAAkB,GAAwB,KAAK,EAC7D,YAA0B,EAC1B,MAA2B,EACZ,EAAE;YACjB,KAAK,MAAM,KAAK,IAAI,YAAY,CAAC,OAAO,EAAE;gBACxC,IAAI,IAA0B,CAAC;gBAE/B,IAAI;oBACF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,2BAA2B,KAAK,CAAC,IAAI,+BAA+B,YAAY,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;oBAC/G,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;oBAC7C,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE;wBAC3B,MAAM,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC;qBAChD;iBACF;gBAAC,OAAO,KAAK,EAAE;oBACd,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,4CAA4C,YAA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