@yaelouuu/fortnite-api 5.1.0 → 6.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/dist/client.d.ts +2 -2
- package/dist/resources/battlepass.js +1 -1
- package/dist/resources/quests.d.ts +1 -1
- package/dist/resources/quests.js +2 -2
- package/dist/resources/tournaments.d.ts +19 -5
- package/dist/resources/tournaments.js +21 -7
- package/dist/resources/weapons.js +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -49,9 +49,9 @@ export declare class FortniteAPI {
|
|
|
49
49
|
/**
|
|
50
50
|
* Internal method to make HTTP requests
|
|
51
51
|
*/
|
|
52
|
-
request<T>(endpoint: string, options?: RequestInit, version?: "v1" | "v2"
|
|
52
|
+
request<T>(endpoint: string, options?: RequestInit, version?: "v1" | "v2"): Promise<T>;
|
|
53
53
|
/**
|
|
54
54
|
* Internal method for multipart/form-data requests (file uploads)
|
|
55
55
|
*/
|
|
56
|
-
requestMultipart<T>(endpoint: string, formData: FormData, version?: "v1" | "v2"
|
|
56
|
+
requestMultipart<T>(endpoint: string, formData: FormData, version?: "v1" | "v2"): Promise<T>;
|
|
57
57
|
}
|
package/dist/resources/quests.js
CHANGED
|
@@ -31,7 +31,7 @@ class QuestsResource {
|
|
|
31
31
|
*
|
|
32
32
|
* **Authentication**: Requires user's personal Fortnite OAuth token
|
|
33
33
|
*
|
|
34
|
-
* **API Version**:
|
|
34
|
+
* **API Version**: v2
|
|
35
35
|
*
|
|
36
36
|
* **Rate Limit**: Standard API rate limits apply
|
|
37
37
|
*
|
|
@@ -56,7 +56,7 @@ class QuestsResource {
|
|
|
56
56
|
headers: {
|
|
57
57
|
"x-fortnite-token": fortniteToken,
|
|
58
58
|
},
|
|
59
|
-
}, "
|
|
59
|
+
}, "v2");
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
exports.QuestsResource = QuestsResource;
|
|
@@ -33,12 +33,26 @@ export declare class TournamentsResource {
|
|
|
33
33
|
}, fortniteToken: string): Promise<any>;
|
|
34
34
|
/**
|
|
35
35
|
* Get tournament leaderboard
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
*
|
|
37
|
+
* The `leaderboardDef` parameter serves two distinct purposes depending on the tournament type:
|
|
38
|
+
*
|
|
39
|
+
* **1. Ranked Cup (rank-tier leaderboards)**
|
|
40
|
+
* Pass the rank-tier def ID found in `eventWindow.metadata.defaultLeaderboardByRank`.
|
|
41
|
+
* The server resolves this to a different internal window ID to return rank-filtered results.
|
|
42
|
+
* Example: `"ranked_br_division_7"`
|
|
43
|
+
*
|
|
44
|
+
* **2. Cumulative leaderboard**
|
|
45
|
+
* Pass the cumulative def ID found in `eventWindow.scoreLocations` where
|
|
46
|
+
* `isMainWindowLeaderboard === false`. The server forwards this as Epic's `sm=` query param,
|
|
47
|
+
* returning the combined leaderboard across all sessions in the same group (e.g. Day 1 + Day 2).
|
|
48
|
+
* Example: `"S40_FNCSMajor1_PlayInStage_CumulativeLeaderboardDef"`
|
|
49
|
+
*
|
|
50
|
+
* @param params.eventId - Event ID (e.g. `"epicgames_S40_FNCSMajor1_PlayInStage_EU"`)
|
|
51
|
+
* @param params.eventWindowId - Event window ID (e.g. `"S40_FNCSMajor1_PlayInStage_Day1_EU"`)
|
|
38
52
|
* @param params.page - Page number (default: 0)
|
|
39
|
-
* @param params.leaderboardDef - Optional leaderboard definition
|
|
40
|
-
* @param params.accountId - Optional account ID
|
|
41
|
-
* @param fortniteToken - Optional user's Fortnite token for personalized view
|
|
53
|
+
* @param params.leaderboardDef - Optional leaderboard definition ID (Ranked Cup tier or cumulative def)
|
|
54
|
+
* @param params.accountId - Optional account ID — highlights that player in the response
|
|
55
|
+
* @param fortniteToken - Optional user's Fortnite access token for personalized view
|
|
42
56
|
*/
|
|
43
57
|
getLeaderboard(params: {
|
|
44
58
|
eventId: string;
|
|
@@ -49,12 +49,26 @@ class TournamentsResource {
|
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Get tournament leaderboard
|
|
52
|
-
*
|
|
53
|
-
*
|
|
52
|
+
*
|
|
53
|
+
* The `leaderboardDef` parameter serves two distinct purposes depending on the tournament type:
|
|
54
|
+
*
|
|
55
|
+
* **1. Ranked Cup (rank-tier leaderboards)**
|
|
56
|
+
* Pass the rank-tier def ID found in `eventWindow.metadata.defaultLeaderboardByRank`.
|
|
57
|
+
* The server resolves this to a different internal window ID to return rank-filtered results.
|
|
58
|
+
* Example: `"ranked_br_division_7"`
|
|
59
|
+
*
|
|
60
|
+
* **2. Cumulative leaderboard**
|
|
61
|
+
* Pass the cumulative def ID found in `eventWindow.scoreLocations` where
|
|
62
|
+
* `isMainWindowLeaderboard === false`. The server forwards this as Epic's `sm=` query param,
|
|
63
|
+
* returning the combined leaderboard across all sessions in the same group (e.g. Day 1 + Day 2).
|
|
64
|
+
* Example: `"S40_FNCSMajor1_PlayInStage_CumulativeLeaderboardDef"`
|
|
65
|
+
*
|
|
66
|
+
* @param params.eventId - Event ID (e.g. `"epicgames_S40_FNCSMajor1_PlayInStage_EU"`)
|
|
67
|
+
* @param params.eventWindowId - Event window ID (e.g. `"S40_FNCSMajor1_PlayInStage_Day1_EU"`)
|
|
54
68
|
* @param params.page - Page number (default: 0)
|
|
55
|
-
* @param params.leaderboardDef - Optional leaderboard definition
|
|
56
|
-
* @param params.accountId - Optional account ID
|
|
57
|
-
* @param fortniteToken - Optional user's Fortnite token for personalized view
|
|
69
|
+
* @param params.leaderboardDef - Optional leaderboard definition ID (Ranked Cup tier or cumulative def)
|
|
70
|
+
* @param params.accountId - Optional account ID — highlights that player in the response
|
|
71
|
+
* @param fortniteToken - Optional user's Fortnite access token for personalized view
|
|
58
72
|
*/
|
|
59
73
|
async getLeaderboard(params, fortniteToken) {
|
|
60
74
|
const { eventId, eventWindowId, page = 0, leaderboardDef, accountId, } = params;
|
|
@@ -85,7 +99,7 @@ class TournamentsResource {
|
|
|
85
99
|
* @param fortniteToken - User's Fortnite access token (from OAuth flow)
|
|
86
100
|
*/
|
|
87
101
|
async getTracker(accountId, fortniteToken) {
|
|
88
|
-
return this.client.request(`/
|
|
102
|
+
return this.client.request(`/events/tracker?accountId=${accountId}`, {
|
|
89
103
|
headers: {
|
|
90
104
|
"x-fortnite-token": fortniteToken,
|
|
91
105
|
},
|
|
@@ -108,7 +122,7 @@ class TournamentsResource {
|
|
|
108
122
|
if (options?.requiredTournaments) {
|
|
109
123
|
params.append("requiredTournaments", options.requiredTournaments.toString());
|
|
110
124
|
}
|
|
111
|
-
return this.client.request(`/
|
|
125
|
+
return this.client.request(`/events/tracker/eligibility?${params.toString()}`, {
|
|
112
126
|
headers: {
|
|
113
127
|
"x-fortnite-token": fortniteToken,
|
|
114
128
|
},
|
|
@@ -43,7 +43,7 @@ class WeaponsResource {
|
|
|
43
43
|
* Get rarity definitions (colors, display names, backend values)
|
|
44
44
|
*/
|
|
45
45
|
async getRarityDefinitions() {
|
|
46
|
-
return this.client.request("/rarity", {}, "v2");
|
|
46
|
+
return this.client.request("/weapons/rarity", {}, "v2");
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
exports.WeaponsResource = WeaponsResource;
|