@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,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Represents an error that is thrown when the stomp websocket connection fails to be established
|
|
5
|
+
*/
|
|
6
|
+
class StompConnectionError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* @param error The error that caused the connection to fail
|
|
9
|
+
*/
|
|
10
|
+
constructor(message, statusCode) {
|
|
11
|
+
super();
|
|
12
|
+
this.name = 'StompConnectionError';
|
|
13
|
+
this.message = `Failed to connect to eos connect stomp: ${message} (status code ${statusCode})`;
|
|
14
|
+
this.statusCode = statusCode;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = StompConnectionError;
|
|
18
|
+
//# sourceMappingURL=StompConnectionError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StompConnectionError.js","sourceRoot":"","sources":["../../../src/exceptions/StompConnectionError.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,MAAM,oBAAqB,SAAQ,KAAK;IAMtC;;OAEG;IACH,YAAY,OAAe,EAAE,UAAkB;QAC7C,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,2CAA2C,OAAO,iBAAiB,UAAU,GAAG,CAAC;QAEhG,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AAED,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represets an error thrown because a user does not exist
|
|
3
|
+
*/
|
|
4
|
+
declare class UserNotFoundError 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 UserNotFoundError;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Represets an error thrown because a user does not exist
|
|
5
|
+
*/
|
|
6
|
+
class UserNotFoundError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* @param query The query which resulted in this error
|
|
9
|
+
*/
|
|
10
|
+
constructor(query) {
|
|
11
|
+
super();
|
|
12
|
+
this.name = 'UserNotFoundError';
|
|
13
|
+
this.message = `The user "${query}" does not exist`;
|
|
14
|
+
this.query = query;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = UserNotFoundError;
|
|
18
|
+
//# sourceMappingURL=UserNotFoundError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserNotFoundError.js","sourceRoot":"","sources":["../../../src/exceptions/UserNotFoundError.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,MAAM,iBAAkB,SAAQ,KAAK;IAMnC;;OAEG;IACH,YAAY,KAAa;QACvB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,aAAa,KAAK,kBAAkB,CAAC;QAEpD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StreamError } from 'stanza/protocol';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an error that is thrown when the XMPP connection fails to be established
|
|
4
|
+
*/
|
|
5
|
+
declare class XMPPConnectionError extends Error {
|
|
6
|
+
/**
|
|
7
|
+
* The error condition
|
|
8
|
+
*/
|
|
9
|
+
condition: string;
|
|
10
|
+
/**
|
|
11
|
+
* The (optional) error text
|
|
12
|
+
*/
|
|
13
|
+
text?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @param error The error that caused the connection to fail
|
|
16
|
+
*/
|
|
17
|
+
constructor(error: StreamError);
|
|
18
|
+
}
|
|
19
|
+
export default XMPPConnectionError;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Represents an error that is thrown when the XMPP connection fails to be established
|
|
5
|
+
*/
|
|
6
|
+
class XMPPConnectionError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* @param error The error that caused the connection to fail
|
|
9
|
+
*/
|
|
10
|
+
constructor(error) {
|
|
11
|
+
super();
|
|
12
|
+
this.name = 'XMPPConnectionError';
|
|
13
|
+
this.message = `The XMPP connection failed to be established: ${error.condition} - ${error.text}`;
|
|
14
|
+
this.condition = error.condition;
|
|
15
|
+
this.text = error.text;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = XMPPConnectionError;
|
|
19
|
+
//# sourceMappingURL=XMPPConnectionError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XMPPConnectionError.js","sourceRoot":"","sources":["../../../src/exceptions/XMPPConnectionError.ts"],"names":[],"mappings":";;AAEA;;GAEG;AACH,MAAM,mBAAoB,SAAQ,KAAK;IAWrC;;OAEG;IACH,YAAY,KAAkB;QAC5B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,iDAAiD,KAAK,CAAC,SAAS,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;QAElG,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;CACF;AAED,kBAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an error that is thrown when the XMPP connection timeout has been exceeded
|
|
3
|
+
*/
|
|
4
|
+
declare class XMPPConnectionTimeoutError extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* The timeout in milliseconds
|
|
7
|
+
*/
|
|
8
|
+
timeoutMs: number;
|
|
9
|
+
/**
|
|
10
|
+
* @param timeoutMs The timeout in milliseconds
|
|
11
|
+
*/
|
|
12
|
+
constructor(timeoutMs: number);
|
|
13
|
+
}
|
|
14
|
+
export default XMPPConnectionTimeoutError;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Represents an error that is thrown when the XMPP connection timeout has been exceeded
|
|
5
|
+
*/
|
|
6
|
+
class XMPPConnectionTimeoutError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* @param timeoutMs The timeout in milliseconds
|
|
9
|
+
*/
|
|
10
|
+
constructor(timeoutMs) {
|
|
11
|
+
super();
|
|
12
|
+
this.name = 'XMPPConnectionTimeoutError';
|
|
13
|
+
this.message = `The XMPP connection timeout of ${timeoutMs}ms has been exceeded`;
|
|
14
|
+
this.timeoutMs = timeoutMs;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = XMPPConnectionTimeoutError;
|
|
18
|
+
//# sourceMappingURL=XMPPConnectionTimeoutError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XMPPConnectionTimeoutError.js","sourceRoot":"","sources":["../../../src/exceptions/XMPPConnectionTimeoutError.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,MAAM,0BAA2B,SAAQ,KAAK;IAM5C;;OAEG;IACH,YAAY,SAAiB;QAC3B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,kCAAkC,SAAS,sBAAsB,CAAC;QAEjF,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF;AAED,kBAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Base from '../Base';
|
|
2
|
+
import type { AuthSessionStoreKey } from '../../resources/enums';
|
|
3
|
+
import type Client from '../Client';
|
|
4
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
5
|
+
interface RequestHeaders {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
type RequestConfig = Omit<AxiosRequestConfig, 'headers'> & {
|
|
9
|
+
headers?: RequestHeaders;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Represents the client's HTTP manager
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
declare class HTTP extends Base {
|
|
16
|
+
/**
|
|
17
|
+
* The axios instance
|
|
18
|
+
*/
|
|
19
|
+
private axios;
|
|
20
|
+
/**
|
|
21
|
+
* @param client The main client
|
|
22
|
+
*/
|
|
23
|
+
constructor(client: Client);
|
|
24
|
+
/**
|
|
25
|
+
* Sends an HTTP request
|
|
26
|
+
* @param config The request config
|
|
27
|
+
* @param auth The auth session to use
|
|
28
|
+
* @param retries How many times this request has been retried (5xx errors)
|
|
29
|
+
*/
|
|
30
|
+
request<T = any>(config: RequestConfig, retries?: number): Promise<T>;
|
|
31
|
+
/**
|
|
32
|
+
* Sends an HTTP request to the Fortnite API
|
|
33
|
+
* @param config The request config
|
|
34
|
+
* @param includeAuthentication Whether to include authentication
|
|
35
|
+
* @throws {EpicgamesAPIError}
|
|
36
|
+
* @throws {AxiosError}
|
|
37
|
+
*/
|
|
38
|
+
epicgamesRequest<T = any>(config: RequestConfig, auth?: AuthSessionStoreKey): Promise<T>;
|
|
39
|
+
}
|
|
40
|
+
export default HTTP;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const axios_1 = tslib_1.__importStar(require("axios"));
|
|
5
|
+
const Base_1 = tslib_1.__importDefault(require("../Base"));
|
|
6
|
+
const AuthenticationMissingError_1 = tslib_1.__importDefault(require("../exceptions/AuthenticationMissingError"));
|
|
7
|
+
const constants_1 = require("../../resources/constants");
|
|
8
|
+
const EpicgamesAPIError_1 = tslib_1.__importDefault(require("../exceptions/EpicgamesAPIError"));
|
|
9
|
+
/**
|
|
10
|
+
* Represents the client's HTTP manager
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
class HTTP extends Base_1.default {
|
|
14
|
+
/**
|
|
15
|
+
* @param client The main client
|
|
16
|
+
*/
|
|
17
|
+
constructor(client) {
|
|
18
|
+
super(client);
|
|
19
|
+
this.axios = axios_1.default.create({
|
|
20
|
+
...this.client.config.http,
|
|
21
|
+
headers: {
|
|
22
|
+
'Content-Type': null,
|
|
23
|
+
...this.client.config.http.headers,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
// Clear all default content type headers
|
|
27
|
+
Object.keys(this.axios.defaults.headers).forEach((h) => {
|
|
28
|
+
var _a;
|
|
29
|
+
(_a = this.axios.defaults.headers[h]) === null || _a === void 0 ? true : delete _a['Content-Type'];
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Sends an HTTP request
|
|
34
|
+
* @param config The request config
|
|
35
|
+
* @param auth The auth session to use
|
|
36
|
+
* @param retries How many times this request has been retried (5xx errors)
|
|
37
|
+
*/
|
|
38
|
+
async request(config, retries = 0) {
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
40
|
+
const reqStartTime = Date.now();
|
|
41
|
+
try {
|
|
42
|
+
const response = await this.axios.request({
|
|
43
|
+
...config,
|
|
44
|
+
headers: {
|
|
45
|
+
'Accept-Language': this.client.config.language,
|
|
46
|
+
...config.headers,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
const reqDuration = ((Date.now() - reqStartTime) / 1000);
|
|
50
|
+
this.client.debug(`${(_b = (_a = config.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== null && _b !== void 0 ? _b : 'GET'} ${config.url} (${reqDuration.toFixed(2)}s): `
|
|
51
|
+
+ `${response.status} ${response.statusText}`, 'http');
|
|
52
|
+
return response.data;
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
const reqDuration = ((Date.now() - reqStartTime) / 1000);
|
|
56
|
+
if (err instanceof axios_1.AxiosError) {
|
|
57
|
+
const errResponse = err.response;
|
|
58
|
+
const errResponseData = errResponse === null || errResponse === void 0 ? void 0 : errResponse.data;
|
|
59
|
+
this.client.debug(`${(_d = (_c = config.method) === null || _c === void 0 ? void 0 : _c.toUpperCase()) !== null && _d !== void 0 ? _d : 'GET'} ${config.url} (${reqDuration.toFixed(2)}s): `
|
|
60
|
+
+ `${errResponse === null || errResponse === void 0 ? void 0 : errResponse.status} ${errResponse === null || errResponse === void 0 ? void 0 : errResponse.statusText}`, 'http');
|
|
61
|
+
if ((errResponse === null || errResponse === void 0 ? void 0 : errResponse.status.toString().startsWith('5')) && retries < this.client.config.restRetryLimit) {
|
|
62
|
+
return this.request(config, retries + 1);
|
|
63
|
+
}
|
|
64
|
+
if (errResponse && (errResponse.status === 429 || (errResponseData === null || errResponseData === void 0 ? void 0 : errResponseData.errorCode) === 'errors.com.epicgames.common.throttled')) {
|
|
65
|
+
const retryString = errResponse.headers['retry-after']
|
|
66
|
+
|| ((_e = errResponseData === null || errResponseData === void 0 ? void 0 : errResponseData.messageVars) === null || _e === void 0 ? void 0 : _e[0])
|
|
67
|
+
|| ((_g = (_f = errResponseData === null || errResponseData === void 0 ? void 0 : errResponseData.errorMessage) === null || _f === void 0 ? void 0 : _f.match(/(?<=in )\d+(?= second)/)) === null || _g === void 0 ? void 0 : _g[0]);
|
|
68
|
+
const retryAfter = parseInt(retryString, 10);
|
|
69
|
+
if (!Number.isNaN(retryAfter)) {
|
|
70
|
+
const sleepTimeout = (retryAfter * 1000) + 500;
|
|
71
|
+
await new Promise((res) => setTimeout(res, sleepTimeout));
|
|
72
|
+
return this.request(config, retries);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
this.client.debug(`${(_j = (_h = config.method) === null || _h === void 0 ? void 0 : _h.toUpperCase()) !== null && _j !== void 0 ? _j : 'GET'} ${config.url} `
|
|
78
|
+
+ `(${reqDuration.toFixed(2)}s): ${err.name} - ${err.message}`, 'http');
|
|
79
|
+
}
|
|
80
|
+
throw err;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Sends an HTTP request to the Fortnite API
|
|
85
|
+
* @param config The request config
|
|
86
|
+
* @param includeAuthentication Whether to include authentication
|
|
87
|
+
* @throws {EpicgamesAPIError}
|
|
88
|
+
* @throws {AxiosError}
|
|
89
|
+
*/
|
|
90
|
+
async epicgamesRequest(config, auth) {
|
|
91
|
+
var _a, _b, _c, _d;
|
|
92
|
+
if (auth) {
|
|
93
|
+
const authSession = this.client.auth.sessions.get(auth);
|
|
94
|
+
if (!authSession)
|
|
95
|
+
throw new AuthenticationMissingError_1.default(auth);
|
|
96
|
+
await authSession.refreshLock.wait();
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
return await this.request({
|
|
100
|
+
...config,
|
|
101
|
+
...auth && {
|
|
102
|
+
headers: {
|
|
103
|
+
...config.headers,
|
|
104
|
+
Authorization: `bearer ${this.client.auth.sessions.get(auth).accessToken}`,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
if (err instanceof axios_1.AxiosError) {
|
|
111
|
+
if (auth && constants_1.invalidTokenCodes.includes((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.errorCode)) {
|
|
112
|
+
await this.client.auth.sessions.get(auth).refresh();
|
|
113
|
+
return this.epicgamesRequest(config, auth);
|
|
114
|
+
}
|
|
115
|
+
if (typeof ((_d = (_c = err.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.errorCode) === 'string') {
|
|
116
|
+
throw new EpicgamesAPIError_1.default(err.response.data, config, err.response.status);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
throw err;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
exports.default = HTTP;
|
|
124
|
+
//# sourceMappingURL=HTTP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HTTP.js","sourceRoot":"","sources":["../../../src/http/HTTP.ts"],"names":[],"mappings":";;;AAAA,uDAA0C;AAC1C,2DAA2B;AAC3B,kHAAkF;AAClF,yDAA8D;AAC9D,gGAAgE;AAahE;;;GAGG;AACH,MAAM,IAAK,SAAQ,cAAI;IAMrB;;OAEG;IACH,YAAY,MAAc;QACxB,KAAK,CAAC,MAAM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* Represent's the client's chat manager (dm, party chat) via eos.
|
|
5
|
+
*/
|
|
6
|
+
declare class ChatManager extends Base {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the chat namespace, this is the eos deployment id
|
|
9
|
+
*/
|
|
10
|
+
get namespace(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Sends a private message to the specified user
|
|
13
|
+
* @param user the account id or displayname
|
|
14
|
+
* @param message the message object
|
|
15
|
+
* @returns the message id
|
|
16
|
+
*/
|
|
17
|
+
whisperUser(user: string, message: ChatMessagePayload): Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Sends a message in the specified conversation (party chat)
|
|
20
|
+
* @param conversationId the conversation id, usually `p-[PARTYID]`
|
|
21
|
+
* @param message the message object
|
|
22
|
+
* @param allowedRecipients the account ids, that should receive the message
|
|
23
|
+
* @returns the message id
|
|
24
|
+
*/
|
|
25
|
+
sendMessageInConversation(conversationId: string, message: ChatMessagePayload, allowedRecipients: string[]): Promise<string>;
|
|
26
|
+
}
|
|
27
|
+
export default ChatManager;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const Endpoints_1 = tslib_1.__importDefault(require("../../resources/Endpoints"));
|
|
6
|
+
const enums_1 = require("../../resources/enums");
|
|
7
|
+
const Base_1 = tslib_1.__importDefault(require("../Base"));
|
|
8
|
+
const UserNotFoundError_1 = tslib_1.__importDefault(require("../exceptions/UserNotFoundError"));
|
|
9
|
+
// private scope
|
|
10
|
+
const generateCustomCorrelationId = () => `EOS-${Date.now()}-${(0, crypto_1.randomUUID)()}`;
|
|
11
|
+
/**
|
|
12
|
+
* Represent's the client's chat manager (dm, party chat) via eos.
|
|
13
|
+
*/
|
|
14
|
+
class ChatManager extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Returns the chat namespace, this is the eos deployment id
|
|
17
|
+
*/
|
|
18
|
+
get namespace() {
|
|
19
|
+
return this.client.config.eosDeploymentId;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Sends a private message to the specified user
|
|
23
|
+
* @param user the account id or displayname
|
|
24
|
+
* @param message the message object
|
|
25
|
+
* @returns the message id
|
|
26
|
+
*/
|
|
27
|
+
async whisperUser(user, message) {
|
|
28
|
+
const accountId = await this.client.user.resolveId(user);
|
|
29
|
+
if (!accountId) {
|
|
30
|
+
throw new UserNotFoundError_1.default(user);
|
|
31
|
+
}
|
|
32
|
+
const correlationId = generateCustomCorrelationId();
|
|
33
|
+
await this.client.http.epicgamesRequest({
|
|
34
|
+
method: 'POST',
|
|
35
|
+
url: `${Endpoints_1.default.EOS_CHAT}/v1/public/${this.namespace}/whisper/${this.client.user.self.id}/${accountId}`,
|
|
36
|
+
headers: {
|
|
37
|
+
'Content-Type': 'application/json',
|
|
38
|
+
'X-Epic-Correlation-ID': correlationId,
|
|
39
|
+
},
|
|
40
|
+
data: {
|
|
41
|
+
message,
|
|
42
|
+
},
|
|
43
|
+
}, enums_1.AuthSessionStoreKey.FortniteEOS);
|
|
44
|
+
return correlationId;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Sends a message in the specified conversation (party chat)
|
|
48
|
+
* @param conversationId the conversation id, usually `p-[PARTYID]`
|
|
49
|
+
* @param message the message object
|
|
50
|
+
* @param allowedRecipients the account ids, that should receive the message
|
|
51
|
+
* @returns the message id
|
|
52
|
+
*/
|
|
53
|
+
async sendMessageInConversation(conversationId, message, allowedRecipients) {
|
|
54
|
+
const correlationId = generateCustomCorrelationId();
|
|
55
|
+
await this.client.http.epicgamesRequest({
|
|
56
|
+
method: 'POST',
|
|
57
|
+
url: `${Endpoints_1.default.EOS_CHAT}/v1/public/${this.namespace}/conversations/${conversationId}/messages?fromAccountId=${this.client.user.self.id}`,
|
|
58
|
+
headers: {
|
|
59
|
+
'Content-Type': 'application/json',
|
|
60
|
+
'X-Epic-Correlation-ID': correlationId,
|
|
61
|
+
},
|
|
62
|
+
data: {
|
|
63
|
+
allowedRecipients,
|
|
64
|
+
message,
|
|
65
|
+
},
|
|
66
|
+
}, enums_1.AuthSessionStoreKey.FortniteEOS);
|
|
67
|
+
return correlationId;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.default = ChatManager;
|
|
71
|
+
//# sourceMappingURL=ChatManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatManager.js","sourceRoot":"","sources":["../../../src/managers/ChatManager.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AACpC,kFAAkD;AAClD,iDAA4D;AAC5D,2DAA2B;AAC3B,gGAAgE;AAGhE,gBAAgB;AAChB,MAAM,2BAA2B,GAAG,GAAG,EAAE,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,IAAA,mBAAU,GAAE,EAAE,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAY,SAAQ,cAAI;IAC5B;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,WAAW,CAAC,IAAY,EAAE,OAA2B;QAChE,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAEzD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,2BAAiB,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;QAED,MAAM,aAAa,GAAG,2BAA2B,EAAE,CAAC;QAEpD,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC;YACtC,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,GAAG,mBAAS,CAAC,QAAQ,cAAc,IAAI,CAAC,SAAS,YAAY,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAK,CAAC,EAAE,IAAI,SAAS,EAAE;YAC1G,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,uBAAuB,EAAE,aAAa;aACvC;YACD,IAAI,EAAE;gBACJ,OAAO;aACR;SACF,EAAE,2BAAmB,CAAC,WAAW,CAAC,CAAC;QAEpC,OAAO,aAAa,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,yBAAyB,CAAC,cAAsB,EAAE,OAA2B,EAAE,iBAA2B;QACrH,MAAM,aAAa,GAAG,2BAA2B,EAAE,CAAC;QAEpD,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC;YACtC,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,GAAG,mBAAS,CAAC,QAAQ,cAAc,IAAI,CAAC,SAAS,kBAAkB,cAAc,2BAA2B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAK,CAAC,EAAE,EAAE;YAC5I,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,uBAAuB,EAAE,aAAa;aACvC;YACD,IAAI,EAAE;gBACJ,iBAAiB;gBACjB,OAAO;aACR;SACF,EAAE,2BAAmB,CAAC,WAAW,CAAC,CAAC;QAEpC,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Collection } from '@discordjs/collection';
|
|
2
|
+
import Friend from '../structures/friend/Friend';
|
|
3
|
+
import SentFriendMessage from '../structures/friend/SentFriendMessage';
|
|
4
|
+
import BasePendingFriend from '../structures/friend/BasePendingFriend';
|
|
5
|
+
import Base from '../Base';
|
|
6
|
+
import type Client from '../Client';
|
|
7
|
+
import type OutgoingPendingFriend from '../structures/friend/OutgoingPendingFriend';
|
|
8
|
+
import type IncomingPendingFriend from '../structures/friend/IncomingPendingFriend';
|
|
9
|
+
declare class FriendManager extends Base {
|
|
10
|
+
/**
|
|
11
|
+
* Friend list
|
|
12
|
+
*/
|
|
13
|
+
list: Collection<string, Friend>;
|
|
14
|
+
/**
|
|
15
|
+
* Pending friend requests (incoming or outgoing)
|
|
16
|
+
*/
|
|
17
|
+
pendingList: Collection<string, IncomingPendingFriend | OutgoingPendingFriend>;
|
|
18
|
+
constructor(constr: Client);
|
|
19
|
+
resolve(friend: string | Friend): Friend | undefined;
|
|
20
|
+
resolvePending(pendingFriend: string | BasePendingFriend): IncomingPendingFriend | OutgoingPendingFriend | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Sends a friendship request to a user or accepts an existing request
|
|
23
|
+
* @param friend The id or display name of the user to add
|
|
24
|
+
* @throws {UserNotFoundError} The user wasn't found
|
|
25
|
+
* @throws {DuplicateFriendshipError} The user is already friends with the client
|
|
26
|
+
* @throws {FriendshipRequestAlreadySentError} A friendship request has already been sent to the user
|
|
27
|
+
* @throws {InviterFriendshipsLimitExceededError} The client's friendship limit is reached
|
|
28
|
+
* @throws {InviteeFriendshipsLimitExceededError} The user's friendship limit is reached
|
|
29
|
+
* @throws {InviteeFriendshipSettingsError} The user disabled friend requests
|
|
30
|
+
* @throws {InviteeFriendshipRequestLimitExceededError} The user's incoming friend request limit is reached
|
|
31
|
+
* @throws {EpicgamesAPIError}
|
|
32
|
+
*/
|
|
33
|
+
add(friend: string): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Removes a friend from the client's friend list or declines / aborts a pending friendship request
|
|
36
|
+
* @param friend The id or display name of the friend
|
|
37
|
+
* @throws {FriendNotFoundError} The user does not exist or is not friends with the client
|
|
38
|
+
* @throws {EpicgamesAPIError}
|
|
39
|
+
*/
|
|
40
|
+
remove(friend: string): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Fetches the friends the client shares with a friend
|
|
43
|
+
* @param friend The id or display name of the friend
|
|
44
|
+
* @throws {FriendNotFoundError} The user does not exist or is not friends with the client
|
|
45
|
+
* @throws {EpicgamesAPIError}
|
|
46
|
+
*/
|
|
47
|
+
getMutual(friend: string): Promise<Friend[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Checks whether a friend owns a specific offer
|
|
50
|
+
* @param friend The id or display name of the friend
|
|
51
|
+
* @param offerId The offer id
|
|
52
|
+
* @throws {OfferNotFoundError} The offer does not exist or is not in the current storefront catalog
|
|
53
|
+
* @throws {FriendNotFoundError} The user does not exist or is not friends with the client
|
|
54
|
+
* @throws {EpicgamesAPIError}
|
|
55
|
+
*/
|
|
56
|
+
checkOfferOwnership(friend: string, offerId: string): Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Sends a message to a friend
|
|
59
|
+
* @param friend The id or display name of the friend
|
|
60
|
+
* @param content The message that will be sent
|
|
61
|
+
* @throws {FriendNotFoundError} The user does not exist or is not friends with the client
|
|
62
|
+
* @throws {SendMessageError} The messant could not be sent
|
|
63
|
+
*/
|
|
64
|
+
sendMessage(friend: string, content: string): Promise<SentFriendMessage>;
|
|
65
|
+
}
|
|
66
|
+
export default FriendManager;
|