@yaelouuu/fortnite-api 6.0.0 → 6.2.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.
@@ -51,4 +51,9 @@ export declare class AccountResource {
51
51
  * @param fortniteToken - Optional user Fortnite token
52
52
  */
53
53
  getExternalAuth(accountId: string, platform: string, fortniteToken?: string): Promise<ExternalAuth>;
54
+ /**
55
+ * Resolve one or more Epic account IDs to their display names
56
+ * @param accountIds - Array of Epic Games account IDs (comma-separated, max 100)
57
+ */
58
+ getDisplayNames(accountIds: string[]): Promise<Account[]>;
54
59
  }
@@ -99,5 +99,13 @@ class AccountResource {
99
99
  }
100
100
  return this.client.request(`/account/${accountId}/externalAuths/${platform}`, { headers }, "v1");
101
101
  }
102
+ /**
103
+ * Resolve one or more Epic account IDs to their display names
104
+ * @param accountIds - Array of Epic Games account IDs (comma-separated, max 100)
105
+ */
106
+ async getDisplayNames(accountIds) {
107
+ const ids = accountIds.join(",");
108
+ return this.client.request(`/account/displaynames?ids=${encodeURIComponent(ids)}`, {}, "v1");
109
+ }
102
110
  }
103
111
  exports.AccountResource = AccountResource;
@@ -1,27 +1,15 @@
1
1
  import { FortniteAPI } from "../client";
2
- import { Profile, ProfileStats } from "../types";
3
2
  export declare class ProfilesResource {
4
3
  private client;
5
4
  constructor(client: FortniteAPI);
6
5
  /**
7
- * Get profile progress (ranked divisions, levels) by display name
6
+ * Get profile progress (track progress, levels) by display name
8
7
  * @param displayName - Epic Games display name
9
8
  */
10
9
  getProgress(displayName: string): Promise<any>;
11
10
  /**
12
- * Get profile stats by display name
11
+ * Get enriched ranked progress by display name (human-readable ranks, game modes, season dates)
13
12
  * @param displayName - Epic Games display name
14
- * @param timeWindow - Time period: "season" or "lifetime" (default: "lifetime")
15
13
  */
16
- getStats(displayName: string, timeWindow?: "season" | "lifetime"): Promise<ProfileStats>;
17
- /**
18
- * Get account info by ID
19
- * @param accountId - Epic Games Account ID
20
- */
21
- getAccount(accountId: string): Promise<Profile>;
22
- /**
23
- * Get multiple display names by account IDs
24
- * @param accountIds - Array of account IDs (max 100)
25
- */
26
- getDisplayNames(accountIds: string[]): Promise<Record<string, string>>;
14
+ getRanked(displayName: string): Promise<any>;
27
15
  }
@@ -6,39 +6,18 @@ class ProfilesResource {
6
6
  this.client = client;
7
7
  }
8
8
  /**
9
- * Get profile progress (ranked divisions, levels) by display name
9
+ * Get profile progress (track progress, levels) by display name
10
10
  * @param displayName - Epic Games display name
11
11
  */
12
12
  async getProgress(displayName) {
13
13
  return this.client.request(`/profile/progress?displayName=${encodeURIComponent(displayName)}`);
14
14
  }
15
15
  /**
16
- * Get profile stats by display name
16
+ * Get enriched ranked progress by display name (human-readable ranks, game modes, season dates)
17
17
  * @param displayName - Epic Games display name
18
- * @param timeWindow - Time period: "season" or "lifetime" (default: "lifetime")
19
18
  */
20
- async getStats(displayName, timeWindow) {
21
- const params = new URLSearchParams({
22
- displayName,
23
- });
24
- if (timeWindow)
25
- params.set("timeWindow", timeWindow);
26
- return this.client.request(`/profile/stats?${params.toString()}`);
27
- }
28
- /**
29
- * Get account info by ID
30
- * @param accountId - Epic Games Account ID
31
- */
32
- async getAccount(accountId) {
33
- return this.client.request(`/account/${accountId}`);
34
- }
35
- /**
36
- * Get multiple display names by account IDs
37
- * @param accountIds - Array of account IDs (max 100)
38
- */
39
- async getDisplayNames(accountIds) {
40
- const ids = accountIds.join(",");
41
- return this.client.request(`/displaynames/multiple?ids=${encodeURIComponent(ids)}`);
19
+ async getRanked(displayName) {
20
+ return this.client.request(`/profile/ranked?displayName=${encodeURIComponent(displayName)}`);
42
21
  }
43
22
  }
44
23
  exports.ProfilesResource = ProfilesResource;
@@ -1,5 +1,5 @@
1
1
  import { FortniteAPI } from "../client";
2
- import { Leaderboard, TournamentTrackerResponse, TournamentEligibilityResponse } from "../types";
2
+ import { Leaderboard, TournamentTrackerResponse, TournamentEligibilityResponse, EventTokenEligibilityResponse } from "../types";
3
3
  export declare class TournamentsResource {
4
4
  private client;
5
5
  constructor(client: FortniteAPI);
@@ -81,6 +81,25 @@ export declare class TournamentsResource {
81
81
  days?: number;
82
82
  requiredTournaments?: number;
83
83
  }): Promise<TournamentEligibilityResponse>;
