import type { Collection } from '@discordjs/collection'; import type { AxiosError, AxiosResponse, RawAxiosRequestConfig } from 'axios'; import type { PathLike } from 'fs'; import type defaultPartyMeta from './defaultPartyMeta.json'; import type defaultPartyMemberMeta from './defaultPartyMemberMeta'; import type EpicgamesAPIError from '../src/exceptions/EpicgamesAPIError'; import type BlockedUser from '../src/structures/user/BlockedUser'; import type ClientParty from '../src/structures/party/ClientParty'; import type ClientPartyMember from '../src/structures/party/ClientPartyMember'; import type ClientUser from '../src/structures/user/ClientUser'; import type Friend from '../src/structures/friend/Friend'; import type FriendPresence from '../src/structures/friend/FriendPresence'; import type IncomingPendingFriend from '../src/structures/friend/IncomingPendingFriend'; import type OutgoingPendingFriend from '../src/structures/friend/OutgoingPendingFriend'; import type ReceivedPartyJoinRequest from '../src/structures/party/ReceivedPartyJoinRequest'; import type PartyMember from '../src/structures/party/PartyMember'; import type PartyMemberConfirmation from '../src/structures/party/PartyMemberConfirmation'; import type PartyMessage from '../src/structures/party/PartyMessage'; import type ReceivedPartyInvitation from '../src/structures/party/ReceivedPartyInvitation'; import type User from '../src/structures/user/User'; import type { EpicgamesOAuthData, STWMissionAlertData, STWMissionData, STWProfileLockerSlotData, STWTheaterData, TournamentWindowTemplateData } from './httpResponses'; import type ReceivedFriendMessage from '../src/structures/friend/ReceivedFriendMessage'; import type STWSurvivor from '../src/structures/stw/STWSurvivor'; import type { AuthSessionStoreKey } from './enums'; import type FortniteAuthSession from '../src/auth/FortniteAuthSession'; import type LauncherAuthSession from '../src/auth/LauncherAuthSession'; import type FortniteClientCredentialsAuthSession from '../src/auth/FortniteClientCredentialsAuthSession'; import type EOSAuthSession from '../src/auth/EOSAuthSession'; export type FortnitePartyMemberSchema = Partial; export type FortnitePartySchema = Partial & { 'Default:LeaderData_j'?: string; 'urn:epic:cfg:presence-perm_s'?: string; 'urn:epic:cfg:accepting-members_b'?: string; 'urn:epic:cfg:invite-perm_s'?: string; 'urn:epic:cfg:not-accepting-members'?: string; 'urn:epic:cfg:not-accepting-members-reason_i'?: string; }; export type Schema = Record; export type Language = 'de' | 'ru' | 'ko' | 'zh-hant' | 'pt-br' | 'en' | 'it' | 'fr' | 'zh-cn' | 'es' | 'ar' | 'ja' | 'pl' | 'es-419' | 'tr'; export type StringFunction = () => string; export type StringFunctionAsync = () => Promise; export interface DeviceAuth { /** * The device auth's account ID */ accountId: string; /** * The device auth's device ID (that does not mean it can only be used on a single device) */ deviceId: string; /** * The device auth's secret */ secret: string; } export interface DeviceAuthWithSnakeCaseSupport extends DeviceAuth { /** * The device auth's account ID */ account_id?: string; /** * The device auth's device ID (that does not mean it can only be used on a single device) */ device_id?: string; } export type DeviceAuthFunction = () => DeviceAuth; export type DeviceAuthFunctionAsync = () => Promise; export type DeviceAuthResolveable = DeviceAuth | PathLike | DeviceAuthFunction | DeviceAuthFunctionAsync; export type AuthStringResolveable = string | PathLike | StringFunction | StringFunctionAsync; export type Platform = 'WIN' | 'MAC' | 'PSN' | 'XBL' | 'SWT' | 'SWT2' | 'IOS' | 'AND' | 'PS5' | 'XSX' | 'LUNA'; export type AuthClient = 'fortnitePCGameClient' | 'fortniteIOSGameClient' | 'fortniteAndroidGameClient' | 'fortniteSwitchGameClient' | 'fortniteCNGameClient' | 'launcherAppClient2' | 'Diesel - Dauntless'; export interface RefreshTokenData { /** * The refresh token */ token: string; /** * The refresh token's expiration time in seconds */ expiresIn: number; /** * The refresh token's expiration date */ expiresAt: string; /** * The ID of the account the refresh token belongs to */ accountId: string; /** * The display name of the account the refresh token belongs to */ displayName: string; /** * The refresh token's client ID (will always be the ID of launcherAppClient2) */ clientId: string; } export interface CacheSetting { /** * How long the data should stay in the cache until it is considered sweepable (in seconds, 0 for no cache, Infinity for infinite) */ maxLifetime: number; /** * How frequently to remove cached data that is older than the lifetime (in seconds, 0 for never) */ sweepInterval: number; } export interface CacheSettings { /** * The presence cache settings */ presences?: CacheSetting; /** * The user cache settings */ users?: CacheSetting; } export interface AuthOptions { /** * A device auth object, a function that returns a device auth object or a path to a file containing a device auth object */ deviceAuth?: DeviceAuthResolveable; /** * An exchange code, a function that returns an exchange code or a path to a file containing an exchange code */ exchangeCode?: AuthStringResolveable; /** * An authorization code, a function that returns an authorization code or a path to a file containing an authorization code */ authorizationCode?: AuthStringResolveable; /** * A refresh token, a function that returns a refresh token or a path to a file containing a refresh token */ refreshToken?: AuthStringResolveable; /** * A launcher refresh token, a function that returns a launcher refresh token or a path to a file containing a launcher refresh token */ launcherRefreshToken?: AuthStringResolveable; /** * Whether the client should check whether the EULA has been accepted. * Do not modify this unless you know what you're doing */ checkEULA?: boolean; /** * Whether the client should kill other active Fortnite auth sessions on startup */ killOtherTokens?: boolean; /** * Whether the client should create a launcher auth session and keep it alive. * The launcher auth session can be accessed via `client.auth.auths.get('launcher')` */ createLauncherSession?: boolean; /** * The Fortnite auth client (eg. 'fortnitePCGameClient' or 'fortniteAndroidGameClient') */ authClient?: AuthClient; } export interface FortnitePartyPrivacy { partyType: 'Public' | 'FriendsOnly' | 'Private'; inviteRestriction: 'AnyMember' | 'LeaderOnly'; onlyLeaderFriendsCanJoin: boolean; presencePermission: 'Anyone' | 'Leader' | 'Noone'; invitePermission: 'Anyone' | 'AnyMember' | 'Leader'; acceptingMembers: boolean; } export interface FortnitePartyOptions { joinConfirmation?: boolean; joinability?: 'OPEN' | 'INVITE_AND_FORMER'; discoverability?: 'ALL' | 'INVITED_ONLY'; privacy?: FortnitePartyPrivacy; maxSize?: number; intentionTtl?: number; inviteTtl?: number; chatEnabled?: boolean; } export interface FortnitePartyConfig { type: 'DEFAULT'; joinability: 'OPEN' | 'INVITE_AND_FORMER'; discoverability: 'ALL' | 'INVITED_ONLY'; subType: 'default'; maxSize: number; inviteTtl: number; intentionTtl: number; joinConfirmation: boolean; privacy: FortnitePartyPrivacy; } export type PresenceOnlineType = 'online' | 'away' | 'chat' | 'dnd' | 'xa' | 'offline'; export type StatsPlaylistType = 'other' | 'solo' | 'duo' | 'squad' | 'ltm'; export interface ClientConfig { /** * Whether the party member meta (outfit, emote, etc) should be saved so they are kept when joining a new party */ savePartyMemberMeta: boolean; /** * Additional axios request options */ http: RawAxiosRequestConfig; /** * Debug function used for general debugging purposes */ debug?: (message: string) => void; /** * Debug function used for http requests */ httpDebug?: (message: string) => void; /** * Debug function used for incoming and outgoing xmpp xml payloads */ xmppDebug?: (message: string) => void; /** * Debug function used for incoming and outgoing stomp eos connect messages */ stompDebug?: (message: string) => void; /** * Default friend presence of the bot (eg. "Playing Battle Royale") */ defaultStatus?: string; /** * Default online type of the bot (eg "away"). None for online */ defaultOnlineType: PresenceOnlineType; /** * Interval in milliseconds for refreshing the client's status. Set to 0 to disable it. * Defaults to 10 minutes. */ statusUpdateInterval: number; /** * The client's platform (WIN by default) */ platform: Platform; /** * The client's default party member meta (can be used to set a custom default skin, etc) */ defaultPartyMemberMeta: Schema; /** * Custom keep alive interval for the xmpp websocket connection. * You should lower this value if the client randomly reconnects */ xmppKeepAliveInterval: number; /** * The maximum number of XMPP reconnect attempts before logout (4 by default). */ xmppMaxConnectionRetries: number; /** * XMPP reconnect delays in milliseconds (defaults to [5000, 15000, 60000, 600000]). * Must be non-empty, with integer delays from 0 to 2147483647. Attempts beyond the array repeat its last delay. * The attempt limit is controlled separately by xmppMaxConnectionRetries. */ xmppConnectionRetryBackoff: number[]; /** * The maximum number of STOMP reconnect attempts before logout (4 by default). */ stompMaxConnectionRetries: number; /** * STOMP reconnect delays in milliseconds (defaults to [5000, 15000, 60000, 600000]). * Must be non-empty, with integer delays from 0 to 2147483647. Attempts beyond the array repeat its last delay. * The attempt limit is controlled separately by stompMaxConnectionRetries. */ stompConnectionRetryBackoff: number[]; /** * Settings that affect the way the client caches certain data */ cacheSettings: CacheSettings; /** * Client authentication options. By default the client will ask you for an authorization code */ auth: AuthOptions; /** * Default config used for creating parties */ partyConfig: FortnitePartyOptions; /** * Whether the client should create a party on startup */ createParty: boolean; /** * Whether a new party should be force created on start (even if the client is already member of a party) */ forceNewParty: boolean; /** * Whether to completely disable all party related functionality */ disablePartyService: boolean; /** * Whether the client should connect via XMPP. * NOTE: If you disable this, almost all features related to friend caching will no longer work. * Do not disable this unless you know what you're doing */ connectToXMPP: boolean; /** * Whether the client should connect to eos connect stomp * NOTE: If you disable this, receiving party or private messages will no longer work. * Do not disable this unless you know what you're doing */ connectToSTOMP: boolean; /** * Whether the client should fetch all friends on startup. * NOTE: If you disable this, almost all features related to friend caching will no longer work. * Do not disable this unless you know what you're doing */ fetchFriends: boolean; /** * Timeout (in ms) for how long a friend is considered online after the last presence was received. * Note: Usually the client will receive a presence when the friend goes offline, when that does not happen, this timeout will be used */ friendOfflineTimeout: number; /** * How many times to retry on HTTP 5xx errors */ restRetryLimit: number; /** * Whether the client should handle rate limits (429 status code responses) */ handleRatelimits: boolean; /** * The party build ID. When omitted, the current build ID is discovered once from Fortnite matchmaking. * Supplying a value disables discovery and preserves the value as provided. */ partyBuildId?: string; /** * Whether a confirmed invalid refresh token should trigger one fresh login for a ready client. * Defaults to false; enabling this can cause competing clients on the same account to restart each other. * Uses configured authentication credentials, which may fail if one-use credentials were already consumed. * Failed logins are not automatically retried. */ restartOnInvalidRefresh: boolean; /** * The default language for all http requests. * Will be overwritten by a method's language parameter */ language: Language; /** * Amount of time (in ms) to wait after the initial xmpp connection before emitting friend:online events */ friendOnlineConnectionTimeout: number; /** * A custom parser for resolving the stats playlist type (ie. "solo", "duo", "ltm"). * Can be useful if you want to use data in the game files to determine the stats playlist type */ statsPlaylistTypeParser?: (playlistId: string) => StatsPlaylistType; /** * Fortnite deployment id (eos) */ eosDeploymentId: string; /** * Amount of time (in ms) to wait for the XMPP connection to be established */ xmppConnectionTimeout: number; /** * Amount of time (in ms) to wait for the STOMP connection to be established */ stompConnectionTimeout: number; } export interface MatchMeta { location?: 'PreLobby' | 'InGame' | 'ReturningToFrontEnd'; hasPreloadedAthena?: boolean; isSpectatable?: boolean; playerCount?: number; matchStartedAt?: Date; } export interface ClientOptions extends Partial { } export interface ClientEvents { /** * Emitted when the client is ready */ ready: () => void; /** * Emitted when the client got shut down */ disconnected: () => void; /** * Emitted when a device auth got created * @param deviceAuth The device auth */ 'deviceauth:created': (deviceAuth: DeviceAuth) => void; /** * Emitted when a refresh token got created * @param refreshTokenData The refresh token data */ 'refreshtoken:created': (refreshTokenData: RefreshTokenData) => void; /** * Emitted when the client received a friend whisper message * @param message The received friend whipser message */ 'friend:message': (message: ReceivedFriendMessage) => void; /** * Emitted when the client recieved a friend presence * @param before The friend's previous presence * @param after The friend's current presence */ 'friend:presence': (before: FriendPresence | undefined, after: FriendPresence) => void; /** * Emitted when a friend becomes online * @param friend The friend that became online */ 'friend:online': (friend: Friend) => void; /** * Emitted when a friend goes offline * @param friend The friend that went offline */ 'friend:offline': (friend: Friend) => void; /** * Emitted when a member in the client's party sent a message in the party chat * @param message The received message */ 'party:member:message': (message: PartyMessage) => void; /** * Emitted when a user got added to the client's friend list * @param friend The new friend */ 'friend:added': (friend: Friend) => void; /** * Emitted when the client recieved a friendship request * @param pendingFriend The pending friend */ 'friend:request': (pendingFriend: IncomingPendingFriend) => void; /** * Emitted when the client sent a friendship request * @param pendingFriend The pending friend */ 'friend:request:sent': (pendingFriend: OutgoingPendingFriend) => void; /** * Emitted when the client aborted an outgoing friendship request or when someone aborted an incoming friendship request * @param pendingFriend The previously pending friend */ 'friend:request:aborted': (pendingFriend: IncomingPendingFriend | OutgoingPendingFriend) => void; /** * Emitted when the client declined an incoming friendship request or when someone declined an outgoing friendship request * @param pendingFriend The previously pending friend */ 'friend:request:declined': (pendingFriend: IncomingPendingFriend | OutgoingPendingFriend) => void; /** * Emitted when a user got removed from the client's friend list * @param friend The friend */ 'friend:removed': (friend: Friend) => void; /** * Emitted when a user got added to the client's block list * @param blockedUser The user that got blocked */ 'user:blocked': (blockedUser: BlockedUser) => void; /** * Emitted when a user got removed from the client's block list * @param blockedUser The user that got unblocked */ 'user:unblocked': (blockedUser: BlockedUser) => void; /** * Emitted for an incoming XMPP notification. * @param body The message body */ 'xmpp:message': (body: any) => void; /** * Emitted for an incoming STOMP notification. * @param body The message body */ 'stomp:message': (body: any) => void; /** * Emitted when an error occured while processing an incoming xmpp message * @param error The error that occurred */ 'xmpp:message:error': (error: Error) => void; /** * Emitted for an error that occured while processing an incoming STOMP message * @param error The error that occurred */ 'stomp:message:error': (error: Error) => void; /** * Emitted when the client sends an HTTP request * @param reqId The request ID * @param config The request config */ 'http:request': (reqId: string, config: RawAxiosRequestConfig) => void; /** * Emitted when the client receives an HTTP response * @param reqId The request ID * @param config The request config * @param response The * @param duration The duration of the request in milliseconds */ 'http:response': (reqId: string, config: RawAxiosRequestConfig, response: AxiosResponse, duration: number) => void; /** * Emitted when the client encounters an error. Specificaly when no HTTP response was received (eg. network error, timeout, etc) * @param reqId The request ID * @param config The request config * @param error The error that occurred * @param duration The duration of the request in milliseconds */ 'http:error': (reqId: string, config: RawAxiosRequestConfig, error: AxiosError, duration: number) => void; /** * Emitted when the client recieved a party invitation * @param invitation The received party invitation */ 'party:invite': (invitation: ReceivedPartyInvitation) => void; /** * Emitted when a party member joined the client party * @param member The member who joined the client's party */ 'party:member:joined': (member: PartyMember | ClientPartyMember) => void; /** * Emitted when a party member got updated * @param member The updated party member */ 'party:member:updated': (member: PartyMember | ClientPartyMember) => void; /** * Emitted when a party member left the party * @param member The party member */ 'party:member:left': (member: PartyMember) => void; /** * Emitted when a party member expired * @param member The party member */ 'party:member:expired': (member: PartyMember) => void; /** * Emitted when a party member gets kicked * @param member The party member */ 'party:member:kicked': (member: PartyMember) => void; /** * Emitted when a party member gets promoted * @param member The party member */ 'party:member:promoted': (member: PartyMember | ClientPartyMember) => void; /** * Emitted when the client's party gets updated * @param party The party which got updated */ 'party:updated': (party: ClientParty) => void; /** * Emitted when a party member requires confirmation * @param confirmation The pending party member confirmation */ 'party:member:confirmation': (confirmation: PartyMemberConfirmation) => void; /** * Emitted when a friend requests to join the bots party * @param request The recieved join request */ 'party:joinrequest': (request: ReceivedPartyJoinRequest) => void; /** * Emitted when a party member updated their outfit * @param member The member * @param value The new outfit * @param previousValue The previous outfit */ 'party:member:outfit:updated': (member: PartyMember | ClientPartyMember, value?: string, previousValue?: string) => void; /** * Emitted when a party member updated their emote * @param member The member * @param value The new emote * @param previousValue The previous emote */ 'party:member:emote:updated': (member: PartyMember | ClientPartyMember, value?: string, previousValue?: string) => void; /** * Emitted when a party member updated their backpack * @param member The member * @param value The new backpack * @param previousValue The previous backpack */ 'party:member:backpack:updated': (member: PartyMember | ClientPartyMember, value?: string, previousValue?: string) => void; /** * Emitted when a party member updated their pickaxe * @param member The member * @param value The new pickaxe * @param previousValue The previous pickaxe */ 'party:member:pickaxe:updated': (member: PartyMember | ClientPartyMember, value?: string, previousValue?: string) => void; /** * Emitted when a party member updated their readiness state * @param member The member * @param value The new readiness state * @param previousValue The previous readiness state */ 'party:member:readiness:updated': (member: PartyMember | ClientPartyMember, value?: boolean, previousValue?: boolean) => void; /** * Emitted when a party member updated their match state * @param member The member * @param value The new match state * @param previousValue The previous match state */ 'party:member:matchstate:updated': (member: PartyMember | ClientPartyMember, value?: MatchMeta, previousValue?: MatchMeta) => void; } export type AuthType = 'fortnite' | 'fortniteClientCredentials' | 'launcher'; export interface AuthResponse { response?: EpicgamesOAuthData; error?: EpicgamesAPIError | Error; } export interface ReauthResponse { response?: { success: boolean; }; error?: EpicgamesAPIError; } export interface FriendConnection { name?: string; } export interface FriendConnections { epic?: FriendConnection; psn?: FriendConnection; nintendo?: FriendConnection; } export interface PresenceGameplayStats { kills?: number; fellToDeath?: boolean; serverPlayerCount?: number; playersAlive?: number; } export type PendingFriendDirection = 'INCOMING' | 'OUTGOING'; export interface StatsPlaylistTypeData { score: number; scorePerMin: number; scorePerMatch: number; wins: number; top3: number; top5: number; top6: number; top10: number; top12: number; top25: number; kills: number; killsPerMin: number; killsPerMatch: number; deaths: number; kd: number; matches: number; winRate: number; minutesPlayed: number; playersOutlived: number; lastModified?: Date; } export interface StatsInputTypeData { overall: StatsPlaylistTypeData; solo: StatsPlaylistTypeData; duo: StatsPlaylistTypeData; squad: StatsPlaylistTypeData; ltm: StatsPlaylistTypeData; } export interface StatsData { all: StatsInputTypeData; keyboardmouse: StatsInputTypeData; gamepad: StatsInputTypeData; touch: StatsInputTypeData; } export interface NewsMOTD { entryType: string; image: string; tileImage: string; videoMute: boolean; hidden: boolean; tabTitleOverride: string; _type: string; title: string; body: string; offerAction: string; videoLoop: boolean; videoStreamingEnabled: boolean; sortingPriority: number; buttonTextOverride?: string; offerId?: string; id: string; videoAutoplay: boolean; videoFullscreen: boolean; spotlight: boolean; videoUID?: string; videoVideoString?: string; playlistId?: string; } export interface NewsMessageData { image: string; hidden: boolean; _type: string; adspace: string; title: string; body: string; spotlight: boolean; } export interface LightswitchLauncherInfo { appName: string; catalogItemId: string; namespace: string; } export interface LightswitchData { serviceInstanceId: string; status: string; message: string; maintenanceUri?: string; overrideCatalogIds: string[]; allowedActions: string[]; banned: boolean; launcherInfoDTO: LightswitchLauncherInfo; } export interface EpicgamesServerStatusData { page: { id: string; name: string; url: string; time_zone: string; updated_at: string; }; components: { id: string; name: string; status: string; created_at: Date; updated_at: Date; position: number; description?: any; showcase: boolean; start_date: string; group_id: string; page_id: string; group: boolean; only_show_if_degraded: boolean; components: string[]; }[]; incidents: any[]; scheduled_maintenances: any[]; status: { indicator: string; description: string; }; } export interface EpicgamesServerStatusIncidentUpdate { id: string; body: string; createdAt: Date; displayAt: Date; status: string; updatedAt: Date; } export interface MessageData { content: string; author: Friend | PartyMember | ClientPartyMember | ClientUser; id: string; sentAt?: Date; } export interface FriendMessageData extends MessageData { author: Friend | ClientUser; } export interface FortnitePartyMessageData extends MessageData { author: PartyMember | ClientPartyMember; party: ClientParty; } export interface PendingFriendData { accountId: string; created: string; favorite: boolean; displayName: string; } export interface ExternalAuth { accountId: string; type: string; externalAuthId: string; externalAuthIdType: string; externalDisplayName?: string; authIds: { id: string; type: string; }[]; } export interface ExternalAuths { github?: ExternalAuth; twitch?: ExternalAuth; steam?: ExternalAuth; psn?: ExternalAuth; xbl?: ExternalAuth; nintendo?: ExternalAuth; } export interface UserData { id: string; displayName?: string; externalAuths?: ExternalAuths; } export interface ClientUserData extends UserData { name: string; email: string; failedLoginAttempts: number; lastLogin: string; numberOfDisplayNameChanges: number; ageGroup: string; headless: boolean; country: string; lastName: string; phoneNumber: string; preferredLanguage: string; lastDisplayNameChange: string; canUpdateDisplayName: boolean; tfaEnabled: boolean; emailVerified: boolean; minorVerified: boolean; minorExpected: boolean; minorStatus: string; } export interface CreatorCodeData { slug: string; owner: User; status: 'ACTIVE' | 'DISABLED'; verified: boolean; } export interface FriendData extends UserData { created: string; favorite: boolean; displayName?: string; connections?: FriendConnections; mutual?: number; alias: string; note: string; } export interface FriendPresenceData { Status?: string; bIsPlaying?: boolean; bIsJoinable?: boolean; bHasVoiceSupport?: boolean; SessionId?: string; ProductName?: string; Properties?: { FortBasicInfo_j?: { homeBaseRating?: number; }; FortLFG_I?: string; FortPartySize_i?: number; FortSubGame_i?: number; InUnjoinableMatch_b?: boolean; FortGameplayStats_j?: { state: string; playlist: string; numKills: number; bFellToDeath: boolean; }; 'party.joininfodata.286331153_j'?: { bIsPrivate?: boolean; }; GamePlaylistName_s?: string; Event_PlayersAlive_s?: string; Event_PartySize_s?: string; Event_PartyMaxSize_s?: string; GameSessionJoinKey_s?: string; ServerPlayerCount_i?: string; }; } export interface FortnitePartyMemberData { id: string; account_id: string; account_dn?: string; meta: Schema; revision: number; updated_at: string; joined_at: string; } export interface FortnitePartyMemberJoinedData { type: 'com.epicgames.social.party.notification.v0.MEMBER_JOINED'; ns: 'Fortnite'; sent: string; party_id: string; account_id: string; account_dn?: string; revision: number; joined_at: string; updated_at: string; member_state_updated: Schema; connection?: { id: string; meta: Schema; connected_at: string; updated_at: string; yield_leadership?: boolean; }; } export interface FortnitePartyMemberUpdateData { account_id: string; account_dn?: string; revision: number; member_state_updated: Schema; member_state_removed: string[]; } export interface FortnitePartyData { id: string; created_at: string; updated_at: string; config: { type: string; joinability: string; discoverability: string; sub_type: string; max_size: number; invite_ttl: number; join_confirmation: boolean; intention_ttl: number; }; members: FortnitePartyMemberData[]; meta: FortnitePartySchema; invites: any[]; revision: number; } export interface EOSPartyDataConfig { joinability: 'OPEN' | 'INVITE_ONLY'; max_size: number; } export interface EOSPartyData { id: string; party_lead: string; created_at: string; updated_at: string; config: EOSPartyDataConfig; meta: Record; revision: number; chat_conversation_id: string; is_reportable: boolean; members?: EOSPartyMemberData[]; } export interface EOSPartyUpdateData { sent: string; party_id: string; party_lead: string; meta: Record; party_privacy_type: 'OPEN' | 'INVITE_ONLY'; max_number_of_members: number; chat_conversation_id: string; created_at: string; updated_at: string; is_reportable: boolean; revision: number; } export interface EOSPartyMemberData { account_id: string; meta: Record; revision: number; updated_at: string; joined_at: string; suspended: boolean; connections: { id: string; deployment_id: string; connected_at: string; updated_at: string; is_first_party: boolean; meta: Record; active_in_party_voice_room?: boolean; }[]; } export interface EOSPartyInviteData { party_id: string; inviter_id: string; inviter_dn: string; invitee_id: string; sent_at: string; sent: string; expires_at: string; updated_at: string; auto: boolean; platform: number; meta: Record; } export interface EOSPartyJoinRequestData { requester_id?: string; sent_by?: string; inviter_id?: string; account_id?: string; sent_at?: string; sent?: string; expires_at?: string; } export interface EOSPartyMemberUpdateData { party_id: string; account_id: string; account_dn: string; sent: string; revision: number; joined_at: string; updated_at: string; suspended?: boolean; member_state_overridden?: Record; connection?: { id: string; meta: Record; deployment_id: string; connected_at: string; updated_at: string; }; member_state_updated?: Schema; member_state_removed?: string[]; } export interface EOSPartyUserState { current?: EOSPartyData; invites?: EOSPartyInviteData[]; join_requests?: EOSPartyJoinRequestData[]; } export interface FortnitePartyUpdateData { type: 'com.epicgames.social.party.notification.v0.PARTY_UPDATED'; ns: 'Fortnite'; sent: string; party_id: string; captain_id: string; revision: number; party_state_updated: Schema; party_state_removed: string[]; party_state_overridden: Record; party_privacy_type: 'OPEN' | 'INVITE_AND_FORMER'; max_number_of_members: number; party_sub_type: 'default'; party_type: 'DEFAULT'; invite_ttl_seconds: number; intention_ttl_seconds: number; discoverability?: 'ALL' | 'INVITED_ONLY'; created_at: string; updated_at: string; } export interface Island { linkId?: { mnemonic?: string; version?: number; }; woldId?: { iD?: string; ownerId?: string; name?: string; }; sessionId?: string; joinInfo?: { islandJoinability?: string; bIsWorldJoinable?: boolean; sessionKey?: string; }; } export interface FortnitePartyMemberIsland { LinkId: string; MatchmakingSettingsV2?: Record; Session: { iD: string; joinInfo: { joinability: string; sessionKey: string; }; }; } export interface Cosmetics { outfit?: { id: string; variants?: CosmeticVariant[]; enlightment?: CosmeticEnlightment; }; backpack?: { id: string; variants?: CosmeticVariant[]; path?: string; }; pickaxe?: { id: string; variants?: CosmeticVariant[]; path?: string; }; shoes?: { id: string; path?: string; }; } export interface CosmeticVariant { channel: string; channelIndex: number; variant: string; variantIndex: number; } export interface CosmeticVariantMeta { i: string[]; } export interface CosmeticsVariantMeta { athenaCharacter?: CosmeticVariantMeta; athenaBackpack?: CosmeticVariantMeta; athenaPickaxe?: CosmeticVariantMeta; athenaSkyDiveContrail?: CosmeticVariantMeta; } export type CosmeticEnlightment = [number, number]; export interface BannerMeta { bannerIconId: string; bannerColorId: string; } export interface BattlePassMeta { bHasPurchasedPass: boolean; passLevel: number; } export interface AssistedChallengeMeta { questItemDef: string; objectivesCompleted: number; } export type Region = 'EU' | 'NAE' | 'NAW' | 'BR' | 'ME' | 'ASIA' | 'OCE'; export type FullPlatform = 'Windows' | 'Android' | 'PS4' | 'XboxOne' | 'XSX' | 'PS5' | 'Switch' | 'Windows' | 'Mac'; export type SentMessageType = 'PARTY' | 'FRIEND'; export interface TournamentColors { titleColor?: string; backgroundTextColor?: string; backgroundRightColor?: string; backgroundLeftColor?: string; shadowColor?: string; posterFadeColor?: string; baseColor?: string; highlightColor?: string; } export interface TournamentImages { squarePosterImage?: string; loadingScreenImage?: string; posterBackImage?: string; posterFrontImage?: string; playlistTileImage?: string; tournamentViewBackgroundImage?: string; } export interface TournamentTexts { pinEarnedText?: string; pinScoreRequirement?: number; scheduleInfo?: string; flavorDescription?: string; shortFormatTitle?: string; titleLine1?: string; titleLine2?: string; detailsDescription?: string; longFormatTitle?: string; backgroundTitle?: string; } export interface TournamentWindowTemplate { windowId: string; templateData: TournamentWindowTemplateData; } export interface FortnitePartyPresenceData { bIsPrivate?: boolean; /** * sourceDisplayName */ sDN?: string; /** * sourcePlatform */ sP?: string; /** * partyId */ p?: string; partyId?: string; /** * appId */ d?: string; appId?: string; /** * buildId */ b?: string; buildId?: string; /** * partyFlags */ f?: number; partyFlags?: number; /** * notAcceptingMembersReason */ nAR?: number; notAcceptingReason?: number; /** * playerCount */ pc?: number; } export type UserSearchPlatform = 'epic' | 'psn' | 'xbl' | 'steam'; export type UserSearchMatchType = 'exact' | 'prefix'; export interface UserSearchResultMatch { value: string; platform: UserSearchPlatform; } export interface BlurlStream { languages: { language: string; url: string; variants: { data: { codecs: string[]; bandwidth: number; resolution: string; }; type: 'video' | 'audio'; url: string; stream: Buffer; }[]; }[]; data: { subtitles: any; ucp?: string; audioonly: boolean; aspectratio?: string; partysync: boolean; lrcs: any; duration?: number; }; } export interface ReplayEvent { Id: string; Group: string; Metadata: string; Time1: number; Time2: number; data: Buffer; } export interface ReplayDataChunk { Id: string; Time1: number; Time2: number; SizeInBytes: number; data: Buffer; } export interface ReplayCheckpoint { Id: string; Group: string; Metadata: string; Time1: number; Time2: number; data: Buffer; } export interface ReplayData { ReplayName: string; LengthInMS: number; NetworkVersion: number; Changelist: number; FriendlyName: string; Timestamp: Date; bIsLive: boolean; bCompressed: boolean; DesiredDelayInSeconds: number; Checkpoints?: ReplayCheckpoint[]; Events?: ReplayEvent[]; DataChunks?: ReplayDataChunk[]; Header: Buffer; } export type ReplayDataType = 'EVENT' | 'DATACHUNK' | 'CHECKPOINT'; export interface ReplayDownloadConfig { /** * Which replay data types to download. * EVENT data contains basic information like eliminations, you will only need EVENT data for ThisNils/node-replay-reader. * DATACHUNK data contains information that is required for most parsing libraries. * CHECKPOINT data contains information that is pretty much only useful if you want to use the replay ingame. * By default, only events and data chunks are downloaded */ dataTypes: ReplayDataType[]; /** * Whether a placeholder for AthenaMatchStats and AthenaMatchTeamStats should be added. * Required if you want to use the replay ingame, otherwise useless. * By default, this is set to false */ addStatsPlaceholder: boolean; } export interface ReplayDownloadOptions extends Partial { } export interface EventTokensResponse { user: User; tokens: string[]; } export interface BRAccountLevel { level: number; progress: number; } export interface BRAccountLevelData { user: User; level: BRAccountLevel; } export interface TournamentSessionMetadata { changelist: number; checkpoints: ReplayCheckpoint[]; dataChunks: ReplayDataChunk[]; desiredDelayInSeconds: number; events: ReplayEvent[]; friendlyName: string; lengthInMS: number; networkVersion: number; replayName: string; timestamp: Date; isCompressed: boolean; isLive: boolean; } export interface STWFORTStats { fortitude: number; resistance: number; offense: number; tech: number; } export type STWSurvivorType = 'special' | 'manager' | 'basic'; export type STWItemRarity = 'c' | 'uc' | 'r' | 'vr' | 'sr' | 'ur'; export type STWItemTier = 1 | 2 | 3 | 4 | 5 | 6; export type STWSurvivorGender = 'male' | 'female'; export interface STWSurvivorSquads { trainingteam: STWSurvivor[]; fireteamalpha: STWSurvivor[]; closeassaultsquad: STWSurvivor[]; thethinktank: STWSurvivor[]; emtsquad: STWSurvivor[]; corpsofengineering: STWSurvivor[]; scoutingparty: STWSurvivor[]; gadgeteers: STWSurvivor[]; } export type STWSurvivorSquadType = 'medicine' | 'arms' | 'synthesis' | 'scavenging'; export interface STWSurvivorSquadData { id: string; name: keyof STWSurvivorSquads; type: STWSurvivorSquadType; slotIdx: number; } export interface STWStatsNodeCostsData { [key: string]: { [key: string]: number; }; } export interface STWStatsSTWLoadoutData { selectedHeroLoadout: string; modeLoadouts: string[]; activeLoadoutIndex: number; } export interface STWStatsBRLoadoutData { loadouts: string[]; lastAppliedLoadout: string; useRandomLoadout: boolean; } export interface STWStatsMissionAlertRedemptionData { missionAlertId: string; redemptionDateUtc: Date; evictClaimDataAfterUtc: Date; } export interface STWStatsQuestData { dailyLoginInterval: Date; dailyQuestRerolls?: number; poolStats: { stats: { poolName: string; nextRefresh: Date; rerollsRemaining: number; questHistory: string[]; }[]; dailyLoginInterval: Date; lockouts: { lockoutName: string; }[]; }; } export interface STWStatsGameplayStatData { statName: string; statValue: number; } export interface STWStatsClientSettingsData { pinnedQuestInstances?: any[]; } export interface STWStatsResearchLevelsData { technology: number; offense: number; fortitude: number; resistance: number; } export interface STWStatsEventCurrencyData { templateId: string; cf: number; } export interface STWStatsXPData { total: number; overflow: number; lost: number; } export interface STWStatsDailyRewardsData { nextDefaultReward: number; totalDaysLoggedIn: number; lastClaimDate: Date; additionalSchedules?: { [key: string]: { rewardsClaimed: number; claimedToday: boolean; }; }; } export interface STWLockerSlotsData { Pickaxe: STWProfileLockerSlotData; MusicPack?: STWProfileLockerSlotData; Character?: STWProfileLockerSlotData; ItemWrap: STWProfileLockerSlotData; Backpack: STWProfileLockerSlotData; Dance: STWProfileLockerSlotData; LoadingScreen: STWProfileLockerSlotData; } export interface STWLockerBannerData { icon: string; color: string; } export type STWHeroType = 'commando' | 'constructor' | 'outlander' | 'ninja'; export type STWSchematicType = 'ranged' | 'melee' | 'trap' | 'other'; export type STWSchematicRangedSubType = 'assault' | 'launcher' | 'pistol' | 'shotgun' | 'smg' | 'sniper'; export type STWSchematicMeleeSubType = 'blunt' | 'blunt_hammer' | 'edged_axe' | 'edged_scythe' | 'edged_sword' | 'piercing_spear'; export type STWSchematicTrapSubType = 'ceiling' | 'floor' | 'wall'; export type STWSchematicSubType = STWSchematicRangedSubType | STWSchematicMeleeSubType | STWSchematicTrapSubType; export type STWSchematicAlterationRarity = 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary'; export type STWSchematicEvoType = 'ore' | 'crystal'; export interface StatsLevelData { [key: string]: { level: number; progress: number; }; } export interface ArenaDivisionData { [key: string]: number; } export interface NewsMessageVideoData { videoAutoplay: boolean; videoFullscreen: boolean; videoLoop: boolean; videoMute: boolean; videoStreamingEnabled: boolean; videoVideoString: string; videoUID: string; } export interface NewsMessagePlaylist { id: string; } export interface NewsMessageOffer { id: string; action: string; } export interface ImageData { url: string; width?: number; height?: number; } export interface STWWorldInfoData { theaters: STWTheaterData[]; missions: STWMissionData[]; missionAlerts: STWMissionAlertData[]; } export interface AuthData { access_token: string; account_id: string; client_id: string; expires_at: string; expires_in: number; token_type: string; } export interface LauncherAuthData extends AuthData { refresh_expires: number; refresh_expires_at: string; refresh_token: string; internal_client: boolean; client_service: string; scope: string[]; displayName: string; app: string; in_app_id: string; } export interface FortniteAuthData extends AuthData { refresh_expires: number; refresh_expires_at: string; refresh_token: string; internal_client: boolean; client_service: string; displayName: string; app: string; in_app_id: string; device_id: string; } export interface FortniteClientCredentialsAuthData extends AuthData { internal_client: boolean; client_service: string; product_id: string; application_id: string; } export interface EOSAuthData extends AuthData { refresh_expires: number; refresh_expires_at: string; refresh_token: string; application_id: string; merged_accounts: string[]; scope: string; } export interface EOSTokenInfo { active: boolean; } export interface AuthSessionStore extends Collection { get(key: AuthSessionStoreKey.Fortnite): FortniteAuthSession | undefined; get(key: AuthSessionStoreKey.Launcher): LauncherAuthSession | undefined; get(key: AuthSessionStoreKey.FortniteEOS): EOSAuthSession | undefined; get(key: AuthSessionStoreKey.FortniteClientCredentials): FortniteClientCredentialsAuthSession | undefined; get(key: K): V | undefined; } /** * Represents a chat message data */ export interface ChatMessagePayload { /** * The message body, should not be empty and not exceed the limit of 2048 characters. Please note that emojis count as 2 characters. */ body: string; } interface BaseEOSConnectMessage { correlationId: string; timestamp: number; id?: string; connectionId?: string; payload?: unknown; } export interface EOSConnectCoreConnected extends BaseEOSConnectMessage { type: 'core.connect.v1.connected'; } export interface EOSConnectCoreConnectFailed extends BaseEOSConnectMessage { message: string; statusCode: number; type: 'core.connect.v1.connect-failed'; } export interface EOSConnectChatMembersJoinMessage extends BaseEOSConnectMessage { payload: { namespace: string; msgId: string; createdAt: string; time: number; conversationId: string; type: string; members: string[]; isReportable: boolean; }; type: 'social.chat.v1.MEMBERS_JOIN'; } export interface EOSConnectChatMemberLeftMessage extends BaseEOSConnectMessage { payload: { namespace: string; conversationId: string; members: string[]; }; type: 'social.chat.v1.MEMBERS_LEFT'; } export interface EOSConnectChatNewMsgMessage extends BaseEOSConnectMessage { payload: { namespace: string; conversation: { conversationId: string; type: string; }; message: { body: string; senderId: string; time: number; }; }; type: 'social.chat.v1.NEW_MESSAGE'; } export interface EOSConnectChatConversionCreatedMessage extends BaseEOSConnectMessage { payload: { namespace: string; conversationId: string; type: string; members: string[]; }; type: 'social.chat.v1.CONVERSATION_CREATED'; } export interface EOSConnectChatNewWhisperMessage extends BaseEOSConnectMessage { payload: { namespace: string; message: { body: string; senderId: string; time: number; }; }; type: 'social.chat.v1.NEW_WHISPER'; } export interface EOSPresenceProps { EOS_Platform: Platform; EOS_IntegratedPlatform: string; EOS_OnlinePlatformType: string; EOS_ProductVersion: string; EOS_ProductName: string; EOS_Session: string; EOS_Lobby: string; } export interface EOSPresencePropsInGame extends EOSPresenceProps { FortBasicInfo?: string; FortLFG?: string; FortPartySize?: string; FortSubGame?: string; IslandCode?: string; IsInZone?: string; FortGameplayStats?: string; SocialStatus?: string; InUnjoinableMatch?: string; 'party.joininfodata.286331153'?: string; SessionIdAttributeKey?: string; GamePlaylistName?: string; Event_PartyMaxSize?: string; Event_PartySize?: string; Event_PlayersAlive?: string; } export interface EOSPresencePerNs { ns: string; productId?: string; status: PresenceOnlineType; activity: { value: string; }; props: EOSPresencePropsInGame; } export interface EOSPresenceUpdateMessage extends BaseEOSConnectMessage { payload: { accountId: string; status: PresenceOnlineType; perNs: EOSPresencePerNs[]; }; type: 'presence.v1.UPDATE'; } export interface EOSConnectPartyInviteCreatedMessage extends BaseEOSConnectMessage { type: 'party.v2.INVITE_CREATED'; payload: EOSPartyInviteData; } export interface EOSConnectPartyInviteExpiredMessage extends BaseEOSConnectMessage { type: 'party.v2.INVITE_EXPIRED'; payload: EOSPartyInviteData; } export interface EOSConnectPartyJoinRequestMessage extends BaseEOSConnectMessage { type: 'party.v2.JOIN_REQUEST_CREATED'; payload: EOSPartyJoinRequestData; } export interface EOSConnectPartyDisbandedMessage extends BaseEOSConnectMessage { type: 'party.v2.MEMBER_EXPIRED_PARTY_DISBANDED'; payload: EOSPartyMemberUpdateData; } export type EOSConnectPartyMemberMessageType = 'party.v2.MEMBER_JOINED' | 'party.v2.MEMBER_LEFT' | 'party.v2.MEMBER_STATE_UPDATED'; export interface EOSConnectPartyMemberMessage extends BaseEOSConnectMessage { type: EOSConnectPartyMemberMessageType; payload: EOSPartyMemberUpdateData; } export interface EOSConnectPartyUpdatedMessage extends BaseEOSConnectMessage { type: 'party.v2.PARTY_UPDATED'; payload: EOSPartyUpdateData; } export interface EOSConnectPartyMemberKickedMessage extends BaseEOSConnectMessage { type: 'party.v2.MEMBER_KICKED'; payload: EOSPartyMemberUpdateData; } export interface EOSConnectPartyMemberDisconnectMessage extends BaseEOSConnectMessage { type: 'party.v2.MEMBER_DISCONNECTED' | 'party.v2.MEMBER_EXPIRED_AFTER_DISCONNECT'; payload: EOSPartyMemberUpdateData; } export interface EOSConnectMemberRefreshSummaryMessage extends BaseEOSConnectMessage { type: 'party.v2.MEMBER_REFRESH_SUMMARY'; payload: unknown; } export interface EOSConnectMemberConnectedMessage extends BaseEOSConnectMessage { type: 'party.v2.MEMBER_CONNECTED'; payload: unknown; } export type EOSConnectPartyNotification = EOSConnectPartyInviteCreatedMessage | EOSConnectPartyInviteExpiredMessage | EOSConnectPartyJoinRequestMessage | EOSConnectPartyDisbandedMessage | EOSConnectPartyMemberMessage | EOSConnectPartyUpdatedMessage | EOSConnectPartyMemberKickedMessage | EOSConnectPartyMemberDisconnectMessage | EOSConnectMemberRefreshSummaryMessage | EOSConnectMemberConnectedMessage; export type EOSConnectMessage = EOSConnectCoreConnected | EOSConnectCoreConnectFailed | EOSConnectChatConversionCreatedMessage | EOSConnectChatNewMsgMessage | EOSConnectChatMembersJoinMessage | EOSConnectChatMemberLeftMessage | EOSConnectChatNewWhisperMessage | EOSConnectPartyNotification | EOSPresenceUpdateMessage; export {};