@wireapp/wire-apps-js-sdk 0.0.1-alpha → 0.1.0

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 (591) hide show
  1. package/README.md +23 -8
  2. package/build/WireAppSdk.d.ts +22 -7
  3. package/build/WireAppSdk.d.ts.map +1 -1
  4. package/build/WireAppSdk.js +69 -47
  5. package/build/WireAppSdk.js.map +1 -1
  6. package/build/api/AssetsApiClient.d.ts +4 -4
  7. package/build/api/AssetsApiClient.d.ts.map +1 -1
  8. package/build/api/AssetsApiClient.js +7 -7
  9. package/build/api/AssetsApiClient.js.map +1 -1
  10. package/build/api/AssetsTransferService.d.ts +3 -3
  11. package/build/api/AssetsTransferService.d.ts.map +1 -1
  12. package/build/api/AssetsTransferService.js +9 -10
  13. package/build/api/AssetsTransferService.js.map +1 -1
  14. package/build/api/ClientsApiClient.d.ts +4 -4
  15. package/build/api/ClientsApiClient.d.ts.map +1 -1
  16. package/build/api/ClientsApiClient.js +7 -7
  17. package/build/api/ClientsApiClient.js.map +1 -1
  18. package/build/api/ClientsService.d.ts +3 -3
  19. package/build/api/ClientsService.d.ts.map +1 -1
  20. package/build/api/ClientsService.js +3 -3
  21. package/build/api/ClientsService.js.map +1 -1
  22. package/build/api/ConversationService.d.ts +34 -22
  23. package/build/api/ConversationService.d.ts.map +1 -1
  24. package/build/api/ConversationService.js +91 -84
  25. package/build/api/ConversationService.js.map +1 -1
  26. package/build/api/ConversationsApiClient.d.ts +7 -9
  27. package/build/api/ConversationsApiClient.d.ts.map +1 -1
  28. package/build/api/ConversationsApiClient.js +10 -20
  29. package/build/api/ConversationsApiClient.js.map +1 -1
  30. package/build/api/FeatureConfigsApiClient.d.ts +2 -2
  31. package/build/api/FeatureConfigsApiClient.d.ts.map +1 -1
  32. package/build/api/FeatureConfigsApiClient.js +3 -3
  33. package/build/api/FeatureConfigsApiClient.js.map +1 -1
  34. package/build/api/FeatureConfigsService.d.ts +1 -1
  35. package/build/api/FeatureConfigsService.d.ts.map +1 -1
  36. package/build/api/FeatureConfigsService.js +16 -16
  37. package/build/api/FeatureConfigsService.js.map +1 -1
  38. package/build/api/MlsApiClient.d.ts +4 -4
  39. package/build/api/MlsApiClient.d.ts.map +1 -1
  40. package/build/api/MlsApiClient.js +12 -12
  41. package/build/api/MlsApiClient.js.map +1 -1
  42. package/build/api/MlsService.d.ts +5 -5
  43. package/build/api/MlsService.d.ts.map +1 -1
  44. package/build/api/MlsService.js +23 -23
  45. package/build/api/MlsService.js.map +1 -1
  46. package/build/api/NotificationsApiClient.d.ts +4 -4
  47. package/build/api/NotificationsApiClient.d.ts.map +1 -1
  48. package/build/api/NotificationsApiClient.js +22 -22
  49. package/build/api/NotificationsApiClient.js.map +1 -1
  50. package/build/api/OneToOneConversationsApiClient.d.ts +3 -3
  51. package/build/api/OneToOneConversationsApiClient.d.ts.map +1 -1
  52. package/build/api/OneToOneConversationsApiClient.js +4 -4
  53. package/build/api/OneToOneConversationsApiClient.js.map +1 -1
  54. package/build/api/SearchApiClient.d.ts +2 -2
  55. package/build/api/SearchApiClient.d.ts.map +1 -1
  56. package/build/api/SearchApiClient.js +9 -8
  57. package/build/api/SearchApiClient.js.map +1 -1
  58. package/build/api/SelfApiClient.d.ts +9 -0
  59. package/build/api/SelfApiClient.d.ts.map +1 -0
  60. package/build/api/SelfApiClient.js +42 -0
  61. package/build/api/SelfApiClient.js.map +1 -0
  62. package/build/api/SelfService.d.ts +12 -0
  63. package/build/api/SelfService.d.ts.map +1 -0
  64. package/build/api/SelfService.js +81 -0
  65. package/build/api/SelfService.js.map +1 -0
  66. package/build/api/TeamsApiClient.d.ts +3 -3
  67. package/build/api/TeamsApiClient.d.ts.map +1 -1
  68. package/build/api/TeamsApiClient.js +4 -4
  69. package/build/api/TeamsApiClient.js.map +1 -1
  70. package/build/api/UserService.d.ts +6 -5
  71. package/build/api/UserService.d.ts.map +1 -1
  72. package/build/api/UserService.js +20 -11
  73. package/build/api/UserService.js.map +1 -1
  74. package/build/api/UsersApiClient.d.ts +8 -5
  75. package/build/api/UsersApiClient.d.ts.map +1 -1
  76. package/build/api/UsersApiClient.js +13 -8
  77. package/build/api/UsersApiClient.js.map +1 -1
  78. package/build/api/model/AddMembersToConversationResult.d.ts +1 -1
  79. package/build/api/model/AddMembersToConversationResult.d.ts.map +1 -1
  80. package/build/api/model/AddMembersToConversationResult.js +14 -14
  81. package/build/api/model/AddMembersToConversationResult.js.map +1 -1
  82. package/build/api/model/ConversationIdsPaginationConfig.js +14 -14
  83. package/build/api/model/ConversationIdsPaginationConfig.js.map +1 -1
  84. package/build/api/model/ConversationMemberOtherResponse.d.ts +2 -2
  85. package/build/api/model/ConversationMemberOtherResponse.d.ts.map +1 -1
  86. package/build/api/model/ConversationMemberOtherResponse.js +14 -14
  87. package/build/api/model/ConversationMemberOtherResponse.js.map +1 -1
  88. package/build/api/model/ConversationMemberSelfResponse.d.ts +2 -2
  89. package/build/api/model/ConversationMemberSelfResponse.d.ts.map +1 -1
  90. package/build/api/model/ConversationMemberSelfResponse.js +14 -14
  91. package/build/api/model/ConversationMemberSelfResponse.js.map +1 -1
  92. package/build/api/model/ConversationMembersResponse.d.ts +2 -2
  93. package/build/api/model/ConversationMembersResponse.d.ts.map +1 -1
  94. package/build/api/model/ConversationMembersResponse.js +14 -14
  95. package/build/api/model/ConversationMembersResponse.js.map +1 -1
  96. package/build/api/model/RemoveMembersFromConversationResult.d.ts +1 -1
  97. package/build/api/model/RemoveMembersFromConversationResult.d.ts.map +1 -1
  98. package/build/api/model/RemoveMembersFromConversationResult.js +14 -14
  99. package/build/api/model/RemoveMembersFromConversationResult.js.map +1 -1
  100. package/build/api/model/UserClientResponse.js +14 -14
  101. package/build/api/model/UserClientResponse.js.map +1 -1
  102. package/build/api/model/UserResponse.d.ts +4 -2
  103. package/build/api/model/UserResponse.d.ts.map +1 -1
  104. package/build/api/model/UserResponse.js +14 -14
  105. package/build/api/model/UserResponse.js.map +1 -1
  106. package/build/api/model/asset/AssetUploadData.d.ts.map +1 -1
  107. package/build/api/model/asset/AssetUploadResponse.d.ts.map +1 -1
  108. package/build/api/request/CapabilitiesRequest.js +14 -14
  109. package/build/api/request/CapabilitiesRequest.js.map +1 -1
  110. package/build/api/request/ClientUpdateRequest.d.ts +1 -1
  111. package/build/api/request/ClientUpdateRequest.d.ts.map +1 -1
  112. package/build/api/request/ClientUpdateRequest.js +14 -14
  113. package/build/api/request/ClientUpdateRequest.js.map +1 -1
  114. package/build/api/request/ConversationIdsRequest.d.ts +1 -1
  115. package/build/api/request/ConversationIdsRequest.js +14 -14
  116. package/build/api/request/ConversationIdsRequest.js.map +1 -1
  117. package/build/api/request/CreateConversationRequest.d.ts +9 -9
  118. package/build/api/request/CreateConversationRequest.d.ts.map +1 -1
  119. package/build/api/request/CreateConversationRequest.js +8 -11
  120. package/build/api/request/CreateConversationRequest.js.map +1 -1
  121. package/build/api/request/MlsKeyPackagesRequest.js +14 -14
  122. package/build/api/request/MlsKeyPackagesRequest.js.map +1 -1
  123. package/build/api/request/PreKeyRequest.d.ts.map +1 -1
  124. package/build/api/request/PreKeyRequest.js +14 -14
  125. package/build/api/request/PreKeyRequest.js.map +1 -1
  126. package/build/api/request/RegisterClientRequest.d.ts +2 -2
  127. package/build/api/request/RegisterClientRequest.d.ts.map +1 -1
  128. package/build/api/request/RegisterClientRequest.js +18 -20
  129. package/build/api/request/RegisterClientRequest.js.map +1 -1
  130. package/build/api/response/ClaimedKeyPackageList.d.ts.map +1 -1
  131. package/build/api/response/ClaimedKeyPackageList.js +14 -14
  132. package/build/api/response/ClaimedKeyPackageList.js.map +1 -1
  133. package/build/api/response/ConversationIdsResponse.d.ts +1 -1
  134. package/build/api/response/ConversationIdsResponse.js +14 -14
  135. package/build/api/response/ConversationIdsResponse.js.map +1 -1
  136. package/build/api/response/ConversationResponse.d.ts +4 -4
  137. package/build/api/response/ConversationResponse.d.ts.map +1 -1
  138. package/build/api/response/ConversationResponse.js +14 -14
  139. package/build/api/response/ConversationResponse.js.map +1 -1
  140. package/build/api/response/ConversationsResponse.d.ts +2 -2
  141. package/build/api/response/ConversationsResponse.js +14 -14
  142. package/build/api/response/ConversationsResponse.js.map +1 -1
  143. package/build/api/response/EventResponse.d.ts +1 -1
  144. package/build/api/response/EventResponse.d.ts.map +1 -1
  145. package/build/api/response/EventResponse.js +14 -14
  146. package/build/api/response/EventResponse.js.map +1 -1
  147. package/build/api/response/FeatureConfigsResponse.d.ts +1 -1
  148. package/build/api/response/FeatureConfigsResponse.d.ts.map +1 -1
  149. package/build/api/response/FeatureConfigsResponse.js +14 -14
  150. package/build/api/response/FeatureConfigsResponse.js.map +1 -1
  151. package/build/api/response/ListUsersResponse.d.ts +7 -0
  152. package/build/api/response/ListUsersResponse.d.ts.map +1 -0
  153. package/build/api/response/ListUsersResponse.js +17 -0
  154. package/build/api/response/ListUsersResponse.js.map +1 -0
  155. package/build/api/response/MlsPublicKeysResponse.d.ts +2 -2
  156. package/build/api/response/MlsPublicKeysResponse.d.ts.map +1 -1
  157. package/build/api/response/MlsPublicKeysResponse.js +18 -17
  158. package/build/api/response/MlsPublicKeysResponse.js.map +1 -1
  159. package/build/api/response/NotificationsResponse.d.ts +1 -1
  160. package/build/api/response/NotificationsResponse.js +14 -14
  161. package/build/api/response/NotificationsResponse.js.map +1 -1
  162. package/build/api/response/OneToOneConversationResponse.d.ts +2 -2
  163. package/build/api/response/OneToOneConversationResponse.d.ts.map +1 -1
  164. package/build/api/response/OneToOneConversationResponse.js +14 -14
  165. package/build/api/response/OneToOneConversationResponse.js.map +1 -1
  166. package/build/api/response/RegisterClientResponse.js +14 -14
  167. package/build/api/response/RegisterClientResponse.js.map +1 -1
  168. package/build/api/response/SearchContactsResponse.d.ts +1 -1
  169. package/build/api/response/SearchContactsResponse.d.ts.map +1 -1
  170. package/build/api/response/SelfResponse.d.ts +6 -0
  171. package/build/api/response/SelfResponse.d.ts.map +1 -0
  172. package/build/api/response/SelfResponse.js +17 -0
  173. package/build/api/response/SelfResponse.js.map +1 -0
  174. package/build/core/BackendConnectionListener.d.ts +31 -0
  175. package/build/core/BackendConnectionListener.d.ts.map +1 -0
  176. package/build/core/BackendConnectionListener.js +17 -0
  177. package/build/core/BackendConnectionListener.js.map +1 -0
  178. package/build/core/CoreCryptoClient.d.ts +10 -7
  179. package/build/core/CoreCryptoClient.d.ts.map +1 -1
  180. package/build/core/CoreCryptoClient.js +49 -32
  181. package/build/core/CoreCryptoClient.js.map +1 -1
  182. package/build/core/CoreCryptoMlsTransport.d.ts +2 -2
  183. package/build/core/CoreCryptoMlsTransport.d.ts.map +1 -1
  184. package/build/core/CoreCryptoMlsTransport.js +18 -17
  185. package/build/core/CoreCryptoMlsTransport.js.map +1 -1
  186. package/build/core/CoreCryptoService.d.ts +15 -14
  187. package/build/core/CoreCryptoService.d.ts.map +1 -1
  188. package/build/core/CoreCryptoService.js +67 -55
  189. package/build/core/CoreCryptoService.js.map +1 -1
  190. package/build/core/HttpClient.d.ts +1 -1
  191. package/build/core/HttpClient.d.ts.map +1 -1
  192. package/build/core/HttpClient.js +66 -76
  193. package/build/core/HttpClient.js.map +1 -1
  194. package/build/core/HttpRetryHelper.d.ts +1 -1
  195. package/build/core/HttpRetryHelper.d.ts.map +1 -1
  196. package/build/core/HttpRetryHelper.js +4 -4
  197. package/build/core/HttpRetryHelper.js.map +1 -1
  198. package/build/core/HttpRetryPolicy.js.map +1 -1
  199. package/build/core/WebSocketClient.d.ts +9 -4
  200. package/build/core/WebSocketClient.d.ts.map +1 -1
  201. package/build/core/WebSocketClient.js +66 -35
  202. package/build/core/WebSocketClient.js.map +1 -1
  203. package/build/core/WireApplicationManager.d.ts +24 -15
  204. package/build/core/WireApplicationManager.d.ts.map +1 -1
  205. package/build/core/WireApplicationManager.js +67 -32
  206. package/build/core/WireApplicationManager.js.map +1 -1
  207. package/build/core/WireEventsHandler.d.ts +7 -8
  208. package/build/core/WireEventsHandler.d.ts.map +1 -1
  209. package/build/core/WireEventsHandler.js +9 -13
  210. package/build/core/WireEventsHandler.js.map +1 -1
  211. package/build/core/event/DeleteConversationEventProcessor.d.ts +4 -4
  212. package/build/core/event/DeleteConversationEventProcessor.d.ts.map +1 -1
  213. package/build/core/event/DeleteConversationEventProcessor.js +7 -7
  214. package/build/core/event/DeleteConversationEventProcessor.js.map +1 -1
  215. package/build/core/event/EventProcessor.d.ts +2 -2
  216. package/build/core/event/EventProcessor.d.ts.map +1 -1
  217. package/build/core/event/EventRouter.d.ts +3 -3
  218. package/build/core/event/EventRouter.d.ts.map +1 -1
  219. package/build/core/event/EventRouter.js +18 -18
  220. package/build/core/event/EventRouter.js.map +1 -1
  221. package/build/core/event/MemberJoinEventProcessor.d.ts +4 -4
  222. package/build/core/event/MemberJoinEventProcessor.d.ts.map +1 -1
  223. package/build/core/event/MemberJoinEventProcessor.js +14 -11
  224. package/build/core/event/MemberJoinEventProcessor.js.map +1 -1
  225. package/build/core/event/MemberLeaveEventProcessor.d.ts +4 -4
  226. package/build/core/event/MemberLeaveEventProcessor.d.ts.map +1 -1
  227. package/build/core/event/MemberLeaveEventProcessor.js +12 -9
  228. package/build/core/event/MemberLeaveEventProcessor.js.map +1 -1
  229. package/build/core/event/MemberUpdateEventProcessor.d.ts +3 -3
  230. package/build/core/event/MemberUpdateEventProcessor.d.ts.map +1 -1
  231. package/build/core/event/MemberUpdateEventProcessor.js +6 -6
  232. package/build/core/event/MemberUpdateEventProcessor.js.map +1 -1
  233. package/build/core/event/MessageTimerUpdateEventProcessor.d.ts +11 -0
  234. package/build/core/event/MessageTimerUpdateEventProcessor.d.ts.map +1 -0
  235. package/build/core/event/MessageTimerUpdateEventProcessor.js +49 -0
  236. package/build/core/event/MessageTimerUpdateEventProcessor.js.map +1 -0
  237. package/build/core/event/MlsMessageEventProcessor.d.ts +6 -6
  238. package/build/core/event/MlsMessageEventProcessor.d.ts.map +1 -1
  239. package/build/core/event/MlsMessageEventProcessor.js +31 -26
  240. package/build/core/event/MlsMessageEventProcessor.js.map +1 -1
  241. package/build/core/event/MlsResetEventProcessor.d.ts +3 -3
  242. package/build/core/event/MlsResetEventProcessor.d.ts.map +1 -1
  243. package/build/core/event/MlsResetEventProcessor.js +6 -6
  244. package/build/core/event/MlsResetEventProcessor.js.map +1 -1
  245. package/build/core/event/MlsWelcomeEventProcessor.d.ts +7 -7
  246. package/build/core/event/MlsWelcomeEventProcessor.d.ts.map +1 -1
  247. package/build/core/event/MlsWelcomeEventProcessor.js +12 -12
  248. package/build/core/event/MlsWelcomeEventProcessor.js.map +1 -1
  249. package/build/core/event/NewConversationEventProcessor.d.ts +3 -3
  250. package/build/core/event/NewConversationEventProcessor.d.ts.map +1 -1
  251. package/build/core/event/NewConversationEventProcessor.js +6 -6
  252. package/build/core/event/NewConversationEventProcessor.js.map +1 -1
  253. package/build/core/event/processors.index.d.ts +9 -8
  254. package/build/core/event/processors.index.d.ts.map +1 -1
  255. package/build/core/event/processors.index.js +9 -8
  256. package/build/core/event/processors.index.js.map +1 -1
  257. package/build/db/AppPropertiesRepository.d.ts +2 -2
  258. package/build/db/AppPropertiesRepository.d.ts.map +1 -1
  259. package/build/db/AppPropertiesRepository.js +34 -23
  260. package/build/db/AppPropertiesRepository.js.map +1 -1
  261. package/build/db/ConversationMemberRepository.d.ts +3 -3
  262. package/build/db/ConversationMemberRepository.d.ts.map +1 -1
  263. package/build/db/ConversationMemberRepository.js +40 -26
  264. package/build/db/ConversationMemberRepository.js.map +1 -1
  265. package/build/db/ConversationRepository.d.ts +7 -2
  266. package/build/db/ConversationRepository.d.ts.map +1 -1
  267. package/build/db/ConversationRepository.js +72 -46
  268. package/build/db/ConversationRepository.js.map +1 -1
  269. package/build/db/DatabaseService.d.ts.map +1 -1
  270. package/build/db/DatabaseService.js +29 -27
  271. package/build/db/DatabaseService.js.map +1 -1
  272. package/build/db/migrations/0002_perfect_karnak.sql +1 -0
  273. package/build/db/migrations/meta/0002_snapshot.json +204 -0
  274. package/build/db/migrations/meta/_journal.json +7 -0
  275. package/build/db/model/AppEntity.js +14 -14
  276. package/build/db/model/AppEntity.js.map +1 -1
  277. package/build/db/model/ConversationEntity.d.ts +2 -1
  278. package/build/db/model/ConversationEntity.d.ts.map +1 -1
  279. package/build/db/model/ConversationEntity.js +14 -14
  280. package/build/db/model/ConversationEntity.js.map +1 -1
  281. package/build/db/model/ConversationMemberEntity.js +14 -14
  282. package/build/db/model/ConversationMemberEntity.js.map +1 -1
  283. package/build/db/relations.d.ts.map +1 -1
  284. package/build/db/relations.js +4 -4
  285. package/build/db/relations.js.map +1 -1
  286. package/build/db/schema.d.ts +17 -0
  287. package/build/db/schema.d.ts.map +1 -1
  288. package/build/db/schema.js +27 -19
  289. package/build/db/schema.js.map +1 -1
  290. package/build/exception/CoreCryptoMlsException.d.ts.map +1 -0
  291. package/build/exception/CoreCryptoMlsException.js +25 -0
  292. package/build/exception/CoreCryptoMlsException.js.map +1 -0
  293. package/build/exception/MlsException.d.ts.map +1 -0
  294. package/build/exception/MlsException.js +25 -0
  295. package/build/exception/MlsException.js.map +1 -0
  296. package/build/exception/WireApiError.d.ts.map +1 -0
  297. package/build/exception/WireApiError.js +17 -0
  298. package/build/exception/WireApiError.js.map +1 -0
  299. package/build/{model/exception → exception}/WireApiException.d.ts +1 -1
  300. package/build/exception/WireApiException.d.ts.map +1 -0
  301. package/build/{model/exception → exception}/WireApiException.js +2 -2
  302. package/build/exception/WireApiException.js.map +1 -0
  303. package/build/exception/WireException.d.ts +41 -0
  304. package/build/exception/WireException.d.ts.map +1 -0
  305. package/build/exception/WireException.js +81 -0
  306. package/build/exception/WireException.js.map +1 -0
  307. package/build/index.d.ts +18 -12
  308. package/build/index.d.ts.map +1 -1
  309. package/build/index.js +27 -22
  310. package/build/index.js.map +1 -1
  311. package/build/mappers/PreKeyMapper.d.ts +2 -2
  312. package/build/mappers/PreKeyMapper.d.ts.map +1 -1
  313. package/build/mappers/PreKeyMapper.js +14 -14
  314. package/build/mappers/PreKeyMapper.js.map +1 -1
  315. package/build/mappers/conversation/ConversationMapper.d.ts +2 -2
  316. package/build/mappers/conversation/ConversationMapper.d.ts.map +1 -1
  317. package/build/mappers/conversation/ConversationMapper.js +16 -15
  318. package/build/mappers/conversation/ConversationMapper.js.map +1 -1
  319. package/build/mappers/conversation/ConversationMemberMapper.d.ts +2 -2
  320. package/build/mappers/conversation/ConversationMemberMapper.d.ts.map +1 -1
  321. package/build/mappers/conversation/ConversationMemberMapper.js +15 -15
  322. package/build/mappers/conversation/ConversationMemberMapper.js.map +1 -1
  323. package/build/mappers/protobuf/EncryptionAlgorithmMapper.d.ts +4 -4
  324. package/build/mappers/protobuf/EncryptionAlgorithmMapper.d.ts.map +1 -1
  325. package/build/mappers/protobuf/EncryptionAlgorithmMapper.js +28 -23
  326. package/build/mappers/protobuf/EncryptionAlgorithmMapper.js.map +1 -1
  327. package/build/mappers/protobuf/MessageContentEncoder.d.ts +1 -1
  328. package/build/mappers/protobuf/MessageContentEncoder.d.ts.map +1 -1
  329. package/build/mappers/protobuf/MessageContentEncoder.js +4 -4
  330. package/build/mappers/protobuf/MessageContentEncoder.js.map +1 -1
  331. package/build/mappers/protobuf/MessageLinkPreviewMapper.d.ts +4 -4
  332. package/build/mappers/protobuf/MessageLinkPreviewMapper.d.ts.map +1 -1
  333. package/build/mappers/protobuf/MessageLinkPreviewMapper.js +18 -17
  334. package/build/mappers/protobuf/MessageLinkPreviewMapper.js.map +1 -1
  335. package/build/mappers/protobuf/MessageMentionMapper.d.ts +4 -4
  336. package/build/mappers/protobuf/MessageMentionMapper.d.ts.map +1 -1
  337. package/build/mappers/protobuf/MessageMentionMapper.js +16 -16
  338. package/build/mappers/protobuf/MessageMentionMapper.js.map +1 -1
  339. package/build/mappers/protobuf/ProtobufDeserializer.d.ts +2 -2
  340. package/build/mappers/protobuf/ProtobufDeserializer.d.ts.map +1 -1
  341. package/build/mappers/protobuf/ProtobufDeserializer.js +44 -40
  342. package/build/mappers/protobuf/ProtobufDeserializer.js.map +1 -1
  343. package/build/mappers/protobuf/ProtobufSerializer.d.ts.map +1 -1
  344. package/build/mappers/protobuf/ProtobufSerializer.js +51 -47
  345. package/build/mappers/protobuf/ProtobufSerializer.js.map +1 -1
  346. package/build/model/Asset.d.ts +1 -1
  347. package/build/model/Asset.d.ts.map +1 -1
  348. package/build/model/Asset.js +14 -14
  349. package/build/model/Asset.js.map +1 -1
  350. package/build/model/ClaimedKeyPackagesResult.d.ts +1 -1
  351. package/build/model/ClaimedKeyPackagesResult.d.ts.map +1 -1
  352. package/build/model/ClaimedKeyPackagesResult.js +14 -14
  353. package/build/model/ClaimedKeyPackagesResult.js.map +1 -1
  354. package/build/model/CryptoClientId.d.ts.map +1 -1
  355. package/build/model/CryptoClientId.js +14 -14
  356. package/build/model/CryptoClientId.js.map +1 -1
  357. package/build/model/CryptoProtocol.js +14 -14
  358. package/build/model/CryptoProtocol.js.map +1 -1
  359. package/build/model/DecryptedMlsMessage.d.ts +6 -0
  360. package/build/model/DecryptedMlsMessage.d.ts.map +1 -0
  361. package/build/model/DecryptedMlsMessage.js +17 -0
  362. package/build/model/DecryptedMlsMessage.js.map +1 -0
  363. package/build/model/EventContentDTO.d.ts +14 -4
  364. package/build/model/EventContentDTO.d.ts.map +1 -1
  365. package/build/model/EventContentDTO.js +14 -14
  366. package/build/model/EventContentDTO.js.map +1 -1
  367. package/build/model/PreKeyCrypto.js +14 -14
  368. package/build/model/PreKeyCrypto.js.map +1 -1
  369. package/build/model/QualifiedId.d.ts +4 -0
  370. package/build/model/QualifiedId.d.ts.map +1 -1
  371. package/build/model/QualifiedId.js +21 -15
  372. package/build/model/QualifiedId.js.map +1 -1
  373. package/build/model/TeamId.js +15 -15
  374. package/build/model/TeamId.js.map +1 -1
  375. package/build/model/UserType.d.ts +6 -0
  376. package/build/model/UserType.d.ts.map +1 -0
  377. package/build/model/UserType.js +22 -0
  378. package/build/model/UserType.js.map +1 -0
  379. package/build/model/WireMessage.d.ts +5 -5
  380. package/build/model/WireMessage.d.ts.map +1 -1
  381. package/build/model/WireMessage.js +43 -45
  382. package/build/model/WireMessage.js.map +1 -1
  383. package/build/model/WireUser.d.ts +5 -3
  384. package/build/model/WireUser.d.ts.map +1 -1
  385. package/build/model/WireUser.js +3 -1
  386. package/build/model/WireUser.js.map +1 -1
  387. package/build/model/conversation/Conversation.d.ts +2 -1
  388. package/build/model/conversation/Conversation.d.ts.map +1 -1
  389. package/build/model/conversation/Conversation.js +15 -15
  390. package/build/model/conversation/Conversation.js.map +1 -1
  391. package/build/model/conversation/ConversationMember.d.ts +2 -2
  392. package/build/model/conversation/ConversationMember.d.ts.map +1 -1
  393. package/build/model/conversation/ConversationMember.js +14 -14
  394. package/build/model/conversation/ConversationMember.js.map +1 -1
  395. package/build/model/conversation/ConversationRole.d.ts.map +1 -1
  396. package/build/model/conversation/ConversationRole.js +14 -14
  397. package/build/model/conversation/ConversationRole.js.map +1 -1
  398. package/build/model/conversation/ConversationType.js +14 -14
  399. package/build/model/conversation/ConversationType.js.map +1 -1
  400. package/build/model/protobuf/MessageEncryptionAlgorithm.d.ts.map +1 -1
  401. package/build/model/protobuf/MessageEncryptionAlgorithm.js +14 -14
  402. package/build/model/protobuf/MessageEncryptionAlgorithm.js.map +1 -1
  403. package/build/service/AppProperties.d.ts +12 -1
  404. package/build/service/AppProperties.d.ts.map +1 -1
  405. package/build/service/AppProperties.js +60 -26
  406. package/build/service/AppProperties.js.map +1 -1
  407. package/build/service/MlsFallbackStrategy.d.ts +3 -3
  408. package/build/service/MlsFallbackStrategy.d.ts.map +1 -1
  409. package/build/service/MlsFallbackStrategy.js +18 -18
  410. package/build/service/MlsFallbackStrategy.js.map +1 -1
  411. package/build/service/NotificationsService.d.ts +3 -3
  412. package/build/service/NotificationsService.d.ts.map +1 -1
  413. package/build/service/NotificationsService.js +19 -19
  414. package/build/service/NotificationsService.js.map +1 -1
  415. package/build/utils/AESUtils.d.ts +1 -1
  416. package/build/utils/AESUtils.d.ts.map +1 -1
  417. package/build/utils/AESUtils.js +15 -15
  418. package/build/utils/AESUtils.js.map +1 -1
  419. package/build/utils/BufferUtils.d.ts.map +1 -1
  420. package/build/utils/BufferUtils.js +15 -15
  421. package/build/utils/BufferUtils.js.map +1 -1
  422. package/build/utils/DependencyInjectionTokens.d.ts +0 -2
  423. package/build/utils/DependencyInjectionTokens.d.ts.map +1 -1
  424. package/build/utils/DependencyInjectionTokens.js +19 -21
  425. package/build/utils/DependencyInjectionTokens.js.map +1 -1
  426. package/build/utils/HashUtils.js +14 -14
  427. package/build/utils/HashUtils.js.map +1 -1
  428. package/build/utils/ObfuscateUtil.js +15 -15
  429. package/build/utils/ObfuscateUtil.js.map +1 -1
  430. package/build/utils/StoragePaths.js +18 -18
  431. package/build/utils/StoragePaths.js.map +1 -1
  432. package/build/utils/logger/ConsoleLogger.d.ts +2 -2
  433. package/build/utils/logger/ConsoleLogger.d.ts.map +1 -1
  434. package/build/utils/logger/ConsoleLogger.js +1 -1
  435. package/build/utils/logger/ConsoleLogger.js.map +1 -1
  436. package/build/utils/logger/Logger.d.ts.map +1 -1
  437. package/build/utils/logger/LoggerFactory.d.ts +1 -1
  438. package/build/utils/logger/LoggerFactory.d.ts.map +1 -1
  439. package/build/utils/logger/LoggerFactory.js +2 -2
  440. package/build/utils/logger/LoggerFactory.js.map +1 -1
  441. package/package.json +22 -8
  442. package/src/WireAppSdk.ts +78 -65
  443. package/src/api/AssetsApiClient.ts +20 -35
  444. package/src/api/AssetsTransferService.ts +20 -32
  445. package/src/api/ClientsApiClient.ts +16 -29
  446. package/src/api/ClientsService.ts +7 -14
  447. package/src/api/ConversationService.ts +221 -154
  448. package/src/api/ConversationsApiClient.ts +25 -29
  449. package/src/api/FeatureConfigsApiClient.ts +4 -4
  450. package/src/api/FeatureConfigsService.ts +17 -17
  451. package/src/api/MlsApiClient.ts +23 -31
  452. package/src/api/MlsService.ts +31 -41
  453. package/src/api/NotificationsApiClient.ts +27 -32
  454. package/src/api/OneToOneConversationsApiClient.ts +7 -10
  455. package/src/api/SearchApiClient.ts +20 -22
  456. package/src/api/SelfApiClient.ts +30 -0
  457. package/src/api/SelfService.ts +81 -0
  458. package/src/api/TeamsApiClient.ts +10 -10
  459. package/src/api/UserService.ts +43 -38
  460. package/src/api/UsersApiClient.ts +27 -23
  461. package/src/api/model/AddMembersToConversationResult.ts +15 -15
  462. package/src/api/model/ConversationIdsPaginationConfig.ts +14 -14
  463. package/src/api/model/ConversationMemberOtherResponse.ts +16 -16
  464. package/src/api/model/ConversationMemberSelfResponse.ts +16 -16
  465. package/src/api/model/ConversationMembersResponse.ts +17 -17
  466. package/src/api/model/RemoveMembersFromConversationResult.ts +15 -15
  467. package/src/api/model/UserClientResponse.ts +14 -14
  468. package/src/api/model/UserResponse.ts +18 -16
  469. package/src/api/model/asset/AssetUploadData.ts +2 -2
  470. package/src/api/model/asset/AssetUploadResponse.ts +3 -3
  471. package/src/api/request/CapabilitiesRequest.ts +15 -15
  472. package/src/api/request/ClientUpdateRequest.ts +15 -15
  473. package/src/api/request/ConversationIdsRequest.ts +15 -15
  474. package/src/api/request/CreateConversationRequest.ts +11 -14
  475. package/src/api/request/MlsKeyPackagesRequest.ts +14 -14
  476. package/src/api/request/PreKeyRequest.ts +15 -18
  477. package/src/api/request/RegisterClientRequest.ts +19 -21
  478. package/src/api/response/ClaimedKeyPackageList.ts +18 -18
  479. package/src/api/response/ConversationIdsResponse.ts +15 -15
  480. package/src/api/response/ConversationResponse.ts +18 -18
  481. package/src/api/response/ConversationsResponse.ts +16 -16
  482. package/src/api/response/EventResponse.ts +17 -17
  483. package/src/api/response/FeatureConfigsResponse.ts +15 -15
  484. package/src/api/response/ListUsersResponse.ts +23 -0
  485. package/src/api/response/MlsPublicKeysResponse.ts +24 -23
  486. package/src/api/response/NotificationsResponse.ts +15 -15
  487. package/src/api/response/OneToOneConversationResponse.ts +16 -17
  488. package/src/api/response/RegisterClientResponse.ts +14 -14
  489. package/src/api/response/SearchContactsResponse.ts +10 -10
  490. package/src/api/response/SelfResponse.ts +22 -0
  491. package/src/core/BackendConnectionListener.ts +47 -0
  492. package/src/core/CoreCryptoClient.ts +93 -117
  493. package/src/core/CoreCryptoMlsTransport.ts +24 -25
  494. package/src/core/CoreCryptoService.ts +93 -98
  495. package/src/core/HttpClient.ts +106 -125
  496. package/src/core/HttpRetryHelper.ts +6 -9
  497. package/src/core/HttpRetryPolicy.ts +5 -5
  498. package/src/core/WebSocketClient.ts +87 -47
  499. package/src/core/WireApplicationManager.ts +120 -68
  500. package/src/core/WireEventsHandler.ts +26 -35
  501. package/src/core/event/DeleteConversationEventProcessor.ts +16 -17
  502. package/src/core/event/EventProcessor.ts +3 -3
  503. package/src/core/event/EventRouter.ts +31 -35
  504. package/src/core/event/MemberJoinEventProcessor.ts +24 -21
  505. package/src/core/event/MemberLeaveEventProcessor.ts +23 -17
  506. package/src/core/event/MemberUpdateEventProcessor.ts +15 -16
  507. package/src/core/event/MessageTimerUpdateEventProcessor.ts +41 -0
  508. package/src/core/event/MlsMessageEventProcessor.ts +48 -38
  509. package/src/core/event/MlsResetEventProcessor.ts +13 -16
  510. package/src/core/event/MlsWelcomeEventProcessor.ts +24 -29
  511. package/src/core/event/NewConversationEventProcessor.ts +14 -15
  512. package/src/core/event/processors.index.ts +9 -8
  513. package/src/db/AppPropertiesRepository.ts +45 -39
  514. package/src/db/ConversationMemberRepository.ts +85 -77
  515. package/src/db/ConversationRepository.ts +86 -71
  516. package/src/db/DatabaseService.ts +34 -32
  517. package/src/db/migrations/0002_perfect_karnak.sql +1 -0
  518. package/src/db/migrations/meta/0002_snapshot.json +204 -0
  519. package/src/db/migrations/meta/_journal.json +7 -0
  520. package/src/db/model/AppEntity.ts +14 -14
  521. package/src/db/model/ConversationEntity.ts +16 -15
  522. package/src/db/model/ConversationMemberEntity.ts +14 -14
  523. package/src/db/relations.ts +6 -6
  524. package/src/db/schema.ts +47 -33
  525. package/src/exception/CoreCryptoMlsException.ts +26 -0
  526. package/src/exception/MlsException.ts +26 -0
  527. package/src/exception/WireApiError.ts +21 -0
  528. package/src/{model/exception → exception}/WireApiException.ts +9 -9
  529. package/src/exception/WireException.ts +94 -0
  530. package/src/index.ts +43 -27
  531. package/src/mappers/PreKeyMapper.ts +16 -16
  532. package/src/mappers/conversation/ConversationMapper.ts +18 -17
  533. package/src/mappers/conversation/ConversationMemberMapper.ts +18 -19
  534. package/src/mappers/protobuf/EncryptionAlgorithmMapper.ts +32 -27
  535. package/src/mappers/protobuf/MessageContentEncoder.ts +34 -50
  536. package/src/mappers/protobuf/MessageLinkPreviewMapper.ts +38 -37
  537. package/src/mappers/protobuf/MessageMentionMapper.ts +22 -22
  538. package/src/mappers/protobuf/ProtobufDeserializer.ts +78 -72
  539. package/src/mappers/protobuf/ProtobufSerializer.ts +137 -155
  540. package/src/model/Asset.ts +18 -18
  541. package/src/model/ClaimedKeyPackagesResult.ts +17 -17
  542. package/src/model/CryptoClientId.ts +16 -25
  543. package/src/model/CryptoProtocol.ts +17 -17
  544. package/src/model/DecryptedMlsMessage.ts +22 -0
  545. package/src/model/EventContentDTO.ts +36 -24
  546. package/src/model/PreKeyCrypto.ts +14 -14
  547. package/src/model/QualifiedId.ts +25 -18
  548. package/src/model/TeamId.ts +15 -15
  549. package/src/model/UserType.ts +21 -0
  550. package/src/model/WireMessage.ts +164 -196
  551. package/src/model/WireUser.ts +4 -3
  552. package/src/model/conversation/ChannelAddPermissionType.ts +2 -3
  553. package/src/model/conversation/Conversation.ts +16 -15
  554. package/src/model/conversation/ConversationAccess.ts +5 -6
  555. package/src/model/conversation/ConversationAccessRole.ts +5 -6
  556. package/src/model/conversation/ConversationMember.ts +16 -16
  557. package/src/model/conversation/ConversationRole.ts +17 -18
  558. package/src/model/conversation/ConversationType.ts +14 -14
  559. package/src/model/conversation/GroupConversationType.ts +2 -3
  560. package/src/model/conversation/ReceiptMode.ts +0 -1
  561. package/src/model/protobuf/MessageEncryptionAlgorithm.ts +18 -15
  562. package/src/service/AppProperties.ts +76 -40
  563. package/src/service/MlsFallbackStrategy.ts +21 -24
  564. package/src/service/NotificationsService.ts +22 -22
  565. package/src/utils/AESUtils.ts +25 -28
  566. package/src/utils/BufferUtils.ts +16 -16
  567. package/src/utils/DependencyInjectionTokens.ts +19 -21
  568. package/src/utils/HashUtils.ts +15 -15
  569. package/src/utils/ObfuscateUtil.ts +15 -15
  570. package/src/utils/StoragePaths.ts +18 -18
  571. package/src/utils/logger/ConsoleLogger.ts +8 -9
  572. package/src/utils/logger/LogLevel.ts +1 -1
  573. package/src/utils/logger/Logger.ts +4 -4
  574. package/src/utils/logger/LoggerFactory.ts +6 -6
  575. package/build/model/exception/CoreCryptoMlsException.d.ts.map +0 -1
  576. package/build/model/exception/CoreCryptoMlsException.js +0 -25
  577. package/build/model/exception/CoreCryptoMlsException.js.map +0 -1
  578. package/build/model/exception/MlsException.d.ts.map +0 -1
  579. package/build/model/exception/MlsException.js +0 -25
  580. package/build/model/exception/MlsException.js.map +0 -1
  581. package/build/model/exception/WireApiError.d.ts.map +0 -1
  582. package/build/model/exception/WireApiError.js +0 -17
  583. package/build/model/exception/WireApiError.js.map +0 -1
  584. package/build/model/exception/WireApiException.d.ts.map +0 -1
  585. package/build/model/exception/WireApiException.js.map +0 -1
  586. package/src/model/exception/CoreCryptoMlsException.ts +0 -26
  587. package/src/model/exception/MlsException.ts +0 -26
  588. package/src/model/exception/WireApiError.ts +0 -21
  589. /package/build/{model/exception → exception}/CoreCryptoMlsException.d.ts +0 -0
  590. /package/build/{model/exception → exception}/MlsException.d.ts +0 -0
  591. /package/build/{model/exception → exception}/WireApiError.d.ts +0 -0
