@devanachat/sdk 0.0.0-stage → 0.6.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 (194) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/LICENSE +21 -0
  3. package/README.md +391 -2
  4. package/build/index.cjs.js +3559 -0
  5. package/build/index.cjs.js.map +1 -0
  6. package/build/index.mjs +3517 -0
  7. package/build/index.mjs.map +1 -0
  8. package/build/index.umd.js +2 -0
  9. package/build/index.umd.js.map +1 -0
  10. package/build/types/AbstractChatClient.d.ts +182 -0
  11. package/build/types/AbstractRestClient.d.ts +21 -0
  12. package/build/types/EventTarget.d.ts +32 -0
  13. package/build/types/FilesClient.d.ts +16 -0
  14. package/build/types/IndexedObjectCollection.d.ts +66 -0
  15. package/build/types/Permissions.d.ts +109 -0
  16. package/build/types/WebApiChatClient.d.ts +38 -0
  17. package/build/types/WebSocketChatClient.d.ts +110 -0
  18. package/build/types/index.d.ts +19 -0
  19. package/build/types/protocol/index.d.ts +163 -0
  20. package/build/types/protocol/schemes/BanObject.d.ts +14 -0
  21. package/build/types/protocol/schemes/ChatLocation.d.ts +5 -0
  22. package/build/types/protocol/schemes/Emoticon.d.ts +9 -0
  23. package/build/types/protocol/schemes/Entitlements.d.ts +92 -0
  24. package/build/types/protocol/schemes/Envelope.d.ts +5 -0
  25. package/build/types/protocol/schemes/FollowedTopic.d.ts +10 -0
  26. package/build/types/protocol/schemes/LeaveReason.d.ts +9 -0
  27. package/build/types/protocol/schemes/Message.d.ts +32 -0
  28. package/build/types/protocol/schemes/MessagePoll.d.ts +10 -0
  29. package/build/types/protocol/schemes/PermissionOverwritesTarget.d.ts +5 -0
  30. package/build/types/protocol/schemes/PermissionOverwritesValue.d.ts +4 -0
  31. package/build/types/protocol/schemes/Reaction.d.ts +13 -0
  32. package/build/types/protocol/schemes/Role.d.ts +20 -0
  33. package/build/types/protocol/schemes/Room.d.ts +17 -0
  34. package/build/types/protocol/schemes/RoomHistory.d.ts +5 -0
  35. package/build/types/protocol/schemes/RoomMember.d.ts +11 -0
  36. package/build/types/protocol/schemes/RoomStream.d.ts +5 -0
  37. package/build/types/protocol/schemes/RoomSummary.d.ts +14 -0
  38. package/build/types/protocol/schemes/SessionData.d.ts +10 -0
  39. package/build/types/protocol/schemes/Space.d.ts +19 -0
  40. package/build/types/protocol/schemes/SpaceMember.d.ts +7 -0
  41. package/build/types/protocol/schemes/SpaceSummary.d.ts +8 -0
  42. package/build/types/protocol/schemes/Topic.d.ts +8 -0
  43. package/build/types/protocol/schemes/User.d.ts +23 -0
  44. package/build/types/protocol/schemes/UserData.d.ts +10 -0
  45. package/build/types/protocol/schemes/UserInformation.d.ts +11 -0
  46. package/build/types/protocol/schemes/UserRelationship.d.ts +6 -0
  47. package/build/types/protocol/schemes/UserState.d.ts +6 -0
  48. package/build/types/protocol/schemes/commands/Ack.d.ts +5 -0
  49. package/build/types/protocol/schemes/commands/AssignRole.d.ts +6 -0
  50. package/build/types/protocol/schemes/commands/Ban.d.ts +10 -0
  51. package/build/types/protocol/schemes/commands/CreateAccessTicket.d.ts +13 -0
  52. package/build/types/protocol/schemes/commands/CreateEmoticon.d.ts +5 -0
  53. package/build/types/protocol/schemes/commands/CreateMessage.d.ts +11 -0
  54. package/build/types/protocol/schemes/commands/CreateOwner.d.ts +5 -0
  55. package/build/types/protocol/schemes/commands/CreateRelationship.d.ts +5 -0
  56. package/build/types/protocol/schemes/commands/CreateRole.d.ts +6 -0
  57. package/build/types/protocol/schemes/commands/CreateRoom.d.ts +9 -0
  58. package/build/types/protocol/schemes/commands/CreateSpace.d.ts +6 -0
  59. package/build/types/protocol/schemes/commands/CreateTopic.d.ts +11 -0
  60. package/build/types/protocol/schemes/commands/DeassignRole.d.ts +6 -0
  61. package/build/types/protocol/schemes/commands/DeleteEmoticon.d.ts +3 -0
  62. package/build/types/protocol/schemes/commands/DeleteOwner.d.ts +5 -0
  63. package/build/types/protocol/schemes/commands/DeleteRelationship.d.ts +5 -0
  64. package/build/types/protocol/schemes/commands/DeleteRole.d.ts +4 -0
  65. package/build/types/protocol/schemes/commands/DeleteRoom.d.ts +3 -0
  66. package/build/types/protocol/schemes/commands/DeleteSpace.d.ts +3 -0
  67. package/build/types/protocol/schemes/commands/DeleteTopic.d.ts +4 -0
  68. package/build/types/protocol/schemes/commands/FollowTopic.d.ts +4 -0
  69. package/build/types/protocol/schemes/commands/GetBans.d.ts +6 -0
  70. package/build/types/protocol/schemes/commands/GetClientData.d.ts +2 -0
  71. package/build/types/protocol/schemes/commands/GetComputedPermissions.d.ts +10 -0
  72. package/build/types/protocol/schemes/commands/GetDiscoverableSpaces.d.ts +2 -0
  73. package/build/types/protocol/schemes/commands/GetEmoticons.d.ts +3 -0
  74. package/build/types/protocol/schemes/commands/GetEntitlements.d.ts +8 -0
  75. package/build/types/protocol/schemes/commands/GetFollowedTopics.d.ts +4 -0
  76. package/build/types/protocol/schemes/commands/GetInvited.d.ts +3 -0
  77. package/build/types/protocol/schemes/commands/GetMessages.d.ts +13 -0
  78. package/build/types/protocol/schemes/commands/GetOwners.d.ts +4 -0
  79. package/build/types/protocol/schemes/commands/GetPermissionOverwriteTargets.d.ts +4 -0
  80. package/build/types/protocol/schemes/commands/GetPermissionOverwrites.d.ts +6 -0
  81. package/build/types/protocol/schemes/commands/GetReactionDetails.d.ts +8 -0
  82. package/build/types/protocol/schemes/commands/GetRelationships.d.ts +2 -0
  83. package/build/types/protocol/schemes/commands/GetRoomMembers.d.ts +3 -0
  84. package/build/types/protocol/schemes/commands/GetRoomSummary.d.ts +4 -0
  85. package/build/types/protocol/schemes/commands/GetSession.d.ts +2 -0
  86. package/build/types/protocol/schemes/commands/GetSessionData.d.ts +2 -0
  87. package/build/types/protocol/schemes/commands/GetSpaceMembers.d.ts +3 -0
  88. package/build/types/protocol/schemes/commands/GetSpaceRooms.d.ts +3 -0
  89. package/build/types/protocol/schemes/commands/GetSpaceSummary.d.ts +3 -0
  90. package/build/types/protocol/schemes/commands/GetTopics.d.ts +4 -0
  91. package/build/types/protocol/schemes/commands/GetUserData.d.ts +2 -0
  92. package/build/types/protocol/schemes/commands/GetUserInfo.d.ts +3 -0
  93. package/build/types/protocol/schemes/commands/Invite.d.ts +5 -0
  94. package/build/types/protocol/schemes/commands/JoinRoom.d.ts +13 -0
  95. package/build/types/protocol/schemes/commands/JoinSpace.d.ts +3 -0
  96. package/build/types/protocol/schemes/commands/Kick.d.ts +7 -0
  97. package/build/types/protocol/schemes/commands/LeaveRoom.d.ts +3 -0
  98. package/build/types/protocol/schemes/commands/LeaveSpace.d.ts +3 -0
  99. package/build/types/protocol/schemes/commands/Ping.d.ts +2 -0
  100. package/build/types/protocol/schemes/commands/React.d.ts +6 -0
  101. package/build/types/protocol/schemes/commands/RedactMessages.d.ts +3 -0
  102. package/build/types/protocol/schemes/commands/ReportAbuse.d.ts +9 -0
  103. package/build/types/protocol/schemes/commands/SetClientData.d.ts +1 -0
  104. package/build/types/protocol/schemes/commands/SetPermissionOverwrites.d.ts +8 -0
  105. package/build/types/protocol/schemes/commands/SetSessionData.d.ts +17 -0
  106. package/build/types/protocol/schemes/commands/SetUserData.d.ts +6 -0
  107. package/build/types/protocol/schemes/commands/Unban.d.ts +3 -0
  108. package/build/types/protocol/schemes/commands/UnfollowTopic.d.ts +4 -0
  109. package/build/types/protocol/schemes/commands/Uninvite.d.ts +5 -0
  110. package/build/types/protocol/schemes/commands/Unreact.d.ts +6 -0
  111. package/build/types/protocol/schemes/commands/UpdateFollowedTopic.d.ts +6 -0
  112. package/build/types/protocol/schemes/commands/UpdateRole.d.ts +8 -0
  113. package/build/types/protocol/schemes/commands/UpdateRoom.d.ts +10 -0
  114. package/build/types/protocol/schemes/commands/UpdateRoomMember.d.ts +8 -0
  115. package/build/types/protocol/schemes/commands/UpdateSpace.d.ts +12 -0
  116. package/build/types/protocol/schemes/commands/UpdateSpaceMember.d.ts +6 -0
  117. package/build/types/protocol/schemes/commands/UpdateTopic.d.ts +5 -0
  118. package/build/types/protocol/schemes/events/AccessTicket.d.ts +14 -0
  119. package/build/types/protocol/schemes/events/Bans.d.ts +6 -0
  120. package/build/types/protocol/schemes/events/Bye.d.ts +4 -0
  121. package/build/types/protocol/schemes/events/ClientData.d.ts +1 -0
  122. package/build/types/protocol/schemes/events/ComputedPermissions.d.ts +9 -0
  123. package/build/types/protocol/schemes/events/DiscoverableSpaces.d.ts +4 -0
  124. package/build/types/protocol/schemes/events/EmoticonDeleted.d.ts +4 -0
  125. package/build/types/protocol/schemes/events/Emoticons.d.ts +6 -0
  126. package/build/types/protocol/schemes/events/EntitlementUsage.d.ts +11 -0
  127. package/build/types/protocol/schemes/events/Entitlements.d.ts +12 -0
  128. package/build/types/protocol/schemes/events/Error.d.ts +4 -0
  129. package/build/types/protocol/schemes/events/FollowedTopicUpdated.d.ts +4 -0
  130. package/build/types/protocol/schemes/events/FollowedTopics.d.ts +6 -0
  131. package/build/types/protocol/schemes/events/Invited.d.ts +10 -0
  132. package/build/types/protocol/schemes/events/Messages.d.ts +9 -0
  133. package/build/types/protocol/schemes/events/MessagesRedacted.d.ts +5 -0
  134. package/build/types/protocol/schemes/events/NewEmoticon.d.ts +4 -0
  135. package/build/types/protocol/schemes/events/NewMessage.d.ts +4 -0
  136. package/build/types/protocol/schemes/events/NewRelationship.d.ts +4 -0
  137. package/build/types/protocol/schemes/events/NewRole.d.ts +5 -0
  138. package/build/types/protocol/schemes/events/NewRoom.d.ts +5 -0
  139. package/build/types/protocol/schemes/events/NewTopic.d.ts +5 -0
  140. package/build/types/protocol/schemes/events/Ok.d.ts +2 -0
  141. package/build/types/protocol/schemes/events/Owners.d.ts +8 -0
  142. package/build/types/protocol/schemes/events/PermissionOverwriteTargets.d.ts +10 -0
  143. package/build/types/protocol/schemes/events/PermissionOverwrites.d.ts +8 -0
  144. package/build/types/protocol/schemes/events/PermissionOverwritesUpdated.d.ts +8 -0
  145. package/build/types/protocol/schemes/events/Pong.d.ts +2 -0
  146. package/build/types/protocol/schemes/events/Reacted.d.ts +9 -0
  147. package/build/types/protocol/schemes/events/ReactionDetails.d.ts +11 -0
  148. package/build/types/protocol/schemes/events/ReactionUpdated.d.ts +8 -0
  149. package/build/types/protocol/schemes/events/RelationshipDeleted.d.ts +4 -0
  150. package/build/types/protocol/schemes/events/Relationships.d.ts +4 -0
  151. package/build/types/protocol/schemes/events/RoleDeleted.d.ts +4 -0
  152. package/build/types/protocol/schemes/events/RoleUpdated.d.ts +5 -0
  153. package/build/types/protocol/schemes/events/RoomDeleted.d.ts +3 -0
  154. package/build/types/protocol/schemes/events/RoomJoined.d.ts +4 -0
  155. package/build/types/protocol/schemes/events/RoomLeft.d.ts +5 -0
  156. package/build/types/protocol/schemes/events/RoomMemberLeft.d.ts +4 -0
  157. package/build/types/protocol/schemes/events/RoomMemberUpdated.d.ts +6 -0
  158. package/build/types/protocol/schemes/events/RoomMembers.d.ts +5 -0
  159. package/build/types/protocol/schemes/events/RoomMembersJoined.d.ts +9 -0
  160. package/build/types/protocol/schemes/events/RoomSummary.d.ts +4 -0
  161. package/build/types/protocol/schemes/events/RoomSummaryUpdated.d.ts +8 -0
  162. package/build/types/protocol/schemes/events/RoomUpdated.d.ts +4 -0
  163. package/build/types/protocol/schemes/events/Session.d.ts +9 -0
  164. package/build/types/protocol/schemes/events/SpaceDeleted.d.ts +3 -0
  165. package/build/types/protocol/schemes/events/SpaceJoined.d.ts +4 -0
  166. package/build/types/protocol/schemes/events/SpaceLeft.d.ts +5 -0
  167. package/build/types/protocol/schemes/events/SpaceMemberJoined.d.ts +5 -0
  168. package/build/types/protocol/schemes/events/SpaceMemberLeft.d.ts +4 -0
  169. package/build/types/protocol/schemes/events/SpaceMemberUpdated.d.ts +6 -0
  170. package/build/types/protocol/schemes/events/SpaceMembers.d.ts +5 -0
  171. package/build/types/protocol/schemes/events/SpaceRooms.d.ts +5 -0
  172. package/build/types/protocol/schemes/events/SpaceSummary.d.ts +4 -0
  173. package/build/types/protocol/schemes/events/SpaceUpdated.d.ts +4 -0
  174. package/build/types/protocol/schemes/events/TopicDeleted.d.ts +4 -0
  175. package/build/types/protocol/schemes/events/TopicFollowed.d.ts +4 -0
  176. package/build/types/protocol/schemes/events/TopicUnfollowed.d.ts +4 -0
  177. package/build/types/protocol/schemes/events/TopicUpdated.d.ts +6 -0
  178. package/build/types/protocol/schemes/events/Topics.d.ts +6 -0
  179. package/build/types/protocol/schemes/events/UserInfo.d.ts +4 -0
  180. package/build/types/protocol/schemes/events/UserUpdated.d.ts +4 -0
  181. package/build/types/state-tracker/AsyncUtils.d.ts +15 -0
  182. package/build/types/state-tracker/ChatStateTracker.d.ts +41 -0
  183. package/build/types/state-tracker/EmoticonsManager.d.ts +15 -0
  184. package/build/types/state-tracker/FollowedTopicsManager.d.ts +85 -0
  185. package/build/types/state-tracker/MessagesManager.d.ts +24 -0
  186. package/build/types/state-tracker/PermissionsManager.d.ts +47 -0
  187. package/build/types/state-tracker/RelationshipsManager.d.ts +15 -0
  188. package/build/types/state-tracker/RoomMessagesHistory.d.ts +69 -0
  189. package/build/types/state-tracker/RoomsManager.d.ts +72 -0
  190. package/build/types/state-tracker/SpacesManager.d.ts +63 -0
  191. package/build/types/state-tracker/TopicHistoryWindow.d.ts +182 -0
  192. package/build/types/state-tracker/UsersManager.d.ts +23 -0
  193. package/build/types/state-tracker/functions.d.ts +6 -0
  194. package/package.json +67 -4
