polfan-server-js-client 0.1.59 → 0.1.92

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 (301) hide show
  1. package/.idea/vcs.xml +1 -0
  2. package/build/index.js +174 -99
  3. package/build/index.js.map +1 -1
  4. package/build/types/AbstractChatClient.d.ts +14 -4
  5. package/build/types/Permissions.d.ts +4 -0
  6. package/build/types/state-tracker/MessagesManager.d.ts +16 -10
  7. package/build/types/state-tracker/RoomsManager.d.ts +1 -0
  8. package/build/types/types/dist/index.d.ts +1 -0
  9. package/build/types/types/dist/schemes/AckReport.d.ts +1 -0
  10. package/build/types/types/dist/schemes/ChatLocation.d.ts +1 -0
  11. package/build/types/types/dist/schemes/Envelope.d.ts +1 -0
  12. package/build/types/types/dist/schemes/FollowedTopic.d.ts +1 -0
  13. package/build/types/types/dist/schemes/Message.d.ts +1 -0
  14. package/build/types/types/dist/schemes/PermissionOverwritesValue.d.ts +1 -0
  15. package/build/types/types/dist/schemes/Role.d.ts +1 -0
  16. package/build/types/types/dist/schemes/Room.d.ts +1 -0
  17. package/build/types/types/dist/schemes/RoomMember.d.ts +1 -0
  18. package/build/types/types/dist/schemes/RoomSummary.d.ts +1 -0
  19. package/build/types/types/dist/schemes/Space.d.ts +1 -0
  20. package/build/types/types/dist/schemes/SpaceMember.d.ts +1 -0
  21. package/build/types/types/dist/schemes/Topic.d.ts +1 -0
  22. package/build/types/types/dist/schemes/User.d.ts +1 -0
  23. package/build/types/types/dist/schemes/UserState.d.ts +1 -0
  24. package/build/types/types/dist/schemes/commands/Ack.d.ts +1 -0
  25. package/build/types/types/dist/schemes/commands/AssignRole.d.ts +1 -0
  26. package/build/types/types/dist/schemes/commands/CreateMessage.d.ts +1 -0
  27. package/build/types/types/dist/schemes/commands/CreateOwner.d.ts +1 -0
  28. package/build/types/types/dist/schemes/commands/CreateRole.d.ts +1 -0
  29. package/build/types/types/dist/schemes/commands/CreateRoom.d.ts +1 -0
  30. package/build/types/types/dist/schemes/commands/CreateSpace.d.ts +1 -0
  31. package/build/types/types/dist/schemes/commands/CreateTopic.d.ts +1 -0
  32. package/build/types/types/dist/schemes/commands/DeassignRole.d.ts +1 -0
  33. package/build/types/types/dist/schemes/commands/DeleteOwner.d.ts +1 -0
  34. package/build/types/types/dist/schemes/commands/DeleteRole.d.ts +1 -0
  35. package/build/types/types/dist/schemes/commands/DeleteRoom.d.ts +1 -0
  36. package/build/types/types/dist/schemes/commands/DeleteSpace.d.ts +1 -0
  37. package/build/types/types/dist/schemes/commands/DeleteTopic.d.ts +1 -0
  38. package/build/types/types/dist/schemes/commands/FollowTopic.d.ts +1 -0
  39. package/build/types/types/dist/schemes/commands/GetAckReports.d.ts +1 -0
  40. package/build/types/types/dist/schemes/commands/GetComputedPermissions.d.ts +1 -0
  41. package/build/types/types/dist/schemes/commands/GetFollowedTopics.d.ts +1 -0
  42. package/build/types/types/dist/schemes/commands/GetOwners.d.ts +1 -0
  43. package/build/types/types/dist/schemes/commands/GetPermissionOverwriteTargets.d.ts +1 -0
  44. package/build/types/types/dist/schemes/commands/GetPermissionOverwrites.d.ts +1 -0
  45. package/build/types/types/dist/schemes/commands/GetRoomMembers.d.ts +1 -0
  46. package/build/types/types/dist/schemes/commands/GetSession.d.ts +1 -0
  47. package/build/types/types/dist/schemes/commands/GetSpaceMembers.d.ts +1 -0
  48. package/build/types/types/dist/schemes/commands/GetSpaceRooms.d.ts +1 -0
  49. package/build/types/types/dist/schemes/commands/JoinRoom.d.ts +1 -0
  50. package/build/types/types/dist/schemes/commands/JoinSpace.d.ts +1 -0
  51. package/build/types/types/dist/schemes/commands/LeaveRoom.d.ts +1 -0
  52. package/build/types/types/dist/schemes/commands/LeaveSpace.d.ts +1 -0
  53. package/build/types/types/dist/schemes/commands/SetPermissionOverwrites.d.ts +1 -0
  54. package/build/types/types/dist/schemes/commands/UnfollowTopic.d.ts +1 -0
  55. package/build/types/types/dist/schemes/commands/UpdateRole.d.ts +1 -0
  56. package/build/types/types/dist/schemes/commands/UpdateRoom.d.ts +1 -0
  57. package/build/types/types/dist/schemes/commands/UpdateSpace.d.ts +1 -0
  58. package/build/types/types/dist/schemes/events/AckReports.d.ts +1 -0
  59. package/build/types/types/dist/schemes/events/Bye.d.ts +1 -0
  60. package/build/types/types/dist/schemes/events/ComputedPermissions.d.ts +1 -0
  61. package/build/types/types/dist/schemes/events/Error.d.ts +1 -0
  62. package/build/types/types/dist/schemes/events/FollowedTopics.d.ts +1 -0
  63. package/build/types/types/dist/schemes/events/NewMessage.d.ts +1 -0
  64. package/build/types/types/dist/schemes/events/NewRole.d.ts +1 -0
  65. package/build/types/types/dist/schemes/events/NewRoom.d.ts +1 -0
  66. package/build/types/types/dist/schemes/events/NewTopic.d.ts +1 -0
  67. package/build/types/types/dist/schemes/events/Ok.d.ts +1 -0
  68. package/build/types/types/dist/schemes/events/Owners.d.ts +1 -0
  69. package/build/types/types/dist/schemes/events/PermissionOverwriteTargets.d.ts +1 -0
  70. package/build/types/types/dist/schemes/events/PermissionOverwrites.d.ts +1 -0
  71. package/build/types/types/dist/schemes/events/PermissionOverwritesUpdated.d.ts +1 -0
  72. package/build/types/types/dist/schemes/events/RoleDeleted.d.ts +1 -0
  73. package/build/types/types/dist/schemes/events/RoleUpdated.d.ts +1 -0
  74. package/build/types/types/dist/schemes/events/RoomDeleted.d.ts +1 -0
  75. package/build/types/types/dist/schemes/events/RoomJoined.d.ts +1 -0
  76. package/build/types/types/dist/schemes/events/RoomLeft.d.ts +1 -0
  77. package/build/types/types/dist/schemes/events/RoomMemberJoined.d.ts +1 -0
  78. package/build/types/types/dist/schemes/events/RoomMemberLeft.d.ts +1 -0
  79. package/build/types/types/dist/schemes/events/RoomMemberUpdated.d.ts +1 -0
  80. package/build/types/types/dist/schemes/events/RoomMembers.d.ts +1 -0
  81. package/build/types/types/dist/schemes/events/RoomUpdated.d.ts +1 -0
  82. package/build/types/types/dist/schemes/events/Session.d.ts +1 -0
  83. package/build/types/types/dist/schemes/events/SpaceDeleted.d.ts +1 -0
  84. package/build/types/types/dist/schemes/events/SpaceJoined.d.ts +1 -0
  85. package/build/types/types/dist/schemes/events/SpaceLeft.d.ts +1 -0
  86. package/build/types/types/dist/schemes/events/SpaceMemberJoined.d.ts +1 -0
  87. package/build/types/types/dist/schemes/events/SpaceMemberLeft.d.ts +1 -0
  88. package/build/types/types/dist/schemes/events/SpaceMemberUpdated.d.ts +1 -0
  89. package/build/types/types/dist/schemes/events/SpaceMembers.d.ts +1 -0
  90. package/build/types/types/dist/schemes/events/SpaceRooms.d.ts +1 -0
  91. package/build/types/types/dist/schemes/events/SpaceUpdated.d.ts +1 -0
  92. package/build/types/types/dist/schemes/events/TopicDeleted.d.ts +1 -0
  93. package/build/types/types/dist/schemes/events/TopicFollowed.d.ts +1 -0
  94. package/build/types/types/dist/schemes/events/TopicUnfollowed.d.ts +1 -0
  95. package/build/types/types/dist/schemes/events/UserUpdated.d.ts +1 -0
  96. package/build/types/types/src/index.d.ts +9 -4
  97. package/build/types/types/src/schemes/FollowedTopic.d.ts +7 -0
  98. package/build/types/types/src/schemes/Room.d.ts +1 -1
  99. package/build/types/types/src/schemes/Topic.d.ts +5 -1
  100. package/build/types/types/src/schemes/commands/CreateTopic.d.ts +2 -2
  101. package/build/types/types/src/schemes/commands/FollowTopic.d.ts +4 -0
  102. package/build/types/types/src/schemes/commands/GetFollowedTopics.d.ts +4 -0
  103. package/build/types/types/src/schemes/commands/UnfollowTopic.d.ts +4 -0
  104. package/build/types/types/src/schemes/events/FollowedTopics.d.ts +4 -0
  105. package/build/types/types/src/schemes/events/TopicFollowed.d.ts +4 -0
  106. package/build/types/types/src/schemes/events/TopicUnfollowed.d.ts +4 -0
  107. package/package.json +1 -1
  108. package/src/AbstractChatClient.ts +13 -5
  109. package/src/Permissions.ts +8 -7
  110. package/src/state-tracker/MessagesManager.ts +113 -57
  111. package/src/state-tracker/RoomsManager.ts +15 -0
  112. package/src/types/dist/index.d.ts +87 -0
  113. package/src/types/dist/index.js +2 -0
  114. package/src/types/dist/schemes/AckReport.js +2 -0
  115. package/src/types/dist/schemes/ChatLocation.d.ts +5 -0
  116. package/src/types/dist/schemes/ChatLocation.js +2 -0
  117. package/src/types/dist/schemes/Envelope.d.ts +5 -0
  118. package/src/types/dist/schemes/Envelope.js +2 -0
  119. package/src/types/dist/schemes/FollowedTopic.d.ts +7 -0
  120. package/src/types/dist/schemes/FollowedTopic.js +2 -0
  121. package/src/types/dist/schemes/Message.d.ts +7 -0
  122. package/src/types/dist/schemes/Message.js +2 -0
  123. package/src/types/dist/schemes/PermissionOverwritesValue.d.ts +4 -0
  124. package/src/types/dist/schemes/PermissionOverwritesValue.js +2 -0
  125. package/src/types/dist/schemes/Role.d.ts +6 -0
  126. package/src/types/dist/schemes/Role.js +2 -0
  127. package/src/types/dist/schemes/Room.d.ts +10 -0
  128. package/src/types/dist/schemes/Room.js +2 -0
  129. package/src/types/dist/schemes/RoomMember.d.ts +7 -0
  130. package/src/types/dist/schemes/RoomMember.js +2 -0
  131. package/src/types/dist/schemes/RoomSummary.d.ts +5 -0
  132. package/src/types/dist/schemes/RoomSummary.js +2 -0
  133. package/src/types/dist/schemes/Space.d.ts +6 -0
  134. package/src/types/dist/schemes/Space.js +2 -0
  135. package/src/types/dist/schemes/SpaceMember.d.ts +5 -0
  136. package/src/types/dist/schemes/SpaceMember.js +2 -0
  137. package/src/types/dist/schemes/Topic.d.ts +9 -0
  138. package/src/types/dist/schemes/Topic.js +2 -0
  139. package/src/types/dist/schemes/User.d.ts +8 -0
  140. package/src/types/dist/schemes/User.js +2 -0
  141. package/src/types/dist/schemes/UserState.d.ts +6 -0
  142. package/src/types/dist/schemes/UserState.js +2 -0
  143. package/src/types/dist/schemes/commands/Ack.d.ts +5 -0
  144. package/src/types/dist/schemes/commands/Ack.js +2 -0
  145. package/src/types/dist/schemes/commands/AssignRole.d.ts +6 -0
  146. package/src/types/dist/schemes/commands/AssignRole.js +2 -0
  147. package/src/types/dist/schemes/commands/CreateMessage.d.ts +5 -0
  148. package/src/types/dist/schemes/commands/CreateMessage.js +2 -0
  149. package/src/types/dist/schemes/commands/CreateOwner.d.ts +5 -0
  150. package/src/types/dist/schemes/commands/CreateOwner.js +2 -0
  151. package/src/types/dist/schemes/commands/CreateRole.d.ts +5 -0
  152. package/src/types/dist/schemes/commands/CreateRole.js +2 -0
  153. package/src/types/dist/schemes/commands/CreateRoom.d.ts +7 -0
  154. package/src/types/dist/schemes/commands/CreateRoom.js +2 -0
  155. package/src/types/dist/schemes/commands/CreateSpace.d.ts +3 -0
  156. package/src/types/dist/schemes/commands/CreateSpace.js +2 -0
  157. package/src/types/dist/schemes/commands/CreateTopic.d.ts +12 -0
  158. package/src/types/dist/schemes/commands/CreateTopic.js +2 -0
  159. package/src/types/dist/schemes/commands/DeassignRole.d.ts +6 -0
  160. package/src/types/dist/schemes/commands/DeassignRole.js +2 -0
  161. package/src/types/dist/schemes/commands/DeleteOwner.d.ts +5 -0
  162. package/src/types/dist/schemes/commands/DeleteOwner.js +2 -0
  163. package/src/types/dist/schemes/commands/DeleteRole.d.ts +4 -0
  164. package/src/types/dist/schemes/commands/DeleteRole.js +2 -0
  165. package/src/types/dist/schemes/commands/DeleteRoom.d.ts +3 -0
  166. package/src/types/dist/schemes/commands/DeleteRoom.js +2 -0
  167. package/src/types/dist/schemes/commands/DeleteSpace.d.ts +3 -0
  168. package/src/types/dist/schemes/commands/DeleteSpace.js +2 -0
  169. package/src/types/dist/schemes/commands/DeleteTopic.d.ts +4 -0
  170. package/src/types/dist/schemes/commands/DeleteTopic.js +2 -0
  171. package/src/types/dist/schemes/commands/FollowTopic.d.ts +4 -0
  172. package/src/types/dist/schemes/commands/FollowTopic.js +2 -0
  173. package/src/types/dist/schemes/commands/GetAckReports.js +2 -0
  174. package/src/types/dist/schemes/commands/GetComputedPermissions.d.ts +4 -0
  175. package/src/types/dist/schemes/commands/GetComputedPermissions.js +2 -0
  176. package/src/types/dist/schemes/commands/GetFollowedTopics.d.ts +4 -0
  177. package/src/types/dist/schemes/commands/GetFollowedTopics.js +2 -0
  178. package/src/types/dist/schemes/commands/GetOwners.d.ts +4 -0
  179. package/src/types/dist/schemes/commands/GetOwners.js +2 -0
  180. package/src/types/dist/schemes/commands/GetPermissionOverwriteTargets.d.ts +4 -0
  181. package/src/types/dist/schemes/commands/GetPermissionOverwriteTargets.js +2 -0
  182. package/src/types/dist/schemes/commands/GetPermissionOverwrites.d.ts +6 -0
  183. package/src/types/dist/schemes/commands/GetPermissionOverwrites.js +2 -0
  184. package/src/types/dist/schemes/commands/GetRoomMembers.d.ts +3 -0
  185. package/src/types/dist/schemes/commands/GetRoomMembers.js +2 -0
  186. package/src/types/dist/schemes/commands/GetSession.d.ts +2 -0
  187. package/src/types/dist/schemes/commands/GetSession.js +2 -0
  188. package/src/types/dist/schemes/commands/GetSpaceMembers.d.ts +3 -0
  189. package/src/types/dist/schemes/commands/GetSpaceMembers.js +2 -0
  190. package/src/types/dist/schemes/commands/GetSpaceRooms.d.ts +3 -0
  191. package/src/types/dist/schemes/commands/GetSpaceRooms.js +2 -0
  192. package/src/types/dist/schemes/commands/JoinRoom.d.ts +3 -0
  193. package/src/types/dist/schemes/commands/JoinRoom.js +2 -0
  194. package/src/types/dist/schemes/commands/JoinSpace.d.ts +3 -0
  195. package/src/types/dist/schemes/commands/JoinSpace.js +2 -0
  196. package/src/types/dist/schemes/commands/LeaveRoom.d.ts +3 -0
  197. package/src/types/dist/schemes/commands/LeaveRoom.js +2 -0
  198. package/src/types/dist/schemes/commands/LeaveSpace.d.ts +3 -0
  199. package/src/types/dist/schemes/commands/LeaveSpace.js +2 -0
  200. package/src/types/dist/schemes/commands/SetPermissionOverwrites.d.ts +8 -0
  201. package/src/types/dist/schemes/commands/SetPermissionOverwrites.js +2 -0
  202. package/src/types/dist/schemes/commands/UnfollowTopic.d.ts +4 -0
  203. package/src/types/dist/schemes/commands/UnfollowTopic.js +2 -0
  204. package/src/types/dist/schemes/commands/UpdateRole.d.ts +7 -0
  205. package/src/types/dist/schemes/commands/UpdateRole.js +2 -0
  206. package/src/types/dist/schemes/commands/UpdateRoom.d.ts +5 -0
  207. package/src/types/dist/schemes/commands/UpdateRoom.js +2 -0
  208. package/src/types/dist/schemes/commands/UpdateSpace.d.ts +4 -0
  209. package/src/types/dist/schemes/commands/UpdateSpace.js +2 -0
  210. package/src/types/dist/schemes/events/AckReports.d.ts +4 -0
  211. package/src/types/dist/schemes/events/AckReports.js +2 -0
  212. package/src/types/dist/schemes/events/Bye.d.ts +3 -0
  213. package/src/types/dist/schemes/events/Bye.js +2 -0
  214. package/src/types/dist/schemes/events/ComputedPermissions.d.ts +5 -0
  215. package/src/types/dist/schemes/events/ComputedPermissions.js +2 -0
  216. package/src/types/dist/schemes/events/Error.d.ts +4 -0
  217. package/src/types/dist/schemes/events/Error.js +2 -0
  218. package/src/types/dist/schemes/events/FollowedTopics.d.ts +4 -0
  219. package/src/types/dist/schemes/events/FollowedTopics.js +2 -0
  220. package/src/types/dist/schemes/events/NewMessage.d.ts +6 -0
  221. package/src/types/dist/schemes/events/NewMessage.js +2 -0
  222. package/src/types/dist/schemes/events/NewRole.d.ts +5 -0
  223. package/src/types/dist/schemes/events/NewRole.js +2 -0
  224. package/src/types/dist/schemes/events/NewRoom.d.ts +5 -0
  225. package/src/types/dist/schemes/events/NewRoom.js +2 -0
  226. package/src/types/dist/schemes/events/NewTopic.d.ts +5 -0
  227. package/src/types/dist/schemes/events/NewTopic.js +2 -0
  228. package/src/types/dist/schemes/events/Ok.d.ts +2 -0
  229. package/src/types/dist/schemes/events/Ok.js +2 -0
  230. package/src/types/dist/schemes/events/Owners.d.ts +8 -0
  231. package/src/types/dist/schemes/events/Owners.js +2 -0
  232. package/src/types/dist/schemes/events/PermissionOverwriteTargets.d.ts +10 -0
  233. package/src/types/dist/schemes/events/PermissionOverwriteTargets.js +2 -0
  234. package/src/types/dist/schemes/events/PermissionOverwrites.d.ts +8 -0
  235. package/src/types/dist/schemes/events/PermissionOverwrites.js +2 -0
  236. package/src/types/dist/schemes/events/PermissionOverwritesUpdated.d.ts +8 -0
  237. package/src/types/dist/schemes/events/PermissionOverwritesUpdated.js +2 -0
  238. package/src/types/dist/schemes/events/RoleDeleted.d.ts +4 -0
  239. package/src/types/dist/schemes/events/RoleDeleted.js +2 -0
  240. package/src/types/dist/schemes/events/RoleUpdated.d.ts +5 -0
  241. package/src/types/dist/schemes/events/RoleUpdated.js +2 -0
  242. package/src/types/dist/schemes/events/RoomDeleted.d.ts +3 -0
  243. package/src/types/dist/schemes/events/RoomDeleted.js +2 -0
  244. package/src/types/dist/schemes/events/RoomJoined.d.ts +4 -0
  245. package/src/types/dist/schemes/events/RoomJoined.js +2 -0
  246. package/src/types/dist/schemes/events/RoomLeft.d.ts +3 -0
  247. package/src/types/dist/schemes/events/RoomLeft.js +2 -0
  248. package/src/types/dist/schemes/events/RoomMemberJoined.d.ts +5 -0
  249. package/src/types/dist/schemes/events/RoomMemberJoined.js +2 -0
  250. package/src/types/dist/schemes/events/RoomMemberLeft.d.ts +4 -0
  251. package/src/types/dist/schemes/events/RoomMemberLeft.js +2 -0
  252. package/src/types/dist/schemes/events/RoomMemberUpdated.d.ts +6 -0
  253. package/src/types/dist/schemes/events/RoomMemberUpdated.js +2 -0
  254. package/src/types/dist/schemes/events/RoomMembers.d.ts +5 -0
  255. package/src/types/dist/schemes/events/RoomMembers.js +2 -0
  256. package/src/types/dist/schemes/events/RoomUpdated.d.ts +4 -0
  257. package/src/types/dist/schemes/events/RoomUpdated.js +2 -0
  258. package/src/types/dist/schemes/events/Session.d.ts +7 -0
  259. package/src/types/dist/schemes/events/Session.js +2 -0
  260. package/src/types/dist/schemes/events/SpaceDeleted.d.ts +3 -0
  261. package/src/types/dist/schemes/events/SpaceDeleted.js +2 -0
  262. package/src/types/dist/schemes/events/SpaceJoined.d.ts +4 -0
  263. package/src/types/dist/schemes/events/SpaceJoined.js +2 -0
  264. package/src/types/dist/schemes/events/SpaceLeft.d.ts +3 -0
  265. package/src/types/dist/schemes/events/SpaceLeft.js +2 -0
  266. package/src/types/dist/schemes/events/SpaceMemberJoined.d.ts +5 -0
  267. package/src/types/dist/schemes/events/SpaceMemberJoined.js +2 -0
  268. package/src/types/dist/schemes/events/SpaceMemberLeft.d.ts +4 -0
  269. package/src/types/dist/schemes/events/SpaceMemberLeft.js +2 -0
  270. package/src/types/dist/schemes/events/SpaceMemberUpdated.d.ts +6 -0
  271. package/src/types/dist/schemes/events/SpaceMemberUpdated.js +2 -0
  272. package/src/types/dist/schemes/events/SpaceMembers.d.ts +5 -0
  273. package/src/types/dist/schemes/events/SpaceMembers.js +2 -0
  274. package/src/types/dist/schemes/events/SpaceRooms.d.ts +5 -0
  275. package/src/types/dist/schemes/events/SpaceRooms.js +2 -0
  276. package/src/types/dist/schemes/events/SpaceUpdated.d.ts +4 -0
  277. package/src/types/dist/schemes/events/SpaceUpdated.js +2 -0
  278. package/src/types/dist/schemes/events/TopicDeleted.d.ts +4 -0
  279. package/src/types/dist/schemes/events/TopicDeleted.js +2 -0
  280. package/src/types/dist/schemes/events/TopicFollowed.d.ts +4 -0
  281. package/src/types/dist/schemes/events/TopicFollowed.js +2 -0
  282. package/src/types/dist/schemes/events/TopicUnfollowed.d.ts +4 -0
  283. package/src/types/dist/schemes/events/TopicUnfollowed.js +2 -0
  284. package/src/types/dist/schemes/events/UserUpdated.d.ts +4 -0
  285. package/src/types/dist/schemes/events/UserUpdated.js +2 -0
  286. package/src/types/src/index.ts +16 -6
  287. package/src/types/src/schemes/FollowedTopic.ts +8 -0
  288. package/src/types/src/schemes/Room.ts +1 -1
  289. package/src/types/src/schemes/Topic.ts +6 -1
  290. package/src/types/src/schemes/commands/CreateTopic.ts +2 -2
  291. package/src/types/src/schemes/commands/{GetAckReports.ts → FollowTopic.ts} +1 -1
  292. package/src/types/src/schemes/commands/GetFollowedTopics.ts +5 -0
  293. package/src/types/src/schemes/commands/UnfollowTopic.ts +5 -0
  294. package/src/types/src/schemes/events/FollowedTopics.ts +5 -0
  295. package/src/types/src/schemes/events/TopicFollowed.ts +5 -0
  296. package/src/types/src/schemes/events/TopicUnfollowed.ts +5 -0
  297. package/build/types/types/src/schemes/events/AckReports.d.ts +0 -4
  298. package/src/types/src/schemes/AckReport.ts +0 -7
  299. package/src/types/src/schemes/events/AckReports.ts +0 -5
  300. /package/{build/types/types/src → src/types/dist}/schemes/AckReport.d.ts +0 -0
  301. /package/{build/types/types/src → src/types/dist}/schemes/commands/GetAckReports.d.ts +0 -0
