@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,539 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.chunk = exports.resolveAuthObject = exports.resolveAuthString = exports.parseStatKey = exports.createDefaultInputTypeStats = exports.calcSTWNonSurvivorPowerLevel = exports.parseSTWHeroTemplateId = exports.calcSTWSurvivorLeadBonus = exports.calcSTWSurvivorBonus = exports.calcSTWSurvivorPowerLevel = exports.parseSTWSurvivorTemplateId = exports.buildReplay = exports.parseM3U8File = exports.parseBlurlStream = exports.createPartyInvitation = exports.getRandomDefaultCharacter = exports.makeSnakeCase = exports.makeCamelCase = exports.consoleQuestion = void 0;
4
+ exports.parseSTWSchematicTemplateId = parseSTWSchematicTemplateId;
5
+ const tslib_1 = require("tslib");
6
+ /* eslint-disable no-restricted-syntax */
7
+ const readline_1 = tslib_1.__importDefault(require("readline"));
8
+ const zlib_1 = tslib_1.__importDefault(require("zlib"));
9
+ const crypto_1 = tslib_1.__importDefault(require("crypto"));
10
+ const fs_1 = require("fs");
11
+ const Enums_1 = require("../../enums/Enums");
12
+ const BinaryWriter_1 = tslib_1.__importDefault(require("./BinaryWriter"));
13
+ const PowerLevelCurves_1 = tslib_1.__importDefault(require("../../resources/PowerLevelCurves"));
14
+ const defaultCharacters = [
15
+ 'CID_A_272_Athena_Commando_F_Prime',
16
+ 'CID_A_273_Athena_Commando_F_Prime_B',
17
+ 'CID_A_274_Athena_Commando_F_Prime_C',
18
+ 'CID_A_275_Athena_Commando_F_Prime_D',
19
+ 'CID_A_276_Athena_Commando_F_Prime_E',
20
+ 'CID_A_277_Athena_Commando_F_Prime_F',
21
+ 'CID_A_278_Athena_Commando_F_Prime_G',
22
+ 'CID_A_279_Athena_Commando_M_Prime',
23
+ 'CID_A_280_Athena_Commando_M_Prime_B',
24
+ 'CID_A_281_Athena_Commando_M_Prime_C',
25
+ 'CID_A_282_Athena_Commando_M_Prime_D',
26
+ 'CID_A_283_Athena_Commando_M_Prime_E',
27
+ 'CID_A_284_Athena_Commando_M_Prime_F',
28
+ 'CID_A_285_Athena_Commando_M_Prime_G',
29
+ ];
30
+ const consoleQuestion = (question) => new Promise((resolve) => {
31
+ const itf = readline_1.default.createInterface(process.stdin, process.stdout);
32
+ itf.question(question, (answer) => {
33
+ itf.close();
34
+ resolve(answer);
35
+ });
36
+ });
37
+ exports.consoleQuestion = consoleQuestion;
38
+ const makeCamelCase = (obj) => {
39
+ const returnObj = {};
40
+ Object.keys(obj).forEach((k) => {
41
+ returnObj[k.split('_').map((s, i) => (i > 0 ? `${s.charAt(0).toUpperCase()}${s.slice(1)}` : s)).join('')] = obj[k];
42
+ });
43
+ return returnObj;
44
+ };
45
+ exports.makeCamelCase = makeCamelCase;
46
+ const makeSnakeCase = (obj) => {
47
+ const returnObj = {};
48
+ Object.keys(obj).forEach((k) => {
49
+ returnObj[k.replace(/[A-Z]/g, (l) => `_${l.toLowerCase()}`)] = obj[k];
50
+ });
51
+ return returnObj;
52
+ };
53
+ exports.makeSnakeCase = makeSnakeCase;
54
+ const getRandomDefaultCharacter = () => defaultCharacters[Math.floor(Math.random() * defaultCharacters.length)];
55
+ exports.getRandomDefaultCharacter = getRandomDefaultCharacter;
56
+ const createPartyInvitation = (clientUserId, pingerId, data) => {
57
+ const member = data.members.find((m) => m.account_id === pingerId);
58
+ const partyMeta = data.meta;
59
+ const memberMeta = member.meta;
60
+ const meta = {
61
+ 'urn:epic:conn:type_s': 'game',
62
+ 'urn:epic:cfg:build-id_s': partyMeta['urn:epic:cfg:build-id_s'],
63
+ 'urn:epic:invite:platformdata_s': '',
64
+ };
65
+ if (memberMeta.Platform_j) {
66
+ meta['Platform_j'] = JSON.parse(memberMeta.Platform_j).Platform.platformStr;
67
+ }
68
+ if (memberMeta['urn:epic:member:dn_s'])
69
+ meta['urn:epic:member:dn_s'] = memberMeta['urn:epic:member:dn_s'];
70
+ return {
71
+ party_id: data.id,
72
+ sent_by: pingerId,
73
+ sent_to: clientUserId,
74
+ sent_at: data.sent,
75
+ updated_at: data.sent,
76
+ expires_at: data.expies_at,
77
+ status: 'SENT',
78
+ meta,
79
+ };
80
+ };
81
+ exports.createPartyInvitation = createPartyInvitation;
82
+ const parseBlurlStream = (stream) => new Promise((res) => {
83
+ zlib_1.default.inflate(stream.slice(8), (_err, buffer) => {
84
+ const data = JSON.parse(buffer.toString());
85
+ res(data);
86
+ });
87
+ });
88
+ exports.parseBlurlStream = parseBlurlStream;
89
+ const parseM3U8FileLine = (line) => {
90
+ const [key, value] = line.replace(/^#EXT-X-/, '').split(/:(.+)/);
91
+ let output;
92
+ if (value.includes(',')) {
93
+ output = {};
94
+ let store = '';
95
+ let isString = false;
96
+ for (const char of value.split('')) {
97
+ if (char === '"') {
98
+ isString = !isString;
99
+ }
100
+ else if (char === ',' && !isString) {
101
+ const [vK, vV] = store.split(/=(.+)/);
102
+ output[vK] = vV.replace(/(^"|"$)/g, '');
103
+ store = '';
104
+ }
105
+ else {
106
+ store += char;
107
+ }
108
+ }
109
+ }
110
+ else {
111
+ output = value;
112
+ }
113
+ return [key, output];
114
+ };
115
+ const parseM3U8File = (data) => {
116
+ const output = {
117
+ streams: [],
118
+ };
119
+ let streamInf;
120
+ for (const line of data.split(/\n/).slice(1)) {
121
+ if (line.startsWith('#EXT-X-STREAM-INF:')) {
122
+ [, streamInf] = parseM3U8FileLine(line);
123
+ }
124
+ else if (line.startsWith('#EXT-X-')) {
125
+ const [key, value] = parseM3U8FileLine(line);
126
+ output[key] = value;
127
+ }
128
+ else if (!line.startsWith('#') && streamInf && line.length > 0) {
129
+ output.streams.push({
130
+ data: streamInf,
131
+ url: line,
132
+ });
133
+ streamInf = undefined;
134
+ }
135
+ }
136
+ return output;
137
+ };
138
+ exports.parseM3U8File = parseM3U8File;
139
+ const buildReplayMeta = (replay, replayData) => {
140
+ replay
141
+ .writeUInt32(480436863)
142
+ .writeUInt32(6)
143
+ .writeUInt32(replayData.LengthInMS)
144
+ .writeUInt32(replayData.NetworkVersion)
145
+ .writeUInt32(replayData.Changelist)
146
+ .writeString(replayData.FriendlyName.padEnd(256), 'utf16le')
147
+ .writeBool(replayData.bIsLive)
148
+ .writeUInt64((BigInt(new Date(replayData.Timestamp).getTime()) * BigInt('10000')) + BigInt('621355968000000000'))
149
+ .writeBool(replayData.bCompressed)
150
+ .writeBool(false)
151
+ .writeUInt32(0);
152
+ };
153
+ const buildChunks = (replay, replayData) => {
154
+ var _a, _b, _c;
155
+ const chunks = [{
156
+ chunkType: 0,
157
+ data: replayData.Header,
158
+ },
159
+ ...((_a = replayData.DataChunks) === null || _a === void 0 ? void 0 : _a.map((c) => ({
160
+ ...c,
161
+ chunkType: 1,
162
+ }))) || [],
163
+ ...((_b = replayData.Checkpoints) === null || _b === void 0 ? void 0 : _b.map((c) => ({
164
+ ...c,
165
+ chunkType: 2,
166
+ }))) || [],
167
+ ...((_c = replayData.Events) === null || _c === void 0 ? void 0 : _c.map((c) => ({
168
+ ...c,
169
+ chunkType: 3,
170
+ }))) || []];
171
+ for (const chunk of chunks) {
172
+ replay.writeUInt32(chunk.chunkType);
173
+ const chunkSizeOffset = replay.offset;
174
+ replay.writeInt32(0);
175
+ switch (chunk.chunkType) {
176
+ case 0:
177
+ replay.writeBytes(chunk.data);
178
+ break;
179
+ case 1:
180
+ replay
181
+ .writeUInt32(chunk.Time1)
182
+ .writeUInt32(chunk.Time2)
183
+ .writeUInt32(chunk.data.length)
184
+ .writeInt32(chunk.SizeInBytes)
185
+ .writeBytes(chunk.data);
186
+ break;
187
+ case 2:
188
+ replay
189
+ .writeString(chunk.Id)
190
+ .writeString(chunk.Group)
191
+ .writeString(chunk.Metadata || '')
192
+ .writeUInt32(chunk.Time1)
193
+ .writeUInt32(chunk.Time2)
194
+ .writeUInt32(chunk.data.length)
195
+ .writeBytes(chunk.data);
196
+ break;
197
+ case 3:
198
+ replay
199
+ .writeString(chunk.Id)
200
+ .writeString(chunk.Group)
201
+ .writeString(chunk.Metadata || '')
202
+ .writeUInt32(chunk.Time1)
203
+ .writeUInt32(chunk.Time2)
204
+ .writeUInt32(chunk.data.length)
205
+ .writeBytes(chunk.data);
206
+ break;
207
+ }
208
+ const chunkSize = replay.offset - (chunkSizeOffset + 4);
209
+ const savedOffset = replay.offset;
210
+ replay
211
+ .goto(chunkSizeOffset)
212
+ .writeInt32(chunkSize)
213
+ .goto(savedOffset);
214
+ }
215
+ };
216
+ const buildReplay = (replayData, addStats) => {
217
+ var _a, _b, _c;
218
+ if (replayData.Events && addStats) {
219
+ replayData.Events.push({
220
+ Id: `${replayData.ReplayName}_${crypto_1.default.randomBytes(16).toString('hex')}`,
221
+ Group: 'AthenaReplayBrowserEvents',
222
+ Metadata: 'AthenaMatchStats',
223
+ data: Buffer.alloc(48),
224
+ Time1: replayData.LengthInMS - 15000,
225
+ Time2: replayData.LengthInMS - 15000,
226
+ });
227
+ replayData.Events.push({
228
+ Id: `${replayData.ReplayName}_${crypto_1.default.randomBytes(16).toString('hex')}`,
229
+ Group: 'AthenaReplayBrowserEvents',
230
+ Metadata: 'AthenaMatchTeamStats',
231
+ data: Buffer.alloc(12),
232
+ Time1: replayData.LengthInMS - 15000,
233
+ Time2: replayData.LengthInMS - 15000,
234
+ });
235
+ }
236
+ const finalReplayByteLength = 562 // meta
237
+ + 8 + replayData.Header.length // header
238
+ + (((_a = replayData.DataChunks) === null || _a === void 0 ? void 0 : _a.map((c) => 8 + 16 + c.data.length).reduce((acc, cur) => acc + cur)) || 0) // datachunks
239
+ + (((_b = replayData.Events) === null || _b === void 0 ? void 0 : _b.map((e) => 8 + 12 + e.Id.length + 5 + e.Group.length + 5
240
+ + (e.Metadata ? e.Metadata.length + 5 : 5) + e.data.length).reduce((acc, cur) => acc + cur)) || 0) // events
241
+ + (((_c = replayData.Checkpoints) === null || _c === void 0 ? void 0 : _c.map((c) => 8 + 12 + c.Id.length + 5 + c.Group.length + 5
242
+ + (c.Metadata ? c.Metadata.length + 5 : 5) + c.data.length).reduce((acc, cur) => acc + cur)) || 0); // checkpoints
243
+ const replay = new BinaryWriter_1.default(Buffer.alloc(finalReplayByteLength));
244
+ buildReplayMeta(replay, replayData);
245
+ buildChunks(replay, replayData);
246
+ return replay.buffer;
247
+ };
248
+ exports.buildReplay = buildReplay;
249
+ const parseSTWSurvivorTemplateId = (templateId) => {
250
+ const id = templateId.split(':')[1];
251
+ const fields = id.split('_');
252
+ let type;
253
+ const rawType = fields.shift();
254
+ if (rawType === 'worker')
255
+ type = 'special';
256
+ else if (rawType === null || rawType === void 0 ? void 0 : rawType.includes('manager'))
257
+ type = 'manager';
258
+ else
259
+ type = 'basic';
260
+ const tier = parseInt(fields.pop().slice(1), 10);
261
+ const rarity = (type === 'manager' ? fields.shift() : fields.pop());
262
+ const name = fields[0] ? fields.join('_') : undefined;
263
+ return {
264
+ type,
265
+ tier,
266
+ rarity,
267
+ name,
268
+ };
269
+ };
270
+ exports.parseSTWSurvivorTemplateId = parseSTWSurvivorTemplateId;
271
+ const calcSTWSurvivorPowerLevel = (rarity, isLeader, level, tier) => {
272
+ /**
273
+ * We use Exclude<> here because mythic lead survivors actually have SR (legendary) rarity,
274
+ * and thus there are no rating curves for UR managers.
275
+ */
276
+ const key = isLeader
277
+ ? `manager_${rarity}_t0${tier}`
278
+ : `default_${rarity}_t0${tier}`;
279
+ return PowerLevelCurves_1.default.survivorItemRating[key].eval(level);
280
+ };
281
+ exports.calcSTWSurvivorPowerLevel = calcSTWSurvivorPowerLevel;
282
+ const calcSTWSurvivorBonus = (leaderPersonality, leaderRarity, survivorPersonality, survivorPowerLevel) => {
283
+ if (survivorPersonality === leaderPersonality) {
284
+ if (leaderRarity === 'sr')
285
+ return 8;
286
+ if (leaderRarity === 'vr')
287
+ return 5;
288
+ if (leaderRarity === 'r')
289
+ return 4;
290
+ if (leaderRarity === 'uc')
291
+ return 3;
292
+ if (leaderRarity === 'c')
293
+ return 2;
294
+ }
295
+ else if (leaderRarity === 'sr') {
296
+ if (survivorPowerLevel <= 2)
297
+ return 0;
298
+ return -2;
299
+ }
300
+ return 0;
301
+ };
302
+ exports.calcSTWSurvivorBonus = calcSTWSurvivorBonus;
303
+ const calcSTWSurvivorLeadBonus = (managerSynergy, squadName, powerLevel) => {
304
+ const leaderMatch = managerSynergy.split('.')[2];
305
+ if (Enums_1.STWLeadSynergy[squadName] === leaderMatch) {
306
+ return powerLevel;
307
+ }
308
+ return 0;
309
+ };
310
+ exports.calcSTWSurvivorLeadBonus = calcSTWSurvivorLeadBonus;
311
+ const parseSTWHeroTemplateId = (templateId) => {
312
+ const id = templateId.split(':')[1];
313
+ const fields = id.split('_');
314
+ fields.shift();
315
+ const type = fields.shift();
316
+ const tier = parseInt(fields.pop().slice(1), 10);
317
+ const rarity = fields.pop();
318
+ const name = fields[0] ? fields.join('_') : undefined;
319
+ return {
320
+ type,
321
+ tier,
322
+ rarity,
323
+ name,
324
+ };
325
+ };
326
+ exports.parseSTWHeroTemplateId = parseSTWHeroTemplateId;
327
+ const calcSTWNonSurvivorPowerLevel = (rarity, level, tier) => (PowerLevelCurves_1.default.baseItemRating[`default_${rarity}_t0${tier}`].eval(level));
328
+ exports.calcSTWNonSurvivorPowerLevel = calcSTWNonSurvivorPowerLevel;
329
+ function parseSTWSchematicTemplateId(templateId) {
330
+ const id = templateId.split(':')[1];
331
+ const fields = id.split('_');
332
+ let type;
333
+ let subType;
334
+ let firstField = fields.shift();
335
+ if (firstField !== 'sid') {
336
+ // probably ammo or something weird
337
+ fields.unshift(firstField);
338
+ return {
339
+ type: 'other',
340
+ subType: undefined,
341
+ tier: undefined,
342
+ evoType: undefined,
343
+ rarity: undefined,
344
+ name: fields[0] ? fields.join('_') : undefined,
345
+ };
346
+ }
347
+ firstField = fields.shift();
348
+ let nextField;
349
+ let i;
350
+ switch (firstField) {
351
+ case 'edged':
352
+ type = 'melee';
353
+ // look for "axe", "scythe", or "sword", which might occur later in the name
354
+ i = fields.findIndex((f) => f === 'axe' || f === 'scythe' || f === 'sword');
355
+ if (i >= 0) {
356
+ subType = `edged_${fields[i]}`;
357
+ fields.splice(i, 1);
358
+ }
359
+ else {
360
+ subType = undefined;
361
+ }
362
+ break;
363
+ case 'blunt':
364
+ type = 'melee';
365
+ // if the next field is "hammer", then the full type is "blunt_hammer", otherwise "blunt"
366
+ nextField = fields.shift();
367
+ if (nextField === 'hammer') {
368
+ subType = 'blunt_hammer';
369
+ }
370
+ else {
371
+ if (nextField !== undefined) {
372
+ fields.unshift(nextField);
373
+ }
374
+ subType = 'blunt';
375
+ }
376
+ break;
377
+ case 'piercing':
378
+ type = 'melee';
379
+ // "piercing" should always be followed by "spear", because spear is the only piercing weapon type
380
+ nextField = fields.shift();
381
+ if (nextField === 'spear') {
382
+ subType = 'piercing_spear';
383
+ }
384
+ else {
385
+ if (nextField !== undefined) {
386
+ fields.unshift(nextField);
387
+ }
388
+ subType = undefined;
389
+ }
390
+ break;
391
+ case 'ceiling':
392
+ case 'floor':
393
+ case 'wall':
394
+ type = 'trap';
395
+ subType = firstField;
396
+ break;
397
+ case 'explosive':
398
+ case 'launcher':
399
+ // "launcher" and "explosive" are used interchangeably to refer to the same subtype,
400
+ // but only some weapons of that subtype use "explosive" ammo, so we settle on "launcher"
401
+ type = 'ranged';
402
+ subType = 'launcher';
403
+ break;
404
+ case 'assault':
405
+ type = 'ranged';
406
+ // some weapons that were originally ARs were recategorized as SMGs when that subtype
407
+ // was added, and now they have both "assault" and "smg" in the name
408
+ i = fields.findIndex((f) => f === 'smg');
409
+ if (i >= 0) {
410
+ subType = 'smg';
411
+ fields.splice(i, 1);
412
+ fields.unshift(firstField);
413
+ }
414
+ else {
415
+ subType = 'assault';
416
+ }
417
+ break;
418
+ case 'pistol':
419
+ case 'shotgun':
420
+ case 'smg':
421
+ case 'sniper':
422
+ type = 'ranged';
423
+ subType = firstField;
424
+ break;
425
+ default:
426
+ // the name doesn't fit any known pattern, so this might be a new type of schematic.
427
+ // in the meantimwe, we still need to represent it somehow.
428
+ type = 'other';
429
+ subType = firstField;
430
+ break;
431
+ }
432
+ const tier = parseInt(fields.pop().slice(1), 10);
433
+ const evoType = type !== 'trap' ? fields.pop() : undefined;
434
+ const rarity = fields.pop();
435
+ const name = fields[0] ? fields.join('_') : undefined;
436
+ return {
437
+ type,
438
+ subType,
439
+ tier,
440
+ evoType,
441
+ rarity,
442
+ name,
443
+ };
444
+ }
445
+ const defaultStats = {
446
+ score: 0,
447
+ scorePerMin: 0,
448
+ scorePerMatch: 0,
449
+ wins: 0,
450
+ top3: 0,
451
+ top5: 0,
452
+ top6: 0,
453
+ top10: 0,
454
+ top12: 0,
455
+ top25: 0,
456
+ kills: 0,
457
+ killsPerMin: 0,
458
+ killsPerMatch: 0,
459
+ deaths: 0,
460
+ kd: 0,
461
+ matches: 0,
462
+ winRate: 0,
463
+ minutesPlayed: 0,
464
+ playersOutlived: 0,
465
+ lastModified: undefined,
466
+ };
467
+ const createDefaultInputTypeStats = () => ({
468
+ overall: { ...defaultStats },
469
+ solo: { ...defaultStats },
470
+ duo: { ...defaultStats },
471
+ squad: { ...defaultStats },
472
+ ltm: { ...defaultStats },
473
+ });
474
+ exports.createDefaultInputTypeStats = createDefaultInputTypeStats;
475
+ const parseStatKey = (key, value) => {
476
+ switch (key) {
477
+ case 'lastmodified':
478
+ return ['lastModified', new Date(value * 1000)];
479
+ case 'placetop25':
480
+ return ['top25', value];
481
+ case 'placetop12':
482
+ return ['top12', value];
483
+ case 'placetop10':
484
+ return ['top10', value];
485
+ case 'placetop6':
486
+ return ['top6', value];
487
+ case 'placetop5':
488
+ return ['top5', value];
489
+ case 'placetop3':
490
+ return ['top3', value];
491
+ case 'placetop1':
492
+ return ['wins', value];
493
+ case 'playersoutlived':
494
+ return ['playersOutlived', value];
495
+ case 'minutesplayed':
496
+ return ['minutesPlayed', value];
497
+ case 'matchesplayed':
498
+ return ['matches', value];
499
+ default:
500
+ return [key, value];
501
+ }
502
+ };
503
+ exports.parseStatKey = parseStatKey;
504
+ const resolveAuthString = async (str) => {
505
+ switch (typeof str) {
506
+ case 'function':
507
+ return str();
508
+ case 'string':
509
+ if (str.length === 32 || str.startsWith('eg1')) {
510
+ return str;
511
+ }
512
+ return fs_1.promises.readFile(str, 'utf8');
513
+ default:
514
+ throw new TypeError(`The type "${typeof str}" does not resolve to a valid auth string`);
515
+ }
516
+ };
517
+ exports.resolveAuthString = resolveAuthString;
518
+ const resolveAuthObject = async (obj) => {
519
+ switch (typeof obj) {
520
+ case 'function':
521
+ return obj();
522
+ case 'string':
523
+ return JSON.parse(await fs_1.promises.readFile(obj, 'utf8'));
524
+ case 'object':
525
+ return obj;
526
+ default:
527
+ throw new TypeError(`The type "${typeof obj}" does not resolve to a valid auth object`);
528
+ }
529
+ };
530
+ exports.resolveAuthObject = resolveAuthObject;
531
+ const chunk = (array, maxSize) => {
532
+ const chunkedArray = [];
533
+ for (let i = 0; i < array.length; i += maxSize) {
534
+ chunkedArray.push(array.slice(i, i + maxSize));
535
+ }
536
+ return chunkedArray;
537
+ };
538
+ exports.chunk = chunk;
539
+ //# sourceMappingURL=Util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Util.js","sourceRoot":"","sources":["../../../src/util/Util.ts"],"names":[],"mappings":";;;AA8WA,kEA6HC;;AA3eD,yCAAyC;AACzC,gEAAgC;AAChC,wDAAwB;AACxB,4DAA4B;AAC5B,2BAAoC;AACpC,6CAAmD;AACnD,0EAA0C;AAC1C,gGAAgE;AAchE,MAAM,iBAAiB,GAAG;IACxB,mCAAmC;IACnC,qCAAqC;IACrC,qCAAqC;IACrC,qCAAqC;IACrC,qCAAqC;IACrC,qCAAqC;IACrC,qCA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AAO,GAAG,2CAA2C,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC,CAAC;AAbW,QAAA,iBAAiB,qBAa5B;AAEK,MAAM,iBAAiB,GAAG,KAAK,EAAE,GAA0B,EAAE,EAAE;IACpE,QAAQ,OAAO,GAAG,EAAE,CAAC;QACnB,KAAK,UAAU;YACb,OAAO,GAAG,EAAE,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,aAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;QACpD,KAAK,QAAQ;YACX,OAAO,GAAG,CAAC;QACb;YACE,MAAM,IAAI,SAAS,CAAC,aAAa,OAAO,GAAG,2CAA2C,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC,CAAC;AAXW,QAAA,iBAAiB,qBAW5B;AAEK,MAAM,KAAK,GAAG,CAAgB,KAAU,EAAE,OAAe,EAAS,EAAE;IACzE,MAAM,YAAY,GAAU,EAAE,CAAC;IAE/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC;QAC/C,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AARW,QAAA,KAAK,SAQhB"}
@@ -0,0 +1,100 @@
1
+ import Base from '../Base';
2
+ import type { Stanzas, Constants } from 'stanza';
3
+ import type Client from '../Client';
4
+ /**
5
+ * Represents the client's XMPP manager
6
+ * @private
7
+ */
8
+ declare class XMPP extends Base {
9
+ /**
10
+ * XMPP agent
11
+ */
12
+ private connection?;
13
+ /**
14
+ * The amount of times the XMPP agent has tried to reconnect
15
+ */
16
+ private connectionRetryCount;
17
+ /**
18
+ * The time the XMPP agent connected at
19
+ */
20
+ private connectedAt?;
21
+ /**
22
+ * @param client The main client
23
+ */
24
+ constructor(client: Client);
25
+ /**
26
+ * Whether the XMPP agent is connected
27
+ */
28
+ get isConnected(): boolean;
29
+ /**
30
+ * Returns the xmpp JID
31
+ */
32
+ get JID(): string | undefined;
33
+ /**
34
+ * Returns the xmpp resource
35
+ */
36
+ get resource(): string | undefined;
37
+ /**
38
+ * Connects the XMPP agent to Epicgames' XMPP servers
39
+ * @param sendStatusWhenConnected Whether to send an empty status status when connected
40
+ */
41
+ connect(sendStatusWhenConnected?: boolean): Promise<void>;
42
+ /**
43
+ * Disconnects the XMPP client.
44
+ * Also performs a cleanup
45
+ */
46
+ disconnect(): void;
47
+ /**
48
+ * Registers all events
49
+ */
50
+ private setupEvents;
51
+ /**
52
+ * Waits for a friend to be added to the clients cache
53
+ */
54
+ private waitForFriend;
55
+ /**
56
+ * Sends a presence to all or a specific friend
57
+ * @param status The status message. Can be undefined if you want to reset it
58
+ * @param show The show type of the presence (eg "away")
59
+ * @param to The JID of a specific friend
60
+ */
61
+ sendStatus(status?: object | string, show?: Constants.PresenceShow, to?: string): void;
62
+ /**
63
+ * Sends an XMPP message
64
+ * @param to The message receiver's JID
65
+ * @param content The message that will be sent
66
+ * @param type The message type (eg "chat" or "groupchat")
67
+ * @deprecated this is useless now, since chat messages are handeled via an rest api now see {@link Client#chat}
68
+ */
69
+ sendMessage(to: string, content: string, type?: Constants.MessageType): Promise<Stanzas.Message | undefined>;
70
+ /**
71
+ * Wait until a message is sent
72
+ * @param id The message id
73
+ * @param timeout How long to wait for the message
74
+ * @deprecated this is useless now, since chat messages are handeled via an rest api now see {@link Client#chat}
75
+ */
76
+ waitForSentMessage(id: string, timeout?: number): Promise<Stanzas.Message | undefined>;
77
+ /**
78
+ * Joins a multi user chat room (MUC)
79
+ * @param jid The room's JID
80
+ * @param nick The client's nickname
81
+ * @deprecated this is useless now, since chat messages are handeled via an rest api now see {@link Client#chat}
82
+ */
83
+ joinMUC(jid: string, nick: string): Promise<Stanzas.ReceivedMUCPresence>;
84
+ /**
85
+ * Leaves a multi user chat room (MUC)
86
+ * @param jid The room's JID
87
+ * @param nick The client's nickname
88
+ * @deprecated this is useless now, since chat messages are handeled via an rest api now see {@link Client#chat}
89
+ */
90
+ leaveMUC(jid: string, nick: string): Promise<Stanzas.ReceivedPresence>;
91
+ /**
92
+ * Bans a member from a multi user chat room
93
+ * @param member The member that should be banned
94
+ * @deprecated this is useless now, since chat messages are handeled via an rest api now see {@link Client#chat}
95
+ */
96
+ ban(jid: string, member: string): Promise<Stanzas.IQ & {
97
+ muc: Stanzas.MUCUserList;
98
+ }>;
99
+ }
100
+ export default XMPP;