@wireapp/core 17.29.0 → 17.31.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 (243) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/package.json +8 -8
  3. package/src/main/conversation/ConversationMapper.js +2 -0
  4. package/src/main/conversation/ConversationService.d.ts +5 -2
  5. package/src/main/conversation/ConversationService.js +0 -2
  6. package/src/main/conversation/message/PayloadBundle.d.ts +3 -0
  7. package/src/main/cryptography/GenericMessageMapper.d.ts +0 -1
  8. package/src/main/cryptography/GenericMessageMapper.js +23 -158
  9. package/src/main/Account.js.map +0 -1
  10. package/src/main/Account.test.browser.js +0 -114
  11. package/src/main/Account.test.node.d.ts +0 -1
  12. package/src/main/Account.test.node.js +0 -214
  13. package/src/main/Account.test.node.js.map +0 -1
  14. package/src/main/Account.test.node.ts +0 -236
  15. package/src/main/Account.ts +0 -401
  16. package/src/main/CoreError.js.map +0 -1
  17. package/src/main/CoreError.ts +0 -30
  18. package/src/main/auth/LoginSanitizer.js.map +0 -1
  19. package/src/main/auth/LoginSanitizer.test.node.d.ts +0 -1
  20. package/src/main/auth/LoginSanitizer.test.node.js +0 -56
  21. package/src/main/auth/LoginSanitizer.test.node.js.map +0 -1
  22. package/src/main/auth/LoginSanitizer.test.node.ts +0 -68
  23. package/src/main/auth/LoginSanitizer.ts +0 -44
  24. package/src/main/auth/index.js.map +0 -1
  25. package/src/main/auth/index.ts +0 -20
  26. package/src/main/broadcast/AvailabilityType.js.map +0 -1
  27. package/src/main/broadcast/AvailabilityType.ts +0 -22
  28. package/src/main/broadcast/BroadcastService.js.map +0 -1
  29. package/src/main/broadcast/BroadcastService.ts +0 -66
  30. package/src/main/broadcast/index.js.map +0 -1
  31. package/src/main/broadcast/index.ts +0 -21
  32. package/src/main/client/ClientBackendRepository.js.map +0 -1
  33. package/src/main/client/ClientBackendRepository.ts +0 -33
  34. package/src/main/client/ClientDatabaseRepository.js.map +0 -1
  35. package/src/main/client/ClientDatabaseRepository.ts +0 -130
  36. package/src/main/client/ClientInfo.js.map +0 -1
  37. package/src/main/client/ClientInfo.ts +0 -28
  38. package/src/main/client/ClientService.js.map +0 -1
  39. package/src/main/client/ClientService.ts +0 -116
  40. package/src/main/client/index.js.map +0 -1
  41. package/src/main/client/index.ts +0 -23
  42. package/src/main/connection/ConnectionService.js.map +0 -1
  43. package/src/main/connection/ConnectionService.ts +0 -49
  44. package/src/main/connection/index.js.map +0 -1
  45. package/src/main/connection/index.ts +0 -20
  46. package/src/main/conversation/AbortReason.js.map +0 -1
  47. package/src/main/conversation/AbortReason.ts +0 -22
  48. package/src/main/conversation/AssetService.js.map +0 -1
  49. package/src/main/conversation/AssetService.test.node.d.ts +0 -1
  50. package/src/main/conversation/AssetService.test.node.js +0 -61
  51. package/src/main/conversation/AssetService.test.node.js.map +0 -1
  52. package/src/main/conversation/AssetService.test.node.ts +0 -65
  53. package/src/main/conversation/AssetService.ts +0 -60
  54. package/src/main/conversation/AssetTransferState.js.map +0 -1
  55. package/src/main/conversation/AssetTransferState.ts +0 -23
  56. package/src/main/conversation/ClientActionType.js.map +0 -1
  57. package/src/main/conversation/ClientActionType.ts +0 -20
  58. package/src/main/conversation/ConversationMapper.js.map +0 -1
  59. package/src/main/conversation/ConversationMapper.test.node.d.ts +0 -1
  60. package/src/main/conversation/ConversationMapper.test.node.js +0 -111
  61. package/src/main/conversation/ConversationMapper.test.node.js.map +0 -1
  62. package/src/main/conversation/ConversationMapper.test.node.ts +0 -154
  63. package/src/main/conversation/ConversationMapper.ts +0 -54
  64. package/src/main/conversation/ConversationService.js.map +0 -1
  65. package/src/main/conversation/ConversationService.test.node.d.ts +0 -1
  66. package/src/main/conversation/ConversationService.test.node.js +0 -344
  67. package/src/main/conversation/ConversationService.test.node.js.map +0 -1
  68. package/src/main/conversation/ConversationService.test.node.ts +0 -416
  69. package/src/main/conversation/ConversationService.ts +0 -1020
  70. package/src/main/conversation/GenericMessageType.js.map +0 -1
  71. package/src/main/conversation/GenericMessageType.ts +0 -44
  72. package/src/main/conversation/MessageTimer.js.map +0 -1
  73. package/src/main/conversation/MessageTimer.test.node.d.ts +0 -1
  74. package/src/main/conversation/MessageTimer.test.node.js +0 -88
  75. package/src/main/conversation/MessageTimer.test.node.js.map +0 -1
  76. package/src/main/conversation/MessageTimer.test.node.ts +0 -103
  77. package/src/main/conversation/MessageTimer.ts +0 -56
  78. package/src/main/conversation/ReactionType.js.map +0 -1
  79. package/src/main/conversation/ReactionType.ts +0 -23
  80. package/src/main/conversation/content/AssetContent.js.map +0 -1
  81. package/src/main/conversation/content/AssetContent.ts +0 -71
  82. package/src/main/conversation/content/ButtonActionConfirmationContent.js.map +0 -1
  83. package/src/main/conversation/content/ButtonActionConfirmationContent.ts +0 -21
  84. package/src/main/conversation/content/ButtonActionContent.js.map +0 -1
  85. package/src/main/conversation/content/ButtonActionContent.ts +0 -21
  86. package/src/main/conversation/content/CallingContent.js.map +0 -1
  87. package/src/main/conversation/content/CallingContent.ts +0 -20
  88. package/src/main/conversation/content/ClearedContent.js.map +0 -1
  89. package/src/main/conversation/content/ClearedContent.ts +0 -21
  90. package/src/main/conversation/content/ClientActionContent.js.map +0 -1
  91. package/src/main/conversation/content/ClientActionContent.ts +0 -22
  92. package/src/main/conversation/content/ClientAddContent.js.map +0 -1
  93. package/src/main/conversation/content/ClientAddContent.ts +0 -24
  94. package/src/main/conversation/content/ClientRemoveContent.js.map +0 -1
  95. package/src/main/conversation/content/ClientRemoveContent.ts +0 -25
  96. package/src/main/conversation/content/CompositeContent.js.map +0 -1
  97. package/src/main/conversation/content/CompositeContent.ts +0 -21
  98. package/src/main/conversation/content/ConfirmationContent.js.map +0 -1
  99. package/src/main/conversation/content/ConfirmationContent.ts +0 -21
  100. package/src/main/conversation/content/ContentType.js.map +0 -1
  101. package/src/main/conversation/content/ContentType.ts +0 -112
  102. package/src/main/conversation/content/ConversationContent.js.map +0 -1
  103. package/src/main/conversation/content/ConversationContent.ts +0 -71
  104. package/src/main/conversation/content/DeletedContent.js.map +0 -1
  105. package/src/main/conversation/content/DeletedContent.ts +0 -21
  106. package/src/main/conversation/content/EditedTextContent.js.map +0 -1
  107. package/src/main/conversation/content/EditedTextContent.ts +0 -31
  108. package/src/main/conversation/content/FileContent.js.map +0 -1
  109. package/src/main/conversation/content/FileContent.ts +0 -32
  110. package/src/main/conversation/content/HiddenContent.js.map +0 -1
  111. package/src/main/conversation/content/HiddenContent.ts +0 -21
  112. package/src/main/conversation/content/ImageContent.js.map +0 -1
  113. package/src/main/conversation/content/ImageContent.ts +0 -25
  114. package/src/main/conversation/content/KnockContent.js.map +0 -1
  115. package/src/main/conversation/content/KnockContent.ts +0 -21
  116. package/src/main/conversation/content/LinkPreviewContent.js.map +0 -1
  117. package/src/main/conversation/content/LinkPreviewContent.ts +0 -32
  118. package/src/main/conversation/content/LocationContent.js.map +0 -1
  119. package/src/main/conversation/content/LocationContent.ts +0 -29
  120. package/src/main/conversation/content/MentionContent.js.map +0 -1
  121. package/src/main/conversation/content/MentionContent.ts +0 -21
  122. package/src/main/conversation/content/QuoteContent.js.map +0 -1
  123. package/src/main/conversation/content/QuoteContent.ts +0 -29
  124. package/src/main/conversation/content/ReactionContent.js.map +0 -1
  125. package/src/main/conversation/content/ReactionContent.ts +0 -27
  126. package/src/main/conversation/content/TextContent.js.map +0 -1
  127. package/src/main/conversation/content/TextContent.ts +0 -29
  128. package/src/main/conversation/content/TweetContent.js.map +0 -1
  129. package/src/main/conversation/content/TweetContent.ts +0 -21
  130. package/src/main/conversation/content/index.js.map +0 -1
  131. package/src/main/conversation/content/index.ts +0 -49
  132. package/src/main/conversation/index.js.map +0 -1
  133. package/src/main/conversation/index.ts +0 -28
  134. package/src/main/conversation/message/CompositeContentBuilder.js.map +0 -1
  135. package/src/main/conversation/message/CompositeContentBuilder.ts +0 -60
  136. package/src/main/conversation/message/Message.js.map +0 -1
  137. package/src/main/conversation/message/Message.ts +0 -24
  138. package/src/main/conversation/message/MessageBuilder.js.map +0 -1
  139. package/src/main/conversation/message/MessageBuilder.test.browser.js +0 -27
  140. package/src/main/conversation/message/MessageBuilder.ts +0 -488
  141. package/src/main/conversation/message/MessageService.js.map +0 -1
  142. package/src/main/conversation/message/MessageService.test.node.d.ts +0 -1
  143. package/src/main/conversation/message/MessageService.test.node.js +0 -308
  144. package/src/main/conversation/message/MessageService.test.node.js.map +0 -1
  145. package/src/main/conversation/message/MessageService.test.node.ts +0 -398
  146. package/src/main/conversation/message/MessageService.ts +0 -383
  147. package/src/main/conversation/message/MessageToProtoMapper.js.map +0 -1
  148. package/src/main/conversation/message/MessageToProtoMapper.ts +0 -114
  149. package/src/main/conversation/message/OtrMessage.js.map +0 -1
  150. package/src/main/conversation/message/OtrMessage.ts +0 -160
  151. package/src/main/conversation/message/PayloadBundle.js.map +0 -1
  152. package/src/main/conversation/message/PayloadBundle.ts +0 -98
  153. package/src/main/conversation/message/TeamMessage.js.map +0 -1
  154. package/src/main/conversation/message/TeamMessage.ts +0 -72
  155. package/src/main/conversation/message/TextContentBuilder.js.map +0 -1
  156. package/src/main/conversation/message/TextContentBuilder.ts +0 -88
  157. package/src/main/conversation/message/UserClientsUtil.js.map +0 -1
  158. package/src/main/conversation/message/UserClientsUtil.ts +0 -44
  159. package/src/main/conversation/message/UserClientsUtils.test.node.d.ts +0 -1
  160. package/src/main/conversation/message/UserClientsUtils.test.node.js +0 -42
  161. package/src/main/conversation/message/UserClientsUtils.test.node.js.map +0 -1
  162. package/src/main/conversation/message/UserClientsUtils.test.node.ts +0 -44
  163. package/src/main/conversation/message/UserMessage.js.map +0 -1
  164. package/src/main/conversation/message/UserMessage.ts +0 -95
  165. package/src/main/cryptography/AssetCryptography.browser.js.map +0 -1
  166. package/src/main/cryptography/AssetCryptography.browser.ts +0 -76
  167. package/src/main/cryptography/AssetCryptography.node.js.map +0 -1
  168. package/src/main/cryptography/AssetCryptography.node.ts +0 -85
  169. package/src/main/cryptography/CryptographyDatabaseRepository.js.map +0 -1
  170. package/src/main/cryptography/CryptographyDatabaseRepository.ts +0 -44
  171. package/src/main/cryptography/CryptographyService.js.map +0 -1
  172. package/src/main/cryptography/CryptographyService.test.browser.js +0 -195
  173. package/src/main/cryptography/CryptographyService.test.node.d.ts +0 -1
  174. package/src/main/cryptography/CryptographyService.test.node.js +0 -228
  175. package/src/main/cryptography/CryptographyService.test.node.js.map +0 -1
  176. package/src/main/cryptography/CryptographyService.test.node.ts +0 -246
  177. package/src/main/cryptography/CryptographyService.ts +0 -246
  178. package/src/main/cryptography/EncryptedAsset.js.map +0 -1
  179. package/src/main/cryptography/EncryptedAsset.ts +0 -30
  180. package/src/main/cryptography/GenericMessageMapper.js.map +0 -1
  181. package/src/main/cryptography/GenericMessageMapper.ts +0 -364
  182. package/src/main/cryptography/MessageHashService.js.map +0 -1
  183. package/src/main/cryptography/MessageHashService.test.browser.js +0 -176
  184. package/src/main/cryptography/MessageHashService.test.node.d.ts +0 -1
  185. package/src/main/cryptography/MessageHashService.test.node.js +0 -138
  186. package/src/main/cryptography/MessageHashService.test.node.js.map +0 -1
  187. package/src/main/cryptography/MessageHashService.test.node.ts +0 -176
  188. package/src/main/cryptography/MessageHashService.ts +0 -109
  189. package/src/main/cryptography/SessionPayloadBundle.js.map +0 -1
  190. package/src/main/cryptography/SessionPayloadBundle.ts +0 -23
  191. package/src/main/cryptography/index.js.map +0 -1
  192. package/src/main/cryptography/index.ts +0 -23
  193. package/src/main/giphy/GiphyService.js.map +0 -1
  194. package/src/main/giphy/GiphyService.ts +0 -37
  195. package/src/main/giphy/index.js.map +0 -1
  196. package/src/main/giphy/index.ts +0 -20
  197. package/src/main/index.js.map +0 -1
  198. package/src/main/index.test.browser.js +0 -22
  199. package/src/main/index.ts +0 -34
  200. package/src/main/notification/NotificationBackendRepository.js.map +0 -1
  201. package/src/main/notification/NotificationBackendRepository.ts +0 -33
  202. package/src/main/notification/NotificationDatabaseRepository.js.map +0 -1
  203. package/src/main/notification/NotificationDatabaseRepository.ts +0 -74
  204. package/src/main/notification/NotificationService.js.map +0 -1
  205. package/src/main/notification/NotificationService.test.browser.js +0 -179
  206. package/src/main/notification/NotificationService.test.node.d.ts +0 -1
  207. package/src/main/notification/NotificationService.test.node.js +0 -99
  208. package/src/main/notification/NotificationService.test.node.js.map +0 -1
  209. package/src/main/notification/NotificationService.test.node.ts +0 -124
  210. package/src/main/notification/NotificationService.ts +0 -260
  211. package/src/main/notification/index.js.map +0 -1
  212. package/src/main/notification/index.ts +0 -20
  213. package/src/main/self/SelfService.js.map +0 -1
  214. package/src/main/self/SelfService.ts +0 -59
  215. package/src/main/self/index.js.map +0 -1
  216. package/src/main/self/index.ts +0 -20
  217. package/src/main/team/TeamService.js.map +0 -1
  218. package/src/main/team/TeamService.ts +0 -68
  219. package/src/main/team/index.js.map +0 -1
  220. package/src/main/team/index.ts +0 -20
  221. package/src/main/test/CryptographyHelper.js.map +0 -1
  222. package/src/main/test/CryptographyHelper.ts +0 -57
  223. package/src/main/test/PayloadHelper.js.map +0 -1
  224. package/src/main/test/PayloadHelper.ts +0 -60
  225. package/src/main/user/UserMapper.js.map +0 -1
  226. package/src/main/user/UserMapper.test.node.d.ts +0 -1
  227. package/src/main/user/UserMapper.test.node.js +0 -55
  228. package/src/main/user/UserMapper.test.node.js.map +0 -1
  229. package/src/main/user/UserMapper.test.node.ts +0 -63
  230. package/src/main/user/UserMapper.ts +0 -92
  231. package/src/main/user/UserService.js.map +0 -1
  232. package/src/main/user/UserService.test.node.js +0 -141
  233. package/src/main/user/UserService.ts +0 -98
  234. package/src/main/user/index.js.map +0 -1
  235. package/src/main/user/index.ts +0 -20
  236. package/src/main/util/TypePredicateUtil.js.map +0 -1
  237. package/src/main/util/TypePredicateUtil.test.node.d.ts +0 -1
  238. package/src/main/util/TypePredicateUtil.test.node.js +0 -42
  239. package/src/main/util/TypePredicateUtil.test.node.js.map +0 -1
  240. package/src/main/util/TypePredicateUtil.test.node.ts +0 -44
  241. package/src/main/util/TypePredicateUtil.ts +0 -52
  242. package/src/main/util/index.js.map +0 -1
  243. package/src/main/util/index.ts +0 -20