@@ -0,0 +1,163 @@
1
+ import { Envelope } from "./schemes/Envelope";
2
+ import { Message, MessageType, MessageAuthor, MessageMentions } from "./schemes/Message";
3
+ import { PermissionOverwritesValue } from "./schemes/PermissionOverwritesValue";
4
+ import { Role, RoleFlag } from "./schemes/Role";
5
+ import { Room, RoomType } from "./schemes/Room";
6
+ import { RoomMember } from "./schemes/RoomMember";
7
+ import { RoomSummary, RoomSummaryExtras } from "./schemes/RoomSummary";
8
+ import { Space, SpaceDiscoverable, SpaceIntent } from "./schemes/Space";
9
+ import { SpaceMember } from "./schemes/SpaceMember";
10
+ import { Topic } from "./schemes/Topic";
11
+ import { User, UserStatus } 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 { RoomMembersJoined } from "./schemes/events/RoomMembersJoined";
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, CreateTopicInitialMessage } 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 { FollowTopic } from "./schemes/commands/FollowTopic";
79
+ import { FollowedTopics } from "./schemes/events/FollowedTopics";
80
+ import { FollowedTopic, NotificationLevel } from "./schemes/FollowedTopic";
81
+ import { UpdateFollowedTopic } from "./schemes/commands/UpdateFollowedTopic";
82
+ import { TopicFollowed } from "./schemes/events/TopicFollowed";
83
+ import { GetFollowedTopics } from "./schemes/commands/GetFollowedTopics";
84
+ import { FollowedTopicUpdated } from "./schemes/events/FollowedTopicUpdated";
85
+ import { GetMessages } from "./schemes/commands/GetMessages";
86
+ import { Messages } from "./schemes/events/Messages";
87
+ import { Topics } from "./schemes/events/Topics";
88
+ import { GetTopics } from "./schemes/commands/GetTopics";
89
+ import { UpdateTopic } from "./schemes/commands/UpdateTopic";
90
+ import { TopicUpdated } from "./schemes/events/TopicUpdated";
91
+ import { GetDiscoverableSpaces } from "./schemes/commands/GetDiscoverableSpaces";
92
+ import { DiscoverableSpaces } from "./schemes/events/DiscoverableSpaces";
93
+ import { SpaceSummary } from "./schemes/SpaceSummary";
94
+ import { Emoticon } from "./schemes/Emoticon";
95
+ import { Emoticons } from "./schemes/events/Emoticons";
96
+ import { GetEmoticons } from "./schemes/commands/GetEmoticons";
97
+ import { CreateEmoticon } from "./schemes/commands/CreateEmoticon";
98
+ import { DeleteEmoticon } from "./schemes/commands/DeleteEmoticon";
99
+ import { NewEmoticon } from "./schemes/events/NewEmoticon";
100
+ import { EmoticonDeleted } from "./schemes/events/EmoticonDeleted";
101
+ import { PermissionOverwritesTarget } from "./schemes/PermissionOverwritesTarget";
102
+ import { Ban } from "./schemes/commands/Ban";
103
+ import { Unban } from "./schemes/commands/Unban";
104
+ import { GetBans } from "./schemes/commands/GetBans";
105
+ import { BanObject } from "./schemes/BanObject";
106
+ import { Bans } from "./schemes/events/Bans";
107
+ import { Kick } from "./schemes/commands/Kick";
108
+ import { LeaveReason } from "./schemes/LeaveReason";
109
+ import { GetClientData } from "./schemes/commands/GetClientData";
110
+ import { SetClientData } from "./schemes/commands/SetClientData";
111
+ import { ClientData } from "./schemes/events/ClientData";
112
+ import { RoomStream, RoomStreamType } from "./schemes/RoomStream";
113
+ import { RoomHistory, RoomHistoryMode } from "./schemes/RoomHistory";
114
+ import { GetRoomSummary } from "./schemes/commands/GetRoomSummary";
115
+ import { GetSpaceSummary } from "./schemes/commands/GetSpaceSummary";
116
+ import { SpaceSummary as SpaceSummaryEvent } from "./schemes/events/SpaceSummary";
117
+ import { RoomSummary as RoomSummaryEvent } from "./schemes/events/RoomSummary";
118
+ import { UpdateSpaceMember } from "./schemes/commands/UpdateSpaceMember";
119
+ import { NewRelationship } from "./schemes/events/NewRelationship";
120
+ import { RelationshipDeleted } from "./schemes/events/RelationshipDeleted";
121
+ import { UserRelationship, UserRelationshipType } from "./schemes/UserRelationship";
122
+ import { DeleteRelationship } from "./schemes/commands/DeleteRelationship";
123
+ import { Relationships } from "./schemes/events/Relationships";
124
+ import { CreateRelationship } from "./schemes/commands/CreateRelationship";
125
+ import { RoomSummaryUpdated } from "./schemes/events/RoomSummaryUpdated";
126
+ import { UpdateRoomMember } from "./schemes/commands/UpdateRoomMember";
127
+ import { Ping } from "./schemes/commands/Ping";
128
+ import { Pong } from "./schemes/events/Pong";
129
+ import { ReportAbuse } from "./schemes/commands/ReportAbuse";
130
+ import { RedactMessages } from "./schemes/commands/RedactMessages";
131
+ import { MessagesRedacted } from "./schemes/events/MessagesRedacted";
132
+ import { GetRelationships } from "./schemes/commands/GetRelationships";
133
+ import { GetUserInfo } from "./schemes/commands/GetUserInfo";
134
+ import { UserInfo } from "./schemes/events/UserInfo";
135
+ import { UserInformation } from "./schemes/UserInformation";
136
+ import { SetSessionData, SessionPush } from "./schemes/commands/SetSessionData";
137
+ import { SessionData, SessionPlatform } from "./schemes/SessionData";
138
+ import { GetSessionData } from "./schemes/commands/GetSessionData";
139
+ import { UserData, PrivateMessagePolicy } from "./schemes/UserData";
140
+ import { SetUserData } from "./schemes/commands/SetUserData";
141
+ import { GetUserData } from "./schemes/commands/GetUserData";
142
+ import { UnfollowTopic } from "./schemes/commands/UnfollowTopic";
143
+ import { Invite } from "./schemes/commands/Invite";
144
+ import { Uninvite } from "./schemes/commands/Uninvite";
145
+ import { GetInvited } from "./schemes/commands/GetInvited";
146
+ import { Invited } from "./schemes/events/Invited";
147
+ import { TopicUnfollowed } from "./schemes/events/TopicUnfollowed";
148
+ import { MessageReaction, ReactionType, ToggledReaction, UserReaction } from "./schemes/Reaction";
149
+ import { MessagePoll, MessagePollOption } from "./schemes/MessagePoll";
150
+ import { React } from "./schemes/commands/React";
151
+ import { Unreact } from "./schemes/commands/Unreact";
152
+ import { GetReactionDetails } from "./schemes/commands/GetReactionDetails";
153
+ import { ReactionUpdated } from "./schemes/events/ReactionUpdated";
154
+ import { Reacted } from "./schemes/events/Reacted";
155
+ import { ReactionDetails } from "./schemes/events/ReactionDetails";
156
+ import { EntitlementsExtras, EntitlementsMap, EntitlementsSubject, EntitlementTarget, EntitlementValue, HistoryRotation, NO_LIMIT, SearchRange, SpaceFeature, STORAGE_UNIT_BYTES, UiPurpose, UserFeature } from "./schemes/Entitlements";
157
+ import { GetEntitlements } from "./schemes/commands/GetEntitlements";
158
+ import { Entitlements } from "./schemes/events/Entitlements";
159
+ import { EntitlementUsage } from "./schemes/events/EntitlementUsage";
160
+ import { CreateAccessTicket, TicketAudience } from "./schemes/commands/CreateAccessTicket";
161
+ import { AccessTicket } from "./schemes/events/AccessTicket";
162
+ export type { Envelope, Message, MessageType, MessageAuthor, MessageMentions, Role, Room, RoomType, RoomStream, RoomStreamType, RoomHistory, RoomHistoryMode, RoomMember, RoomSummary, RoomSummaryExtras, Space, SpaceMember, Topic, FollowedTopic, NotificationLevel, User, UserState, PermissionOverwritesValue, ChatLocation, SpaceSummary, SpaceDiscoverable, Emoticon, PermissionOverwritesTarget, BanObject, LeaveReason, UserRelationship, UserRelationshipType, CreateTopicInitialMessage, UserInformation, SessionPush, SessionData, SessionPlatform, UserData, PrivateMessagePolicy, ReactionType, MessageReaction, UserReaction, ToggledReaction, MessagePoll, MessagePollOption, EntitlementTarget, EntitlementsSubject, EntitlementValue, EntitlementsMap, EntitlementsExtras, TicketAudience, Bye, Error, Messages, NewMessage, NewRole, NewRoom, NewTopic, TopicFollowed, TopicUnfollowed, FollowedTopics, FollowedTopicUpdated, ComputedPermissions, PermissionOverwrites, PermissionOverwritesUpdated, RoleDeleted, RoleUpdated, RoomDeleted, RoomUpdated, RoomJoined, RoomLeft, RoomMembersJoined, RoomMemberLeft, RoomMembers, RoomMemberUpdated, UserUpdated, Session, SpaceDeleted, SpaceUpdated, SpaceJoined, SpaceLeft, SpaceMemberJoined, SpaceMemberLeft, SpaceMembers, SpaceMemberUpdated, SpaceRooms, TopicDeleted, TopicUpdated, PermissionOverwriteTargets, Owners, Ok, DiscoverableSpaces, Emoticons, EmoticonDeleted, NewEmoticon, Bans, ClientData, SpaceSummaryEvent, RoomSummaryEvent, NewRelationship, RelationshipDeleted, Relationships, RoomSummaryUpdated, Pong, MessagesRedacted, UserInfo, Invited, ReactionUpdated, Reacted, ReactionDetails, Entitlements, EntitlementUsage, AccessTicket, AssignRole, GetMessages, CreateMessage, Ack, CreateRole, CreateRoom, CreateSpace, CreateTopic, FollowTopic, UnfollowTopic, UpdateFollowedTopic, GetFollowedTopics, DeassignRole, DeleteRole, DeleteRoom, DeleteSpace, DeleteTopic, SetPermissionOverwrites, GetPermissionOverwrites, GetComputedPermissions, GetRoomMembers, GetSession, GetSpaceMembers, GetSpaceRooms, JoinRoom, JoinSpace, LeaveRoom, LeaveSpace, UpdateRole, UpdateSpace, UpdateRoom, UpdateTopic, GetPermissionOverwriteTargets, CreateOwner, DeleteOwner, GetOwners, Topics, GetTopics, GetDiscoverableSpaces, GetEmoticons, CreateEmoticon, DeleteEmoticon, Ban, Unban, GetBans, Kick, GetClientData, SetClientData, GetSpaceSummary, GetRoomSummary, UpdateSpaceMember, CreateRelationship, DeleteRelationship, GetRelationships, UpdateRoomMember, Ping, ReportAbuse, RedactMessages, GetUserInfo, SetSessionData, GetSessionData, SetUserData, GetUserData, Invite, Uninvite, GetInvited, React, Unreact, GetReactionDetails, GetEntitlements, CreateAccessTicket, };
163
+ export { NO_LIMIT, STORAGE_UNIT_BYTES, HistoryRotation, RoleFlag, SearchRange, SpaceFeature, SpaceIntent, UiPurpose, UserFeature, UserStatus, };
@@ -0,0 +1,14 @@
1
+ import { User } from "./User";
2
+ import { ChatLocation } from "./ChatLocation";
3
+ export type BanType = 'Ban' | 'Mute';
4
+ export interface BanObject {
5
+ id: string;
6
+ bannedUser: User;
7
+ banningUser?: User;
8
+ location: ChatLocation;
9
+ reason: string;
10
+ expiresAt?: string;
11
+ createdAt: string;
12
+ type: BanType;
13
+ parentId?: string;
14
+ }
@@ -0,0 +1,5 @@
1
+ export interface ChatLocation {
2
+ spaceId?: string;
3
+ roomId?: string;
4
+ topicId?: string;
5
+ }
@@ -0,0 +1,9 @@
1
+ import { User } from "./User";
2
+ export interface Emoticon {
3
+ id: string;
4
+ spaceId?: string;
5
+ name: string;
6
+ fileId: string;
7
+ user: User;
8
+ tag?: string;
9
+ }
@@ -0,0 +1,92 @@
1
+ /**
2
+ * What a package is attached to. A space package and a user package never describe the same
3
+ * feature, so entitlements of the two targets are never merged, summed or prioritised.
4
+ */
5
+ export type EntitlementTarget = 'Space' | 'User';
6
+ /**
7
+ * Subject the entitlements belong to, as the billing service knows it.
8
+ */
9
+ export interface EntitlementsSubject {
10
+ target: EntitlementTarget;
11
+ id: string;
12
+ }
13
+ /**
14
+ * Value of a single entitlement: a flag, a numeric limit ({@link NO_LIMIT} means unlimited)
15
+ * or a dictionary value. A dictionary states its numbers as strings.
16
+ */
17
+ export type EntitlementValue = boolean | number | string;
18
+ /**
19
+ * Entitlement keys granted by the package, keyed by {@link SpaceFeature} or {@link UserFeature}.
20
+ * A feature the package does not grant is simply absent.
21
+ */
22
+ export type EntitlementsMap = Record<string, EntitlementValue>;
23
+ /**
24
+ * What the modules of the chat server add to the answer of `GetEntitlements`. The package says
25
+ * how much a subject may take, these say how much of it is already gone.
26
+ */
27
+ export interface EntitlementsExtras {
28
+ storageUsedBytes?: number;
29
+ }
30
+ /**
31
+ * Value of a numeric limit that is not limited at all.
32
+ */
33
+ export declare const NO_LIMIT = -1;
34
+ /**
35
+ * Entitlement keys of space packages.
36
+ */
37
+ export declare enum SpaceFeature {
38
+ MembersLimit = "space.members.limit",
39
+ MembersGuests = "space.members.guests",
40
+ RoomsLimit = "space.rooms.limit",
41
+ RoomsPrivateLimit = "space.rooms.private_limit",
42
+ RoomsArchive = "space.rooms.archive",
43
+ RoomsHistoryRotation = "space.rooms.history_rotation",
44
+ EmoticonsLimit = "space.emoticons.limit",
45
+ MessageLength = "space.message.length",
46
+ StorageLimit = "space.storage.limit",
47
+ StorageSingleFileLimit = "space.storage.single_file_limit",
48
+ AccessWhitelist = "space.access.whitelist",
49
+ SearchRange = "space.search.range",
50
+ ContentExport = "space.content.export",
51
+ ContentAuditLog = "space.content.auditlog",
52
+ AvMemberLimit = "space.av.member_limit",
53
+ AvBroadcasterLimit = "space.av.broadcaster_limit",
54
+ AvQuality = "space.av.quality",
55
+ UiPurpose = "app.ui.purpose",
56
+ ApiAccess = "app.api.access",
57
+ DataSovereignty = "app.data.sovereignty",
58
+ Support = "app.support"
59
+ }
60
+ /**
61
+ * Entitlement keys of user packages.
62
+ */
63
+ export declare enum UserFeature {
64
+ MessageLength = "user.message.length",
65
+ StorageLimit = "user.storage.limit",
66
+ StorageSingleFileLimit = "user.storage.single_file_limit"
67
+ }
68
+ /**
69
+ * How far back a room of the space may be told to keep its history.
70
+ */
71
+ export declare enum HistoryRotation {
72
+ Low = "low",
73
+ High = "high"
74
+ }
75
+ /**
76
+ * What the space is for; a space for work gets the simplified interface.
77
+ */
78
+ export declare enum UiPurpose {
79
+ Work = "work",
80
+ Fun = "fun"
81
+ }
82
+ /**
83
+ * How much of the space search reaches.
84
+ */
85
+ export declare enum SearchRange {
86
+ JoinedRooms = "joined_rooms",
87
+ AvailableRooms = "available_rooms"
88
+ }
89
+ /**
90
+ * Every storage entitlement is stated in megabytes.
91
+ */
92
+ export declare const STORAGE_UNIT_BYTES: number;
@@ -0,0 +1,5 @@
1
+ export interface Envelope<T = any> {
2
+ type: string;
3
+ ref?: string;
4
+ data: T;
5
+ }
@@ -0,0 +1,10 @@
1
+ import { ChatLocation } from "./ChatLocation";
2
+ export type NotificationLevel = 'All' | 'Mentions' | 'None';
3
+ export interface FollowedTopic {
4
+ location: ChatLocation;
5
+ lastAckMessageId: string | null;
6
+ notificationLevel: NotificationLevel;
7
+ missed: number | null;
8
+ isUnread: boolean;
9
+ mentionCount: number;
10
+ }
@@ -0,0 +1,9 @@
1
+ import { BanObject } from "./BanObject";
2
+ import { Error as ErrorObject } from "./events/Error";
3
+ export interface LeaveReason {
4
+ type: 'Leave' | 'Ban' | 'Kick' | 'Service' | 'Error';
5
+ ban?: BanObject;
6
+ kick?: string;
7
+ service?: string;
8
+ error?: ErrorObject;
9
+ }
@@ -0,0 +1,32 @@
1
+ import { User } from "./User";
2
+ import { ChatLocation } from "./ChatLocation";
3
+ import { MessageReaction } from "./Reaction";
4
+ import { MessagePoll } from "./MessagePoll";
5
+ export type MessageType = 'Text' | 'RoomJoin' | 'RoomMemberAdd' | 'RoomLeave' | 'SpaceJoin' | 'SpaceLeave' | 'TopicChange' | 'CustomNickChange' | 'Ephemeral' | 'Poll';
6
+ /**
7
+ * Mention targets a message actually reached, as resolved by the server: role
8
+ * mentions the author was not allowed to fire are absent, even though they stay
9
+ * in the content. Null when the message mentions nobody.
10
+ */
11
+ export interface MessageMentions {
12
+ userIds: string[];
13
+ roleIds: string[];
14
+ }
15
+ export interface MessageAuthor {
16
+ user: User;
17
+ customNick?: string;
18
+ color?: string;
19
+ }
20
+ export interface Message {
21
+ id: string;
22
+ location: ChatLocation;
23
+ createdAt: string;
24
+ type: MessageType;
25
+ author: MessageAuthor;
26
+ content?: string;
27
+ topicRef: string | null;
28
+ attachments: string[] | null;
29
+ reactions: MessageReaction[];
30
+ poll?: MessagePoll;
31
+ mentions: MessageMentions | null;
32
+ }
@@ -0,0 +1,10 @@
1
+ import { ReactionType } from "./Reaction";
2
+ export interface MessagePollOption {
3
+ type: ReactionType;
4
+ value: string;
5
+ label: string;
6
+ }
7
+ export interface MessagePoll {
8
+ multipleChoice: boolean;
9
+ options: MessagePollOption[];
10
+ }
@@ -0,0 +1,5 @@
1
+ export interface PermissionOverwritesTarget {
2
+ type: 'User' | 'Role';
3
+ userId?: string;
4
+ roleId?: string;
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface PermissionOverwritesValue {
2
+ allow: number | null;
3
+ deny: number | null;
4
+ }
@@ -0,0 +1,13 @@
1
+ export type ReactionType = 'Emoji' | 'Emoticon';
2
+ export interface MessageReaction {
3
+ type: ReactionType;
4
+ value: string;
5
+ count: number;
6
+ }
7
+ export interface UserReaction {
8
+ type: ReactionType;
9
+ value: string;
10
+ }
11
+ export interface ToggledReaction extends UserReaction {
12
+ isAdded: boolean;
13
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Bit flags of a role, stored in {@link Role.flags}.
3
+ *
4
+ * - `SeparateOnMembersList` - available holders of the role are listed in their
5
+ * own group of the members list, headed by the role name.
6
+ * - `MentionableByEveryone` - anybody may mention the role with notification
7
+ * effects; without it the mention is decorative only, unless the author holds
8
+ * the `MentionAllRoles` permission.
9
+ */
10
+ export declare enum RoleFlag {
11
+ SeparateOnMembersList = 1,
12
+ MentionableByEveryone = 2
13
+ }
14
+ export interface Role {
15
+ id: string;
16
+ priority: number;
17
+ name: string;
18
+ color?: string;
19
+ flags: number;
20
+ }
@@ -0,0 +1,17 @@
1
+ import { Topic } from "./Topic";
2
+ import { User } from "./User";
3
+ import { RoomStream } from "./RoomStream";
4
+ import { RoomHistory } from "./RoomHistory";
5
+ export type RoomType = 'Text' | 'ClassicText' | 'Pm';
6
+ export interface Room {
7
+ id: string;
8
+ spaceId: string | null;
9
+ name: string;
10
+ description: string;
11
+ type: RoomType;
12
+ defaultTopic: Topic | null;
13
+ recipients: User[] | null;
14
+ flags: number;
15
+ stream: RoomStream | null;
16
+ history: RoomHistory | null;
17
+ }
@@ -0,0 +1,5 @@
1
+ export type RoomHistoryMode = 'Full' | 'Ephemeral' | 'MaxAge';
2
+ export interface RoomHistory {
3
+ mode: RoomHistoryMode;
4
+ maxAge?: number;
5
+ }
@@ -0,0 +1,11 @@
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
+ customNick: string | null;
8
+ customColor: string | null;
9
+ customAvatar: string | null;
10
+ extras: string;
11
+ }
@@ -0,0 +1,5 @@
1
+ export type RoomStreamType = 'Direct' | 'Shoutcast';
2
+ export interface RoomStream {
3
+ type: RoomStreamType;
4
+ url: string;
5
+ }
@@ -0,0 +1,14 @@
1
+ import { RoomType } from "./Room";
2
+ export interface RoomSummaryExtras {
3
+ isPrivate: boolean;
4
+ isInvitationOnly: boolean;
5
+ }
6
+ export interface RoomSummary {
7
+ id: string;
8
+ spaceId?: string;
9
+ name: string;
10
+ description: string;
11
+ memberCount: number;
12
+ type: RoomType;
13
+ extras?: RoomSummaryExtras;
14
+ }
@@ -0,0 +1,10 @@
1
+ import { SessionPush } from "./commands/SetSessionData";
2
+ /**
3
+ * Platform of a client session. Reported on connect (the `platform` query
4
+ * parameter) and independent of the push registration.
5
+ */
6
+ export type SessionPlatform = 'web' | 'ios' | 'android' | 'desktop';
7
+ export interface SessionData {
8
+ platform?: SessionPlatform;
9
+ push?: SessionPush;
10
+ }
@@ -0,0 +1,19 @@
1
+ import { Role } from "./Role";
2
+ export type SpaceDiscoverable = 'NotRequested' | 'Requested' | 'Accepted' | 'Declined';
3
+ export declare enum SpaceIntent {
4
+ Community = "Community",
5
+ Friends = "Friends",
6
+ Team = "Team"
7
+ }
8
+ export interface Space {
9
+ id: string;
10
+ name: string;
11
+ description: string;
12
+ roles: Role[];
13
+ systemRoom: string | null;
14
+ defaultRooms: string[];
15
+ icon: string | null;
16
+ banner: string | null;
17
+ discoverable: SpaceDiscoverable;
18
+ flags: number;
19
+ }
@@ -0,0 +1,7 @@
1
+ import { User } from "./User";
2
+ export interface SpaceMember {
3
+ user: User | null;
4
+ roles: string[];
5
+ customNick: string | null;
6
+ customAvatar: string | null;
7
+ }
@@ -0,0 +1,8 @@
1
+ export interface SpaceSummary {
2
+ id: string;
3
+ name: string;
4
+ description: string;
5
+ icon?: string;
6
+ banner?: string;
7
+ memberCount: number;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { Message } from "./Message";
2
+ export interface Topic {
3
+ id: string;
4
+ name: string;
5
+ messageCount: number;
6
+ refMessage?: Message;
7
+ lastMessage?: Message;
8
+ }
@@ -0,0 +1,23 @@
1
+ export type UserTags = 'bot' | 'temp' | string;
2
+ /**
3
+ * Availability of a user, aggregated over all of their sessions.
4
+ *
5
+ * - `Offline` - no session is connected and none can be reached asynchronously.
6
+ * - `Online` - at least one session holds a live connection.
7
+ * - `OnlineAsync` - no live connection, but a push-registered device was active
8
+ * recently, so a message will still reach the user.
9
+ */
10
+ export declare enum UserStatus {
11
+ Offline = 0,
12
+ Online = 1,
13
+ OnlineAsync = 2
14
+ }
15
+ export interface User {
16
+ id: string;
17
+ nick: string;
18
+ avatar: string;
19
+ tags: UserTags[];
20
+ status: UserStatus;
21
+ /** @deprecated Use {@link status}. Kept for clients older than the numeric status. */
22
+ online: boolean;
23
+ }
@@ -0,0 +1,10 @@
1
+ export type PrivateMessagePolicy = 'None' | 'Mutual' | 'All';
2
+ export interface UserData {
3
+ privateMessagePolicy: PrivateMessagePolicy;
4
+ /**
5
+ * Whether others may see that the user is reachable on a push-registered
6
+ * device while disconnected. When false the user simply reads as offline.
7
+ */
8
+ showAsyncPresence: boolean;
9
+ language: string | null;
10
+ }
@@ -0,0 +1,11 @@
1
+ import { User } from "./User";
2
+ import { SpaceSummary } from "./SpaceSummary";
3
+ import { RoomSummary } from "./RoomSummary";
4
+ export interface UserInformation {
5
+ user: User;
6
+ firstSeenAt: string;
7
+ lastSeenAt: string;
8
+ spaces: SpaceSummary[];
9
+ rooms: RoomSummary[];
10
+ knownAliases?: User[];
11
+ }
@@ -0,0 +1,6 @@
1
+ import { User } from "./User";
2
+ export type UserRelationshipType = 'Ignore';
3
+ export interface UserRelationship {
4
+ refUser: User;
5
+ type: UserRelationshipType;
6
+ }
@@ -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,5 @@
1
+ import { ChatLocation } from "../ChatLocation";
2
+ export interface Ack {
3
+ location: ChatLocation;
4
+ messageId?: string;
5
+ }
@@ -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,10 @@
1
+ import { ChatLocation } from "../ChatLocation";
2
+ import { BanType } from "../BanObject";
3
+ export interface Ban {
4
+ userId: string;
5
+ location: ChatLocation;
6
+ reason: string;
7
+ expiresAt?: string;
8
+ notify?: boolean;
9
+ type?: BanType;
10
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Issues a short-lived signed ticket with which the client authenticates in a service outside the
3
+ * chat server. With `spaceId` the ticket covers that space and requires the `ManageSpace`
4
+ * permission; without it the ticket covers the requesting user.
5
+ */
6
+ export interface CreateAccessTicket {
7
+ audience: TicketAudience;
8
+ spaceId?: string;
9
+ }
10
+ /**
11
+ * Service a ticket is issued for. A ticket is rejected by every other service.
12
+ */
13
+ export type TicketAudience = 'billing' | string;