Skip to content

Commit

Permalink
Merge pull request #392 from fnbrjs/master
Browse files Browse the repository at this point in the history
3.0.0
  • Loading branch information
ThisNils authored Apr 19, 2022
2 parents 59bbaac + 8e1dda4 commit 55cbff2
Show file tree
Hide file tree
Showing 73 changed files with 21,147 additions and 2,697 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2021 Nils S.
Copyright (c) 2020-2022 Nils S.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ client.login().then(() => {
<h2>License</h2>
MIT License

Copyright (c) 2020-2021 Nils S.
Copyright (c) 2020-2022 Nils S.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
71 changes: 71 additions & 0 deletions docs/general/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,76 @@
# Changelog

## 3.0.0

### Additions
* Enums
* Added `XBOX_SERIES_X` and `PLAYSTATION_5` to the `Platform` enum
* Added the `STWLeadSynergy` enum
* Added the `PresenceOnlineType` enum
* Client Config
* Added `ClientOptions#language`
* Added `ClientOptions#statsPlaylistTypeParser`
* Added comments to many config options
* Friend Online And Offline Events
* Added `Client#friend:online` and `Client#friend:offline` events
* Added `ClientOptions#friendOnlineConnectionTimeout`
* Launcher Refresh Token Auth
* Added `AuthOptions#createLauncherSession`
* Reworked launcher refresh token auth to ensure that a token will always be created
* Save The World Profiles
* Added `Client#getSTWProfile()`
* Can be used to calculate a profile's power level, fetch its survivors, etc
* Save The World Info
* Added `Client#getSTWWorldInfo()`
* Party Refreshing
* Added `Party#fetch()`
* Client Party Member
* Added `ClientPartyMember#setCrowns()`
* Party Member State Updated Events
* Added `Client#party:member:outfit:updated`
* Added `Client#party:member:backpack:updated`
* Added `Client#party:member:emote:updated`
* Added `Client#party:member:pickaxe:updated`
* Added `Client#party:member:readiness:updated`
* Added `Client#party:member:matchstate:updated`

### Changes
* Party Fetching
* Added `raw` parameter to `Client#getParty()` that will make the method return the raw party data
* `Client#getParty()` now handles errors correctly
* Stats
* **(Breaking)** `Client#getBRStats()` now returns a `Stats` object
* News
* **(Breaking)** Removed `Client#getNews()`
* Added `Client#getBRNews()`
* Added `Client#getSTWNews()`
* Battle Royale Account Level
* **(Breaking)** `Client#getBRAccountLevel()` now returns a `BRAccountLevelData` object
* Event Tokens
* **(Breaking)** `Client#getEventTokens()` now returns a `EventTokens` object

### Fixes
* Fortnite EULA Accept Method
* Fixed an issue that occured when Fortnite was bought on an account but never actually launched
* Client Presence Sweeping
* Fixed the documentation of the `maxLifetime` parameter of `Client#sweepPresences()`
* HTTP Auth Error Handling
* Fixed an issue that affected automatic token refreshing
* Refresh Token Auth
* Fixed an issue that occured when the client was kept running longer than the refresh token's lifetime
* XMPP PARTY_MEMBER_EXPIRED Error
* Fixed an error that occured when the client handled its own party member expiration event
* XMPP Presences
* Fixed an issue that caused the presence cache to be populated very slower
* XBOX External Auth
* Added `ExternalAuths#xbl`
* Party Join Requests
* Fixed `sender` and `receiver` being swapped
* Party Invites
* Fixed an issue that caused party member display names to be undefined

<hr>

## 2.4.0

### Additions
Expand Down
127 changes: 126 additions & 1 deletion enums/Enums.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { PartyPrivacy as IPartyPrivacy, Platform as IPlatform } from '../resources/structs';
import {
PartyPrivacy as IPartyPrivacy, Platform as IPlatform, PresenceOnlineType as IPresenceOnlineType,
STWHeroType as ISTWHeroType, STWSchematicRangedSubType as ISTWSchematicRangedSubType,
STWSchematicMeleeSubType as ISTWSchematicMeleeSubType, STWSchematicTrapSubType as ISTWSchematicTrapSubType,
STWSchematicAlterationRarity as ISTWSchematicAlterationRarity, STWSchematicEvoType as ISTWSchematicEvoType,
} from '../resources/structs';

export interface IPartyPrivacyEnum {
PUBLIC: IPartyPrivacy;
Expand All @@ -16,6 +21,61 @@ export interface IPlatformEnum {
SWITCH: IPlatform;
IOS: IPlatform;
ANDROID: IPlatform;
XBOX_SERIES_X: IPlatform;
PLAYSTATION_5: IPlatform;
}

export interface IPresenceOnlineTypeEnum {
ONLINE: IPresenceOnlineType;
CHAT: IPresenceOnlineType;
AWAY: IPresenceOnlineType;
EXTENDED_AWAY: IPresenceOnlineType;
DO_NOT_DISTURB: IPresenceOnlineType;
}

export interface ISTWHeroTypeEnum {
SOLDIER: ISTWHeroType;
CONSTRUCTOR: ISTWHeroType;
OUTLANDER: ISTWHeroType;
NINJA: ISTWHeroType;
}

export interface ISTWSchematicTypeEnum {
RANGED_WEAPON: 'ranged';
MELEE_WEAPON: 'melee';
TRAP: 'trap';
OTHER: 'other';
}

export interface ISTWSchematicSubTypeEnum {
ASSAULT: ISTWSchematicRangedSubType;
LAUNCHER: ISTWSchematicRangedSubType;
PISTOL: ISTWSchematicRangedSubType;
SHOTGUN: ISTWSchematicRangedSubType;
SMG: ISTWSchematicRangedSubType;
SNIPER: ISTWSchematicRangedSubType;
CLUB: ISTWSchematicMeleeSubType;
HARDWARE: ISTWSchematicMeleeSubType;
AXE: ISTWSchematicMeleeSubType;
SCYTHE: ISTWSchematicMeleeSubType;
SWORD: ISTWSchematicMeleeSubType;
SPEAR: ISTWSchematicMeleeSubType;
CEILING_TRAP: ISTWSchematicTrapSubType;
FLOOR_TRAP: ISTWSchematicTrapSubType;
WALL_TRAP: ISTWSchematicTrapSubType;
}

export interface ISTWSchematicAlterationRarityEnum {
COMMON: ISTWSchematicAlterationRarity;
UNCOMMON: ISTWSchematicAlterationRarity;
RARE: ISTWSchematicAlterationRarity;
EPIC: ISTWSchematicAlterationRarity;
LEGENDARY: ISTWSchematicAlterationRarity;
}

export interface ISTWSchematicEvoTypeEnum {
ORE: ISTWSchematicEvoType;
CRYSTAL: ISTWSchematicEvoType;
}

export const PartyPrivacy: Readonly<IPartyPrivacyEnum> = Object.freeze({
Expand Down Expand Up @@ -69,6 +129,8 @@ export const Platform: Readonly<IPlatformEnum> = Object.freeze({
SWITCH: 'SWT',
IOS: 'IOS',
ANDROID: 'AND',
XBOX_SERIES_X: 'XSX',
PLAYSTATION_5: 'PS5',
});

export const Playlist = Object.freeze({
Expand Down Expand Up @@ -172,6 +234,63 @@ export const SeasonEnd = Object.freeze({
CH2_S8: 1638662400,
});

export const STWLeadSynergy = Object.freeze({
trainingteam: 'IsTrainer',
fireteamalpha: 'IsSoldier',
closeassaultsquad: 'IsMartialArtist',
thethinktank: 'IsInventor',
emtsquad: 'IsDoctor',
corpsofengineering: 'IsEngineer',
scoutingparty: 'IsExplorer',
gadgeteers: 'IsGadgeteer',
});

export const PresenceOnlineType: Readonly<IPresenceOnlineTypeEnum> = Object.freeze({
ONLINE: 'online',
CHAT: 'chat',
AWAY: 'away',
EXTENDED_AWAY: 'xa',
DO_NOT_DISTURB: 'dnd',
});

export const STWHeroType: Readonly<ISTWHeroTypeEnum> = Object.freeze({
SOLDIER: 'commando',
CONSTRUCTOR: 'constructor',
OUTLANDER: 'outlander',
NINJA: 'ninja',
});

export const STWSchematicSubType: Readonly<ISTWSchematicSubTypeEnum> = Object.freeze({
ASSAULT: 'assault',
LAUNCHER: 'launcher',
PISTOL: 'pistol',
SHOTGUN: 'shotgun',
SMG: 'smg',
SNIPER: 'sniper',
CLUB: 'blunt',
HARDWARE: 'blunt_hammer',
AXE: 'edged_axe',
SCYTHE: 'edged_scythe',
SWORD: 'edged_sword',
SPEAR: 'piercing_spear',
CEILING_TRAP: 'ceiling',
FLOOR_TRAP: 'floor',
WALL_TRAP: 'wall',
});

export const STWSchematicAlterationRarity: Readonly<ISTWSchematicAlterationRarityEnum> = Object.freeze({
COMMON: 'common',
UNCOMMON: 'uncommon',
RARE: 'rare',
EPIC: 'epic',
LEGENDARY: 'legendary',
});

export const STWSchematicEvoType: Readonly<ISTWSchematicEvoTypeEnum> = Object.freeze({
ORE: 'ore',
CRYSTAL: 'crystal',
});

export default Object.freeze({
PartyPrivacy,
Platform,
Expand All @@ -181,4 +300,10 @@ export default Object.freeze({
DefaultSkin,
SeasonStart,
SeasonEnd,
STWLeadSynergy,
PresenceOnlineType,
STWHeroType,
STWSchematicSubType,
STWSchematicAlterationRarity,
STWSchematicEvoType,
});
5 changes: 4 additions & 1 deletion generateExports.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ const fs = require('fs').promises;
let output = '';

output += '// main exports\nexport { default as Client } from \'./src/client/Client\';\n'
+ 'export { default as Enums } from \'./enums/Enums\';\n\n// types and interfaces\nexport * from \'./resources/structs\';\n';
+ 'export { default as Enums } from \'./enums/Enums\';\n\n// types and interfaces\nexport * from \'./resources/structs\';\n'
+ '\n// endpoints\nexport { default as Endpoints } from \'./resources/Endpoints\';\n';

output += '\n// exceptions\n';
const exceptions = await fs.readdir('./src/exceptions');
exceptions.sort();
exceptions.forEach((file) => {
const fileWithoutExtension = file.split('.')[0];
output += `export { default as ${fileWithoutExtension} } from './src/exceptions/${fileWithoutExtension}';\n`;
});

output += '\n// structures\n';
const structures = await fs.readdir('./src/structures');
structures.sort();
structures.forEach((file) => {
const fileWithoutExtension = file.split('.')[0];
output += `export { default as ${fileWithoutExtension} } from './src/structures/${fileWithoutExtension}';\n`;
Expand Down
24 changes: 24 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ export { default as Enums } from './enums/Enums';
// types and interfaces
export * from './resources/structs';

// endpoints
export { default as Endpoints } from './resources/Endpoints';

// exceptions
export { default as CreativeIslandNotFoundError } from './src/exceptions/CreativeIslandNotFoundError';
export { default as CreatorCodeNotFoundError } from './src/exceptions/CreatorCodeNotFoundError';
export { default as DuplicateFriendshipError } from './src/exceptions/DuplicateFriendshipError';
export { default as EpicgamesAPIError } from './src/exceptions/EpicgamesAPIError';
export { default as EpicgamesGraphQLError } from './src/exceptions/EpicgamesGraphQLError';
export { default as EventTimeoutError } from './src/exceptions/EventTimeoutError';
export { default as FriendNotFoundError } from './src/exceptions/FriendNotFoundError';
export { default as FriendshipRequestAlreadySentError } from './src/exceptions/FriendshipRequestAlreadySentError';
export { default as InviteeFriendshipRequestLimitExceededError } from './src/exceptions/InviteeFriendshipRequestLimitExceededError';
Expand Down Expand Up @@ -43,10 +47,14 @@ export { default as ClientPartyMemberMeta } from './src/structures/ClientPartyMe
export { default as ClientPartyMeta } from './src/structures/ClientPartyMeta';
export { default as ClientUser } from './src/structures/ClientUser';
export { default as CreatorCode } from './src/structures/CreatorCode';
export { default as EventTokens } from './src/structures/EventTokens';
export { default as Friend } from './src/structures/Friend';
export { default as FriendPresence } from './src/structures/FriendPresence';
export { default as GlobalProfile } from './src/structures/GlobalProfile';
export { default as Image } from './src/structures/Image';
export { default as IncomingPendingFriend } from './src/structures/IncomingPendingFriend';
export { default as NewsMessage } from './src/structures/NewsMessage';
export { default as NewsMessageVideo } from './src/structures/NewsMessageVideo';
export { default as OutgoingPendingFriend } from './src/structures/OutgoingPendingFriend';
export { default as Party } from './src/structures/Party';
export { default as PartyChat } from './src/structures/PartyChat';
Expand All @@ -60,9 +68,25 @@ export { default as RadioStation } from './src/structures/RadioStation';
export { default as ReceivedFriendMessage } from './src/structures/ReceivedFriendMessage';
export { default as ReceivedPartyInvitation } from './src/structures/ReceivedPartyInvitation';
export { default as ReceivedPartyJoinRequest } from './src/structures/ReceivedPartyJoinRequest';
export { default as STWHero } from './src/structures/STWHero';
export { default as STWHeroLoadout } from './src/structures/STWHeroLoadout';
export { default as STWItem } from './src/structures/STWItem';
export { default as STWLocker } from './src/structures/STWLocker';
export { default as STWMeleeWeaponSchematic } from './src/structures/STWMeleeWeaponSchematic';
export { default as STWNewsMessage } from './src/structures/STWNewsMessage';
export { default as STWProfile } from './src/structures/STWProfile';
export { default as STWRangedWeaponSchematic } from './src/structures/STWRangedWeaponSchematic';
export { default as STWResource } from './src/structures/STWResource';
export { default as STWSchematic } from './src/structures/STWSchematic';
export { default as STWStats } from './src/structures/STWStats';
export { default as STWSurvivor } from './src/structures/STWSurvivor';
export { default as STWTeamPerk } from './src/structures/STWTeamPerk';
export { default as STWTrapSchematic } from './src/structures/STWTrapSchematic';
export { default as STWWeaponSchematic } from './src/structures/STWWeaponSchematic';
export { default as SentFriendMessage } from './src/structures/SentFriendMessage';
export { default as SentPartyInvitation } from './src/structures/SentPartyInvitation';
export { default as SentPartyJoinRequest } from './src/structures/SentPartyJoinRequest';
export { default as Stats } from './src/structures/Stats';
export { default as Tournament } from './src/structures/Tournament';
export { default as TournamentWindow } from './src/structures/TournamentWindow';
export { default as User } from './src/structures/User';
Expand Down
Loading

0 comments on commit 55cbff2

Please sign in to comment.