@yaelouuu/fortnite-api 6.1.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.
|
@@ -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
|
*
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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.
|
|
4
|
-
"description": "SDK for Fortnite
|
|
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": {
|