@@ -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 './NotificationService';
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelfService.js","sourceRoot":"","sources":["SelfService.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAKH,MAAa,WAAW;IACtB,YAA6B,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IAAG,CAAC;IAE9C,KAAK,CAAC,aAAa,CAAC,QAAgB;QACzC,MAAM,CAAC,iBAAiB,CAAC,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QAClE,OAAO,CAAC,CAAC,iBAAiB,CAAC;IAC7B,CAAC;IAEM,cAAc,CAAC,SAAmB;QACvC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC;YACzC,OAAO,EAAE,SAAS;SACnB,CAAC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,OAAO;QAClB,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,OAAO;QAClB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACzD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,WAAW;QACtB,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,OAAO,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAC,IAAI,EAAC,CAAC,CAAC;IACjD,CAAC;IAEM,WAAW,CAAC,QAAgB;QACjC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAC,CAAC,CAAC;IAC/D,CAAC;CACF;AApCD,kCAoCC"}
@@ -1,59 +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 {Self} from '@wireapp/api-client/src/self/';
22
-
23
- export class SelfService {
24
- constructor(private readonly apiClient: APIClient) {}
25
-
26
- public async checkUsername(username: string): Promise<boolean> {
27
- const [availableUsername] = await this.checkUsernames([username]);
28
- return !!availableUsername;
29
- }
30
-
31
- public checkUsernames(usernames: string[]): Promise<string[]> {
32
- return this.apiClient.user.api.postHandles({
33
- handles: usernames,
34
- });
35
- }
36
-
37
- public async getName(): Promise<string> {
38
- const {name} = await this.apiClient.self.api.getName();
39
- return name;
40
- }
41
-
42
- public async getSelf(): Promise<Self> {
43
- const selfData = await this.apiClient.self.api.getSelf();
44
- return selfData;
45
- }
46
-
47
- public async getUsername(): Promise<string | undefined> {
48
- const {handle} = await this.getSelf();
49
- return handle;
50
- }
51
-
52
- public setName(name: string): Promise<void> {
53
- return this.apiClient.self.api.putSelf({name});
54
- }
55
-
56
- public setUsername(username: string): Promise<void> {
57
- return this.apiClient.self.api.putHandle({handle: username});
58
- }
59
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAEH,gDAA8B"}
@@ -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 './SelfService';
@@ -1 +0,0 @@
1
- {"version":3,"file":"TeamService.js","sourceRoot":"","sources":["TeamService.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAYH,MAAa,WAAW;IACtB,YAA6B,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IAAG,CAAC;IAE9C,SAAS,CAAC,MAAc,EAAE,UAAsB;QACrD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,EAAE,UA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AC;IACjE,CAAC;CACF;AAtCD,kCAsCC"}
@@ -1,68 +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 {
22
- MemberData,
23
- Members,
24
- NewTeamData,
25
- TeamChunkData,
26
- TeamData,
27
- UpdateTeamData,
28
- } from '@wireapp/api-client/src/team/';
29
-
30
- export class TeamService {
31
- constructor(private readonly apiClient: APIClient) {}
32
-
33
- public addMember(teamId: string, memberData: MemberData): Promise<void> {
34
- return this.apiClient.teams.member.api.postMembers(teamId, memberData);
35
- }
36
-
37
- public createTeam(teamData: NewTeamData): Promise<void> {
38
- return this.apiClient.teams.team.api.postTeam(teamData);
39
- }
40
-
41
- public deleteTeam(teamId: string, password: string): Promise<void> {
42
- return this.apiClient.teams.team.api.deleteTeam(teamId, password);
43
- }
44
-
45
- public getAllMembers(teamId: string): Promise<Members> {
46
- return this.apiClient.teams.member.api.getAllMembers(teamId);
47
- }
48
-
49
- public getTeam(teamId: string): Promise<TeamData> {
50
- return this.apiClient.teams.team.api.getTeam(teamId);
51
- }
52
-
53
- public getTeams(): Promise<TeamChunkData> {
54
- return this.apiClient.teams.team.api.getTeams();
55
- }
56
-
57
- public removeMember(teamId: string, userId: string, password: string): Promise<void> {
58
- return this.apiClient.teams.member.api.deleteMember(teamId, userId, password);
59
- }
60
-
61
- public updateMember(teamId: string, memberData: MemberData): Promise<void> {
62
- return this.apiClient.teams.member.api.putMembers(teamId, memberData);
63
- }
64
-
65
- public updateTeam(teamId: string, teamData: UpdateTeamData): Promise<void> {
66
- return this.apiClient.teams.team.api.putTeam(teamId, teamData);
67
- }
68
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAEH,gDAA8B"}
@@ -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 './TeamService';
@@ -1 +0,0 @@
1
- {"version":3,"file":"CryptographyHelper.js","sourceRoot":"","sources":["CryptographyHelper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAA6C;AAC7C,8CAA4C;AAC5C,qDAAuC;AAIvC,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAEtC,KAAK,UAAU,uBAAuB,CAC3C,QAA8B,EAC9B,MAAmB,EACnB,IAAY;IAEZ,MAAM,IAAA,cAAI,GAAE,CAAC;IACb,MAAM,YAAY,GAAG,MAAM,WAAW,CAAC,kBAAkB,EAAE,CAAC;IAC5D,MAAM,MAAM,GAAG,IAAI,qBAAS,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAC9C,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;IAEtB,MAAM,SAAS,GAAG,QAAQ,MAAM,CAC9B,UAAU,CACV,CAAC,UAAU,CAAC,WAAW,EAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC;IAE7E,MAAM,cAAc,GAAG,QAAQ,CAAC,UAAU,CAAC;IAC3C,MAAM,kBAAkB,GAAG,IAAI,cAAI,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IACzE,MAAM,sBAAsB,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,kBAAkB,CAAC,SAAS,EAAE,CAAC,CAAC;IACrG,OAAO,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC,QAAQ,CAAC;AACrE,CAAC;AAlBD,0DAkBC;AAEM,KAAK,UAAU,YAAY,CAChC,mBAAwC,EACxC,oBAA4B,EAC5B,YAAoB,QAAQ,IAAI,CAAC,GAAG,EAAE,EAAE;IAExC,IAAI;QACF,MAAM,gBAAgB,GAAG,MAAM,mBAAmB,CAAC,OAAO,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QAC5F,OAAO,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KACvD;IAAC,OAAO,KAAK,EAAE,GAAE;AACpB,CAAC;AATD,oCASC"}
@@ -1,57 +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 {Cryptobox} from '@wireapp/cryptobox';
21
- import {init, keys} from '@wireapp/proteus';
22
- import * as bazinga64 from 'bazinga64';
23
-
24
- import type {CryptographyService} from '../cryptography';
25
-
26
- const StoreHelper = require('./StoreHelper');
27
-
28
- export async function createEncodedCipherText(
29
- receiver: keys.IdentityKeyPair,
30
- preKey: keys.PreKey,
31
- text: string,
32
- ): Promise<string> {
33
- await init();
34
- const senderEngine = await StoreHelper.createMemoryEngine();
35
- const sender = new Cryptobox(senderEngine, 1);
36
- await sender.create();
37
-
38
- const sessionId = `from-${sender[
39
- 'identity'
40
- ]!.public_key.fingerprint()}-to-${preKey.key_pair.public_key.fingerprint()}`;
41
-
42
- const alicePublicKey = receiver.public_key;
43
- const publicPreKeyBundle = new keys.PreKeyBundle(alicePublicKey, preKey);
44
- const encryptedPreKeyMessage = await sender.encrypt(sessionId, text, publicPreKeyBundle.serialise());
45
- return bazinga64.Encoder.toBase64(encryptedPreKeyMessage).asString;
46
- }
47
-
48
- export async function getPlainText(
49
- cryptographyService: CryptographyService,
50
- encodedPreKeyMessage: string,
51
- sessionId: string = `temp-${Date.now()}`,
52
- ): Promise<string | void> {
53
- try {
54
- const decryptedMessage = await cryptographyService.decrypt(sessionId, encodedPreKeyMessage);
55
- return Buffer.from(decryptedMessage).toString('utf8');
56
- } catch (error) {}
57
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"PayloadHelper.js","sourceRoot":"","sources":["PayloadHelper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;AAEH,+BAAgC;AAChC,oDAA0B;AAE1B,SAAgB,OAAO;IACrB,OAAO,gBAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC;AACjC,CAAC;AAFD,0BAEC;AAED,SAAgB,eAAe,CAAC,GAAW,EAAE,SAAiB;IAC5D,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;KACzD;IACD,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAClD,CAAC;AALD,0CAKC;AAED,SAAgB,eAAe,CAAC,MAAc;IAC5C,OAAO;QACL,SAAS,EAAE,CAAC;QACZ,MAAM,EAAE,EAAE;QACV,EAAE,EAAE,MAAM;QACV,MAAM,EAAE,IAAI;QACZ,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE;QAC3B,OAAO,EAAE;YACP;gBACE,cAAc,EAAE,MAAM;gBACtB,YAAY,EAAE,YAAY;gBAC1B,IAAI,EAAE,IAAI;gBACV,EAAE,EAAE,OAAO,EAAE;gBACb,IAAI,EAAE;oBACJ,cAAc,EAAE,OAAO,EAAE;oBACzB,MAAM,EAAE,GAAG;oBACX,KAAK,EAAE,OAAO,EAAE;oBAChB,eAAe,EAAE,GAAG;oBACpB,cAAc,EAAE,IAAI;oBACpB,MAAM,EAAE,IAAI;oBACZ,GAAG,EAAE,QAAQ;oBACb,KAAK,EAAE,IAAI;iBACZ;aACF;SACF;KACF,CAAC;AACJ,CAAC;AA1BD,0CA0BC"}
@@ -1,60 +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 faker = require('faker');
21
- import UUID from 'uuidjs';
22
-
23
- export function getUUID(): string {
24
- return UUID.genV4().toString();
25
- }
26
-
27
- export function getUrlParameter(url: string, parameter: string): string | string[] | null {
28
- if (typeof window === 'undefined') {
29
- return require('url').parse(url, true).query[parameter];
30
- }
31
- return new URL(url).searchParams.get(parameter);
32
- }
33
-
34
- export function mockUserPayload(userId: string): Object {
35
- return {
36
- accent_id: 3,
37
- assets: [],
38
- id: userId,
39
- locale: 'en',
40
- name: faker.name.findName(),
41
- picture: [
42
- {
43
- content_length: 263345,
44
- content_type: 'image/jpeg',
45
- data: null,
46
- id: getUUID(),
47
- info: {
48
- correlation_id: getUUID(),
49
- height: 960,
50
- nonce: getUUID(),
51
- original_height: 960,
52
- original_width: 1280,
53
- public: true,
54
- tag: 'medium',
55
- width: 1280,
56
- },
57
- },
58
- ],
59
- };
60
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserMapper.js","sourceRoot":"","sources":["UserMapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,yDAOuC;AAEvC,kDAA0G;AAC1G,2EAAsE;AAEtE,MAAa,UAAU;IACd,MAAM,CAAC,YAAY,CAAC,KAAgB,EAAE,UAAkB,EAAE,MAA2B;QAC1F,QAAQ,KAAK,CAAC,IAAI,EAAE;YAClB,KAAK,kBAAU,CAAC,UAAU,CAAC,CAAC;gBAC1B,MAAM,EAAC,UAAU,EAAE,IAAI,EAAC,GAAG,KAA4B,CAAC;gBACxD,OAAO;oBACL,OAAO,EAAE,EAAC,UAAU,EAAE,IAAI,EAAC;oBAC3B,YAAY,EAAE,UAAU,CAAC,YAAY;oBACrC,IAAI,EAAE,UAAU,CAAC,IAAI;oBACrB,EAAE,EAAE,+BAAc,CAAC,QAAQ,EAAE;oBAC7B,YAAY,EAAE,CAAC;oBACf,MAAM;oBACN,KAAK,EAAE,iCAAkB,CAAC,QAAQ;oBAClC,SAAS,EAAE,IAAI,IAAI,CAAC,UAAU,CAA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AkB,CAAC,QAAQ;oBAClC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;oBAC/B,IAAI,EAAE,gCAAiB,CAAC,aAAa;iBACtC,CAAC;aACH;SACF;IACH,CAAC;CACF;AA5DD,gCA4DC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,55 +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
- const connection_1 = require("@wireapp/api-client/src/connection");
22
- const event_1 = require("@wireapp/api-client/src/event");
23
- const conversation_1 = require("../conversation");
24
- const UserMapper_1 = require("./UserMapper");
25
- describe('UserMapper', () => {
26
- describe('"mapUserEvent"', () => {
27
- it('maps "user.connection" events', () => {
28
- const selfUserId = '95dbbc18-5e22-41dc-acce-0d9d983c1a60';
29
- const event = {
30
- connection: {
31
- conversation: '19dbbc18-5e22-41dc-acce-0d9d983c1a60',
32
- from: '39b7f597-dfd1-4dff-86f5-fe1b79cb70a0',
33
- last_update: '2018-07-06T09:38:52.286Z',
34
- message: ' ',
35
- status: connection_1.ConnectionStatus.SENT,
36
- to: 'e023c681-7e51-43dd-a5d8-0f821e70a9c0',
37
- },
38
- type: event_1.USER_EVENT.CONNECTION,
39
- user: {
40
- name: 'Someone',
41
- },
42
- };
43
- const incomingEvent = UserMapper_1.UserMapper.mapUserEvent(event, selfUserId, conversation_1.PayloadBundleSource.WEBSOCKET);
44
- expect(incomingEvent.content).toEqual({ connection: event.connection, user: event.user });
45
- expect(incomingEvent.conversation).toBe(event.connection.conversation);
46
- expect(incomingEvent.from).toBe(event.connection.from);
47
- expect(typeof incomingEvent.id).toBe('string');
48
- expect(incomingEvent.messageTimer).toBe(0);
49
- expect(incomingEvent.state).toBe(conversation_1.PayloadBundleState.INCOMING);
50
- expect(incomingEvent.timestamp).toBe(new Date(event.connection.last_update).getTime());
51
- expect(incomingEvent.type).toBe(conversation_1.PayloadBundleType.CONNECTION_REQUEST);
52
- });
53
- });
54
- });
55
- //# sourceMappingURL=UserMapper.test.node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserMapper.test.node.js","sourceRoot":"","sources":["UserMapper.test.node.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;AAEH,mEAAoE;AACpE,yDAA8E;AAG9E,kDAA2F;AAE3F,6CAAwC;AAExC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC9B,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;YACvC,MAAM,UAAU,GAAG,sCAAsC,CAAC;YAC1D,MAAM,KAAK,GAAwB;gBACjC,UAAU,EAAE;oBACV,YAAY,EAAE,sCAAsC;oBACpD,IAAI,EAAE,sCAAsC;oBAC5C,WAAW,EAAE,0BAA0B;oBACvC,OAAO,EAAE,GAAG;oBACZ,MAAM,EAAE,6BAAgB,CAAC,IAAI;oBAC7B,EAAE,EAAE,sCAAsC;iBAC3C;gBACD,IAAI,EAAE,kBAAU,CAAC,UAAU;gBAC3B,IAAI,EAAE;oBACJ,IAAI,EAAE,SAAS;iBAChB;aACF,CAAC;YAEF,MAAM,aAAa,GAAG,uBAAU,CAAC,YAAY,CAC3C,KAAK,EACL,UAAU,EACV,kCAAmB,CAAC,SAAS,CACL,CAAC;YAE3B,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAuB,CAAC,CAAC;YAC9G,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;YACvE,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACvD,MAAM,CAAC,OAAO,aAAa,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC/C,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC3C,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,iCAAkB,CAAC,QAAQ,CAAC,CAAC;YAC9D,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACvF,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,gCAAiB,CAAC,kBAAkB,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,63 +0,0 @@
1
- /*
2
- * Wire
3
- * Copyright (C) 2019 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 {ConnectionStatus} from '@wireapp/api-client/src/connection';
21
- import {USER_EVENT, UserConnectionEvent} from '@wireapp/api-client/src/event';
22
- import {UserConnectionData} from '@wireapp/api-client/src/user/data';
23
-
24
- import {PayloadBundleSource, PayloadBundleState, PayloadBundleType} from '../conversation';
25
- import {UserConnectionMessage} from '../conversation/message/UserMessage';
26
- import {UserMapper} from './UserMapper';
27
-
28
- describe('UserMapper', () => {
29
- describe('"mapUserEvent"', () => {
30
- it('maps "user.connection" events', () => {
31
- const selfUserId = '95dbbc18-5e22-41dc-acce-0d9d983c1a60';
32
- const event: UserConnectionEvent = {
33
- connection: {
34
- conversation: '19dbbc18-5e22-41dc-acce-0d9d983c1a60',
35
- from: '39b7f597-dfd1-4dff-86f5-fe1b79cb70a0',
36
- last_update: '2018-07-06T09:38:52.286Z',
37
- message: ' ',
38
- status: ConnectionStatus.SENT,
39
- to: 'e023c681-7e51-43dd-a5d8-0f821e70a9c0',
40
- },
41
- type: USER_EVENT.CONNECTION,
42
- user: {
43
- name: 'Someone',
44
- },
45
- };
46
-
47
- const incomingEvent = UserMapper.mapUserEvent(
48
- event,
49
- selfUserId,
50
- PayloadBundleSource.WEBSOCKET,
51
- ) as UserConnectionMessage;
52
-
53
- expect(incomingEvent.content).toEqual({connection: event.connection, user: event.user} as UserConnectionData);
54
- expect(incomingEvent.conversation).toBe(event.connection.conversation);
55
- expect(incomingEvent.from).toBe(event.connection.from);
56
- expect(typeof incomingEvent.id).toBe('string');
57
- expect(incomingEvent.messageTimer).toBe(0);
58
- expect(incomingEvent.state).toBe(PayloadBundleState.INCOMING);
59
- expect(incomingEvent.timestamp).toBe(new Date(event.connection.last_update).getTime());
60
- expect(incomingEvent.type).toBe(PayloadBundleType.CONNECTION_REQUEST);
61
- });
62
- });
63
- });
@@ -1,92 +0,0 @@
1
- /*
2
- * Wire
3
- * Copyright (C) 2019 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 {
21
- USER_EVENT,
22
- UserClientAddEvent,
23
- UserClientRemoveEvent,
24
- UserConnectionEvent,
25
- UserEvent,
26
- UserUpdateEvent,
27
- } from '@wireapp/api-client/src/event';
28
-
29
- import {PayloadBundle, PayloadBundleSource, PayloadBundleState, PayloadBundleType} from '../conversation';
30
- import {MessageBuilder} from '../conversation/message/MessageBuilder';
31
-
32
- export class UserMapper {
33
- public static mapUserEvent(event: UserEvent, selfUserId: string, source: PayloadBundleSource): PayloadBundle | void {
34
- switch (event.type) {
35
- case USER_EVENT.CONNECTION: {
36
- const {connection, user} = event as UserConnectionEvent;
37
- return {
38
- content: {connection, user},
39
- conversation: connection.conversation,
40
- from: connection.from,
41
- id: MessageBuilder.createId(),
42
- messageTimer: 0,
43
- source,
44
- state: PayloadBundleState.INCOMING,
45
- timestamp: new Date(connection.last_update).getTime(),
46
- type: PayloadBundleType.CONNECTION_REQUEST,
47
- };
48
- }
49
- case USER_EVENT.CLIENT_ADD: {
50
- const {client} = event as UserClientAddEvent;
51
- return {
52
- content: {client},
53
- conversation: selfUserId,
54
- from: selfUserId,
55
- id: MessageBuilder.createId(),
56
- messageTimer: 0,
57
- source,
58
- state: PayloadBundleState.INCOMING,
59
- timestamp: new Date().getTime(),
60
- type: PayloadBundleType.CLIENT_ADD,
61
- };
62
- }
63
- case USER_EVENT.UPDATE: {
64
- const {user} = event as UserUpdateEvent;
65
- return {
66
- content: {user},
67
- conversation: selfUserId,
68
- from: selfUserId,
69
- id: MessageBuilder.createId(),
70
- source,
71
- state: PayloadBundleState.INCOMING,
72
- timestamp: new Date().getTime(),
73
- type: PayloadBundleType.USER_UPDATE,
74
- };
75
- }
76
- case USER_EVENT.CLIENT_REMOVE: {
77
- const {client} = event as UserClientRemoveEvent;
78
- return {
79
- content: {client},
80
- conversation: selfUserId,
81
- from: selfUserId,
82
- id: MessageBuilder.createId(),
83
- messageTimer: 0,
84
- source,
85
- state: PayloadBundleState.INCOMING,
86
- timestamp: new Date().getTime(),
87
- type: PayloadBundleType.CLIENT_REMOVE,
88
- };
89
- }
90
- }
91
- }
92
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserService.js","sourceRoot":"","sources":["UserService.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;AAIH,oEAAyE;AACzE,oDAA0B;AAG1B,iEAA6D;AAE7D,mEAAoE;AAIpE,MAAa,WAAW;IAMtB,YACE,SAAoB,EACpB,gBAAkC,EAClC,mBAAwC,EACxC,iBAAoC;QAEpC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACjD,CAAC;IAEM,OAAO,CAAC,MAA4B;QACzC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAqB,CAAC,CAAC;IAChE,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,OAAiC;QACrD,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACnB,OAAO,EAAE,CAAC;SACX;QACD,OAAO,IAAA,sCAAkB,EAAC,OAAO,CAAC;YAChC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAC,aAAa,EAAE,OAAO,EAAC,CAAC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