@@ -1,5 +1,17 @@
1
1
  import {ChatStateTracker} from "./ChatStateTracker";
2
- import {AckReport, AckReports, ChatLocation, Message, NewMessage, Topic} from "../types/src";
2
+ import {
3
+ ChatLocation,
4
+ Message,
5
+ NewMessage,
6
+ Topic,
7
+ FollowedTopic,
8
+ FollowedTopics,
9
+ TopicFollowed,
10
+ TopicUnfollowed,
11
+ RoomDeleted,
12
+ RoomLeft,
13
+ TopicDeleted
14
+ } from "../types/src";
3
15
  import {
4
16
  IndexedCollection,
5
17
  ObservableIndexedObjectCollection
@@ -10,11 +22,16 @@ export const getCombinedId = (location: ChatLocation) => (location.roomId ?? '')
10
22
  export class MessagesManager {
11
23
  // Temporary not lazy loaded; server must implement GetTopicMessages command.
12
24
  private readonly list = new IndexedCollection<string, ObservableIndexedObjectCollection<Message>>();
13
- private readonly acks: IndexedCollection<string, ObservableIndexedObjectCollection<AckReport>> = new IndexedCollection();
25
+ private readonly followedTopics = new IndexedCollection<string, ObservableIndexedObjectCollection<FollowedTopic>>();
14
26
 
15
27
  public constructor(private tracker: ChatStateTracker) {
16
28
  this.tracker.client.on('NewMessage', ev => this.handleNewMessage(ev));
17
- this.tracker.client.on('AckReports', ev => this.handleAckReports(ev));
29
+ this.tracker.client.on('FollowedTopics', ev => this.handleFollowedTopics(ev));
30
+ this.tracker.client.on('TopicFollowed', ev => this.handleTopicFollowed(ev));
31
+ this.tracker.client.on('TopicUnfollowed', ev => this.handleTopicUnfollowed(ev));
32
+ this.tracker.client.on('RoomDeleted', ev => this.handleRoomDeleted(ev));
33
+ this.tracker.client.on('RoomLeft', ev => this.handleRoomLeft(ev));
34
+ this.tracker.client.on('TopicDeleted', ev => this.handleTopicDeleted(ev));
18
35
  }
19
36
 
20
37
  /**
@@ -26,54 +43,44 @@ export class MessagesManager {
26
43
 
27
44
  /**
28
45
  * Cache ack reports for all joined rooms in a space and fetch them in bulk if necessary.
29
- * Then you can get the reports using getRoomAckReports().
30
- * @see getRoomAckReports
46
+ * Then you can get the reports using getRoomFollowedTopics().
47
+ * @see getRoomFollowedTopics
31
48
  */
32
- public async cacheSpaceAckReports(spaceId: string): Promise<void> {
49
+ public async cacheSpaceFollowedTopic(spaceId: string): Promise<void> {
33
50
  if (! (await this.tracker.spaces.get()).has(spaceId)) {
34
51
  throw new Error(`You are not in space ${spaceId}`);
35
52
  }
36
53
 
37
- const roomIds = (await this.tracker.rooms.get()).findBy('spaceId', spaceId).map(room => room.id);
38
- const missingRoomIds = roomIds.filter(roomId => ! this.acks.has(roomId));
39
-
40
- if (missingRoomIds.length) {
41
- // If we don't have ack reports for all rooms in space, fetch them
42
- const result = await this.tracker.client.send('GetAckReports', {location: {spaceId}});
43
-
44
- if (result.error) {
45
- throw result.error;
46
- }
54
+ // If we don't have ack reports for all rooms in space, fetch them
55
+ const result = await this.tracker.client.send('GetFollowedTopics', {location: {spaceId}});
47
56
 
48
- missingRoomIds.forEach(roomId => {
49
- const reports = result.data.reports.filter(report => report.roomId === roomId);
50
- this.acks.set([roomId, new ObservableIndexedObjectCollection('topicId', reports)]);
51
- });
57
+ if (result.error) {
58
+ throw result.error;
52
59
  }
60
+
61
+ this.setFollowedTopicsArray(result.data.followedTopics);
53
62
  }
54
63
 
55
64
  /**
56
65
  * Get ack reports for the given room. Undefined if you are not in the room.
57
66
  * @param roomId
58
67
  */
59
- public async getRoomAckReports(roomId: string): Promise<ObservableIndexedObjectCollection<AckReport> | undefined> {
60
- const room = (await this.tracker.rooms.get()).get(roomId);
61
-
62
- if (! room) {
68
+ public async getRoomFollowedTopics(roomId: string): Promise<ObservableIndexedObjectCollection<FollowedTopic> | undefined> {
69
+ if (! (await this.tracker.rooms.get()).has(roomId)) {
63
70
  return undefined;
64
71
  }
65
72
 
66
- if (! this.acks.has(roomId)) {
67
- const result = await this.tracker.client.send('GetAckReports', {location: {roomId}});
73
+ if (! this.followedTopics.has(roomId)) {
74
+ const result = await this.tracker.client.send('GetFollowedTopics', {location: {roomId}});
68
75
 
69
76
  if (result.error) {
70
77
  throw result.error;
71
78
  }
72
79
 
73
- this.acks.set([roomId, new ObservableIndexedObjectCollection('topicId', result.data.reports)]);
80
+ this.setFollowedTopicsArray(result.data.followedTopics);
74
81
  }
75
82
 
76
- return this.acks.get(roomId);
83
+ return this.followedTopics.get(roomId);
77
84
  }
78
85
 
79
86
  /**
@@ -82,61 +89,70 @@ export class MessagesManager {
82
89
  */
83
90
  public _deleteByTopicIds(roomId: string, ...topicIds: string[]): void {
84
91
  this.list.delete(...topicIds.map(topicId => getCombinedId({roomId, topicId})));
85
- this.acks.get(roomId)?.delete(...topicIds);
92
+ this.followedTopics.get(roomId)?.delete(...topicIds);
86
93
  }
87
94
 
88
95
  /**
89
96
  * For internal use. If you want to add new topic, execute a proper command on client object.
90
97
  * @internal
91
98
  */
92
- public _handleNewTopics(roomId: string, ...topics: Topic[]): void {
93
- this.list.set(...topics.map<[string, ObservableIndexedObjectCollection<Message>]>(topic => [
94
- getCombinedId({roomId, topicId: topic.id}),
95
- new ObservableIndexedObjectCollection<Message>('id'),
96
- ]));
97
- this.createAckReportsForNewTopics(roomId, topics);
99
+ public _handleNewTopics(roomId: string, ...newTopics: Topic[]):void {
100
+ for (const newTopic of newTopics) {
101
+ const newTopicCombinedId = getCombinedId({roomId, topicId: newTopic.id});
102
+
103
+ this.list.set([newTopicCombinedId, new ObservableIndexedObjectCollection<Message>('id')]);
104
+
105
+ // If new topic refers to some message from this room, update other structures
106
+ if (newTopic.messageRef) {
107
+ const refTopicCombinedId = getCombinedId({roomId, topicId: newTopic.messageRef.topicId});
108
+ const refTopicMessages = this.list.get(refTopicCombinedId);
109
+ const refMessage = refTopicMessages?.get(newTopic.messageRef.messageId);
110
+
111
+ if (refMessage) {
112
+ // Update referenced topic ID in message
113
+ refTopicMessages.set({...refMessage, topicRef: newTopic.id});
114
+ }
115
+ }
116
+ }
117
+
118
+ this.createFollowedStructuresForNewTopics(roomId, newTopics);
98
119
  }
99
120
 
100
121
  private handleNewMessage(ev: NewMessage): void {
101
122
  this.list.get(getCombinedId(ev.location)).set(ev.message);
102
- this.updateLocallyAckReportOnNewMessage(ev);
123
+ this.updateLocallyFollowedTopicOnNewMessage(ev);
103
124
  }
104
125
 
105
- private handleAckReports(ev: AckReports): void {
106
- ev.reports.forEach(report => {
107
- const ackReports = this.acks.get(report.roomId);
108
- if (ackReports) {
109
- ackReports.set(report);
110
- }
111
- });
126
+ private handleFollowedTopics(ev: FollowedTopics): void {
127
+ this.setFollowedTopicsArray(ev.followedTopics);
112
128
  }
113
129
 
114
- private createAckReportsForNewTopics(roomId: string, topics: Topic[]): void {
115
- const ackReports = this.acks.get(roomId);
130
+ private createFollowedStructuresForNewTopics(roomId: string, topics: Topic[]): void {
131
+ const followedTopic = this.followedTopics.get(roomId);
116
132
 
117
- if (! ackReports) {
133
+ if (! followedTopic) {
118
134
  // If we don't follow ack reports for this room, skip
119
135
  return;
120
136
  }
121
137
 
122
- const newReports: AckReport[] = topics.map(topic => ({
123
- roomId, topicId: topic.id, lastAckMessageId: null, missed: 0, missedMoreThan: null
138
+ const followedTopics: FollowedTopic[] = topics.map(topic => ({
139
+ location: {roomId, topicId: topic.id}, lastAckMessageId: null, missed: 0, missedMoreThan: null
124
140
  }));
125
141
 
126
- ackReports.set(...newReports);
142
+ followedTopic.set(...followedTopics);
127
143
  }
128
144
 
129
- private updateLocallyAckReportOnNewMessage(ev: NewMessage): void {
130
- const ackReports = this.acks.get(ev.location.roomId);
145
+ private updateLocallyFollowedTopicOnNewMessage(ev: NewMessage): void {
146
+ const followedTopic = this.followedTopics.get(ev.location.roomId);
131
147
 
132
- if (! ackReports) {
148
+ if (! followedTopic) {
133
149
  // If we don't follow ack reports for this room, skip
134
150
  return;
135
151
  }
136
152
 
137
153
  const isMe = ev.message.author.id === this.tracker.me?.id;
138
- const currentAckReport = ackReports.get(ev.location.topicId);
139
- let update: Partial<AckReport>;
154
+ const currentFollowedTopic = followedTopic.get(ev.location.topicId);
155
+ let update: Partial<FollowedTopic>;
140
156
 
141
157
  if (isMe) {
142
158
  // Reset missed messages count if new message is authored by me
@@ -144,11 +160,51 @@ export class MessagesManager {
144
160
  } else {
145
161
  // ...add 1 otherwise
146
162
  update = {
147
- missed: currentAckReport.missed === null ? null : currentAckReport.missed + 1,
148
- missedMoreThan: currentAckReport.missedMoreThan === null ? null : currentAckReport.missedMoreThan,
163
+ missed: currentFollowedTopic.missed === null ? null : currentFollowedTopic.missed + 1,
164
+ missedMoreThan: currentFollowedTopic.missedMoreThan === null ? null : currentFollowedTopic.missedMoreThan,
149
165
  };
150
166
  }
151
167
 
152
- ackReports.set({...currentAckReport, ...update});
168
+ followedTopic.set({...currentFollowedTopic, ...update});
169
+ }
170
+
171
+ private handleTopicFollowed(ev: TopicFollowed): void {
172
+ this.setFollowedTopicsArray([ev.followedTopic]);
173
+ }
174
+
175
+ private handleTopicUnfollowed(ev: TopicUnfollowed): void {
176
+ this.followedTopics.get(ev.location.roomId)?.delete(ev.location.topicId);
177
+ }
178
+
179
+ private handleRoomDeleted(ev: RoomDeleted): void {
180
+ this.followedTopics.delete(ev.id);
181
+ }
182
+
183
+ private handleRoomLeft(ev: RoomLeft): void {
184
+ this.followedTopics.delete(ev.id);
185
+ }
186
+
187
+ private handleTopicDeleted(ev: TopicDeleted): void {
188
+ this.followedTopics.get(ev.location.roomId)?.delete(ev.location.topicId);
189
+ }
190
+
191
+ private setFollowedTopicsArray(followedTopics: FollowedTopic[]): void {
192
+ const roomToTopics: {[roomId: string]: FollowedTopic[]} = {};
193
+
194
+ // Reassign reports to limit collection change event emit
195
+ followedTopics.forEach(followedTopic => {
196
+ roomToTopics[followedTopic.location.roomId] ??= [];
197
+ roomToTopics[followedTopic.location.roomId].push(followedTopic);
198
+ });
199
+
200
+ for (const roomId in roomToTopics) {
201
+ if (! this.followedTopics.has(roomId)) {
202
+ this.followedTopics.set([
203
+ roomId,
204
+ new ObservableIndexedObjectCollection<FollowedTopic>(report => report.location.topicId),
205
+ ]);
206
+ }
207
+ this.followedTopics.get(roomId).set(...roomToTopics[roomId]);
208
+ }
153
209
  }
154
210
  }
@@ -1,5 +1,6 @@
1
1
  import {IndexedCollection, ObservableIndexedObjectCollection} from "../IndexedObjectCollection";
2
2
  import {
3
+ NewMessage,
3
4
  NewTopic,
4
5
  Room, RoomDeleted,
5
6
  RoomJoined, RoomLeft,
@@ -26,6 +27,7 @@ export class RoomsManager {
26
27
  public constructor(private tracker: ChatStateTracker) {
27
28
  this.messages = new MessagesManager(tracker);
28
29
 
30
+ this.tracker.client.on('NewMessage', ev => this.handleNewMessage(ev));
29
31
  this.tracker.client.on('NewTopic', ev => this.handleNewTopic(ev));
30
32
  this.tracker.client.on('TopicDeleted', ev => this.handleTopicDeleted(ev));
31
33
  this.tracker.client.on('RoomJoined', ev => this.handleRoomJoined(ev));
@@ -269,4 +271,17 @@ export class RoomsManager {
269
271
  members.set(newMember);
270
272
  });
271
273
  }
274
+
275
+ private handleNewMessage(ev: NewMessage): void {
276
+ const topics = this.topics.get(ev.location.roomId);
277
+ const topic = topics.get(ev.location.topicId);
278
+
279
+ if (topic) {
280
+ topics.set({
281
+ ...topic,
282
+ messageCount: topic.messageCount + 1,
283
+ lastMessage: ev.message,
284
+ });
285
+ }
286
+ }
272
287
  }
@@ -0,0 +1,87 @@
1
+ import { Envelope } from "./schemes/Envelope";
2
+ import { Message } from "./schemes/Message";
3
+ import { PermissionOverwritesValue } from "./schemes/PermissionOverwritesValue";
4
+ import { Role } from "./schemes/Role";
5
+ import { Room } from "./schemes/Room";
6
+ import { RoomMember } from "./schemes/RoomMember";
7
+ import { RoomSummary } from "./schemes/RoomSummary";
8
+ import { Space } from "./schemes/Space";
9
+ import { SpaceMember } from "./schemes/SpaceMember";
10
+ import { Topic } from "./schemes/Topic";
11
+ import { User } from "./schemes/User";
12
+ import { UserState } from "./schemes/UserState";
13
+ import { Bye } from "./schemes/events/Bye";
14
+ import { Error } from "./schemes/events/Error";
15
+ import { Session } from "./schemes/events/Session";
16
+ import { ComputedPermissions } from "./schemes/events/ComputedPermissions";
17
+ import { SpaceJoined } from "./schemes/events/SpaceJoined";
18
+ import { SpaceLeft } from "./schemes/events/SpaceLeft";
19
+ import { SpaceMemberJoined } from "./schemes/events/SpaceMemberJoined";
20
+ import { SpaceMemberLeft } from "./schemes/events/SpaceMemberLeft";
21
+ import { SpaceMemberUpdated } from "./schemes/events/SpaceMemberUpdated";
22
+ import { SpaceDeleted } from "./schemes/events/SpaceDeleted";
23
+ import { SpaceMembers } from "./schemes/events/SpaceMembers";
24
+ import { SpaceRooms } from "./schemes/events/SpaceRooms";
25
+ import { NewRole } from "./schemes/events/NewRole";
26
+ import { RoleDeleted } from "./schemes/events/RoleDeleted";
27
+ import { RoomJoined } from "./schemes/events/RoomJoined";
28
+ import { RoomLeft } from "./schemes/events/RoomLeft";
29
+ import { RoomMemberJoined } from "./schemes/events/RoomMemberJoined";
30
+ import { RoomMemberLeft } from "./schemes/events/RoomMemberLeft";
31
+ import { RoomMembers } from "./schemes/events/RoomMembers";
32
+ import { RoomMemberUpdated } from "./schemes/events/RoomMemberUpdated";
33
+ import { NewRoom } from "./schemes/events/NewRoom";
34
+ import { RoomDeleted } from "./schemes/events/RoomDeleted";
35
+ import { NewTopic } from "./schemes/events/NewTopic";
36
+ import { TopicDeleted } from "./schemes/events/TopicDeleted";
37
+ import { NewMessage } from "./schemes/events/NewMessage";
38
+ import { PermissionOverwritesUpdated } from "./schemes/events/PermissionOverwritesUpdated";
39
+ import { PermissionOverwrites } from "./schemes/events/PermissionOverwrites";
40
+ import { GetSession } from "./schemes/commands/GetSession";
41
+ import { GetComputedPermissions } from "./schemes/commands/GetComputedPermissions";
42
+ import { JoinSpace } from "./schemes/commands/JoinSpace";
43
+ import { LeaveSpace } from "./schemes/commands/LeaveSpace";
44
+ import { CreateSpace } from "./schemes/commands/CreateSpace";
45
+ import { DeleteSpace } from "./schemes/commands/DeleteSpace";
46
+ import { GetSpaceMembers } from "./schemes/commands/GetSpaceMembers";
47
+ import { GetSpaceRooms } from "./schemes/commands/GetSpaceRooms";
48
+ import { CreateRole } from "./schemes/commands/CreateRole";
49
+ import { DeleteRole } from "./schemes/commands/DeleteRole";
50
+ import { RoleUpdated } from "./schemes/events/RoleUpdated";
51
+ import { AssignRole } from "./schemes/commands/AssignRole";
52
+ import { DeassignRole } from "./schemes/commands/DeassignRole";
53
+ import { SetPermissionOverwrites } from "./schemes/commands/SetPermissionOverwrites";
54
+ import { GetPermissionOverwrites } from "./schemes/commands/GetPermissionOverwrites";
55
+ import { JoinRoom } from "./schemes/commands/JoinRoom";
56
+ import { LeaveRoom } from "./schemes/commands/LeaveRoom";
57
+ import { CreateRoom } from "./schemes/commands/CreateRoom";
58
+ import { DeleteRoom } from "./schemes/commands/DeleteRoom";
59
+ import { GetRoomMembers } from "./schemes/commands/GetRoomMembers";
60
+ import { CreateTopic } from "./schemes/commands/CreateTopic";
61
+ import { DeleteTopic } from "./schemes/commands/DeleteTopic";
62
+ import { CreateMessage } from "./schemes/commands/CreateMessage";
63
+ import { UpdateRole } from "./schemes/commands/UpdateRole";
64
+ import { Ack } from "./schemes/commands/Ack";
65
+ import { UserUpdated } from "./schemes/events/UserUpdated";
66
+ import { UpdateRoom } from "./schemes/commands/UpdateRoom";
67
+ import { UpdateSpace } from "./schemes/commands/UpdateSpace";
68
+ import { RoomUpdated } from "./schemes/events/RoomUpdated";
69
+ import { SpaceUpdated } from "./schemes/events/SpaceUpdated";
70
+ import { ChatLocation } from "./schemes/ChatLocation";
71
+ import { GetPermissionOverwriteTargets } from "./schemes/commands/GetPermissionOverwriteTargets";
72
+ import { PermissionOverwriteTargets } from "./schemes/events/PermissionOverwriteTargets";
73
+ import { CreateOwner } from "./schemes/commands/CreateOwner";
74
+ import { DeleteOwner } from "./schemes/commands/DeleteOwner";
75
+ import { GetOwners } from "./schemes/commands/GetOwners";
76
+ import { Owners } from "./schemes/events/Owners";
77
+ import { Ok } from "./schemes/events/Ok";
78
+ import { RoomType } from "./schemes/Room";
79
+ import { MessageReference } from "./schemes/commands/CreateTopic";
80
+ import { FollowTopic } from "./schemes/commands/FollowTopic";
81
+ import { FollowedTopics } from "./schemes/events/FollowedTopics";
82
+ import { FollowedTopic } from "./schemes/FollowedTopic";
83
+ import { UnfollowTopic } from "./schemes/commands/UnfollowTopic";
84
+ import { TopicUnfollowed } from "./schemes/events/TopicUnfollowed";
85
+ import { TopicFollowed } from "./schemes/events/TopicFollowed";
86
+ import { GetFollowedTopics } from "./schemes/commands/GetFollowedTopics";
87
+ export { Envelope, Message, Role, Room, RoomType, RoomMember, RoomSummary, Space, SpaceMember, Topic, FollowedTopic, User, UserState, PermissionOverwritesValue, ChatLocation, MessageReference, Bye, Error, NewMessage, NewRole, NewRoom, NewTopic, TopicFollowed, TopicUnfollowed, FollowedTopics, ComputedPermissions, PermissionOverwrites, PermissionOverwritesUpdated, RoleDeleted, RoleUpdated, RoomDeleted, RoomUpdated, RoomJoined, RoomLeft, RoomMemberJoined, RoomMemberLeft, RoomMembers, RoomMemberUpdated, UserUpdated, Session, SpaceDeleted, SpaceUpdated, SpaceJoined, SpaceLeft, SpaceMemberJoined, SpaceMemberLeft, SpaceMembers, SpaceMemberUpdated, SpaceRooms, TopicDeleted, PermissionOverwriteTargets, Owners, Ok, AssignRole, CreateMessage, Ack, CreateRole, CreateRoom, CreateSpace, CreateTopic, FollowTopic, UnfollowTopic, GetFollowedTopics, DeassignRole, DeleteRole, DeleteRoom, DeleteSpace, DeleteTopic, SetPermissionOverwrites, GetPermissionOverwrites, GetComputedPermissions, GetRoomMembers, GetSession, GetSpaceMembers, GetSpaceRooms, JoinRoom, JoinSpace, LeaveRoom, LeaveSpace, UpdateRole, UpdateSpace, UpdateRoom, GetPermissionOverwriteTargets, CreateOwner, DeleteOwner, GetOwners, };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export interface ChatLocation {
2
+ spaceId?: string;
3
+ roomId?: string;
4
+ topicId?: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export interface Envelope<T = any> {
2
+ type: string;
3
+ ref?: string;
4
+ data: T;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { ChatLocation } from "./ChatLocation";
2
+ export interface FollowedTopic {
3
+ location: ChatLocation;
4
+ lastAckMessageId: string | null;
5
+ missed: number | null;
6
+ missedMoreThan: number | null;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { User } from "./User";
2
+ export interface Message {
3
+ id: string;
4
+ author: User;
5
+ content: string;
6
+ topicRef: string | null;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface PermissionOverwritesValue {
2
+ allow: number | null;
3
+ deny: number | null;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export interface Role {
2
+ id: string;
3
+ priority: number;
4
+ name: string;
5
+ color?: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import { Topic } from "./Topic";
2
+ export type RoomType = 'Text';
3
+ export interface Room {
4
+ id: string;
5
+ spaceId: string | null;
6
+ name: string;
7
+ description: string;
8
+ type: RoomType;
9
+ defaultTopic: Topic | null;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { User } from "./User";
2
+ import { SpaceMember } from "./SpaceMember";
3
+ export interface RoomMember {
4
+ user: User | null;
5
+ spaceMember: SpaceMember | null;
6
+ roles: string[] | null;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export interface RoomSummary {
2
+ id: string;
3
+ name: string;
4
+ description: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { Role } from "./Role";
2
+ export interface Space {
3
+ id: string;
4
+ name: string;
5
+ roles: Role[];
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { User } from "./User";
2
+ export interface SpaceMember {
3
+ user: User | null;
4
+ roles: string[];
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { MessageReference } from "./commands/CreateTopic";
2
+ import { Message } from "./Message";
3
+ export interface Topic {
4
+ id: string;
5
+ name: string;
6
+ messageCount: number;
7
+ messageRef?: MessageReference;
8
+ lastMessage?: Message;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export type UserFlag = 'bot' | 'temp';
2
+ export interface User {
3
+ id: string;
4
+ nick: string;
5
+ avatar: string;
6
+ flags: UserFlag[];
7
+ online: boolean;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { Space } from "./Space";
2
+ import { Room } from "./Room";
3
+ export interface UserState {
4
+ spaces: Space[];
5
+ rooms: Room[];
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { ChatLocation } from "../ChatLocation";
2
+ export interface Ack {
3
+ location: ChatLocation;
4
+ messageId?: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { ChatLocation } from "../ChatLocation";
2
+ export interface AssignRole {
3
+ roleId: string;
4
+ userId: string;
5
+ location: ChatLocation;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { ChatLocation } from "../ChatLocation";
2
+ export interface CreateMessage {
3
+ location: ChatLocation;
4
+ content: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { ChatLocation } from "../ChatLocation";
2
+ export interface CreateOwner {
3
+ location: ChatLocation;
4
+ userId: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export interface CreateRole {
2
+ spaceId: string;
3
+ name: string;
4
+ color: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { RoomType } from "../Room";
2
+ export interface CreateRoom {
3
+ spaceId: string;
4
+ name: string;
5
+ description: string;
6
+ type: RoomType;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export interface CreateSpace {
2
+ name: string;
3
+ }