@fnlb-project/fnbr 4.0.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 (363) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +68 -0
  3. package/dist/enums/Enums.d.ts +251 -0
  4. package/dist/enums/Enums.js +202 -0
  5. package/dist/enums/Enums.js.map +1 -0
  6. package/dist/index.d.ts +92 -0
  7. package/dist/index.js +194 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/resources/AuthClients.d.ts +39 -0
  10. package/dist/resources/AuthClients.js +41 -0
  11. package/dist/resources/AuthClients.js.map +1 -0
  12. package/dist/resources/BaseItemRating.json +5203 -0
  13. package/dist/resources/Endpoints.d.ts +58 -0
  14. package/dist/resources/Endpoints.js +71 -0
  15. package/dist/resources/Endpoints.js.map +1 -0
  16. package/dist/resources/HomebaseRatingMapping.json +255 -0
  17. package/dist/resources/PowerLevelCurves.d.ts +111 -0
  18. package/dist/resources/PowerLevelCurves.js +21 -0
  19. package/dist/resources/PowerLevelCurves.js.map +1 -0
  20. package/dist/resources/SurvivorItemRating.json +9343 -0
  21. package/dist/resources/constants.d.ts +2 -0
  22. package/dist/resources/constants.js +11 -0
  23. package/dist/resources/constants.js.map +1 -0
  24. package/dist/resources/defaultPartyMemberMeta.json +28 -0
  25. package/dist/resources/defaultPartyMeta.json +38 -0
  26. package/dist/resources/enums.d.ts +12 -0
  27. package/dist/resources/enums.js +18 -0
  28. package/dist/resources/enums.js.map +1 -0
  29. package/dist/resources/httpResponses.d.ts +773 -0
  30. package/dist/resources/httpResponses.js +3 -0
  31. package/dist/resources/httpResponses.js.map +1 -0
  32. package/dist/resources/structs.d.ts +1310 -0
  33. package/dist/resources/structs.js +3 -0
  34. package/dist/resources/structs.js.map +1 -0
  35. package/dist/src/Base.d.ts +15 -0
  36. package/dist/src/Base.js +15 -0
  37. package/dist/src/Base.js.map +1 -0
  38. package/dist/src/Client.d.ts +341 -0
  39. package/dist/src/Client.js +1043 -0
  40. package/dist/src/Client.js.map +1 -0
  41. package/dist/src/auth/Auth.d.ts +66 -0
  42. package/dist/src/auth/Auth.js +249 -0
  43. package/dist/src/auth/Auth.js.map +1 -0
  44. package/dist/src/auth/AuthSession.d.ts +41 -0
  45. package/dist/src/auth/AuthSession.js +25 -0
  46. package/dist/src/auth/AuthSession.js.map +1 -0
  47. package/dist/src/auth/EOSAuthSession.d.ts +19 -0
  48. package/dist/src/auth/EOSAuthSession.js +80 -0
  49. package/dist/src/auth/EOSAuthSession.js.map +1 -0
  50. package/dist/src/auth/FortniteAuthSession.d.ts +53 -0
  51. package/dist/src/auth/FortniteAuthSession.js +107 -0
  52. package/dist/src/auth/FortniteAuthSession.js.map +1 -0
  53. package/dist/src/auth/FortniteClientCredentialsAuthSession.d.ts +18 -0
  54. package/dist/src/auth/FortniteClientCredentialsAuthSession.js +88 -0
  55. package/dist/src/auth/FortniteClientCredentialsAuthSession.js.map +1 -0
  56. package/dist/src/auth/LauncherAuthSession.d.ts +23 -0
  57. package/dist/src/auth/LauncherAuthSession.js +120 -0
  58. package/dist/src/auth/LauncherAuthSession.js.map +1 -0
  59. package/dist/src/exceptions/AuthenticationMissingError.d.ts +15 -0
  60. package/dist/src/exceptions/AuthenticationMissingError.js +18 -0
  61. package/dist/src/exceptions/AuthenticationMissingError.js.map +1 -0
  62. package/dist/src/exceptions/CreativeIslandNotFoundError.d.ts +14 -0
  63. package/dist/src/exceptions/CreativeIslandNotFoundError.js +18 -0
  64. package/dist/src/exceptions/CreativeIslandNotFoundError.js.map +1 -0
  65. package/dist/src/exceptions/CreatorCodeNotFoundError.d.ts +14 -0
  66. package/dist/src/exceptions/CreatorCodeNotFoundError.js +18 -0
  67. package/dist/src/exceptions/CreatorCodeNotFoundError.js.map +1 -0
  68. package/dist/src/exceptions/DuplicateFriendshipError.d.ts +14 -0
  69. package/dist/src/exceptions/DuplicateFriendshipError.js +18 -0
  70. package/dist/src/exceptions/DuplicateFriendshipError.js.map +1 -0
  71. package/dist/src/exceptions/EpicgamesAPIError.d.ts +42 -0
  72. package/dist/src/exceptions/EpicgamesAPIError.js +27 -0
  73. package/dist/src/exceptions/EpicgamesAPIError.js.map +1 -0
  74. package/dist/src/exceptions/EventTimeoutError.d.ts +19 -0
  75. package/dist/src/exceptions/EventTimeoutError.js +20 -0
  76. package/dist/src/exceptions/EventTimeoutError.js.map +1 -0
  77. package/dist/src/exceptions/FriendNotFoundError.d.ts +14 -0
  78. package/dist/src/exceptions/FriendNotFoundError.js +18 -0
  79. package/dist/src/exceptions/FriendNotFoundError.js.map +1 -0
  80. package/dist/src/exceptions/FriendshipRequestAlreadySentError.d.ts +14 -0
  81. package/dist/src/exceptions/FriendshipRequestAlreadySentError.js +18 -0
  82. package/dist/src/exceptions/FriendshipRequestAlreadySentError.js.map +1 -0
  83. package/dist/src/exceptions/InviteeFriendshipRequestLimitExceededError.d.ts +14 -0
  84. package/dist/src/exceptions/InviteeFriendshipRequestLimitExceededError.js +18 -0
  85. package/dist/src/exceptions/InviteeFriendshipRequestLimitExceededError.js.map +1 -0
  86. package/dist/src/exceptions/InviteeFriendshipSettingsError.d.ts +14 -0
  87. package/dist/src/exceptions/InviteeFriendshipSettingsError.js +18 -0
  88. package/dist/src/exceptions/InviteeFriendshipSettingsError.js.map +1 -0
  89. package/dist/src/exceptions/InviteeFriendshipsLimitExceededError.d.ts +14 -0
  90. package/dist/src/exceptions/InviteeFriendshipsLimitExceededError.js +18 -0
  91. package/dist/src/exceptions/InviteeFriendshipsLimitExceededError.js.map +1 -0
  92. package/dist/src/exceptions/InviterFriendshipsLimitExceededError.d.ts +14 -0
  93. package/dist/src/exceptions/InviterFriendshipsLimitExceededError.js +18 -0
  94. package/dist/src/exceptions/InviterFriendshipsLimitExceededError.js.map +1 -0
  95. package/dist/src/exceptions/MatchNotFoundError.d.ts +14 -0
  96. package/dist/src/exceptions/MatchNotFoundError.js +18 -0
  97. package/dist/src/exceptions/MatchNotFoundError.js.map +1 -0
  98. package/dist/src/exceptions/OfferNotFoundError.d.ts +14 -0
  99. package/dist/src/exceptions/OfferNotFoundError.js +18 -0
  100. package/dist/src/exceptions/OfferNotFoundError.js.map +1 -0
  101. package/dist/src/exceptions/PartyAlreadyJoinedError.d.ts +7 -0
  102. package/dist/src/exceptions/PartyAlreadyJoinedError.js +14 -0
  103. package/dist/src/exceptions/PartyAlreadyJoinedError.js.map +1 -0
  104. package/dist/src/exceptions/PartyInvitationExpiredError.d.ts +7 -0
  105. package/dist/src/exceptions/PartyInvitationExpiredError.js +14 -0
  106. package/dist/src/exceptions/PartyInvitationExpiredError.js.map +1 -0
  107. package/dist/src/exceptions/PartyMaxSizeReachedError.d.ts +7 -0
  108. package/dist/src/exceptions/PartyMaxSizeReachedError.js +14 -0
  109. package/dist/src/exceptions/PartyMaxSizeReachedError.js.map +1 -0
  110. package/dist/src/exceptions/PartyMemberNotFoundError.d.ts +14 -0
  111. package/dist/src/exceptions/PartyMemberNotFoundError.js +18 -0
  112. package/dist/src/exceptions/PartyMemberNotFoundError.js.map +1 -0
  113. package/dist/src/exceptions/PartyNotFoundError.d.ts +7 -0
  114. package/dist/src/exceptions/PartyNotFoundError.js +14 -0
  115. package/dist/src/exceptions/PartyNotFoundError.js.map +1 -0
  116. package/dist/src/exceptions/PartyPermissionError.d.ts +7 -0
  117. package/dist/src/exceptions/PartyPermissionError.js +14 -0
  118. package/dist/src/exceptions/PartyPermissionError.js.map +1 -0
  119. package/dist/src/exceptions/SendMessageError.d.ts +27 -0
  120. package/dist/src/exceptions/SendMessageError.js +21 -0
  121. package/dist/src/exceptions/SendMessageError.js.map +1 -0
  122. package/dist/src/exceptions/StatsPrivacyError.d.ts +14 -0
  123. package/dist/src/exceptions/StatsPrivacyError.js +18 -0
  124. package/dist/src/exceptions/StatsPrivacyError.js.map +1 -0
  125. package/dist/src/exceptions/StompConnectionError.d.ts +14 -0
  126. package/dist/src/exceptions/StompConnectionError.js +18 -0
  127. package/dist/src/exceptions/StompConnectionError.js.map +1 -0
  128. package/dist/src/exceptions/UserNotFoundError.d.ts +14 -0
  129. package/dist/src/exceptions/UserNotFoundError.js +18 -0
  130. package/dist/src/exceptions/UserNotFoundError.js.map +1 -0
  131. package/dist/src/exceptions/XMPPConnectionError.d.ts +19 -0
  132. package/dist/src/exceptions/XMPPConnectionError.js +19 -0
  133. package/dist/src/exceptions/XMPPConnectionError.js.map +1 -0
  134. package/dist/src/exceptions/XMPPConnectionTimeoutError.d.ts +14 -0
  135. package/dist/src/exceptions/XMPPConnectionTimeoutError.js +18 -0
  136. package/dist/src/exceptions/XMPPConnectionTimeoutError.js.map +1 -0
  137. package/dist/src/http/HTTP.d.ts +40 -0
  138. package/dist/src/http/HTTP.js +124 -0
  139. package/dist/src/http/HTTP.js.map +1 -0
  140. package/dist/src/managers/ChatManager.d.ts +27 -0
  141. package/dist/src/managers/ChatManager.js +71 -0
  142. package/dist/src/managers/ChatManager.js.map +1 -0
  143. package/dist/src/managers/FriendManager.d.ts +66 -0
  144. package/dist/src/managers/FriendManager.js +175 -0
  145. package/dist/src/managers/FriendManager.js.map +1 -0
  146. package/dist/src/managers/STWManager.d.ts +29 -0
  147. package/dist/src/managers/STWManager.js +80 -0
  148. package/dist/src/managers/STWManager.js.map +1 -0
  149. package/dist/src/managers/TournamentManager.d.ts +51 -0
  150. package/dist/src/managers/TournamentManager.js +182 -0
  151. package/dist/src/managers/TournamentManager.js.map +1 -0
  152. package/dist/src/managers/UserManager.d.ts +78 -0
  153. package/dist/src/managers/UserManager.js +216 -0
  154. package/dist/src/managers/UserManager.js.map +1 -0
  155. package/dist/src/stomp/EOSConnect.d.ts +43 -0
  156. package/dist/src/stomp/EOSConnect.js +175 -0
  157. package/dist/src/stomp/EOSConnect.js.map +1 -0
  158. package/dist/src/structures/Avatar.d.ts +27 -0
  159. package/dist/src/structures/Avatar.js +22 -0
  160. package/dist/src/structures/Avatar.js.map +1 -0
  161. package/dist/src/structures/BaseMessage.d.ts +34 -0
  162. package/dist/src/structures/BaseMessage.js +22 -0
  163. package/dist/src/structures/BaseMessage.js.map +1 -0
  164. package/dist/src/structures/CreatorCode.d.ts +31 -0
  165. package/dist/src/structures/CreatorCode.js +22 -0
  166. package/dist/src/structures/CreatorCode.js.map +1 -0
  167. package/dist/src/structures/EpicgamesServerStatus.d.ts +52 -0
  168. package/dist/src/structures/EpicgamesServerStatus.js +31 -0
  169. package/dist/src/structures/EpicgamesServerStatus.js.map +1 -0
  170. package/dist/src/structures/EpicgamesServerStatusComponent.d.ts +67 -0
  171. package/dist/src/structures/EpicgamesServerStatusComponent.js +37 -0
  172. package/dist/src/structures/EpicgamesServerStatusComponent.js.map +1 -0
  173. package/dist/src/structures/EpicgamesServerStatusIncident.d.ts +58 -0
  174. package/dist/src/structures/EpicgamesServerStatusIncident.js +36 -0
  175. package/dist/src/structures/EpicgamesServerStatusIncident.js.map +1 -0
  176. package/dist/src/structures/EpicgamesServerStatusScheduledMainteance.d.ts +21 -0
  177. package/dist/src/structures/EpicgamesServerStatusScheduledMainteance.js +20 -0
  178. package/dist/src/structures/EpicgamesServerStatusScheduledMainteance.js.map +1 -0
  179. package/dist/src/structures/EventTokens.d.ts +32 -0
  180. package/dist/src/structures/EventTokens.js +45 -0
  181. package/dist/src/structures/EventTokens.js.map +1 -0
  182. package/dist/src/structures/FortniteServerStatus.d.ts +46 -0
  183. package/dist/src/structures/FortniteServerStatus.js +26 -0
  184. package/dist/src/structures/FortniteServerStatus.js.map +1 -0
  185. package/dist/src/structures/GlobalProfile.d.ts +36 -0
  186. package/dist/src/structures/GlobalProfile.js +25 -0
  187. package/dist/src/structures/GlobalProfile.js.map +1 -0
  188. package/dist/src/structures/Image.d.ts +36 -0
  189. package/dist/src/structures/Image.js +38 -0
  190. package/dist/src/structures/Image.js.map +1 -0
  191. package/dist/src/structures/NewsMessage.d.ts +56 -0
  192. package/dist/src/structures/NewsMessage.js +45 -0
  193. package/dist/src/structures/NewsMessage.js.map +1 -0
  194. package/dist/src/structures/NewsMessageVideo.d.ts +47 -0
  195. package/dist/src/structures/NewsMessageVideo.js +32 -0
  196. package/dist/src/structures/NewsMessageVideo.js.map +1 -0
  197. package/dist/src/structures/RadioStation.d.ts +31 -0
  198. package/dist/src/structures/RadioStation.js +33 -0
  199. package/dist/src/structures/RadioStation.js.map +1 -0
  200. package/dist/src/structures/Stats.d.ts +45 -0
  201. package/dist/src/structures/Stats.js +109 -0
  202. package/dist/src/structures/Stats.js.map +1 -0
  203. package/dist/src/structures/Tournament.d.ts +86 -0
  204. package/dist/src/structures/Tournament.js +64 -0
  205. package/dist/src/structures/Tournament.js.map +1 -0
  206. package/dist/src/structures/TournamentWindow.d.ts +124 -0
  207. package/dist/src/structures/TournamentWindow.js +52 -0
  208. package/dist/src/structures/TournamentWindow.js.map +1 -0
  209. package/dist/src/structures/friend/BaseFriendMessage.d.ts +32 -0
  210. package/dist/src/structures/friend/BaseFriendMessage.js +28 -0
  211. package/dist/src/structures/friend/BaseFriendMessage.js.map +1 -0
  212. package/dist/src/structures/friend/BasePendingFriend.d.ts +22 -0
  213. package/dist/src/structures/friend/BasePendingFriend.js +22 -0
  214. package/dist/src/structures/friend/BasePendingFriend.js.map +1 -0
  215. package/dist/src/structures/friend/Friend.d.ts +106 -0
  216. package/dist/src/structures/friend/Friend.js +97 -0
  217. package/dist/src/structures/friend/Friend.js.map +1 -0
  218. package/dist/src/structures/friend/FriendPresence.d.ts +84 -0
  219. package/dist/src/structures/friend/FriendPresence.js +48 -0
  220. package/dist/src/structures/friend/FriendPresence.js.map +1 -0
  221. package/dist/src/structures/friend/IncomingPendingFriend.d.ts +27 -0
  222. package/dist/src/structures/friend/IncomingPendingFriend.js +36 -0
  223. package/dist/src/structures/friend/IncomingPendingFriend.js.map +1 -0
  224. package/dist/src/structures/friend/OutgoingPendingFriend.d.ts +17 -0
  225. package/dist/src/structures/friend/OutgoingPendingFriend.js +24 -0
  226. package/dist/src/structures/friend/OutgoingPendingFriend.js.map +1 -0
  227. package/dist/src/structures/friend/ReceivedFriendMessage.d.ts +27 -0
  228. package/dist/src/structures/friend/ReceivedFriendMessage.js +27 -0
  229. package/dist/src/structures/friend/ReceivedFriendMessage.js.map +1 -0
  230. package/dist/src/structures/friend/SentFriendMessage.d.ts +21 -0
  231. package/dist/src/structures/friend/SentFriendMessage.js +19 -0
  232. package/dist/src/structures/friend/SentFriendMessage.js.map +1 -0
  233. package/dist/src/structures/party/BasePartyInvitation.d.ts +48 -0
  234. package/dist/src/structures/party/BasePartyInvitation.js +33 -0
  235. package/dist/src/structures/party/BasePartyInvitation.js.map +1 -0
  236. package/dist/src/structures/party/BasePartyJoinRequest.d.ts +37 -0
  237. package/dist/src/structures/party/BasePartyJoinRequest.js +30 -0
  238. package/dist/src/structures/party/BasePartyJoinRequest.js.map +1 -0
  239. package/dist/src/structures/party/ClientParty.d.ts +162 -0
  240. package/dist/src/structures/party/ClientParty.js +412 -0
  241. package/dist/src/structures/party/ClientParty.js.map +1 -0
  242. package/dist/src/structures/party/ClientPartyMember.d.ts +144 -0
  243. package/dist/src/structures/party/ClientPartyMember.js +463 -0
  244. package/dist/src/structures/party/ClientPartyMember.js.map +1 -0
  245. package/dist/src/structures/party/ClientPartyMemberMeta.d.ts +18 -0
  246. package/dist/src/structures/party/ClientPartyMemberMeta.js +54 -0
  247. package/dist/src/structures/party/ClientPartyMemberMeta.js.map +1 -0
  248. package/dist/src/structures/party/ClientPartyMeta.d.ts +23 -0
  249. package/dist/src/structures/party/ClientPartyMeta.js +59 -0
  250. package/dist/src/structures/party/ClientPartyMeta.js.map +1 -0
  251. package/dist/src/structures/party/Party.d.ts +95 -0
  252. package/dist/src/structures/party/Party.js +200 -0
  253. package/dist/src/structures/party/Party.js.map +1 -0
  254. package/dist/src/structures/party/PartyChat.d.ts +73 -0
  255. package/dist/src/structures/party/PartyChat.js +76 -0
  256. package/dist/src/structures/party/PartyChat.js.map +1 -0
  257. package/dist/src/structures/party/PartyMember.d.ts +139 -0
  258. package/dist/src/structures/party/PartyMember.js +201 -0
  259. package/dist/src/structures/party/PartyMember.js.map +1 -0
  260. package/dist/src/structures/party/PartyMemberConfirmation.d.ts +43 -0
  261. package/dist/src/structures/party/PartyMemberConfirmation.js +53 -0
  262. package/dist/src/structures/party/PartyMemberConfirmation.js.map +1 -0
  263. package/dist/src/structures/party/PartyMemberMeta.d.ts +76 -0
  264. package/dist/src/structures/party/PartyMemberMeta.js +145 -0
  265. package/dist/src/structures/party/PartyMemberMeta.js.map +1 -0
  266. package/dist/src/structures/party/PartyMessage.d.ts +30 -0
  267. package/dist/src/structures/party/PartyMessage.js +28 -0
  268. package/dist/src/structures/party/PartyMessage.js.map +1 -0
  269. package/dist/src/structures/party/PartyMeta.d.ts +24 -0
  270. package/dist/src/structures/party/PartyMeta.js +43 -0
  271. package/dist/src/structures/party/PartyMeta.js.map +1 -0
  272. package/dist/src/structures/party/PresenceParty.d.ts +66 -0
  273. package/dist/src/structures/party/PresenceParty.js +49 -0
  274. package/dist/src/structures/party/PresenceParty.js.map +1 -0
  275. package/dist/src/structures/party/ReceivedPartyInvitation.d.ts +33 -0
  276. package/dist/src/structures/party/ReceivedPartyInvitation.js +54 -0
  277. package/dist/src/structures/party/ReceivedPartyInvitation.js.map +1 -0
  278. package/dist/src/structures/party/ReceivedPartyJoinRequest.d.ts +26 -0
  279. package/dist/src/structures/party/ReceivedPartyJoinRequest.js +31 -0
  280. package/dist/src/structures/party/ReceivedPartyJoinRequest.js.map +1 -0
  281. package/dist/src/structures/party/SentPartyInvitation.d.ts +27 -0
  282. package/dist/src/structures/party/SentPartyInvitation.js +39 -0
  283. package/dist/src/structures/party/SentPartyInvitation.js.map +1 -0
  284. package/dist/src/structures/party/SentPartyJoinRequest.d.ts +19 -0
  285. package/dist/src/structures/party/SentPartyJoinRequest.js +22 -0
  286. package/dist/src/structures/party/SentPartyJoinRequest.js.map +1 -0
  287. package/dist/src/structures/stw/STWHero.d.ts +61 -0
  288. package/dist/src/structures/stw/STWHero.js +38 -0
  289. package/dist/src/structures/stw/STWHero.js.map +1 -0
  290. package/dist/src/structures/stw/STWHeroLoadout.d.ts +44 -0
  291. package/dist/src/structures/stw/STWHeroLoadout.js +34 -0
  292. package/dist/src/structures/stw/STWHeroLoadout.js.map +1 -0
  293. package/dist/src/structures/stw/STWItem.d.ts +31 -0
  294. package/dist/src/structures/stw/STWItem.js +23 -0
  295. package/dist/src/structures/stw/STWItem.js.map +1 -0
  296. package/dist/src/structures/stw/STWLocker.d.ts +32 -0
  297. package/dist/src/structures/stw/STWLocker.js +26 -0
  298. package/dist/src/structures/stw/STWLocker.js.map +1 -0
  299. package/dist/src/structures/stw/STWMeleeWeaponSchematic.d.ts +14 -0
  300. package/dist/src/structures/stw/STWMeleeWeaponSchematic.js +15 -0
  301. package/dist/src/structures/stw/STWMeleeWeaponSchematic.js.map +1 -0
  302. package/dist/src/structures/stw/STWNewsMessage.d.ts +42 -0
  303. package/dist/src/structures/stw/STWNewsMessage.js +27 -0
  304. package/dist/src/structures/stw/STWNewsMessage.js.map +1 -0
  305. package/dist/src/structures/stw/STWProfile.d.ts +132 -0
  306. package/dist/src/structures/stw/STWProfile.js +283 -0
  307. package/dist/src/structures/stw/STWProfile.js.map +1 -0
  308. package/dist/src/structures/stw/STWRangedWeaponSchematic.d.ts +14 -0
  309. package/dist/src/structures/stw/STWRangedWeaponSchematic.js +15 -0
  310. package/dist/src/structures/stw/STWRangedWeaponSchematic.js.map +1 -0
  311. package/dist/src/structures/stw/STWResource.d.ts +27 -0
  312. package/dist/src/structures/stw/STWResource.js +22 -0
  313. package/dist/src/structures/stw/STWResource.js.map +1 -0
  314. package/dist/src/structures/stw/STWSchematic.d.ts +72 -0
  315. package/dist/src/structures/stw/STWSchematic.js +40 -0
  316. package/dist/src/structures/stw/STWSchematic.js.map +1 -0
  317. package/dist/src/structures/stw/STWStats.d.ts +103 -0
  318. package/dist/src/structures/stw/STWStats.js +85 -0
  319. package/dist/src/structures/stw/STWStats.js.map +1 -0
  320. package/dist/src/structures/stw/STWSurvivor.d.ts +104 -0
  321. package/dist/src/structures/stw/STWSurvivor.js +76 -0
  322. package/dist/src/structures/stw/STWSurvivor.js.map +1 -0
  323. package/dist/src/structures/stw/STWTeamPerk.d.ts +19 -0
  324. package/dist/src/structures/stw/STWTeamPerk.js +20 -0
  325. package/dist/src/structures/stw/STWTeamPerk.js.map +1 -0
  326. package/dist/src/structures/stw/STWTrapSchematic.d.ts +15 -0
  327. package/dist/src/structures/stw/STWTrapSchematic.js +16 -0
  328. package/dist/src/structures/stw/STWTrapSchematic.js.map +1 -0
  329. package/dist/src/structures/stw/STWWeaponSchematic.d.ts +15 -0
  330. package/dist/src/structures/stw/STWWeaponSchematic.js +16 -0
  331. package/dist/src/structures/stw/STWWeaponSchematic.js.map +1 -0
  332. package/dist/src/structures/user/BlockedUser.d.ts +13 -0
  333. package/dist/src/structures/user/BlockedUser.js +19 -0
  334. package/dist/src/structures/user/BlockedUser.js.map +1 -0
  335. package/dist/src/structures/user/ClientUser.d.ts +78 -0
  336. package/dist/src/structures/user/ClientUser.js +34 -0
  337. package/dist/src/structures/user/ClientUser.js.map +1 -0
  338. package/dist/src/structures/user/User.d.ts +98 -0
  339. package/dist/src/structures/user/User.js +130 -0
  340. package/dist/src/structures/user/User.js.map +1 -0
  341. package/dist/src/structures/user/UserSearchResult.d.ts +31 -0
  342. package/dist/src/structures/user/UserSearchResult.js +23 -0
  343. package/dist/src/structures/user/UserSearchResult.js.map +1 -0
  344. package/dist/src/util/AsyncLock.d.ts +28 -0
  345. package/dist/src/util/AsyncLock.js +44 -0
  346. package/dist/src/util/AsyncLock.js.map +1 -0
  347. package/dist/src/util/BinaryWriter.d.ts +79 -0
  348. package/dist/src/util/BinaryWriter.js +136 -0
  349. package/dist/src/util/BinaryWriter.js.map +1 -0
  350. package/dist/src/util/CurveTable.d.ts +24 -0
  351. package/dist/src/util/CurveTable.js +37 -0
  352. package/dist/src/util/CurveTable.js.map +1 -0
  353. package/dist/src/util/Meta.d.ts +41 -0
  354. package/dist/src/util/Meta.js +73 -0
  355. package/dist/src/util/Meta.js.map +1 -0
  356. package/dist/src/util/Util.d.ts +162 -0
  357. package/dist/src/util/Util.js +539 -0
  358. package/dist/src/util/Util.js.map +1 -0
  359. package/dist/src/xmpp/XMPP.d.ts +100 -0
  360. package/dist/src/xmpp/XMPP.js +702 -0
  361. package/dist/src/xmpp/XMPP.js.map +1 -0
  362. package/dist/tsconfig.tsbuildinfo +1 -0
  363. package/package.json +66 -0
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const collection_1 = require("@discordjs/collection");
5
+ const Base_1 = tslib_1.__importDefault(require("../Base"));
6
+ const UserNotFoundError_1 = tslib_1.__importDefault(require("../exceptions/UserNotFoundError"));
7
+ const Util_1 = require("../util/Util");
8
+ const Endpoints_1 = tslib_1.__importDefault(require("../../resources/Endpoints"));
9
+ const EpicgamesAPIError_1 = tslib_1.__importDefault(require("../exceptions/EpicgamesAPIError"));
10
+ const enums_1 = require("../../resources/enums");
11
+ const UserSearchResult_1 = tslib_1.__importDefault(require("../structures/user/UserSearchResult"));
12
+ const AuthenticationMissingError_1 = tslib_1.__importDefault(require("../exceptions/AuthenticationMissingError"));
13
+ const User_1 = tslib_1.__importDefault(require("../structures/user/User"));
14
+ const Avatar_1 = tslib_1.__importDefault(require("../structures/Avatar"));
15
+ const GlobalProfile_1 = tslib_1.__importDefault(require("../structures/GlobalProfile"));
16
+ const ClientUser_1 = tslib_1.__importDefault(require("../structures/user/ClientUser"));
17
+ class UserManager extends Base_1.default {
18
+ constructor(client) {
19
+ super(client);
20
+ this.blocklist = new collection_1.Collection();
21
+ this.cache = new collection_1.Collection();
22
+ this.self = undefined;
23
+ }
24
+ /**
25
+ * Resolves a user's ID from the cache or via the API
26
+ * @param idOrDisplayName The user's ID or display name
27
+ */
28
+ async resolveId(idOrDisplayName) {
29
+ if (idOrDisplayName.length === 32) {
30
+ return idOrDisplayName;
31
+ }
32
+ const cachedUser = this.cache.find((u) => u.displayName === idOrDisplayName);
33
+ if (cachedUser) {
34
+ return cachedUser.id;
35
+ }
36
+ const user = await this.fetch(idOrDisplayName);
37
+ return user.id;
38
+ }
39
+ async fetch(idOrDisplayName) {
40
+ const [user] = await this.fetchMultiple([idOrDisplayName]);
41
+ if (!user) {
42
+ throw new UserNotFoundError_1.default(idOrDisplayName);
43
+ }
44
+ return user;
45
+ }
46
+ async fetchMultiple(idsOrDisplayNames) {
47
+ var _a, _b;
48
+ const ids = [];
49
+ const displayNames = [];
50
+ const users = [];
51
+ for (const idOrDisplayName of idsOrDisplayNames) {
52
+ if (idOrDisplayName.length === 32) {
53
+ const cachedUser = this.cache.get(idOrDisplayName);
54
+ if (cachedUser) {
55
+ const cachedUserClone = new User_1.default(this.client, cachedUser.toObject());
56
+ users.push(cachedUserClone);
57
+ }
58
+ else {
59
+ ids.push(idOrDisplayName);
60
+ }
61
+ }
62
+ else if (idOrDisplayName.length > 3 && idOrDisplayName.length < 16) {
63
+ const cachedUser = this.cache.find((u) => u.displayName === idOrDisplayName);
64
+ if (cachedUser) {
65
+ const cachedUserClone = new User_1.default(this.client, cachedUser.toObject());
66
+ users.push(cachedUserClone);
67
+ }
68
+ else {
69
+ displayNames.push(idOrDisplayName);
70
+ }
71
+ }
72
+ }
73
+ const idChunks = (0, Util_1.chunk)(ids, 100);
74
+ const fetchedUserData = await Promise.all([
75
+ ...idChunks.map((c) => this.client.http.epicgamesRequest({
76
+ method: 'GET',
77
+ url: `${Endpoints_1.default.ACCOUNT_MULTIPLE}?accountId=${c.join('&accountId=')}`,
78
+ }, enums_1.AuthSessionStoreKey.Fortnite)),
79
+ ...displayNames.map((d) => this.client.http.epicgamesRequest({
80
+ method: 'GET',
81
+ url: `${Endpoints_1.default.ACCOUNT_DISPLAYNAME}/${d}`,
82
+ }, enums_1.AuthSessionStoreKey.Fortnite).catch((e) => {
83
+ if (e instanceof EpicgamesAPIError_1.default && e.code === 'errors.com.epicgames.account.account_not_found') {
84
+ return undefined;
85
+ }
86
+ return Promise.reject(e);
87
+ })),
88
+ ]);
89
+ const fetchedUsers = fetchedUserData.flat(1).filter((u) => !!u).map((u) => new User_1.default(this.client, u));
90
+ if (((_b = (_a = this.client.config.cacheSettings.users) === null || _a === void 0 ? void 0 : _a.maxLifetime) !== null && _b !== void 0 ? _b : 0) > 0) {
91
+ for (const user of fetchedUsers) {
92
+ const userClone = new User_1.default(this.client, user.toObject());
93
+ userClone.cachedAt = Date.now();
94
+ this.cache.set(user.id, userClone);
95
+ }
96
+ }
97
+ return [...users, ...fetchedUsers];
98
+ }
99
+ async fetchSelf() {
100
+ if (!this.client.auth.sessions.has(enums_1.AuthSessionStoreKey.Fortnite)) {
101
+ throw new AuthenticationMissingError_1.default(enums_1.AuthSessionStoreKey.Fortnite);
102
+ }
103
+ const self = await this.client.http.epicgamesRequest({
104
+ method: 'GET',
105
+ url: `${Endpoints_1.default.ACCOUNT_ID}/${this.client.auth.sessions.get(enums_1.AuthSessionStoreKey.Fortnite).accountId}`,
106
+ }, enums_1.AuthSessionStoreKey.Fortnite);
107
+ this.self = new ClientUser_1.default(this.client, self);
108
+ }
109
+ async search(prefix, platform = 'epic') {
110
+ const results = await this.client.http.epicgamesRequest({
111
+ method: 'GET',
112
+ url: `${Endpoints_1.default.ACCOUNT_SEARCH}/${this.self.id}?prefix=${encodeURIComponent(prefix)}&platform=${platform}`,
113
+ }, enums_1.AuthSessionStoreKey.Fortnite);
114
+ const users = await this.fetchMultiple(results.map((r) => r.accountId));
115
+ return results
116
+ .filter((r) => users.some((u) => u.id === r.accountId))
117
+ .map((r) => new UserSearchResult_1.default(this.client, users.find((u) => u.id === r.accountId), r));
118
+ }
119
+ /**
120
+ * Fetches the avatar of a user
121
+ * @param user The id or display name of the user
122
+ * @throws {EpicgamesAPIError}
123
+ * @throws {UserNotFoundError} The user wasn't found
124
+ */
125
+ async fetchAvatar(idOrDisplayName) {
126
+ const [avatar] = await this.fetchAvatarMultiple([idOrDisplayName]);
127
+ if (!avatar) {
128
+ throw new UserNotFoundError_1.default(idOrDisplayName);
129
+ }
130
+ return avatar;
131
+ }
132
+ /**
133
+ * Fetches the avatar of multiple users
134
+ * @param user The ids and/or display names of the users
135
+ * @throws {EpicgamesAPIError}
136
+ */
137
+ async fetchAvatarMultiple(idsOrDisplayNames) {
138
+ const users = await this.fetchMultiple(idsOrDisplayNames);
139
+ const userChunks = (0, Util_1.chunk)(users, 100);
140
+ const avatars = await Promise.all(userChunks.map((uc) => this.client.http.epicgamesRequest({
141
+ method: 'GET',
142
+ url: `${Endpoints_1.default.ACCOUNT_AVATAR}/fortnite/ids?accountIds=${uc.map((u) => u.id).join(',')}`,
143
+ }, enums_1.AuthSessionStoreKey.Fortnite)));
144
+ return avatars
145
+ .map((a) => a.map((ar) => new Avatar_1.default(this.client, ar, users.find((u) => u.id === ar.accountId))))
146
+ .flat(1);
147
+ }
148
+ /**
149
+ * Fetches the global profile of a user
150
+ * @param user The id or display name of the user
151
+ * @throws {EpicgamesAPIError}
152
+ * @throws {UserNotFoundError} The user wasn't found
153
+ */
154
+ async fetchGlobalProfile(idOrDisplayName) {
155
+ const [profile] = await this.fetchGlobalProfileMultiple([idOrDisplayName]);
156
+ if (!profile) {
157
+ throw new UserNotFoundError_1.default(idOrDisplayName);
158
+ }
159
+ return profile;
160
+ }
161
+ /**
162
+ * Fetches the global profile for multiple users
163
+ * @param user The ids and/or display names of the users
164
+ * @throws {EpicgamesAPIError}
165
+ */
166
+ async fetchGlobalProfileMultiple(idsOrDisplayNames) {
167
+ const users = await this.fetchMultiple(idsOrDisplayNames);
168
+ const userChunks = (0, Util_1.chunk)(users, 100);
169
+ const globalProfiles = await Promise.all(userChunks.map((uc) => this.client.http.epicgamesRequest({
170
+ method: 'PUT',
171
+ url: Endpoints_1.default.ACCOUNT_GLOBAL_PROFILE,
172
+ headers: {
173
+ 'Content-Type': 'application/json',
174
+ },
175
+ data: {
176
+ namespace: 'Fortnite',
177
+ accountIds: uc.map((u) => u.id),
178
+ },
179
+ }, enums_1.AuthSessionStoreKey.Fortnite)));
180
+ return globalProfiles
181
+ .map((a) => a.profiles.map((ar) => new GlobalProfile_1.default(this.client, ar, users.find((u) => u.id === ar.accountId))))
182
+ .flat(1);
183
+ }
184
+ /**
185
+ * Blocks a user
186
+ * @param user The id or display name of the user
187
+ * @throws {UserNotFoundError} The user wasn't found
188
+ * @throws {EpicgamesAPIError}
189
+ */
190
+ async block(user) {
191
+ const userId = await this.resolveId(user);
192
+ if (!userId)
193
+ throw new UserNotFoundError_1.default(user);
194
+ await this.client.http.epicgamesRequest({
195
+ method: 'POST',
196
+ url: `${Endpoints_1.default.FRIEND_BLOCK}/${this.self.id}/${userId}`,
197
+ }, enums_1.AuthSessionStoreKey.Fortnite);
198
+ }
199
+ /**
200
+ * Unblocks a user
201
+ * @param user The id or display name of the user
202
+ * @throws {UserNotFoundError} The user wasn't found
203
+ * @throws {EpicgamesAPIError}
204
+ */
205
+ async unblock(user) {
206
+ const blockedUser = this.blocklist.find((u) => u.displayName === user || u.id === user);
207
+ if (!blockedUser)
208
+ throw new UserNotFoundError_1.default(user);
209
+ await this.client.http.epicgamesRequest({
210
+ method: 'DELETE',
211
+ url: `${Endpoints_1.default.FRIEND_BLOCK}/${this.self.id}/${blockedUser.id}`,
212
+ }, enums_1.AuthSessionStoreKey.Fortnite);
213
+ }
214
+ }
215
+ exports.default = UserManager;
216
+ //# sourceMappingURL=UserManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserManager.js","sourceRoot":"","sources":["../../../src/managers/UserManager.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AACnD,2DAA2B;AAC3B,gGAAgE;AAChE,uCAAqC;AACrC,kFAAkD;AAClD,gGAAgE;AAChE,iDAA4D;AAC5D,mGAAmE;AACnE,kHAAkF;AAClF,2EAA2C;AAC3C,0EAA0C;AAC1C,wFAAwD;AACxD,uFAAuD;AAKvD,MAAM,WAAY,SAAQ,cAAI;I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AC;QAEpD,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC;YACtC,MAAM,EAAE,QAAQ;YAChB,GAAG,EAAE,GAAG,mBAAS,CAAC,YAAY,IAAI,IAAI,CAAC,IAAK,CAAC,EAAE,IAAI,WAAW,CAAC,EAAE,EAAE;SACpE,EAAE,2BAAmB,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;CACF;AAED,kBAAe,WAAW,CAAC"}
@@ -0,0 +1,43 @@
1
+ import Base from '../Base';
2
+ import type Client from '../Client';
3
+ /**
4
+ * Represents the client's EOS Connect STOMP manager (i.e. chat messages)
5
+ */
6
+ declare class EOSConnect extends Base {
7
+ /**
8
+ * private stomp connection
9
+ */
10
+ private stompConnection?;
11
+ /**
12
+ * private stomp connection id (i.e. used for eos presence)
13
+ */
14
+ private stompConnectionId?;
15
+ /**
16
+ * @param client The main client
17
+ */
18
+ constructor(client: Client);
19
+ /**
20
+ * Whether the internal websocket is connected
21
+ */
22
+ get isConnected(): boolean;
23
+ /**
24
+ * Returns the eos stomp connection id
25
+ */
26
+ get connectionId(): string | undefined;
27
+ /**
28
+ * connect to the eos connect stomp server
29
+ */
30
+ connect(): Promise<unknown>;
31
+ /**
32
+ * Disconnects the stomp websocket client.
33
+ * Also performs a cleanup
34
+ */
35
+ disconnect(): void;
36
+ /**
37
+ * Sets up the subscription for the deployment
38
+ * @param connectionResolve connect promise resolve
39
+ * @param connectionReject connect promise reject
40
+ */
41
+ private setupSubscription;
42
+ }
43
+ export default EOSConnect;
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const stompjs_1 = require("@stomp/stompjs");
5
+ const ws_1 = tslib_1.__importDefault(require("ws"));
6
+ const Base_1 = tslib_1.__importDefault(require("../Base"));
7
+ const enums_1 = require("../../resources/enums");
8
+ const AuthenticationMissingError_1 = tslib_1.__importDefault(require("../exceptions/AuthenticationMissingError"));
9
+ const StompConnectionError_1 = tslib_1.__importDefault(require("../exceptions/StompConnectionError"));
10
+ const Endpoints_1 = tslib_1.__importDefault(require("../../resources/Endpoints"));
11
+ const ReceivedFriendMessage_1 = tslib_1.__importDefault(require("../structures/friend/ReceivedFriendMessage"));
12
+ const PartyMessage_1 = tslib_1.__importDefault(require("../structures/party/PartyMessage"));
13
+ /**
14
+ * Represents the client's EOS Connect STOMP manager (i.e. chat messages)
15
+ */
16
+ class EOSConnect extends Base_1.default {
17
+ /**
18
+ * @param client The main client
19
+ */
20
+ constructor(client) {
21
+ super(client);
22
+ this.stompConnection = undefined;
23
+ this.stompConnectionId = undefined;
24
+ }
25
+ /**
26
+ * Whether the internal websocket is connected
27
+ */
28
+ get isConnected() {
29
+ return !!this.stompConnection && this.stompConnection.connected;
30
+ }
31
+ /**
32
+ * Returns the eos stomp connection id
33
+ */
34
+ get connectionId() {
35
+ return this.stompConnectionId;
36
+ }
37
+ /**
38
+ * connect to the eos connect stomp server
39
+ */
40
+ async connect() {
41
+ if (!this.client.auth.sessions.has(enums_1.AuthSessionStoreKey.FortniteEOS)) {
42
+ throw new AuthenticationMissingError_1.default(enums_1.AuthSessionStoreKey.FortniteEOS);
43
+ }
44
+ return new Promise((resolve, reject) => {
45
+ const brokerURL = `wss://${Endpoints_1.default.EOS_STOMP}`;
46
+ this.stompConnection = new stompjs_1.Client({
47
+ brokerURL,
48
+ stompVersions: new stompjs_1.Versions([stompjs_1.Versions.V1_0, stompjs_1.Versions.V1_1, stompjs_1.Versions.V1_2]),
49
+ heartbeatOutgoing: 30000,
50
+ heartbeatIncoming: 0,
51
+ webSocketFactory: () => new ws_1.default(brokerURL, {
52
+ headers: {
53
+ Authorization: `Bearer ${this.client.auth.sessions.get(enums_1.AuthSessionStoreKey.FortniteEOS).accessToken}`,
54
+ 'Sec-Websocket-Protocol': 'v10.stomp,v11.stomp,v12.stomp',
55
+ 'Epic-Connect-Protocol': 'stomp',
56
+ 'Epic-Connect-Device-Id': '',
57
+ },
58
+ }),
59
+ debug: (str) => {
60
+ var _a, _b;
61
+ (_b = (_a = this.client.config).stompEosConnectDebug) === null || _b === void 0 ? void 0 : _b.call(_a, str);
62
+ },
63
+ onConnect: () => {
64
+ this.setupSubscription(resolve, reject);
65
+ },
66
+ onStompError: (frame) => {
67
+ reject(new StompConnectionError_1.default(frame.body, -1));
68
+ },
69
+ onWebSocketError: (event) => {
70
+ const errorEvent = event;
71
+ if (errorEvent.error || errorEvent.message) {
72
+ let error = undefined;
73
+ if (errorEvent.error instanceof Error) {
74
+ error = errorEvent.error;
75
+ }
76
+ else {
77
+ error = new Error(errorEvent.message);
78
+ }
79
+ error.message += ' (eos connect stomp)';
80
+ reject(error);
81
+ }
82
+ },
83
+ });
84
+ this.client.debug('[STOMP EOS Connect] Connecting...');
85
+ this.stompConnection.activate();
86
+ });
87
+ }
88
+ /**
89
+ * Disconnects the stomp websocket client.
90
+ * Also performs a cleanup
91
+ */
92
+ disconnect() {
93
+ if (!this.stompConnection)
94
+ return;
95
+ this.stompConnection.forceDisconnect();
96
+ this.stompConnection.deactivate();
97
+ this.stompConnection = undefined;
98
+ this.stompConnectionId = undefined;
99
+ this.client.debug('[STOMP EOS Connect] Disconnected');
100
+ }
101
+ /**
102
+ * Sets up the subscription for the deployment
103
+ * @param connectionResolve connect promise resolve
104
+ * @param connectionReject connect promise reject
105
+ */
106
+ setupSubscription(connectionResolve, connectionReject) {
107
+ this.stompConnection.subscribe(`${this.client.config.eosDeploymentId}/account/${this.client.user.self.id}`, async (message) => {
108
+ var _a, _b, _c;
109
+ if (!((_a = message.headers['content-type']) === null || _a === void 0 ? void 0 : _a.includes('application/json'))) {
110
+ return;
111
+ }
112
+ const messageData = JSON.parse(message.body);
113
+ (_c = (_b = this.client.config).stompEosConnectDebug) === null || _c === void 0 ? void 0 : _c.call(_b, message.body);
114
+ this.client.debug(`new message '${messageData.type}' - ${message.body}`, 'eos-connect');
115
+ switch (messageData.type) {
116
+ case 'core.connect.v1.connected': {
117
+ this.stompConnectionId = messageData.connectionId;
118
+ this.client.debug(`[STOMP EOS Connect] Connected as ${messageData.connectionId}`);
119
+ connectionResolve(messageData.connectionId);
120
+ break;
121
+ }
122
+ case 'core.connect.v1.connect-failed': {
123
+ this.client.debug(`failed connecting to eos connect: ${messageData.statusCode} - ${messageData.message}`);
124
+ connectionReject(new StompConnectionError_1.default(messageData.message, messageData.statusCode));
125
+ break;
126
+ }
127
+ case 'social.chat.v1.NEW_WHISPER': {
128
+ const { senderId, body, time } = messageData.payload.message;
129
+ const friend = this.client.friend.list.get(senderId);
130
+ if (!friend || senderId === this.client.user.self.id) {
131
+ return;
132
+ }
133
+ const friendMessage = new ReceivedFriendMessage_1.default(this.client, {
134
+ content: body || '',
135
+ author: friend,
136
+ id: messageData.id,
137
+ sentAt: new Date(time),
138
+ });
139
+ this.client.emit('friend:message', friendMessage);
140
+ break;
141
+ }
142
+ case 'social.chat.v1.NEW_MESSAGE': {
143
+ if (messageData.payload.conversation.type !== 'party') {
144
+ return;
145
+ }
146
+ await this.client.partyLock.wait();
147
+ const { conversation: { conversationId }, message: { senderId, body, time } } = messageData.payload;
148
+ const partyId = conversationId.replace('p-', '');
149
+ if (!this.client.party
150
+ || this.client.party.id !== partyId
151
+ || senderId === this.client.user.self.id) {
152
+ return;
153
+ }
154
+ const authorMember = this.client.party.members.get(senderId);
155
+ if (!authorMember) {
156
+ return;
157
+ }
158
+ const partyMessage = new PartyMessage_1.default(this.client, {
159
+ content: body || '',
160
+ author: authorMember,
161
+ sentAt: new Date(time),
162
+ id: messageData.id,
163
+ party: this.client.party,
164
+ });
165
+ this.client.emit('party:member:message', partyMessage);
166
+ break;
167
+ }
168
+ }
169
+ }, {
170
+ id: 'sub-0',
171
+ });
172
+ }
173
+ }
174
+ exports.default = EOSConnect;
175
+ //# sourceMappingURL=EOSConnect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EOSConnect.js","sourceRoot":"","sources":["../../../src/stomp/EOSConnect.ts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;SACZ,CACF,CAAC;IACJ,CAAC;CACF;AAED,kBAAe,UAAU,CAAC"}
@@ -0,0 +1,27 @@
1
+ import Base from '../Base';
2
+ import type User from './user/User';
3
+ import type Client from '../Client';
4
+ /**
5
+ * Represents a user's avatar
6
+ */
7
+ declare class Avatar extends Base {
8
+ /**
9
+ * The user this avatar belongs to
10
+ */
11
+ user: User;
12
+ /**
13
+ * The avatar's id
14
+ */
15
+ id: string;
16
+ /**
17
+ * The avatar's namespace (eg. "fortnite")
18
+ */
19
+ namespace: string;
20
+ /**
21
+ * @param client The main client
22
+ * @param data The avatar's data
23
+ * @param user The user this avatar belongs to
24
+ */
25
+ constructor(client: Client, data: any, user: User);
26
+ }
27
+ export default Avatar;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Base_1 = tslib_1.__importDefault(require("../Base"));
5
+ /**
6
+ * Represents a user's avatar
7
+ */
8
+ class Avatar extends Base_1.default {
9
+ /**
10
+ * @param client The main client
11
+ * @param data The avatar's data
12
+ * @param user The user this avatar belongs to
13
+ */
14
+ constructor(client, data, user) {
15
+ super(client);
16
+ this.id = data.avatarId;
17
+ this.namespace = data.namespace;
18
+ this.user = user;
19
+ }
20
+ }
21
+ exports.default = Avatar;
22
+ //# sourceMappingURL=Avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../src/structures/Avatar.ts"],"names":[],"mappings":";;;AAAA,2DAA2B;AAI3B;;GAEG;AACH,MAAM,MAAO,SAAQ,cAAI;IAgBvB;;;;OAIG;IACH,YAAY,MAAc,EAAE,IAAS,EAAE,IAAU;QAC/C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,34 @@
1
+ import Base from '../Base';
2
+ import type { MessageData } from '../../resources/structs';
3
+ import type Client from '../Client';
4
+ import type ClientPartyMember from './party/ClientPartyMember';
5
+ import type ClientUser from './user/ClientUser';
6
+ import type Friend from './friend/Friend';
7
+ import type PartyMember from './party/PartyMember';
8
+ /**
9
+ * Represents a message
10
+ */
11
+ declare abstract class BaseMessage extends Base {
12
+ /**
13
+ * The message's content
14
+ */
15
+ content: string;
16
+ /**
17
+ * The message's author
18
+ */
19
+ author: Friend | PartyMember | ClientPartyMember | ClientUser;
20
+ /**
21
+ * The message creation date
22
+ */
23
+ sentAt: Date;
24
+ /**
25
+ * The message's id
26
+ */
27
+ id: string;
28
+ /**
29
+ * @param client The main client
30
+ * @param data The message's data
31
+ */
32
+ constructor(client: Client, data: MessageData);
33
+ }
34
+ export default BaseMessage;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Base_1 = tslib_1.__importDefault(require("../Base"));
5
+ /**
6
+ * Represents a message
7
+ */
8
+ class BaseMessage extends Base_1.default {
9
+ /**
10
+ * @param client The main client
11
+ * @param data The message's data
12
+ */
13
+ constructor(client, data) {
14
+ super(client);
15
+ this.content = data.content;
16
+ this.author = data.author;
17
+ this.sentAt = data.sentAt || new Date();
18
+ this.id = data.id;
19
+ }
20
+ }
21
+ exports.default = BaseMessage;
22
+ //# sourceMappingURL=BaseMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseMessage.js","sourceRoot":"","sources":["../../../src/structures/BaseMessage.ts"],"names":[],"mappings":";;;AAAA,2DAA2B;AAQ3B;;GAEG;AACH,MAAe,WAAY,SAAQ,cAAI;IAqBrC;;;OAGG;IACH,YAAY,MAAc,EAAE,IAAiB;QAC3C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IACpB,CAAC;CACF;AAED,kBAAe,WAAW,CAAC"}
@@ -0,0 +1,31 @@
1
+ import Base from '../Base';
2
+ import type Client from '../Client';
3
+ import type User from './user/User';
4
+ import type { CreatorCodeData } from '../../resources/structs';
5
+ /**
6
+ * Represents a Support-A-Creator code
7
+ */
8
+ declare class CreatorCode extends Base {
9
+ /**
10
+ * The Support-A-Creator code (slug)
11
+ */
12
+ code: string;
13
+ /**
14
+ * The code's owner
15
+ */
16
+ owner: User;
17
+ /**
18
+ * Whether the code is enabled
19
+ */
20
+ isEnabled: boolean;
21
+ /**
22
+ * Whether the code is verified
23
+ */
24
+ isVerified: boolean;
25
+ /**
26
+ * @param client The main client
27
+ * @param data The creator code data
28
+ */
29
+ constructor(client: Client, data: CreatorCodeData);
30
+ }
31
+ export default CreatorCode;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Base_1 = tslib_1.__importDefault(require("../Base"));
5
+ /**
6
+ * Represents a Support-A-Creator code
7
+ */
8
+ class CreatorCode extends Base_1.default {
9
+ /**
10
+ * @param client The main client
11
+ * @param data The creator code data
12
+ */
13
+ constructor(client, data) {
14
+ super(client);
15
+ this.code = data.slug;
16
+ this.owner = data.owner;
17
+ this.isEnabled = data.status === 'ACTIVE';
18
+ this.isVerified = data.verified;
19
+ }
20
+ }
21
+ exports.default = CreatorCode;
22
+ //# sourceMappingURL=CreatorCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreatorCode.js","sourceRoot":"","sources":["../../../src/structures/CreatorCode.ts"],"names":[],"mappings":";;;AAAA,2DAA2B;AAK3B;;GAEG;AACH,MAAM,WAAY,SAAQ,cAAI;IAqB5B;;;OAGG;IACH,YAAY,MAAc,EAAE,IAAqB;QAC/C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC;IAClC,CAAC;CACF;AAED,kBAAe,WAAW,CAAC"}