84
+ /**
85
+ * Check a player's token eligibility for a specific event window.
86
+ *
87
+ * Verifies all token requirements (requireAllTokens, requireAnyTokens,
88
+ * requireNoneTokensCaller, etc.) using the Epic tokens endpoint — no player
89
+ * auth needed. Hardware/system requirements and MFA are always listed as
90
+ * unverified since they cannot be checked remotely.
91
+ *
92
+ * Accepts a display name or an Epic account ID (with or without dashes).
93
+ *
94
+ * @param identifier - Player display name or Epic account ID
95
+ * @param eventId - Epic event ID (e.g. `"epicgames_S40_FNCSMajor1_LCQ_EU"`)
96
+ * @param options.eventWindowId - Optional window ID; defaults to the most relevant window (live → upcoming → latest ended)
97
+ * @param options.fortniteToken - Optional user Fortnite token for future extended checks
98
+ */
99
+ checkEventEligibility(identifier: string, eventId: string, options?: {
100
+ eventWindowId?: string;
101
+ fortniteToken?: string;
102
+ }): Promise<EventTokenEligibilityResponse>;
84
103
  /**
85
104
  * Get tournament leaderboard using V2 endpoint (POST with teams body)
86
105
  *
@@ -128,6 +128,33 @@ class TournamentsResource {
128
128
  },
129
129
  });
130
130
  }
131
+ /**
132
+ * Check a player's token eligibility for a specific event window.
133
+ *
134
+ * Verifies all token requirements (requireAllTokens, requireAnyTokens,
135
+ * requireNoneTokensCaller, etc.) using the Epic tokens endpoint — no player
136
+ * auth needed. Hardware/system requirements and MFA are always listed as
137
+ * unverified since they cannot be checked remotely.
138
+ *
139
+ * Accepts a display name or an Epic account ID (with or without dashes).
140
+ *
141
+ * @param identifier - Player display name or Epic account ID
142
+ * @param eventId - Epic event ID (e.g. `"epicgames_S40_FNCSMajor1_LCQ_EU"`)
143
+ * @param options.eventWindowId - Optional window ID; defaults to the most relevant window (live → upcoming → latest ended)
144
+ * @param options.fortniteToken - Optional user Fortnite token for future extended checks
145
+ */
146
+ async checkEventEligibility(identifier, eventId, options) {
147
+ const query = new URLSearchParams();
148
+ if (options?.eventWindowId) {
149
+ query.append("eventWindowId", options.eventWindowId);
150
+ }
151
+ const qs = query.toString();
152
+ const path = `/events/tracker/eligibility/${encodeURIComponent(identifier)}/${encodeURIComponent(eventId)}${qs ? `?${qs}` : ""}`;
153
+ const requestOptions = options?.fortniteToken
154
+ ? { headers: { "x-fortnite-token": options.fortniteToken } }
155
+ : undefined;
156
+ return this.client.request(path, requestOptions);
157
+ }
131
158
  /**
132
159
  * Get tournament leaderboard using V2 endpoint (POST with teams body)
133
160
  *
@@ -214,6 +214,36 @@ export interface TournamentEligibilityResponse {
214
214
  newest_tournament_date: string | null;
215
215
  recent_tournaments: TournamentTrackerEntry[];
216
216
  }
217
+ export type TokenRequirementType = "mustHave" | "mustHaveAny" | "mustNotHave";
218
+ export type TokenGroupType = "requireAllTokens" | "requireAnyTokens" | "requireNoneTokensCaller" | "requireAllTokensCaller" | "requireAnyTokensCaller";
219
+ export interface VerifiedRequirement {
220
+ token: string;
221
+ label: string;
222
+ type: TokenRequirementType;
223
+ tokenGroup: TokenGroupType;
224
+ met: boolean;
225
+ }
226
+ export interface UnverifiedRequirement {
227
+ type: "accountLevel" | "systemFeature" | "mfa";
228
+ key: string;
229
+ label: string;
230
+ description: string;
231
+ /** Only present for accountLevel requirements */
232
+ threshold?: number;
233
+ /** Only present for accountLevel requirements */
234
+ estimatedCurrentLevel?: number | null;
235
+ /** Only present for accountLevel requirements */
236
+ estimatedMet?: boolean | null;
237
+ }
238
+ export interface EventTokenEligibilityResponse {
239
+ accountId: string;
240
+ displayName: string;
241
+ eventId: string;
242
+ eventWindowId: string;
243
+ isEligible: boolean;
244
+ verifiedRequirements: VerifiedRequirement[];
245
+ unverifiedRequirements: UnverifiedRequirement[];
246
+ }
217
247
  export interface SeasonEntry {
218
248
  chapter: number;
219
249
  season: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yaelouuu/fortnite-api",
3
- "version": "6.0.0",
4
- "description": "SDK for Fortnite Tournaments API by Royal Arena - Author : Yael Brinkert",
3
+ "version": "6.2.0",
4
+ "description": "SDK for Fortnite API - api-fortnite.com - Author : Yael Brinkert",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {