@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.
- package/LICENSE +21 -0
- package/README.md +68 -0
- package/dist/enums/Enums.d.ts +251 -0
- package/dist/enums/Enums.js +202 -0
- package/dist/enums/Enums.js.map +1 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.js +194 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/AuthClients.d.ts +39 -0
- package/dist/resources/AuthClients.js +41 -0
- package/dist/resources/AuthClients.js.map +1 -0
- package/dist/resources/BaseItemRating.json +5203 -0
- package/dist/resources/Endpoints.d.ts +58 -0
- package/dist/resources/Endpoints.js +71 -0
- package/dist/resources/Endpoints.js.map +1 -0
- package/dist/resources/HomebaseRatingMapping.json +255 -0
- package/dist/resources/PowerLevelCurves.d.ts +111 -0
- package/dist/resources/PowerLevelCurves.js +21 -0
- package/dist/resources/PowerLevelCurves.js.map +1 -0
- package/dist/resources/SurvivorItemRating.json +9343 -0
- package/dist/resources/constants.d.ts +2 -0
- package/dist/resources/constants.js +11 -0
- package/dist/resources/constants.js.map +1 -0
- package/dist/resources/defaultPartyMemberMeta.json +28 -0
- package/dist/resources/defaultPartyMeta.json +38 -0
- package/dist/resources/enums.d.ts +12 -0
- package/dist/resources/enums.js +18 -0
- package/dist/resources/enums.js.map +1 -0
- package/dist/resources/httpResponses.d.ts +773 -0
- package/dist/resources/httpResponses.js +3 -0
- package/dist/resources/httpResponses.js.map +1 -0
- package/dist/resources/structs.d.ts +1310 -0
- package/dist/resources/structs.js +3 -0
- package/dist/resources/structs.js.map +1 -0
- package/dist/src/Base.d.ts +15 -0
- package/dist/src/Base.js +15 -0
- package/dist/src/Base.js.map +1 -0
- package/dist/src/Client.d.ts +341 -0
- package/dist/src/Client.js +1043 -0
- package/dist/src/Client.js.map +1 -0
- package/dist/src/auth/Auth.d.ts +66 -0
- package/dist/src/auth/Auth.js +249 -0
- package/dist/src/auth/Auth.js.map +1 -0
- package/dist/src/auth/AuthSession.d.ts +41 -0
- package/dist/src/auth/AuthSession.js +25 -0
- package/dist/src/auth/AuthSession.js.map +1 -0
- package/dist/src/auth/EOSAuthSession.d.ts +19 -0
- package/dist/src/auth/EOSAuthSession.js +80 -0
- package/dist/src/auth/EOSAuthSession.js.map +1 -0
- package/dist/src/auth/FortniteAuthSession.d.ts +53 -0
- package/dist/src/auth/FortniteAuthSession.js +107 -0
- package/dist/src/auth/FortniteAuthSession.js.map +1 -0
- package/dist/src/auth/FortniteClientCredentialsAuthSession.d.ts +18 -0
- package/dist/src/auth/FortniteClientCredentialsAuthSession.js +88 -0
- package/dist/src/auth/FortniteClientCredentialsAuthSession.js.map +1 -0
- package/dist/src/auth/LauncherAuthSession.d.ts +23 -0
- package/dist/src/auth/LauncherAuthSession.js +120 -0
- package/dist/src/auth/LauncherAuthSession.js.map +1 -0
- package/dist/src/exceptions/AuthenticationMissingError.d.ts +15 -0
- package/dist/src/exceptions/AuthenticationMissingError.js +18 -0
- package/dist/src/exceptions/AuthenticationMissingError.js.map +1 -0
- package/dist/src/exceptions/CreativeIslandNotFoundError.d.ts +14 -0
- package/dist/src/exceptions/CreativeIslandNotFoundError.js +18 -0
- package/dist/src/exceptions/CreativeIslandNotFoundError.js.map +1 -0
- package/dist/src/exceptions/CreatorCodeNotFoundError.d.ts +14 -0
- package/dist/src/exceptions/CreatorCodeNotFoundError.js +18 -0
- package/dist/src/exceptions/CreatorCodeNotFoundError.js.map +1 -0
- package/dist/src/exceptions/DuplicateFriendshipError.d.ts +14 -0
- package/dist/src/exceptions/DuplicateFriendshipError.js +18 -0
- package/dist/src/exceptions/DuplicateFriendshipError.js.map +1 -0
- package/dist/src/exceptions/EpicgamesAPIError.d.ts +42 -0
- package/dist/src/exceptions/EpicgamesAPIError.js +27 -0
- package/dist/src/exceptions/EpicgamesAPIError.js.map +1 -0
- package/dist/src/exceptions/EventTimeoutError.d.ts +19 -0
- package/dist/src/exceptions/EventTimeoutError.js +20 -0
- package/dist/src/exceptions/EventTimeoutError.js.map +1 -0
- package/dist/src/exceptions/FriendNotFoundError.d.ts +14 -0
- package/dist/src/exceptions/FriendNotFoundError.js +18 -0
- package/dist/src/exceptions/FriendNotFoundError.js.map +1 -0
- package/dist/src/exceptions/FriendshipRequestAlreadySentError.d.ts +14 -0
- package/dist/src/exceptions/FriendshipRequestAlreadySentError.js +18 -0
- package/dist/src/exceptions/FriendshipRequestAlreadySentError.js.map +1 -0
- package/dist/src/exceptions/InviteeFriendshipRequestLimitExceededError.d.ts +14 -0
- package/dist/src/exceptions/InviteeFriendshipRequestLimitExceededError.js +18 -0
- package/dist/src/exceptions/InviteeFriendshipRequestLimitExceededError.js.map +1 -0
- package/dist/src/exceptions/InviteeFriendshipSettingsError.d.ts +14 -0
- package/dist/src/exceptions/InviteeFriendshipSettingsError.js +18 -0
- package/dist/src/exceptions/InviteeFriendshipSettingsError.js.map +1 -0
- package/dist/src/exceptions/InviteeFriendshipsLimitExceededError.d.ts +14 -0
- package/dist/src/exceptions/InviteeFriendshipsLimitExceededError.js +18 -0
- package/dist/src/exceptions/InviteeFriendshipsLimitExceededError.js.map +1 -0
- package/dist/src/exceptions/InviterFriendshipsLimitExceededError.d.ts +14 -0
- package/dist/src/exceptions/InviterFriendshipsLimitExceededError.js +18 -0
- package/dist/src/exceptions/InviterFriendshipsLimitExceededError.js.map +1 -0
- package/dist/src/exceptions/MatchNotFoundError.d.ts +14 -0
- package/dist/src/exceptions/MatchNotFoundError.js +18 -0
- package/dist/src/exceptions/MatchNotFoundError.js.map +1 -0
- package/dist/src/exceptions/OfferNotFoundError.d.ts +14 -0
- package/dist/src/exceptions/OfferNotFoundError.js +18 -0
- package/dist/src/exceptions/OfferNotFoundError.js.map +1 -0
- package/dist/src/exceptions/PartyAlreadyJoinedError.d.ts +7 -0
- package/dist/src/exceptions/PartyAlreadyJoinedError.js +14 -0
- package/dist/src/exceptions/PartyAlreadyJoinedError.js.map +1 -0
- package/dist/src/exceptions/PartyInvitationExpiredError.d.ts +7 -0
- package/dist/src/exceptions/PartyInvitationExpiredError.js +14 -0
- package/dist/src/exceptions/PartyInvitationExpiredError.js.map +1 -0
- package/dist/src/exceptions/PartyMaxSizeReachedError.d.ts +7 -0
- package/dist/src/exceptions/PartyMaxSizeReachedError.js +14 -0
- package/dist/src/exceptions/PartyMaxSizeReachedError.js.map +1 -0
- package/dist/src/exceptions/PartyMemberNotFoundError.d.ts +14 -0
- package/dist/src/exceptions/PartyMemberNotFoundError.js +18 -0
- package/dist/src/exceptions/PartyMemberNotFoundError.js.map +1 -0
- package/dist/src/exceptions/PartyNotFoundError.d.ts +7 -0
- package/dist/src/exceptions/PartyNotFoundError.js +14 -0
- package/dist/src/exceptions/PartyNotFoundError.js.map +1 -0
- package/dist/src/exceptions/PartyPermissionError.d.ts +7 -0
- package/dist/src/exceptions/PartyPermissionError.js +14 -0
- package/dist/src/exceptions/PartyPermissionError.js.map +1 -0
- package/dist/src/exceptions/SendMessageError.d.ts +27 -0
- package/dist/src/exceptions/SendMessageError.js +21 -0
- package/dist/src/exceptions/SendMessageError.js.map +1 -0
- package/dist/src/exceptions/StatsPrivacyError.d.ts +14 -0
- package/dist/src/exceptions/StatsPrivacyError.js +18 -0
- package/dist/src/exceptions/StatsPrivacyError.js.map +1 -0
- package/dist/src/exceptions/StompConnectionError.d.ts +14 -0
- package/dist/src/exceptions/StompConnectionError.js +18 -0
- package/dist/src/exceptions/StompConnectionError.js.map +1 -0
- package/dist/src/exceptions/UserNotFoundError.d.ts +14 -0
- package/dist/src/exceptions/UserNotFoundError.js +18 -0
- package/dist/src/exceptions/UserNotFoundError.js.map +1 -0
- package/dist/src/exceptions/XMPPConnectionError.d.ts +19 -0
- package/dist/src/exceptions/XMPPConnectionError.js +19 -0
- package/dist/src/exceptions/XMPPConnectionError.js.map +1 -0
- package/dist/src/exceptions/XMPPConnectionTimeoutError.d.ts +14 -0
- package/dist/src/exceptions/XMPPConnectionTimeoutError.js +18 -0
- package/dist/src/exceptions/XMPPConnectionTimeoutError.js.map +1 -0
- package/dist/src/http/HTTP.d.ts +40 -0
- package/dist/src/http/HTTP.js +124 -0
- package/dist/src/http/HTTP.js.map +1 -0
- package/dist/src/managers/ChatManager.d.ts +27 -0
- package/dist/src/managers/ChatManager.js +71 -0
- package/dist/src/managers/ChatManager.js.map +1 -0
- package/dist/src/managers/FriendManager.d.ts +66 -0
- package/dist/src/managers/FriendManager.js +175 -0
- package/dist/src/managers/FriendManager.js.map +1 -0
- package/dist/src/managers/STWManager.d.ts +29 -0
- package/dist/src/managers/STWManager.js +80 -0
- package/dist/src/managers/STWManager.js.map +1 -0
- package/dist/src/managers/TournamentManager.d.ts +51 -0
- package/dist/src/managers/TournamentManager.js +182 -0
- package/dist/src/managers/TournamentManager.js.map +1 -0
- package/dist/src/managers/UserManager.d.ts +78 -0
- package/dist/src/managers/UserManager.js +216 -0
- package/dist/src/managers/UserManager.js.map +1 -0
- package/dist/src/stomp/EOSConnect.d.ts +43 -0
- package/dist/src/stomp/EOSConnect.js +175 -0
- package/dist/src/stomp/EOSConnect.js.map +1 -0
- package/dist/src/structures/Avatar.d.ts +27 -0
- package/dist/src/structures/Avatar.js +22 -0
- package/dist/src/structures/Avatar.js.map +1 -0
- package/dist/src/structures/BaseMessage.d.ts +34 -0
- package/dist/src/structures/BaseMessage.js +22 -0
- package/dist/src/structures/BaseMessage.js.map +1 -0
- package/dist/src/structures/CreatorCode.d.ts +31 -0
- package/dist/src/structures/CreatorCode.js +22 -0
- package/dist/src/structures/CreatorCode.js.map +1 -0
- package/dist/src/structures/EpicgamesServerStatus.d.ts +52 -0
- package/dist/src/structures/EpicgamesServerStatus.js +31 -0
- package/dist/src/structures/EpicgamesServerStatus.js.map +1 -0
- package/dist/src/structures/EpicgamesServerStatusComponent.d.ts +67 -0
- package/dist/src/structures/EpicgamesServerStatusComponent.js +37 -0
- package/dist/src/structures/EpicgamesServerStatusComponent.js.map +1 -0
- package/dist/src/structures/EpicgamesServerStatusIncident.d.ts +58 -0
- package/dist/src/structures/EpicgamesServerStatusIncident.js +36 -0
- package/dist/src/structures/EpicgamesServerStatusIncident.js.map +1 -0
- package/dist/src/structures/EpicgamesServerStatusScheduledMainteance.d.ts +21 -0
- package/dist/src/structures/EpicgamesServerStatusScheduledMainteance.js +20 -0
- package/dist/src/structures/EpicgamesServerStatusScheduledMainteance.js.map +1 -0
- package/dist/src/structures/EventTokens.d.ts +32 -0
- package/dist/src/structures/EventTokens.js +45 -0
- package/dist/src/structures/EventTokens.js.map +1 -0
- package/dist/src/structures/FortniteServerStatus.d.ts +46 -0
- package/dist/src/structures/FortniteServerStatus.js +26 -0
- package/dist/src/structures/FortniteServerStatus.js.map +1 -0
- package/dist/src/structures/GlobalProfile.d.ts +36 -0
- package/dist/src/structures/GlobalProfile.js +25 -0
- package/dist/src/structures/GlobalProfile.js.map +1 -0
- package/dist/src/structures/Image.d.ts +36 -0
- package/dist/src/structures/Image.js +38 -0
- package/dist/src/structures/Image.js.map +1 -0
- package/dist/src/structures/NewsMessage.d.ts +56 -0
- package/dist/src/structures/NewsMessage.js +45 -0
- package/dist/src/structures/NewsMessage.js.map +1 -0
- package/dist/src/structures/NewsMessageVideo.d.ts +47 -0
- package/dist/src/structures/NewsMessageVideo.js +32 -0
- package/dist/src/structures/NewsMessageVideo.js.map +1 -0
- package/dist/src/structures/RadioStation.d.ts +31 -0
- package/dist/src/structures/RadioStation.js +33 -0
- package/dist/src/structures/RadioStation.js.map +1 -0
- package/dist/src/structures/Stats.d.ts +45 -0
- package/dist/src/structures/Stats.js +109 -0
- package/dist/src/structures/Stats.js.map +1 -0
- package/dist/src/structures/Tournament.d.ts +86 -0
- package/dist/src/structures/Tournament.js +64 -0
- package/dist/src/structures/Tournament.js.map +1 -0
- package/dist/src/structures/TournamentWindow.d.ts +124 -0
- package/dist/src/structures/TournamentWindow.js +52 -0
- package/dist/src/structures/TournamentWindow.js.map +1 -0
- package/dist/src/structures/friend/BaseFriendMessage.d.ts +32 -0
- package/dist/src/structures/friend/BaseFriendMessage.js +28 -0
- package/dist/src/structures/friend/BaseFriendMessage.js.map +1 -0
- package/dist/src/structures/friend/BasePendingFriend.d.ts +22 -0
- package/dist/src/structures/friend/BasePendingFriend.js +22 -0
- package/dist/src/structures/friend/BasePendingFriend.js.map +1 -0
- package/dist/src/structures/friend/Friend.d.ts +106 -0
- package/dist/src/structures/friend/Friend.js +97 -0
- package/dist/src/structures/friend/Friend.js.map +1 -0
- package/dist/src/structures/friend/FriendPresence.d.ts +84 -0
- package/dist/src/structures/friend/FriendPresence.js +48 -0
- package/dist/src/structures/friend/FriendPresence.js.map +1 -0
- package/dist/src/structures/friend/IncomingPendingFriend.d.ts +27 -0
- package/dist/src/structures/friend/IncomingPendingFriend.js +36 -0
- package/dist/src/structures/friend/IncomingPendingFriend.js.map +1 -0
- package/dist/src/structures/friend/OutgoingPendingFriend.d.ts +17 -0
- package/dist/src/structures/friend/OutgoingPendingFriend.js +24 -0
- package/dist/src/structures/friend/OutgoingPendingFriend.js.map +1 -0
- package/dist/src/structures/friend/ReceivedFriendMessage.d.ts +27 -0
- package/dist/src/structures/friend/ReceivedFriendMessage.js +27 -0
- package/dist/src/structures/friend/ReceivedFriendMessage.js.map +1 -0
- package/dist/src/structures/friend/SentFriendMessage.d.ts +21 -0
- package/dist/src/structures/friend/SentFriendMessage.js +19 -0
- package/dist/src/structures/friend/SentFriendMessage.js.map +1 -0
- package/dist/src/structures/party/BasePartyInvitation.d.ts +48 -0
- package/dist/src/structures/party/BasePartyInvitation.js +33 -0
- package/dist/src/structures/party/BasePartyInvitation.js.map +1 -0
- package/dist/src/structures/party/BasePartyJoinRequest.d.ts +37 -0
- package/dist/src/structures/party/BasePartyJoinRequest.js +30 -0
- package/dist/src/structures/party/BasePartyJoinRequest.js.map +1 -0
- package/dist/src/structures/party/ClientParty.d.ts +162 -0
- package/dist/src/structures/party/ClientParty.js +412 -0
- package/dist/src/structures/party/ClientParty.js.map +1 -0
- package/dist/src/structures/party/ClientPartyMember.d.ts +144 -0
- package/dist/src/structures/party/ClientPartyMember.js +463 -0
- package/dist/src/structures/party/ClientPartyMember.js.map +1 -0
- package/dist/src/structures/party/ClientPartyMemberMeta.d.ts +18 -0
- package/dist/src/structures/party/ClientPartyMemberMeta.js +54 -0
- package/dist/src/structures/party/ClientPartyMemberMeta.js.map +1 -0
- package/dist/src/structures/party/ClientPartyMeta.d.ts +23 -0
- package/dist/src/structures/party/ClientPartyMeta.js +59 -0
- package/dist/src/structures/party/ClientPartyMeta.js.map +1 -0
- package/dist/src/structures/party/Party.d.ts +95 -0
- package/dist/src/structures/party/Party.js +200 -0
- package/dist/src/structures/party/Party.js.map +1 -0
- package/dist/src/structures/party/PartyChat.d.ts +73 -0
- package/dist/src/structures/party/PartyChat.js +76 -0
- package/dist/src/structures/party/PartyChat.js.map +1 -0
- package/dist/src/structures/party/PartyMember.d.ts +139 -0
- package/dist/src/structures/party/PartyMember.js +201 -0
- package/dist/src/structures/party/PartyMember.js.map +1 -0
- package/dist/src/structures/party/PartyMemberConfirmation.d.ts +43 -0
- package/dist/src/structures/party/PartyMemberConfirmation.js +53 -0
- package/dist/src/structures/party/PartyMemberConfirmation.js.map +1 -0
- package/dist/src/structures/party/PartyMemberMeta.d.ts +76 -0
- package/dist/src/structures/party/PartyMemberMeta.js +145 -0
- package/dist/src/structures/party/PartyMemberMeta.js.map +1 -0
- package/dist/src/structures/party/PartyMessage.d.ts +30 -0
- package/dist/src/structures/party/PartyMessage.js +28 -0
- package/dist/src/structures/party/PartyMessage.js.map +1 -0
- package/dist/src/structures/party/PartyMeta.d.ts +24 -0
- package/dist/src/structures/party/PartyMeta.js +43 -0
- package/dist/src/structures/party/PartyMeta.js.map +1 -0
- package/dist/src/structures/party/PresenceParty.d.ts +66 -0
- package/dist/src/structures/party/PresenceParty.js +49 -0
- package/dist/src/structures/party/PresenceParty.js.map +1 -0
- package/dist/src/structures/party/ReceivedPartyInvitation.d.ts +33 -0
- package/dist/src/structures/party/ReceivedPartyInvitation.js +54 -0
- package/dist/src/structures/party/ReceivedPartyInvitation.js.map +1 -0
- package/dist/src/structures/party/ReceivedPartyJoinRequest.d.ts +26 -0
- package/dist/src/structures/party/ReceivedPartyJoinRequest.js +31 -0
- package/dist/src/structures/party/ReceivedPartyJoinRequest.js.map +1 -0
- package/dist/src/structures/party/SentPartyInvitation.d.ts +27 -0
- package/dist/src/structures/party/SentPartyInvitation.js +39 -0
- package/dist/src/structures/party/SentPartyInvitation.js.map +1 -0
- package/dist/src/structures/party/SentPartyJoinRequest.d.ts +19 -0
- package/dist/src/structures/party/SentPartyJoinRequest.js +22 -0
- package/dist/src/structures/party/SentPartyJoinRequest.js.map +1 -0
- package/dist/src/structures/stw/STWHero.d.ts +61 -0
- package/dist/src/structures/stw/STWHero.js +38 -0
- package/dist/src/structures/stw/STWHero.js.map +1 -0
- package/dist/src/structures/stw/STWHeroLoadout.d.ts +44 -0
- package/dist/src/structures/stw/STWHeroLoadout.js +34 -0
- package/dist/src/structures/stw/STWHeroLoadout.js.map +1 -0
- package/dist/src/structures/stw/STWItem.d.ts +31 -0
- package/dist/src/structures/stw/STWItem.js +23 -0
- package/dist/src/structures/stw/STWItem.js.map +1 -0
- package/dist/src/structures/stw/STWLocker.d.ts +32 -0
- package/dist/src/structures/stw/STWLocker.js +26 -0
- package/dist/src/structures/stw/STWLocker.js.map +1 -0
- package/dist/src/structures/stw/STWMeleeWeaponSchematic.d.ts +14 -0
- package/dist/src/structures/stw/STWMeleeWeaponSchematic.js +15 -0
- package/dist/src/structures/stw/STWMeleeWeaponSchematic.js.map +1 -0
- package/dist/src/structures/stw/STWNewsMessage.d.ts +42 -0
- package/dist/src/structures/stw/STWNewsMessage.js +27 -0
- package/dist/src/structures/stw/STWNewsMessage.js.map +1 -0
- package/dist/src/structures/stw/STWProfile.d.ts +132 -0
- package/dist/src/structures/stw/STWProfile.js +283 -0
- package/dist/src/structures/stw/STWProfile.js.map +1 -0
- package/dist/src/structures/stw/STWRangedWeaponSchematic.d.ts +14 -0
- package/dist/src/structures/stw/STWRangedWeaponSchematic.js +15 -0
- package/dist/src/structures/stw/STWRangedWeaponSchematic.js.map +1 -0
- package/dist/src/structures/stw/STWResource.d.ts +27 -0
- package/dist/src/structures/stw/STWResource.js +22 -0
- package/dist/src/structures/stw/STWResource.js.map +1 -0
- package/dist/src/structures/stw/STWSchematic.d.ts +72 -0
- package/dist/src/structures/stw/STWSchematic.js +40 -0
- package/dist/src/structures/stw/STWSchematic.js.map +1 -0
- package/dist/src/structures/stw/STWStats.d.ts +103 -0
- package/dist/src/structures/stw/STWStats.js +85 -0
- package/dist/src/structures/stw/STWStats.js.map +1 -0
- package/dist/src/structures/stw/STWSurvivor.d.ts +104 -0
- package/dist/src/structures/stw/STWSurvivor.js +76 -0
- package/dist/src/structures/stw/STWSurvivor.js.map +1 -0
- package/dist/src/structures/stw/STWTeamPerk.d.ts +19 -0
- package/dist/src/structures/stw/STWTeamPerk.js +20 -0
- package/dist/src/structures/stw/STWTeamPerk.js.map +1 -0
- package/dist/src/structures/stw/STWTrapSchematic.d.ts +15 -0
- package/dist/src/structures/stw/STWTrapSchematic.js +16 -0
- package/dist/src/structures/stw/STWTrapSchematic.js.map +1 -0
- package/dist/src/structures/stw/STWWeaponSchematic.d.ts +15 -0
- package/dist/src/structures/stw/STWWeaponSchematic.js +16 -0
- package/dist/src/structures/stw/STWWeaponSchematic.js.map +1 -0
- package/dist/src/structures/user/BlockedUser.d.ts +13 -0
- package/dist/src/structures/user/BlockedUser.js +19 -0
- package/dist/src/structures/user/BlockedUser.js.map +1 -0
- package/dist/src/structures/user/ClientUser.d.ts +78 -0
- package/dist/src/structures/user/ClientUser.js +34 -0
- package/dist/src/structures/user/ClientUser.js.map +1 -0
- package/dist/src/structures/user/User.d.ts +98 -0
- package/dist/src/structures/user/User.js +130 -0
- package/dist/src/structures/user/User.js.map +1 -0
- package/dist/src/structures/user/UserSearchResult.d.ts +31 -0
- package/dist/src/structures/user/UserSearchResult.js +23 -0
- package/dist/src/structures/user/UserSearchResult.js.map +1 -0
- package/dist/src/util/AsyncLock.d.ts +28 -0
- package/dist/src/util/AsyncLock.js +44 -0
- package/dist/src/util/AsyncLock.js.map +1 -0
- package/dist/src/util/BinaryWriter.d.ts +79 -0
- package/dist/src/util/BinaryWriter.js +136 -0
- package/dist/src/util/BinaryWriter.js.map +1 -0
- package/dist/src/util/CurveTable.d.ts +24 -0
- package/dist/src/util/CurveTable.js +37 -0
- package/dist/src/util/CurveTable.js.map +1 -0
- package/dist/src/util/Meta.d.ts +41 -0
- package/dist/src/util/Meta.js +73 -0
- package/dist/src/util/Meta.js.map +1 -0
- package/dist/src/util/Util.d.ts +162 -0
- package/dist/src/util/Util.js +539 -0
- package/dist/src/util/Util.js.map +1 -0
- package/dist/src/xmpp/XMPP.d.ts +100 -0
- package/dist/src/xmpp/XMPP.js +702 -0
- package/dist/src/xmpp/XMPP.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const AuthSession_1 = tslib_1.__importDefault(require("./AuthSession"));
|
|
5
|
+
const enums_1 = require("../../resources/enums");
|
|
6
|
+
const Endpoints_1 = tslib_1.__importDefault(require("../../resources/Endpoints"));
|
|
7
|
+
/**
|
|
8
|
+
* Represents an auth session
|
|
9
|
+
*/
|
|
10
|
+
class FortniteAuthSession extends AuthSession_1.default {
|
|
11
|
+
constructor(client, data, clientSecret) {
|
|
12
|
+
super(client, data, clientSecret, enums_1.AuthSessionType.Fortnite);
|
|
13
|
+
this.app = data.app;
|
|
14
|
+
this.clientsService = data.client_service;
|
|
15
|
+
this.displayName = data.displayName;
|
|
16
|
+
this.isInternalClient = data.internal_client;
|
|
17
|
+
this.inAppId = data.in_app_id;
|
|
18
|
+
this.deviceId = data.device_id;
|
|
19
|
+
this.refreshToken = data.refresh_token;
|
|
20
|
+
this.refreshTokenExpiresAt = new Date(data.refresh_expires_at);
|
|
21
|
+
}
|
|
22
|
+
async verify(forceVerify = false) {
|
|
23
|
+
if (!forceVerify && this.isExpired) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
await this.client.http.epicgamesRequest({
|
|
28
|
+
url: Endpoints_1.default.OAUTH_TOKEN_VERIFY,
|
|
29
|
+
headers: {
|
|
30
|
+
Authorization: `bearer ${this.accessToken}`,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async createExchangeCode() {
|
|
40
|
+
const response = await this.client.http.epicgamesRequest({
|
|
41
|
+
url: Endpoints_1.default.OAUTH_EXCHANGE,
|
|
42
|
+
headers: {
|
|
43
|
+
Authorization: `bearer ${this.accessToken}`,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
return response.code;
|
|
47
|
+
}
|
|
48
|
+
async revoke() {
|
|
49
|
+
clearTimeout(this.refreshTimeout);
|
|
50
|
+
this.refreshTimeout = undefined;
|
|
51
|
+
await this.client.http.epicgamesRequest({
|
|
52
|
+
method: 'DELETE',
|
|
53
|
+
url: `${Endpoints_1.default.OAUTH_TOKEN_KILL}/${this.accessToken}`,
|
|
54
|
+
headers: {
|
|
55
|
+
Authorization: `bearer ${this.accessToken}`,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
async refresh() {
|
|
60
|
+
this.refreshLock.lock();
|
|
61
|
+
try {
|
|
62
|
+
clearTimeout(this.refreshTimeout);
|
|
63
|
+
this.refreshTimeout = undefined;
|
|
64
|
+
const response = await this.client.http.epicgamesRequest({
|
|
65
|
+
method: 'POST',
|
|
66
|
+
url: Endpoints_1.default.OAUTH_TOKEN_CREATE,
|
|
67
|
+
headers: {
|
|
68
|
+
Authorization: `basic ${Buffer.from(`${this.clientId}:${this.clientSecret}`).toString('base64')}`,
|
|
69
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
70
|
+
},
|
|
71
|
+
data: new URLSearchParams({
|
|
72
|
+
grant_type: 'refresh_token',
|
|
73
|
+
refresh_token: this.refreshToken,
|
|
74
|
+
token_type: 'eg1',
|
|
75
|
+
}).toString(),
|
|
76
|
+
});
|
|
77
|
+
this.accessToken = response.access_token;
|
|
78
|
+
this.expiresAt = new Date(response.expires_at);
|
|
79
|
+
this.refreshToken = response.refresh_token;
|
|
80
|
+
this.refreshTokenExpiresAt = new Date(response.refresh_expires_at);
|
|
81
|
+
this.initRefreshTimeout();
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
this.refreshLock.unlock();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
initRefreshTimeout() {
|
|
88
|
+
clearTimeout(this.refreshTimeout);
|
|
89
|
+
this.refreshTimeout = setTimeout(() => this.refresh(), this.expiresAt.getTime() - Date.now() - 15 * 60 * 1000);
|
|
90
|
+
}
|
|
91
|
+
static async create(client, clientId, clientSecret, data) {
|
|
92
|
+
const response = await client.http.epicgamesRequest({
|
|
93
|
+
method: 'POST',
|
|
94
|
+
url: Endpoints_1.default.OAUTH_TOKEN_CREATE,
|
|
95
|
+
headers: {
|
|
96
|
+
Authorization: `basic ${Buffer.from(`${clientId}:${clientSecret}`).toString('base64')}`,
|
|
97
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
98
|
+
},
|
|
99
|
+
data: new URLSearchParams(data).toString(),
|
|
100
|
+
});
|
|
101
|
+
const session = new FortniteAuthSession(client, response, clientSecret);
|
|
102
|
+
session.initRefreshTimeout();
|
|
103
|
+
return session;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.default = FortniteAuthSession;
|
|
107
|
+
//# sourceMappingURL=FortniteAuthSession.js.map
|
|
@@ -0,0 +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CAAC,EAAE;gBACvF,cAAc,EAAE,mCAAmC;aACpD;YACD,IAAI,EAAE,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;SAC3C,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,IAAI,mBAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;QACxE,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAE7B,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAED,kBAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import AuthSession from './AuthSession';
|
|
2
|
+
import { AuthSessionType } from '../../resources/enums';
|
|
3
|
+
import type Client from '../Client';
|
|
4
|
+
import type { FortniteClientCredentialsAuthData } from '../../resources/structs';
|
|
5
|
+
declare class FortniteClientCredentialsAuthSession extends AuthSession<AuthSessionType.FortniteClientCredentials> {
|
|
6
|
+
clientsService: string;
|
|
7
|
+
isInternalClient: boolean;
|
|
8
|
+
productId: string;
|
|
9
|
+
applicationId: string;
|
|
10
|
+
refreshTimeout?: any;
|
|
11
|
+
constructor(client: Client, data: FortniteClientCredentialsAuthData, clientSecret: string);
|
|
12
|
+
verify(forceVerify?: boolean): Promise<boolean>;
|
|
13
|
+
revoke(): Promise<void>;
|
|
14
|
+
refresh(): Promise<void>;
|
|
15
|
+
initRefreshTimeout(): void;
|
|
16
|
+
static create(client: Client, clientId: string, clientSecret: string, data: any): Promise<FortniteClientCredentialsAuthSession>;
|
|
17
|
+
}
|
|
18
|
+
export default FortniteClientCredentialsAuthSession;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const AuthSession_1 = tslib_1.__importDefault(require("./AuthSession"));
|
|
5
|
+
const enums_1 = require("../../resources/enums");
|
|
6
|
+
const Endpoints_1 = tslib_1.__importDefault(require("../../resources/Endpoints"));
|
|
7
|
+
class FortniteClientCredentialsAuthSession extends AuthSession_1.default {
|
|
8
|
+
constructor(client, data, clientSecret) {
|
|
9
|
+
super(client, data, clientSecret, enums_1.AuthSessionType.FortniteClientCredentials);
|
|
10
|
+
this.clientsService = data.client_service;
|
|
11
|
+
this.isInternalClient = data.internal_client;
|
|
12
|
+
this.productId = data.product_id;
|
|
13
|
+
this.applicationId = data.application_id;
|
|
14
|
+
}
|
|
15
|
+
async verify(forceVerify = false) {
|
|
16
|
+
if (!forceVerify && this.isExpired) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
await this.client.http.epicgamesRequest({
|
|
21
|
+
url: Endpoints_1.default.OAUTH_TOKEN_VERIFY,
|
|
22
|
+
headers: {
|
|
23
|
+
Authorization: `bearer ${this.accessToken}`,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async revoke() {
|
|
33
|
+
clearTimeout(this.refreshTimeout);
|
|
34
|
+
this.refreshTimeout = undefined;
|
|
35
|
+
await this.client.http.epicgamesRequest({
|
|
36
|
+
method: 'DELETE',
|
|
37
|
+
url: `${Endpoints_1.default.OAUTH_TOKEN_KILL}/${this.accessToken}`,
|
|
38
|
+
headers: {
|
|
39
|
+
Authorization: `bearer ${this.accessToken}`,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
async refresh() {
|
|
44
|
+
this.refreshLock.lock();
|
|
45
|
+
try {
|
|
46
|
+
clearTimeout(this.refreshTimeout);
|
|
47
|
+
this.refreshTimeout = undefined;
|
|
48
|
+
const response = await this.client.http.epicgamesRequest({
|
|
49
|
+
method: 'POST',
|
|
50
|
+
url: Endpoints_1.default.OAUTH_TOKEN_CREATE,
|
|
51
|
+
headers: {
|
|
52
|
+
Authorization: `basic ${Buffer.from(`${this.clientId}:${this.clientSecret}`).toString('base64')}`,
|
|
53
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
54
|
+
},
|
|
55
|
+
data: new URLSearchParams({
|
|
56
|
+
grant_type: 'client_credentials',
|
|
57
|
+
token_type: 'eg1',
|
|
58
|
+
}).toString(),
|
|
59
|
+
});
|
|
60
|
+
this.accessToken = response.access_token;
|
|
61
|
+
this.expiresAt = new Date(response.expires_at);
|
|
62
|
+
this.initRefreshTimeout();
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
this.refreshLock.unlock();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
initRefreshTimeout() {
|
|
69
|
+
clearTimeout(this.refreshTimeout);
|
|
70
|
+
this.refreshTimeout = setTimeout(() => this.refresh(), this.expiresAt.getTime() - Date.now() - 15 * 60 * 1000);
|
|
71
|
+
}
|
|
72
|
+
static async create(client, clientId, clientSecret, data) {
|
|
73
|
+
const response = await client.http.epicgamesRequest({
|
|
74
|
+
method: 'POST',
|
|
75
|
+
url: Endpoints_1.default.OAUTH_TOKEN_CREATE,
|
|
76
|
+
headers: {
|
|
77
|
+
Authorization: `basic ${Buffer.from(`${clientId}:${clientSecret}`).toString('base64')}`,
|
|
78
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
79
|
+
},
|
|
80
|
+
data: new URLSearchParams(data).toString(),
|
|
81
|
+
});
|
|
82
|
+
const session = new FortniteClientCredentialsAuthSession(client, response, clientSecret);
|
|
83
|
+
session.initRefreshTimeout();
|
|
84
|
+
return session;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.default = FortniteClientCredentialsAuthSession;
|
|
88
|
+
//# sourceMappingURL=FortniteClientCredentialsAuthSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FortniteClientCredentialsAuthSession.js","sourceRoot":"","sources":["../../../src/auth/FortniteClientCredentialsAuthSession.ts"],"names":[],"mappings":";;;AAAA,wEAA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AAE,GAAG,IAAI,CAAC,CAAC;IACjH,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,QAAgB,EAAE,YAAoB,EAAE,IAAS;QAC1F,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAoC;YACrF,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,mBAAS,CAAC,kBAAkB;YACjC,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;gBACvF,cAAc,EAAE,mCAAmC;aACpD;YACD,IAAI,EAAE,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;SAC3C,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,IAAI,oCAAoC,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;QACzF,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAE7B,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAED,kBAAe,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import AuthSession from './AuthSession';
|
|
2
|
+
import { AuthSessionType } from '../../resources/enums';
|
|
3
|
+
import type Client from '../Client';
|
|
4
|
+
import type { LauncherAuthData } from '../../resources/structs';
|
|
5
|
+
declare class LauncherAuthSession extends AuthSession<AuthSessionType.Launcher> {
|
|
6
|
+
app: string;
|
|
7
|
+
clientsService: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
isInternalClient: boolean;
|
|
10
|
+
inAppId: string;
|
|
11
|
+
scope: string[];
|
|
12
|
+
refreshToken: string;
|
|
13
|
+
refreshTokenExpiresAt: Date;
|
|
14
|
+
refreshTimeout?: any;
|
|
15
|
+
constructor(client: Client, data: LauncherAuthData, clientSecret: string);
|
|
16
|
+
verify(forceVerify?: boolean): Promise<boolean>;
|
|
17
|
+
createExchangeCode(): Promise<string>;
|
|
18
|
+
revoke(): Promise<void>;
|
|
19
|
+
refresh(): Promise<void>;
|
|
20
|
+
initRefreshTimeout(): void;
|
|
21
|
+
static create(client: Client, clientId: string, clientSecret: string, data: any): Promise<LauncherAuthSession>;
|
|
22
|
+
}
|
|
23
|
+
export default LauncherAuthSession;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const AuthSession_1 = tslib_1.__importDefault(require("./AuthSession"));
|
|
5
|
+
const enums_1 = require("../../resources/enums");
|
|
6
|
+
const Endpoints_1 = tslib_1.__importDefault(require("../../resources/Endpoints"));
|
|
7
|
+
class LauncherAuthSession extends AuthSession_1.default {
|
|
8
|
+
constructor(client, data, clientSecret) {
|
|
9
|
+
super(client, data, clientSecret, enums_1.AuthSessionType.Launcher);
|
|
10
|
+
this.app = data.app;
|
|
11
|
+
this.clientsService = data.client_service;
|
|
12
|
+
this.displayName = data.displayName;
|
|
13
|
+
this.isInternalClient = data.internal_client;
|
|
14
|
+
this.inAppId = data.in_app_id;
|
|
15
|
+
this.scope = data.scope;
|
|
16
|
+
this.refreshToken = data.refresh_token;
|
|
17
|
+
this.refreshTokenExpiresAt = new Date(data.refresh_expires_at);
|
|
18
|
+
}
|
|
19
|
+
async verify(forceVerify = false) {
|
|
20
|
+
if (!forceVerify && this.isExpired) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
await this.client.http.epicgamesRequest({
|
|
25
|
+
url: Endpoints_1.default.OAUTH_TOKEN_VERIFY,
|
|
26
|
+
headers: {
|
|
27
|
+
Authorization: `bearer ${this.accessToken}`,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async createExchangeCode() {
|
|
37
|
+
const response = await this.client.http.epicgamesRequest({
|
|
38
|
+
url: Endpoints_1.default.OAUTH_EXCHANGE,
|
|
39
|
+
headers: {
|
|
40
|
+
Authorization: `bearer ${this.accessToken}`,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return response.code;
|
|
44
|
+
}
|
|
45
|
+
async revoke() {
|
|
46
|
+
clearTimeout(this.refreshTimeout);
|
|
47
|
+
this.refreshTimeout = undefined;
|
|
48
|
+
await this.client.http.epicgamesRequest({
|
|
49
|
+
method: 'DELETE',
|
|
50
|
+
url: `${Endpoints_1.default.OAUTH_TOKEN_KILL}/${this.accessToken}`,
|
|
51
|
+
headers: {
|
|
52
|
+
Authorization: `bearer ${this.accessToken}`,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
async refresh() {
|
|
57
|
+
this.refreshLock.lock();
|
|
58
|
+
try {
|
|
59
|
+
clearTimeout(this.refreshTimeout);
|
|
60
|
+
this.refreshTimeout = undefined;
|
|
61
|
+
const response = await this.client.http.epicgamesRequest({
|
|
62
|
+
method: 'POST',
|
|
63
|
+
url: Endpoints_1.default.OAUTH_TOKEN_CREATE,
|
|
64
|
+
headers: {
|
|
65
|
+
Authorization: `basic ${Buffer.from(`${this.clientId}:${this.clientSecret}`).toString('base64')}`,
|
|
66
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
67
|
+
},
|
|
68
|
+
data: new URLSearchParams({
|
|
69
|
+
grant_type: 'refresh_token',
|
|
70
|
+
refresh_token: this.refreshToken,
|
|
71
|
+
token_type: 'eg1',
|
|
72
|
+
}).toString(),
|
|
73
|
+
});
|
|
74
|
+
this.accessToken = response.access_token;
|
|
75
|
+
this.expiresAt = new Date(response.expires_at);
|
|
76
|
+
this.refreshToken = response.refresh_token;
|
|
77
|
+
this.refreshTokenExpiresAt = new Date(response.refresh_expires_at);
|
|
78
|
+
this.client.emit('refreshtoken:created', {
|
|
79
|
+
accountId: this.accountId,
|
|
80
|
+
clientId: this.clientId,
|
|
81
|
+
displayName: this.displayName,
|
|
82
|
+
expiresAt: this.refreshTokenExpiresAt.toISOString(),
|
|
83
|
+
expiresIn: this.refreshTokenExpiresAt.getTime() - Date.now(),
|
|
84
|
+
token: this.refreshToken,
|
|
85
|
+
});
|
|
86
|
+
this.initRefreshTimeout();
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
this.refreshLock.unlock();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
initRefreshTimeout() {
|
|
93
|
+
clearTimeout(this.refreshTimeout);
|
|
94
|
+
this.refreshTimeout = setTimeout(() => this.refresh(), this.expiresAt.getTime() - Date.now() - 15 * 60 * 1000);
|
|
95
|
+
}
|
|
96
|
+
static async create(client, clientId, clientSecret, data) {
|
|
97
|
+
const response = await client.http.epicgamesRequest({
|
|
98
|
+
method: 'POST',
|
|
99
|
+
url: Endpoints_1.default.OAUTH_TOKEN_CREATE,
|
|
100
|
+
headers: {
|
|
101
|
+
Authorization: `basic ${Buffer.from(`${clientId}:${clientSecret}`).toString('base64')}`,
|
|
102
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
103
|
+
},
|
|
104
|
+
data: new URLSearchParams(data).toString(),
|
|
105
|
+
});
|
|
106
|
+
const session = new LauncherAuthSession(client, response, clientSecret);
|
|
107
|
+
session.initRefreshTimeout();
|
|
108
|
+
client.emit('refreshtoken:created', {
|
|
109
|
+
accountId: session.accountId,
|
|
110
|
+
clientId: session.clientId,
|
|
111
|
+
displayName: session.displayName,
|
|
112
|
+
expiresAt: session.refreshTokenExpiresAt.toISOString(),
|
|
113
|
+
expiresIn: Math.round((session.refreshTokenExpiresAt.getTime() - Date.now()) / 1000),
|
|
114
|
+
token: session.refreshToken,
|
|
115
|
+
});
|
|
116
|
+
return session;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.default = LauncherAuthSession;
|
|
120
|
+
//# sourceMappingURL=LauncherAuthSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LauncherAuthSession.js","sourceRoot":"","sources":["../../../src/auth/LauncherAuthSession.ts"],"names":[],"mappings":";;;AAAA,wEAAwC;AACxC,iDAAwD;AACxD,kFAAkD;AAIlD,MAAM,mBAAoB,SAAQ,qBAAqC;IAUrE,YAAY,MAAc,EAAE,IAAsB,EAAE,YAAoB;QACtE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,uBAAe,CAAC,QAAQ,CAAC,CAAC;QAE5D,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,eAAe,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC;QACvC,IAAI,CAAC,qBAAqB,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACjE,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,KAAK;QACrC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC;gBACtC,GAAG,EAAE,mBAAS,CAAC,kBAAkB;gBACjC,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;iBAC5C;aACF,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,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* Represents an error that is thrown when an authentication does not exist in the client's session store
|
|
4
|
+
*/
|
|
5
|
+
declare class AuthenticationMissingError extends Error {
|
|
6
|
+
/**
|
|
7
|
+
* The authentication type that does not exist
|
|
8
|
+
*/
|
|
9
|
+
type: AuthSessionStoreKey;
|
|
10
|
+
/**
|
|
11
|
+
* @param type The authentication type that does not exist
|
|
12
|
+
*/
|
|
13
|
+
constructor(type: AuthSessionStoreKey);
|
|
14
|
+
}
|
|
15
|
+
export default AuthenticationMissingError;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Represents an error that is thrown when an authentication does not exist in the client's session store
|
|
5
|
+
*/
|
|
6
|
+
class AuthenticationMissingError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* @param type The authentication type that does not exist
|
|
9
|
+
*/
|
|
10
|
+
constructor(type) {
|
|
11
|
+
super();
|
|
12
|
+
this.name = 'AuthenticationMissingError';
|
|
13
|
+
this.message = `The authentication "${type}" does not exist in the client's session store`;
|
|
14
|
+
this.type = type;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = AuthenticationMissingError;
|
|
18
|
+
//# sourceMappingURL=AuthenticationMissingError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthenticationMissingError.js","sourceRoot":"","sources":["../../../src/exceptions/AuthenticationMissingError.ts"],"names":[],"mappings":";;AAEA;;GAEG;AACH,MAAM,0BAA2B,SAAQ,KAAK;IAM5C;;OAEG;IACH,YAAY,IAAyB;QACnC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,uBAAuB,IAAI,gDAAgD,CAAC;QAE3F,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,kBAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represets an error thrown because a creative island does not exist
|
|
3
|
+
*/
|
|
4
|
+
declare class CreativeIslandNotFoundError extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* The query which resulted in this error
|
|
7
|
+
*/
|
|
8
|
+
query: string;
|
|
9
|
+
/**
|
|
10
|
+
* @param query The query which resulted in this error
|
|
11
|
+
*/
|
|
12
|
+
constructor(query: string);
|
|
13
|
+
}
|
|
14
|
+
export default CreativeIslandNotFoundError;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Represets an error thrown because a creative island does not exist
|
|
5
|
+
*/
|
|
6
|
+
class CreativeIslandNotFoundError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* @param query The query which resulted in this error
|
|
9
|
+
*/
|
|
10
|
+
constructor(query) {
|
|
11
|
+
super();
|
|
12
|
+
this.name = 'CreativeIslandNotFoundError';
|
|
13
|
+
this.message = `A creative island with the code "${query}" does not exist`;
|
|
14
|
+
this.query = query;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = CreativeIslandNotFoundError;
|
|
18
|
+
//# sourceMappingURL=CreativeIslandNotFoundError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreativeIslandNotFoundError.js","sourceRoot":"","sources":["../../../src/exceptions/CreativeIslandNotFoundError.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,MAAM,2BAA4B,SAAQ,KAAK;IAM7C;;OAEG;IACH,YAAY,KAAa;QACvB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,oCAAoC,KAAK,kBAAkB,CAAC;QAE3E,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAED,kBAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represets an error thrown because a creator code does not exist
|
|
3
|
+
*/
|
|
4
|
+
declare class CreatorCodeNotFoundError extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* The query which resulted in this error
|
|
7
|
+
*/
|
|
8
|
+
query: string;
|
|
9
|
+
/**
|
|
10
|
+
* @param query The query which resulted in this error
|
|
11
|
+
*/
|
|
12
|
+
constructor(query: string);
|
|
13
|
+
}
|
|
14
|
+
export default CreatorCodeNotFoundError;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Represets an error thrown because a creator code does not exist
|
|
5
|
+
*/
|
|
6
|
+
class CreatorCodeNotFoundError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* @param query The query which resulted in this error
|
|
9
|
+
*/
|
|
10
|
+
constructor(query) {
|
|
11
|
+
super();
|
|
12
|
+
this.name = 'CreatorCodeNotFoundError';
|
|
13
|
+
this.message = `The Support-A-Creator code "${query}" does not exist`;
|
|
14
|
+
this.query = query;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = CreatorCodeNotFoundError;
|
|
18
|
+
//# sourceMappingURL=CreatorCodeNotFoundError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreatorCodeNotFoundError.js","sourceRoot":"","sources":["../../../src/exceptions/CreatorCodeNotFoundError.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,MAAM,wBAAyB,SAAQ,KAAK;IAM1C;;OAEG;IACH,YAAY,KAAa;QACvB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,+BAA+B,KAAK,kBAAkB,CAAC;QAEtE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAED,kBAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represets an error thrown because a friendship already exists
|
|
3
|
+
*/
|
|
4
|
+
declare class DuplicateFriendshipError extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* The query which resulted in this error
|
|
7
|
+
*/
|
|
8
|
+
query: string;
|
|
9
|
+
/**
|
|
10
|
+
* @param query The query which resulted in this error
|
|
11
|
+
*/
|
|
12
|
+
constructor(query: string);
|
|
13
|
+
}
|
|
14
|
+
export default DuplicateFriendshipError;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Represets an error thrown because a friendship already exists
|
|
5
|
+
*/
|
|
6
|
+
class DuplicateFriendshipError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* @param query The query which resulted in this error
|
|
9
|
+
*/
|
|
10
|
+
constructor(query) {
|
|
11
|
+
super();
|
|
12
|
+
this.name = 'DuplicateFriendshipError';
|
|
13
|
+
this.message = `The user "${query}" is already friends with the client`;
|
|
14
|
+
this.query = query;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = DuplicateFriendshipError;
|
|
18
|
+
//# sourceMappingURL=DuplicateFriendshipError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DuplicateFriendshipError.js","sourceRoot":"","sources":["../../../src/exceptions/DuplicateFriendshipError.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,MAAM,wBAAyB,SAAQ,KAAK;IAM1C;;OAEG;IACH,YAAY,KAAa;QACvB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,aAAa,KAAK,sCAAsC,CAAC;QAExE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAED,kBAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import type { EpicgamesAPIErrorData } from '../../resources/httpResponses';
|
|
3
|
+
/**
|
|
4
|
+
* Represets an HTTP error from the Epicgames API
|
|
5
|
+
*/
|
|
6
|
+
declare class EpicgamesAPIError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* The HTTP method
|
|
9
|
+
*/
|
|
10
|
+
method: string;
|
|
11
|
+
/**
|
|
12
|
+
* The URL of the requested API endpoint
|
|
13
|
+
*/
|
|
14
|
+
url: string;
|
|
15
|
+
/**
|
|
16
|
+
* The Epicgames error code (Starts with "errors.com.epicgames")
|
|
17
|
+
*/
|
|
18
|
+
code: string;
|
|
19
|
+
/**
|
|
20
|
+
* The Epicgames numeric error code (defaults to null)
|
|
21
|
+
*/
|
|
22
|
+
numericCode: number | null;
|
|
23
|
+
/**
|
|
24
|
+
* The HTTP status code
|
|
25
|
+
*/
|
|
26
|
+
httpStatus: number;
|
|
27
|
+
/**
|
|
28
|
+
* The request data sent by the client
|
|
29
|
+
*/
|
|
30
|
+
requestData?: any;
|
|
31
|
+
/**
|
|
32
|
+
* The variables contained in {@link EpicgamesAPIError#message}
|
|
33
|
+
*/
|
|
34
|
+
messageVars: string[];
|
|
35
|
+
/**
|
|
36
|
+
* @param error The raw Epicgames API error data
|
|
37
|
+
* @param request The client's request
|
|
38
|
+
* @param status The response's HTTP status
|
|
39
|
+
*/
|
|
40
|
+
constructor(error: EpicgamesAPIErrorData, request: AxiosRequestConfig, status: number);
|
|
41
|
+
}
|
|
42
|
+
export default EpicgamesAPIError;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Represets an HTTP error from the Epicgames API
|
|
5
|
+
*/
|
|
6
|
+
class EpicgamesAPIError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* @param error The raw Epicgames API error data
|
|
9
|
+
* @param request The client's request
|
|
10
|
+
* @param status The response's HTTP status
|
|
11
|
+
*/
|
|
12
|
+
constructor(error, request, status) {
|
|
13
|
+
var _a;
|
|
14
|
+
super();
|
|
15
|
+
this.name = 'EpicgamesAPIError';
|
|
16
|
+
this.message = error.errorMessage;
|
|
17
|
+
this.method = ((_a = request.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) || 'GET';
|
|
18
|
+
this.url = request.url || '';
|
|
19
|
+
this.code = error.errorCode;
|
|
20
|
+
this.numericCode = typeof error.numericErrorCode === 'number' ? error.numericErrorCode : null;
|
|
21
|
+
this.messageVars = error.messageVars || [];
|
|
22
|
+
this.httpStatus = status;
|
|
23
|
+
this.requestData = request.data;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = EpicgamesAPIError;
|
|
27
|
+
//# sourceMappingURL=EpicgamesAPIError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EpicgamesAPIError.js","sourceRoot":"","sources":["../../../src/exceptions/EpicgamesAPIError.ts"],"names":[],"mappings":";;AAGA;;GAEG;AACH,MAAM,iBAAkB,SAAQ,KAAK;IAoCnC;;;;OAIG;IACH,YAAY,KAA4B,EAAE,OAA2B,EAAE,MAAc;;QACnF,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC;QAElC,IAAI,CAAC,MAAM,GAAG,CAAA,MAAA,OAAO,CAAC,MAAM,0CAAE,WAAW,EAAE,KAAI,KAAK,CAAC;QACrD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,OAAO,KAAK,CAAC,gBAAgB,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9F,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAClC,CAAC;CACF;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represets an error thrown because an event timeout was exceeded
|
|
3
|
+
*/
|
|
4
|
+
declare class EventTimeoutError extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* The event which resulted in this error
|
|
7
|
+
*/
|
|
8
|
+
event: string;
|
|
9
|
+
/**
|
|
10
|
+
* The timeout in milliseconds
|
|
11
|
+
*/
|
|
12
|
+
timeout: number;
|
|
13
|
+
/**
|
|
14
|
+
* @param event The query which resulted in this error
|
|
15
|
+
* @param timeout The timeout in milliseconds
|
|
16
|
+
*/
|
|
17
|
+
constructor(event: string, timeout: number);
|
|
18
|
+
}
|
|
19
|
+
export default EventTimeoutError;
|