@@ -1,18 +1,18 @@
1
1
  /*
2
- * Wire
3
- * Copyright (C) 2025 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
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- * You should have received a copy of the GNU General Public License
14
- * along with this program. If not, see http://www.gnu.org/licenses/.
15
- */
2
+ * Wire
3
+ * Copyright (C) 2025 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
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU General Public License for more details.
13
+ * You should have received a copy of the GNU General Public License
14
+ * along with this program. If not, see http://www.gnu.org/licenses/.
15
+ */
16
16
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
17
17
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
18
18
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -22,12 +22,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
22
22
  var __metadata = (this && this.__metadata) || function (k, v) {
23
23
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
24
24
  };
25
- import { DatabaseService } from "./DatabaseService.js";
26
- import { singleton } from "tsyringe";
27
- import { LoggerFactory } from "../utils/logger/LoggerFactory.js";
28
- import { obfuscateId } from "../utils/ObfuscateUtil.js";
29
- import { conversationMember } from "./schema.js";
30
- import { and, eq, sql } from "drizzle-orm";
25
+ import { DatabaseService } from './DatabaseService.js';
26
+ import { singleton } from 'tsyringe';
27
+ import { LoggerFactory } from '../utils/logger/LoggerFactory.js';
28
+ import { obfuscateId } from '../utils/ObfuscateUtil.js';
29
+ import { conversationMember } from './schema.js';
30
+ import { and, eq, sql } from 'drizzle-orm';
31
31
  let ConversationMemberRepository = class ConversationMemberRepository {
32
32
  databaseService;
33
33
  logger = LoggerFactory.getLogger(this.constructor.name);
@@ -40,14 +40,21 @@ let ConversationMemberRepository = class ConversationMemberRepository {
40
40
  constructor(databaseService) {
41
41
  this.databaseService = databaseService;
42
42
  this.selectAllStmt = this.databaseService.db.select().from(conversationMember).prepare();
43
- this.selectByIdAndDomainStmt = this.databaseService.db.select().from(conversationMember).where(and(eq(conversationMember.conversationId, sql.placeholder('conversationId')), eq(conversationMember.conversationDomain, sql.placeholder('conversationDomain')))).prepare();
44
- this.insertStmt = this.databaseService.db.insert(conversationMember).values({
43
+ this.selectByIdAndDomainStmt = this.databaseService.db
44
+ .select()
45
+ .from(conversationMember)
46
+ .where(and(eq(conversationMember.conversationId, sql.placeholder('conversationId')), eq(conversationMember.conversationDomain, sql.placeholder('conversationDomain'))))
47
+ .prepare();
48
+ this.insertStmt = this.databaseService.db
49
+ .insert(conversationMember)
50
+ .values({
45
51
  userId: sql.placeholder('userId'),
46
52
  userDomain: sql.placeholder('userDomain'),
47
53
  conversationId: sql.placeholder('conversationId'),
48
54
  conversationDomain: sql.placeholder('conversationDomain'),
49
55
  role: sql.placeholder('role')
50
- }).onConflictDoUpdate({
56
+ })
57
+ .onConflictDoUpdate({
51
58
  target: [
52
59
  conversationMember.userId,
53
60
  conversationMember.userDomain,
@@ -55,9 +62,16 @@ let ConversationMemberRepository = class ConversationMemberRepository {
55
62
  conversationMember.conversationDomain
56
63
  ],
57
64
  set: { role: sql.raw(`excluded.${conversationMember.role.name}`) }
58
- }).prepare();
59
- this.deleteStmt = this.databaseService.db.delete(conversationMember).where(and(eq(conversationMember.userId, sql.placeholder('userId')), eq(conversationMember.userDomain, sql.placeholder('userDomain')), eq(conversationMember.conversationId, sql.placeholder('conversationId')), eq(conversationMember.conversationDomain, sql.placeholder('conversationDomain')))).prepare();
60
- this.deleteAllMembersInConversationStmt = this.databaseService.db.delete(conversationMember).where(and(eq(conversationMember.conversationId, sql.placeholder('conversationId')), eq(conversationMember.conversationDomain, sql.placeholder('conversationDomain')))).prepare();
65
+ })
66
+ .prepare();
67
+ this.deleteStmt = this.databaseService.db
68
+ .delete(conversationMember)
69
+ .where(and(eq(conversationMember.userId, sql.placeholder('userId')), eq(conversationMember.userDomain, sql.placeholder('userDomain')), eq(conversationMember.conversationId, sql.placeholder('conversationId')), eq(conversationMember.conversationDomain, sql.placeholder('conversationDomain'))))
70
+ .prepare();
71
+ this.deleteAllMembersInConversationStmt = this.databaseService.db
72
+ .delete(conversationMember)
73
+ .where(and(eq(conversationMember.conversationId, sql.placeholder('conversationId')), eq(conversationMember.conversationDomain, sql.placeholder('conversationDomain'))))
74
+ .prepare();
61
75
  this.existsStmt = this.databaseService.db
62
76
  .select({ found: sql `1` })
63
77
  .from(conversationMember)
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationMemberRepository.js","sourceRoot":"","sources":["../../src/db/ConversationMemberRepository.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;;;;;;;;;;AAGF,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AACnC,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAC,GAAG,EAAE,EAAE,EAAE,GAAG,EAAC,MAAM,aAAa,CAAC;AAGlC,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAUV;IATrB,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAEvD,aAAa,CAAA;IACb,uBAAuB,CAAA;IACvB,UAAU,CAAA;IACV,UAAU,CAAA;IACV,kCAAkC,CAAA;IAClC,UAAU,CAAA;IAElB,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;QAC3D,IAAI,CAAC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AU,EAAE,UAAU;YACtB,cAAc,EAAE,cAAc;YAC9B,kBAAkB,EAAE,kBAAkB;SACvC,CAAC,CAAA;QAEF,OAAO,MAAM,KAAK,SAAS,CAAA;IAC7B,CAAC;CACF,CAAA;AAhJY,4BAA4B;IADxC,SAAS,EAAE;qCAWoC,eAAe;GAVlD,4BAA4B,CAgJxC"}
@@ -1,5 +1,5 @@
1
- import { DatabaseService } from "./DatabaseService.js";
2
- import type { ConversationEntity } from "./model/ConversationEntity.js";
1
+ import { DatabaseService } from './DatabaseService.js';
2
+ import type { ConversationEntity } from './model/ConversationEntity.js';
3
3
  export declare class ConversationRepository {
4
4
  private readonly databaseService;
5
5
  private selectAllStmt;
@@ -12,6 +12,11 @@ export declare class ConversationRepository {
12
12
  findByIdAndDomain(id: string, domain: string): ConversationEntity | null;
13
13
  findOneToOneByNameAndDomain(name: string, domain: string): ConversationEntity | null;
14
14
  save(conv: ConversationEntity): void;
15
+ /**
16
+ * Update the message timer value of the conversation record.
17
+ * This is important for ephemeral (self-deleting) messages.
18
+ */
19
+ updateMessageTimer(id: string, domain: string, messageTimer: number | null): void;
15
20
  delete(id: string, domain: string): void;
16
21
  }
17
22
  //# sourceMappingURL=ConversationRepository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationRepository.d.ts","sourceRoot":"","sources":["../../src/db/ConversationRepository.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AAMtE,qBACa,sBAAsB;IAQrB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAN5C,OAAO,CAAC,aAAa,CAAA;IACrB,OAAO,CAAC,uBAAuB,CAAA;IAC/B,OAAO,CAAC,oBAAoB,CAAA;IAC5B,OAAO,CAAC,UAAU,CAAA;IAClB,OAAO,CAAC,UAAU,CAAA;gBAEW,eAAe,EAAE,eAAe;IAmD7D,MAAM,IA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I;CAMzC"}
@@ -1,18 +1,18 @@
1
1
  /*
2
- * Wire
3
- * Copyright (C) 2025 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
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- * You should have received a copy of the GNU General Public License
14
- * along with this program. If not, see http://www.gnu.org/licenses/.
15
- */
2
+ * Wire
3
+ * Copyright (C) 2025 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
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU General Public License for more details.
13
+ * You should have received a copy of the GNU General Public License
14
+ * along with this program. If not, see http://www.gnu.org/licenses/.
15
+ */
16
16
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
17
17
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
18
18
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -22,11 +22,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
22
22
  var __metadata = (this && this.__metadata) || function (k, v) {
23
23
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
24
24
  };
25
- import { DatabaseService } from "./DatabaseService.js";
26
- import { singleton } from "tsyringe";
27
- import { conversation } from "./schema.js";
28
- import { and, eq, sql } from "drizzle-orm";
29
- import { ConversationType } from "../model/conversation/ConversationType.js";
25
+ import { DatabaseService } from './DatabaseService.js';
26
+ import { singleton } from 'tsyringe';
27
+ import { conversation } from './schema.js';
28
+ import { and, eq, sql } from 'drizzle-orm';
29
+ import { ConversationType } from '../model/conversation/ConversationType.js';
30
30
  let ConversationRepository = class ConversationRepository {
31
31
  databaseService;
32
32
  selectAllStmt;
@@ -37,43 +37,57 @@ let ConversationRepository = class ConversationRepository {
37
37
  constructor(databaseService) {
38
38
  this.databaseService = databaseService;
39
39
  this.selectAllStmt = this.databaseService.db.select().from(conversation).prepare();
40
- this.selectByIdAndDomainStmt =
41
- this.databaseService.db.select().from(conversation).where(and(eq(conversation.id, sql.placeholder('id')), eq(conversation.domain, sql.placeholder('domain')))).prepare();
42
- this.selectOneToOneByName =
43
- this.databaseService.db.select().from(conversation).where(and(eq(conversation.name, sql.placeholder('name')), eq(conversation.domain, sql.placeholder('domain')), eq(conversation.type, ConversationType.ONE_TO_ONE))).prepare();
44
- this.insertStmt =
45
- this.databaseService.db.insert(conversation).values({
46
- id: sql.placeholder('id'),
47
- domain: sql.placeholder('domain'),
48
- name: sql.placeholder('name'),
49
- teamId: sql.placeholder('teamId'),
50
- mlsGroupId: sql.placeholder('mlsGroupId'),
51
- type: sql.placeholder('type')
52
- }).onConflictDoUpdate({
53
- target: [conversation.id, conversation.domain],
54
- set: {
55
- name: sql.raw(`excluded.${conversation.name.name}`),
56
- teamId: sql.raw(`excluded.${conversation.teamId.name}`),
57
- mlsGroupId: sql.raw(`excluded.${conversation.mlsGroupId.name}`),
58
- type: sql.raw(`excluded.${conversation.type.name}`),
59
- }
60
- }).prepare();
61
- this.deleteStmt = this.databaseService.db.delete(conversation).where(and(eq(conversation.id, sql.placeholder('id')), eq(conversation.domain, sql.placeholder('domain')))).prepare();
40
+ this.selectByIdAndDomainStmt = this.databaseService.db
41
+ .select()
42
+ .from(conversation)
43
+ .where(and(eq(conversation.id, sql.placeholder('id')), eq(conversation.domain, sql.placeholder('domain'))))
44
+ .prepare();
45
+ this.selectOneToOneByName = this.databaseService.db
46
+ .select()
47
+ .from(conversation)
48
+ .where(and(eq(conversation.name, sql.placeholder('name')), eq(conversation.domain, sql.placeholder('domain')), eq(conversation.type, ConversationType.ONE_TO_ONE)))
49
+ .prepare();
50
+ this.insertStmt = this.databaseService.db
51
+ .insert(conversation)
52
+ .values({
53
+ id: sql.placeholder('id'),
54
+ domain: sql.placeholder('domain'),
55
+ name: sql.placeholder('name'),
56
+ teamId: sql.placeholder('teamId'),
57
+ mlsGroupId: sql.placeholder('mlsGroupId'),
58
+ type: sql.placeholder('type'),
59
+ messageTimer: sql.placeholder('messageTimer')
60
+ })
61
+ .onConflictDoUpdate({
62
+ target: [conversation.id, conversation.domain],
63
+ set: {
64
+ name: sql.raw(`excluded.${conversation.name.name}`),
65
+ teamId: sql.raw(`excluded.${conversation.teamId.name}`),
66
+ mlsGroupId: sql.raw(`excluded.${conversation.mlsGroupId.name}`),
67
+ type: sql.raw(`excluded.${conversation.type.name}`),
68
+ messageTimer: sql.raw(`excluded.${conversation.messageTimer.name}`)
69
+ }
70
+ })
71
+ .prepare();
72
+ this.deleteStmt = this.databaseService.db
73
+ .delete(conversation)
74
+ .where(and(eq(conversation.id, sql.placeholder('id')), eq(conversation.domain, sql.placeholder('domain'))))
75
+ .prepare();
62
76
  }
63
77
  getAll() {
64
78
  return this.selectAllStmt.all();
65
79
  }
66
80
  findByIdAndDomain(id, domain) {
67
- return this.selectByIdAndDomainStmt.get({
81
+ return (this.selectByIdAndDomainStmt.get({
68
82
  id: id,
69
83
  domain: domain
70
- }) ?? null;
84
+ }) ?? null);
71
85
  }
72
86
  findOneToOneByNameAndDomain(name, domain) {
73
- return this.selectOneToOneByName.get({
87
+ return (this.selectOneToOneByName.get({
74
88
  name: name,
75
89
  domain: domain
76
- }) ?? null;
90
+ }) ?? null);
77
91
  }
78
92
  save(conv) {
79
93
  this.insertStmt.run({
@@ -82,9 +96,21 @@ let ConversationRepository = class ConversationRepository {
82
96
  name: conv.name,
83
97
  teamId: conv.teamId,
84
98
  mlsGroupId: conv.mlsGroupId,
85
- type: conv.type
99
+ type: conv.type,
100
+ messageTimer: conv.messageTimer ?? null
86
101
  });
87
102
  }
103
+ /**
104
+ * Update the message timer value of the conversation record.
105
+ * This is important for ephemeral (self-deleting) messages.
106
+ */
107
+ updateMessageTimer(id, domain, messageTimer) {
108
+ this.databaseService.db
109
+ .update(conversation)
110
+ .set({ messageTimer })
111
+ .where(and(eq(conversation.id, id), eq(conversation.domain, domain)))
112
+ .run();
113
+ }
88
114
  delete(id, domain) {
89
115
  this.deleteStmt.run({
90
116
  id: id,
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationRepository.js","sourceRoot":"","sources":["../../src/db/ConversationRepository.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;;;;;;;;;;AAEF,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AACnC,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,EAAC,GAAG,EAAE,EAAE,EAAE,GAAG,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,EAAC,gBAAgB,EAAC,MAAM,2CAA2C,CAAC;AAGpE,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAQJ;IANrB,aAAa,CAAA;IACb,uBAAuB,CAAA;IACvB,oBAAoB,CAAA;IACpB,UAAU,CAAA;IACV,UAAU,CAAA;IAElB,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;QAC3D,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;QAEnF,IAAI,CAAC,uBAAuB;YAC1B,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,C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O,CAAC,MAAM,CAAiD;IAC/D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAK;IAClC,SAAgB,EAAE,EAAE,qBAAqB,CAAC;;IAW1C,SAAS,CAAC,eAAe,IAAI,MAAM;IAInC,SAAS,CAAC,mBAAmB,IAAI,MAAM;IAIvC,OAAO,CAAC,OAAO;IAiBf,KAAK;CAGN"}
1
+ {"version":3,"file":"DatabaseService.d.ts","sourceRoot":"","sources":["../../src/db/DatabaseService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,qBAAqB,EAAU,MAAM,4BAA4B,CAAA;AAOzE,qBACa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAiD;IAC/D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAI;IACjC,SAAgB,EAAE,EAAE,qBAAqB,CAAA;;IAWzC,SAAS,CAAC,eAAe,IAAI,MAAM;IAInC,SAAS,CAAC,mBAAmB,IAAI,MAAM;IAIvC,OAAO,CAAC,OAAO;IAkBf,KAAK;CAGN"}
@@ -1,18 +1,18 @@
1
1
  /*
2
- * Wire
3
- * Copyright (C) 2025 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
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- * You should have received a copy of the GNU General Public License
14
- * along with this program. If not, see http://www.gnu.org/licenses/.
15
- */
2
+ * Wire
3
+ * Copyright (C) 2025 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
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU General Public License for more details.
13
+ * You should have received a copy of the GNU General Public License
14
+ * along with this program. If not, see http://www.gnu.org/licenses/.
15
+ */
16
16
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
17
17
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
18
18
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -22,22 +22,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
22
22
  var __metadata = (this && this.__metadata) || function (k, v) {
23
23
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
24
24
  };
25
- import Database, {} from "better-sqlite3";
26
- import { singleton } from "tsyringe";
27
- import { LoggerFactory } from "../utils/logger/LoggerFactory.js";
25
+ import Database, {} from 'better-sqlite3';
26
+ import { singleton } from 'tsyringe';
27
+ import { LoggerFactory } from '../utils/logger/LoggerFactory.js';
28
28
  import { BetterSQLite3Database, drizzle } from 'drizzle-orm/better-sqlite3';
29
- import { migrate } from "drizzle-orm/better-sqlite3/migrator";
30
- import { DATABASE_PATH } from "../utils/StoragePaths.js";
31
- import { dirname, join } from "node:path";
32
- import { fileURLToPath } from "node:url";
29
+ import { migrate } from 'drizzle-orm/better-sqlite3/migrator';
30
+ import { DATABASE_PATH } from '../utils/StoragePaths.js';
31
+ import { dirname, join } from 'node:path';
32
+ import { fileURLToPath } from 'node:url';
33
+ import { DatabaseError } from '../exception/WireException.js';
33
34
  let DatabaseService = class DatabaseService {
34
35
  logger = LoggerFactory.getLogger(this.constructor.name);
35
36
  sqliteClient;
36
37
  db;
37
38
  constructor() {
38
- this.logger.info("DatabaseService being created");
39
+ this.logger.info('DatabaseService being created');
39
40
  this.sqliteClient = new Database(this.getDatabasePath());
40
- this.sqliteClient.pragma("foreign_keys = ON");
41
+ this.sqliteClient.pragma('foreign_keys = ON');
41
42
  this.db = drizzle({ client: this.sqliteClient });
42
43
  this.migrate();
43
44
  }
@@ -45,20 +46,21 @@ let DatabaseService = class DatabaseService {
45
46
  return DATABASE_PATH;
46
47
  }
47
48
  getMigrationsFolder() {
48
- return join(dirname(fileURLToPath(import.meta.url)), "migrations");
49
+ return join(dirname(fileURLToPath(import.meta.url)), 'migrations');
49
50
  }
50
51
  migrate() {
51
52
  const migrationsFolder = this.getMigrationsFolder();
52
- this.logger.info("Running database migrations");
53
+ this.logger.info('Running database migrations');
53
54
  try {
54
55
  migrate(this.db, {
55
56
  migrationsFolder
56
57
  });
57
58
  }
58
59
  catch (exception) {
59
- throw new Error(`Failed to run Wire Apps SDK database migrations from "${migrationsFolder}". ` +
60
+ //TODO: This error seems good. Do we need a separate custom error in WireException class?
61
+ throw new DatabaseError(`Failed to run Wire Apps SDK database migrations from "${migrationsFolder}". ` +
60
62
  `Make sure the database migration files are included next to the built ` +
61
- `DatabaseService.js file, for example in "build/db/migrations".`, { cause: exception });
63
+ `DatabaseService.js file, for example in "build/db/migrations".`, exception);
62
64
  }
63
65
  }
64
66
  close() {
@@ -1 +1 @@
1
- {"version":3,"file":"DatabaseService.js","sourceRoot":"","sources":["../../src/db/DatabaseService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;;;;;;;;;;AAEF,OAAO,QAAQ,EAAE,EAAuB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AACnC,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAC,qBAAqB,EAAE,OAAO,EAAC,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAC,OAAO,EAAC,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,aAAa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