@yaelouuu/fortnite-api 7.1.1 → 7.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.
- package/dist/client.d.ts +6 -0
- package/dist/client.js +24 -0
- package/dist/resources/account.d.ts +6 -0
- package/dist/resources/account.js +9 -0
- package/dist/resources/battlepass.d.ts +3 -2
- package/dist/resources/battlepass.js +5 -3
- package/dist/resources/bundles.d.ts +2 -2
- package/dist/resources/bundles.js +2 -2
- package/dist/resources/cosmetics.d.ts +14 -3
- package/dist/resources/cosmetics.js +18 -5
- package/dist/resources/events.d.ts +19 -1
- package/dist/resources/events.js +22 -0
- package/dist/resources/fn.d.ts +4 -4
- package/dist/resources/fn.js +5 -4
- package/dist/resources/map.d.ts +3 -2
- package/dist/resources/map.js +9 -3
- package/dist/resources/news.d.ts +8 -4
- package/dist/resources/news.js +16 -8
- package/dist/resources/oauth.d.ts +26 -1
- package/dist/resources/oauth.js +28 -0
- package/dist/resources/parsing.d.ts +90 -5
- package/dist/resources/parsing.js +170 -24
- package/dist/resources/playlists.d.ts +7 -3
- package/dist/resources/playlists.js +13 -6
- package/dist/resources/quests.d.ts +3 -44
- package/dist/resources/quests.js +3 -44
- package/dist/resources/replays.d.ts +82 -0
- package/dist/resources/replays.js +105 -0
- package/dist/resources/shop.d.ts +5 -4
- package/dist/resources/shop.js +6 -4
- package/dist/resources/tournaments.d.ts +42 -1
- package/dist/resources/tournaments.js +53 -0
- package/dist/resources/weapons.d.ts +19 -15
- package/dist/resources/weapons.js +22 -15
- package/dist/types/index.d.ts +73 -0
- package/package.json +1 -1
|
@@ -5,48 +5,194 @@ class ParsingResource {
|
|
|
5
5
|
constructor(client) {
|
|
6
6
|
this.client = client;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
* Parse a single Fortnite replay file
|
|
10
|
-
* @param file - File object (Browser) or Blob/Buffer (Node.js)
|
|
11
|
-
* @param filename - Optional filename (required in Node.js)
|
|
12
|
-
*/
|
|
13
|
-
async parseReplay(file, filename) {
|
|
8
|
+
buildFormData(file, filename) {
|
|
14
9
|
const formData = new FormData();
|
|
15
|
-
// In browser: File object has name
|
|
16
|
-
// In Node.js: Need to pass filename
|
|
17
10
|
if (file instanceof File) {
|
|
18
|
-
formData.append("
|
|
11
|
+
formData.append("file", file);
|
|
19
12
|
}
|
|
20
13
|
else {
|
|
21
|
-
formData.append("
|
|
14
|
+
formData.append("file", file, filename || "replay.replay");
|
|
22
15
|
}
|
|
23
|
-
|
|
16
|
+
return formData;
|
|
17
|
+
}
|
|
18
|
+
buildMultiFormData(files, filenames) {
|
|
19
|
+
const formData = new FormData();
|
|
20
|
+
files.forEach((file, index) => {
|
|
21
|
+
if (file instanceof File) {
|
|
22
|
+
formData.append("files", file);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
formData.append("files", file, filenames?.[index] || `replay-${index}.replay`);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return formData;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Parse a single Fortnite replay file — full parse.
|
|
32
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
33
|
+
* @param file - File object (Browser) or Blob (Node.js)
|
|
34
|
+
* @param filename - Filename (required in Node.js when passing a Blob)
|
|
35
|
+
*/
|
|
36
|
+
async parseReplay(file, filename) {
|
|
37
|
+
const response = await this.client.requestMultipart("/parsing", this.buildFormData(file, filename));
|
|
24
38
|
if (!response.success || !response.data) {
|
|
25
39
|
throw new Error(response.error || "Failed to parse replay");
|
|
26
40
|
}
|
|
27
41
|
return response.data;
|
|
28
42
|
}
|
|
29
43
|
/**
|
|
30
|
-
* Parse
|
|
44
|
+
* Parse a single replay — stats only (faster, skips movement/zones/kill feed).
|
|
45
|
+
* Returns: name, replayId, version, stats (elims, damage, accuracy, placement, assists, etc.).
|
|
46
|
+
* Subject to per-plan parsing quota limits (1 credit).
|
|
47
|
+
* @param file - File object or Blob
|
|
48
|
+
* @param filename - Filename (required in Node.js)
|
|
49
|
+
*/
|
|
50
|
+
async parseReplayStats(file, filename) {
|
|
51
|
+
const response = await this.client.requestMultipart("/parsing/stats", this.buildFormData(file, filename));
|
|
52
|
+
if (!response.success || !response.data) {
|
|
53
|
+
throw new Error(response.error || "Failed to parse replay stats");
|
|
54
|
+
}
|
|
55
|
+
return response.data;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Parse a single replay — map context.
|
|
59
|
+
* Returns: bus flight path + drop window, all storm circles with timing, supply drops, llamas, reboot vans.
|
|
60
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
61
|
+
* @param file - File object or Blob
|
|
62
|
+
* @param filename - Filename (required in Node.js)
|
|
63
|
+
*/
|
|
64
|
+
async parseReplayMap(file, filename) {
|
|
65
|
+
const response = await this.client.requestMultipart("/parsing/map", this.buildFormData(file, filename));
|
|
66
|
+
if (!response.success || !response.data) {
|
|
67
|
+
throw new Error(response.error || "Failed to parse replay map");
|
|
68
|
+
}
|
|
69
|
+
return response.data;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Parse a single replay — ground loot data.
|
|
73
|
+
* Returns all items that were on the ground near the player: position, item ID, picked-up status and time.
|
|
74
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
75
|
+
* @param file - File object or Blob
|
|
76
|
+
* @param filename - Filename (required in Node.js)
|
|
77
|
+
*/
|
|
78
|
+
async parseReplayLoot(file, filename) {
|
|
79
|
+
const response = await this.client.requestMultipart("/parsing/loot", this.buildFormData(file, filename));
|
|
80
|
+
if (!response.success || !response.data) {
|
|
81
|
+
throw new Error(response.error || "Failed to parse replay loot");
|
|
82
|
+
}
|
|
83
|
+
return response.data;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Parse a single replay — match timeline.
|
|
87
|
+
* Returns all events relative to bus drop: kills, knocks, own death, damage dealt/taken, healed, pickups.
|
|
88
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
89
|
+
* @param file - File object or Blob
|
|
90
|
+
* @param filename - Filename (required in Node.js)
|
|
91
|
+
*/
|
|
92
|
+
async parseReplayTimeline(file, filename) {
|
|
93
|
+
const response = await this.client.requestMultipart("/parsing/timeline", this.buildFormData(file, filename));
|
|
94
|
+
if (!response.success || !response.data) {
|
|
95
|
+
throw new Error(response.error || "Failed to parse replay timeline");
|
|
96
|
+
}
|
|
97
|
+
return response.data;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Parse a single replay — storm zone data.
|
|
101
|
+
* Returns all safe zone phases with circle positions, timing, damage per tick, and phase count.
|
|
102
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
103
|
+
* @param file - File object or Blob
|
|
104
|
+
* @param filename - Filename (required in Node.js)
|
|
105
|
+
*/
|
|
106
|
+
async parseReplayZones(file, filename) {
|
|
107
|
+
const response = await this.client.requestMultipart("/parsing/zones", this.buildFormData(file, filename));
|
|
108
|
+
if (!response.success || !response.data) {
|
|
109
|
+
throw new Error(response.error || "Failed to parse replay zones");
|
|
110
|
+
}
|
|
111
|
+
return response.data;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Parse a single replay — full player lobby.
|
|
115
|
+
* Returns all players with placement, kills, death info, cosmetics, and team data.
|
|
116
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
117
|
+
* @param file - File object or Blob
|
|
118
|
+
* @param filename - Filename (required in Node.js)
|
|
119
|
+
*/
|
|
120
|
+
async parseReplayLobby(file, filename) {
|
|
121
|
+
const response = await this.client.requestMultipart("/parsing/lobby", this.buildFormData(file, filename));
|
|
122
|
+
if (!response.success || !response.data) {
|
|
123
|
+
throw new Error(response.error || "Failed to parse replay lobby");
|
|
124
|
+
}
|
|
125
|
+
return response.data;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Parse a single replay — full broadcast payload.
|
|
129
|
+
* Combines all data: header, stats, full lobby, storm zones, map objects, ground loot, and timeline.
|
|
130
|
+
* Equivalent to calling all parse endpoints in one request.
|
|
131
|
+
* Subject to per-plan parsing quota limits (20 credits).
|
|
132
|
+
* @param file - File object or Blob
|
|
133
|
+
* @param filename - Filename (required in Node.js)
|
|
134
|
+
*/
|
|
135
|
+
async parseReplayBroadcast(file, filename) {
|
|
136
|
+
const response = await this.client.requestMultipart("/parsing/broadcast", this.buildFormData(file, filename));
|
|
137
|
+
if (!response.success || !response.data) {
|
|
138
|
+
throw new Error(response.error || "Failed to parse replay broadcast");
|
|
139
|
+
}
|
|
140
|
+
return response.data;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Parse multiple replay files in batch — full parse.
|
|
144
|
+
* All files are processed in parallel.
|
|
145
|
+
* Subject to per-plan parsing quota limits (10 credits).
|
|
31
146
|
* @param files - Array of File objects or Blobs
|
|
32
|
-
* @param filenames -
|
|
147
|
+
* @param filenames - Filenames (required in Node.js when passing Blobs)
|
|
33
148
|
*/
|
|
34
149
|
async parseMultipleReplays(files, filenames) {
|
|
35
|
-
const
|
|
36
|
-
files.forEach((file, index) => {
|
|
37
|
-
if (file instanceof File) {
|
|
38
|
-
formData.append("Files", file);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
const name = filenames?.[index] || `replay-${index}.replay`;
|
|
42
|
-
formData.append("Files", file, name);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
const response = await this.client.requestMultipart("/parsing/multiple", formData);
|
|
150
|
+
const response = await this.client.requestMultipart("/parsing/multiple", this.buildMultiFormData(files, filenames));
|
|
46
151
|
if (!response.success || !response.results) {
|
|
47
152
|
throw new Error(response.error || "Failed to parse replays");
|
|
48
153
|
}
|
|
49
154
|
return response.results;
|
|
50
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Parse multiple replay files — stats only.
|
|
158
|
+
* Faster than full parse — skips movement, zones, and kill feed.
|
|
159
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
160
|
+
* @param files - Array of File objects or Blobs
|
|
161
|
+
* @param filenames - Filenames (required in Node.js)
|
|
162
|
+
*/
|
|
163
|
+
async parseMultipleReplaysStats(files, filenames) {
|
|
164
|
+
const response = await this.client.requestMultipart("/parsing/multiple/stats", this.buildMultiFormData(files, filenames));
|
|
165
|
+
if (!response.success || !response.results) {
|
|
166
|
+
throw new Error(response.error || "Failed to parse replays stats");
|
|
167
|
+
}
|
|
168
|
+
return response.results;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Parse multiple replay files — map context for each.
|
|
172
|
+
* Returns bus path, storm circles, supply drops, llamas, reboot vans per file.
|
|
173
|
+
* Subject to per-plan parsing quota limits (10 credits).
|
|
174
|
+
* @param files - Array of File objects or Blobs
|
|
175
|
+
* @param filenames - Filenames (required in Node.js)
|
|
176
|
+
*/
|
|
177
|
+
async parseMultipleReplaysMap(files, filenames) {
|
|
178
|
+
const response = await this.client.requestMultipart("/parsing/multiple/map", this.buildMultiFormData(files, filenames));
|
|
179
|
+
if (!response.success || !response.results) {
|
|
180
|
+
throw new Error(response.error || "Failed to parse replays map");
|
|
181
|
+
}
|
|
182
|
+
return response.results;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Parse multiple replay files — ground loot data for each.
|
|
186
|
+
* Subject to per-plan parsing quota limits (10 credits).
|
|
187
|
+
* @param files - Array of File objects or Blobs
|
|
188
|
+
* @param filenames - Filenames (required in Node.js)
|
|
189
|
+
*/
|
|
190
|
+
async parseMultipleReplaysLoot(files, filenames) {
|
|
191
|
+
const response = await this.client.requestMultipart("/parsing/multiple/loot", this.buildMultiFormData(files, filenames));
|
|
192
|
+
if (!response.success || !response.results) {
|
|
193
|
+
throw new Error(response.error || "Failed to parse replays loot");
|
|
194
|
+
}
|
|
195
|
+
return response.results;
|
|
196
|
+
}
|
|
51
197
|
}
|
|
52
198
|
exports.ParsingResource = ParsingResource;
|
|
@@ -5,14 +5,18 @@ export declare class PlaylistsResource {
|
|
|
5
5
|
constructor(client: FortniteAPI);
|
|
6
6
|
/**
|
|
7
7
|
* Get all Fortnite playlists/gamemodes
|
|
8
|
+
* @param lang - Language code (default: en)
|
|
8
9
|
*/
|
|
9
|
-
getAll(): Promise<PlaylistsResponse>;
|
|
10
|
+
getAll(lang?: string): Promise<PlaylistsResponse>;
|
|
10
11
|
/**
|
|
11
12
|
* Get currently active playlists/gamemodes
|
|
13
|
+
* @param lang - Language code (default: en)
|
|
12
14
|
*/
|
|
13
|
-
getActive(): Promise<ActivePlaylistsResponse>;
|
|
15
|
+
getActive(lang?: string): Promise<ActivePlaylistsResponse>;
|
|
14
16
|
/**
|
|
15
17
|
* Get a specific playlist by ID
|
|
18
|
+
* @param playlistId - Playlist identifier
|
|
19
|
+
* @param lang - Language code (default: en)
|
|
16
20
|
*/
|
|
17
|
-
getById(playlistId: string): Promise<PlaylistResponse>;
|
|
21
|
+
getById(playlistId: string, lang?: string): Promise<PlaylistResponse>;
|
|
18
22
|
}
|
|
@@ -7,21 +7,28 @@ class PlaylistsResource {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Get all Fortnite playlists/gamemodes
|
|
10
|
+
* @param lang - Language code (default: en)
|
|
10
11
|
*/
|
|
11
|
-
async getAll() {
|
|
12
|
-
|
|
12
|
+
async getAll(lang) {
|
|
13
|
+
const query = lang ? `?lang=${encodeURIComponent(lang)}` : "";
|
|
14
|
+
return this.client.request(`/playlists${query}`, {}, "v2");
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* Get currently active playlists/gamemodes
|
|
18
|
+
* @param lang - Language code (default: en)
|
|
16
19
|
*/
|
|
17
|
-
async getActive() {
|
|
18
|
-
|
|
20
|
+
async getActive(lang) {
|
|
21
|
+
const query = lang ? `?lang=${encodeURIComponent(lang)}` : "";
|
|
22
|
+
return this.client.request(`/playlists/active${query}`, {}, "v2");
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
25
|
* Get a specific playlist by ID
|
|
26
|
+
* @param playlistId - Playlist identifier
|
|
27
|
+
* @param lang - Language code (default: en)
|
|
22
28
|
*/
|
|
23
|
-
async getById(playlistId) {
|
|
24
|
-
|
|
29
|
+
async getById(playlistId, lang) {
|
|
30
|
+
const query = lang ? `?lang=${encodeURIComponent(lang)}` : "";
|
|
31
|
+
return this.client.request(`/playlists/${playlistId}${query}`, {}, "v2");
|
|
25
32
|
}
|
|
26
33
|
}
|
|
27
34
|
exports.PlaylistsResource = PlaylistsResource;
|
|
@@ -1,53 +1,12 @@
|
|
|
1
1
|
import { FortniteAPI } from "../client";
|
|
2
2
|
import { QuestsResponse } from "../types";
|
|
3
|
-
/**
|
|
4
|
-
* QuestsResource provides access to Fortnite quests and account progression data
|
|
5
|
-
*
|
|
6
|
-
* This resource allows you to fetch player quest progress, XP, playtime, and account level.
|
|
7
|
-
* All methods require the user's personal Fortnite OAuth token obtained through the OAuth flow.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* // Get quests for an account
|
|
12
|
-
* const quests = await client.quests.getQuests(
|
|
13
|
-
* "account-id-here",
|
|
14
|
-
* "user-fortnite-token-here"
|
|
15
|
-
* );
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
3
|
export declare class QuestsResource {
|
|
19
4
|
private client;
|
|
20
5
|
constructor(client: FortniteAPI);
|
|
21
6
|
/**
|
|
22
|
-
* Get
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* - Active quest progress and completion status
|
|
26
|
-
* - Account XP and level information
|
|
27
|
-
* - Total playtime statistics
|
|
28
|
-
* - Quest rewards and milestones
|
|
29
|
-
*
|
|
30
|
-
* **Authentication**: Requires user's personal Fortnite OAuth token
|
|
31
|
-
*
|
|
32
|
-
* **API Version**: v2
|
|
33
|
-
*
|
|
34
|
-
* **Rate Limit**: Standard API rate limits apply
|
|
35
|
-
*
|
|
36
|
-
* @param accountId - Epic Games Account ID (32 character hexadecimal string)
|
|
37
|
-
* @param fortniteToken - User's Fortnite access token obtained from OAuth flow
|
|
38
|
-
*
|
|
39
|
-
* @returns Promise resolving to quest progress, XP, playtime, and account level data
|
|
40
|
-
*
|
|
41
|
-
* @throws {FortniteAPIError} When the request fails (invalid token, account not found, etc.)
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```typescript
|
|
45
|
-
* const accountId = "a1b2c3d4e5f6..."; // 32 character account ID
|
|
46
|
-
* const token = "eg1~..."; // User's Fortnite OAuth token
|
|
47
|
-
*
|
|
48
|
-
* const questData = await client.quests.getQuests(accountId, token);
|
|
49
|
-
* console.log(questData);
|
|
50
|
-
* ```
|
|
7
|
+
* Get active quests and challenges for a player. Requires x-fortnite-token.
|
|
8
|
+
* @param accountId - Epic Games account ID
|
|
9
|
+
* @param fortniteToken - User's Fortnite access token (required)
|
|
51
10
|
*/
|
|
52
11
|
getQuests(accountId: string, fortniteToken: string): Promise<QuestsResponse>;
|
|
53
12
|
}
|
package/dist/resources/quests.js
CHANGED
|
@@ -1,55 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QuestsResource = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* QuestsResource provides access to Fortnite quests and account progression data
|
|
6
|
-
*
|
|
7
|
-
* This resource allows you to fetch player quest progress, XP, playtime, and account level.
|
|
8
|
-
* All methods require the user's personal Fortnite OAuth token obtained through the OAuth flow.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* // Get quests for an account
|
|
13
|
-
* const quests = await client.quests.getQuests(
|
|
14
|
-
* "account-id-here",
|
|
15
|
-
* "user-fortnite-token-here"
|
|
16
|
-
* );
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
4
|
class QuestsResource {
|
|
20
5
|
constructor(client) {
|
|
21
6
|
this.client = client;
|
|
22
7
|
}
|
|
23
8
|
/**
|
|
24
|
-
* Get
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* - Active quest progress and completion status
|
|
28
|
-
* - Account XP and level information
|
|
29
|
-
* - Total playtime statistics
|
|
30
|
-
* - Quest rewards and milestones
|
|
31
|
-
*
|
|
32
|
-
* **Authentication**: Requires user's personal Fortnite OAuth token
|
|
33
|
-
*
|
|
34
|
-
* **API Version**: v2
|
|
35
|
-
*
|
|
36
|
-
* **Rate Limit**: Standard API rate limits apply
|
|
37
|
-
*
|
|
38
|
-
* @param accountId - Epic Games Account ID (32 character hexadecimal string)
|
|
39
|
-
* @param fortniteToken - User's Fortnite access token obtained from OAuth flow
|
|
40
|
-
*
|
|
41
|
-
* @returns Promise resolving to quest progress, XP, playtime, and account level data
|
|
42
|
-
*
|
|
43
|
-
* @throws {FortniteAPIError} When the request fails (invalid token, account not found, etc.)
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
* const accountId = "a1b2c3d4e5f6..."; // 32 character account ID
|
|
48
|
-
* const token = "eg1~..."; // User's Fortnite OAuth token
|
|
49
|
-
*
|
|
50
|
-
* const questData = await client.quests.getQuests(accountId, token);
|
|
51
|
-
* console.log(questData);
|
|
52
|
-
* ```
|
|
9
|
+
* Get active quests and challenges for a player. Requires x-fortnite-token.
|
|
10
|
+
* @param accountId - Epic Games account ID
|
|
11
|
+
* @param fortniteToken - User's Fortnite access token (required)
|
|
53
12
|
*/
|
|
54
13
|
async getQuests(accountId, fortniteToken) {
|
|
55
14
|
return this.client.request(`/quests/${accountId}`, {
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { FortniteAPI } from "../client";
|
|
2
|
+
import { ParsedReplayData } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Replays Resource
|
|
5
|
+
* Download and parse tournament server replay files by match ID.
|
|
6
|
+
* Match IDs come from Epic's tournament events API.
|
|
7
|
+
* All parse endpoints subject to per-plan parsing quota limits.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ReplaysResource {
|
|
10
|
+
private client;
|
|
11
|
+
constructor(client: FortniteAPI);
|
|
12
|
+
/**
|
|
13
|
+
* Download a tournament replay file by match ID.
|
|
14
|
+
* Returns the raw .replay binary as an ArrayBuffer.
|
|
15
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
16
|
+
*/
|
|
17
|
+
download(matchId: string): Promise<ArrayBuffer>;
|
|
18
|
+
/**
|
|
19
|
+
* Get the raw chunk manifest (metadata) for a tournament replay.
|
|
20
|
+
* Returns Events, DataChunks, Checkpoints arrays with timing info.
|
|
21
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
22
|
+
*/
|
|
23
|
+
getMetadata(matchId: string): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Download and fully parse a tournament replay — full parse.
|
|
26
|
+
* Returns the same structure as POST /api/v1/parsing.
|
|
27
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
28
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
29
|
+
*/
|
|
30
|
+
parse(matchId: string): Promise<ParsedReplayData>;
|
|
31
|
+
/**
|
|
32
|
+
* Download and parse a tournament replay — stats only.
|
|
33
|
+
* Faster than full parse. Returns name, replayId, version, playlist, teamSize, teamCount, isTournament, tournamentRound, stats.
|
|
34
|
+
* Subject to per-plan parsing quota limits (1 credit).
|
|
35
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
36
|
+
*/
|
|
37
|
+
parseStats(matchId: string): Promise<ParsedReplayData>;
|
|
38
|
+
/**
|
|
39
|
+
* Download and parse a tournament replay — map context.
|
|
40
|
+
* Returns bus path, storm circles, supply drops, llamas, reboot vans.
|
|
41
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
42
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
43
|
+
*/
|
|
44
|
+
parseMap(matchId: string): Promise<ParsedReplayData>;
|
|
45
|
+
/**
|
|
46
|
+
* Download and parse a tournament replay — ground loot.
|
|
47
|
+
* Server replays give whole-map loot coverage (vs ~150m radius for client replays).
|
|
48
|
+
* Returns all item spawns: position, item ID, picked-up status and time.
|
|
49
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
50
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
51
|
+
*/
|
|
52
|
+
parseLoot(matchId: string): Promise<ParsedReplayData>;
|
|
53
|
+
/**
|
|
54
|
+
* Download and parse a tournament replay — full player lobby.
|
|
55
|
+
* Returns all players with kills, placement, damage, reboots, headshots, teamKills, death info, and cosmetics.
|
|
56
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
57
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
58
|
+
*/
|
|
59
|
+
parseLobby(matchId: string): Promise<ParsedReplayData>;
|
|
60
|
+
/**
|
|
61
|
+
* Download and parse a tournament replay — storm zones.
|
|
62
|
+
* Returns all safe zone phases with timing, positions, and damage per tick.
|
|
63
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
64
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
65
|
+
*/
|
|
66
|
+
parseZones(matchId: string): Promise<ParsedReplayData>;
|
|
67
|
+
/**
|
|
68
|
+
* Download and parse a tournament replay — match timeline.
|
|
69
|
+
* Returns chronological event feed: kills, knocks, death, damage dealt/taken, heals, pickups.
|
|
70
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
71
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
72
|
+
*/
|
|
73
|
+
parseTimeline(matchId: string): Promise<ParsedReplayData>;
|
|
74
|
+
/**
|
|
75
|
+
* Download and parse a tournament replay — full broadcast payload.
|
|
76
|
+
* Combines all data: stats, full lobby, storm zones, map objects, ground loot, and timeline.
|
|
77
|
+
* Equivalent to calling all parse endpoints in one request.
|
|
78
|
+
* Subject to per-plan parsing quota limits (20 credits).
|
|
79
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
80
|
+
*/
|
|
81
|
+
parseBroadcast(matchId: string): Promise<ParsedReplayData>;
|
|
82
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReplaysResource = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Replays Resource
|
|
6
|
+
* Download and parse tournament server replay files by match ID.
|
|
7
|
+
* Match IDs come from Epic's tournament events API.
|
|
8
|
+
* All parse endpoints subject to per-plan parsing quota limits.
|
|
9
|
+
*/
|
|
10
|
+
class ReplaysResource {
|
|
11
|
+
constructor(client) {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Download a tournament replay file by match ID.
|
|
16
|
+
* Returns the raw .replay binary as an ArrayBuffer.
|
|
17
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
18
|
+
*/
|
|
19
|
+
async download(matchId) {
|
|
20
|
+
return this.client.requestBinary(`/replays/${encodeURIComponent(matchId)}`);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the raw chunk manifest (metadata) for a tournament replay.
|
|
24
|
+
* Returns Events, DataChunks, Checkpoints arrays with timing info.
|
|
25
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
26
|
+
*/
|
|
27
|
+
async getMetadata(matchId) {
|
|
28
|
+
return this.client.request(`/replays/${encodeURIComponent(matchId)}/metadata`, {}, "v1");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Download and fully parse a tournament replay — full parse.
|
|
32
|
+
* Returns the same structure as POST /api/v1/parsing.
|
|
33
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
34
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
35
|
+
*/
|
|
36
|
+
async parse(matchId) {
|
|
37
|
+
return this.client.request(`/replays/${encodeURIComponent(matchId)}/parse`, {}, "v1");
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Download and parse a tournament replay — stats only.
|
|
41
|
+
* Faster than full parse. Returns name, replayId, version, playlist, teamSize, teamCount, isTournament, tournamentRound, stats.
|
|
42
|
+
* Subject to per-plan parsing quota limits (1 credit).
|
|
43
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
44
|
+
*/
|
|
45
|
+
async parseStats(matchId) {
|
|
46
|
+
return this.client.request(`/replays/${encodeURIComponent(matchId)}/parse/stats`, {}, "v1");
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Download and parse a tournament replay — map context.
|
|
50
|
+
* Returns bus path, storm circles, supply drops, llamas, reboot vans.
|
|
51
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
52
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
53
|
+
*/
|
|
54
|
+
async parseMap(matchId) {
|
|
55
|
+
return this.client.request(`/replays/${encodeURIComponent(matchId)}/parse/map`, {}, "v1");
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Download and parse a tournament replay — ground loot.
|
|
59
|
+
* Server replays give whole-map loot coverage (vs ~150m radius for client replays).
|
|
60
|
+
* Returns all item spawns: position, item ID, picked-up status and time.
|
|
61
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
62
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
63
|
+
*/
|
|
64
|
+
async parseLoot(matchId) {
|
|
65
|
+
return this.client.request(`/replays/${encodeURIComponent(matchId)}/parse/loot`, {}, "v1");
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Download and parse a tournament replay — full player lobby.
|
|
69
|
+
* Returns all players with kills, placement, damage, reboots, headshots, teamKills, death info, and cosmetics.
|
|
70
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
71
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
72
|
+
*/
|
|
73
|
+
async parseLobby(matchId) {
|
|
74
|
+
return this.client.request(`/replays/${encodeURIComponent(matchId)}/parse/lobby`, {}, "v1");
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Download and parse a tournament replay — storm zones.
|
|
78
|
+
* Returns all safe zone phases with timing, positions, and damage per tick.
|
|
79
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
80
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
81
|
+
*/
|
|
82
|
+
async parseZones(matchId) {
|
|
83
|
+
return this.client.request(`/replays/${encodeURIComponent(matchId)}/parse/zones`, {}, "v1");
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Download and parse a tournament replay — match timeline.
|
|
87
|
+
* Returns chronological event feed: kills, knocks, death, damage dealt/taken, heals, pickups.
|
|
88
|
+
* Subject to per-plan parsing quota limits (5 credits).
|
|
89
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
90
|
+
*/
|
|
91
|
+
async parseTimeline(matchId) {
|
|
92
|
+
return this.client.request(`/replays/${encodeURIComponent(matchId)}/parse/timeline`, {}, "v1");
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Download and parse a tournament replay — full broadcast payload.
|
|
96
|
+
* Combines all data: stats, full lobby, storm zones, map objects, ground loot, and timeline.
|
|
97
|
+
* Equivalent to calling all parse endpoints in one request.
|
|
98
|
+
* Subject to per-plan parsing quota limits (20 credits).
|
|
99
|
+
* @param matchId - Match ID from Epic's tournament events API
|
|
100
|
+
*/
|
|
101
|
+
async parseBroadcast(matchId) {
|
|
102
|
+
return this.client.request(`/replays/${encodeURIComponent(matchId)}/parse/broadcast`, {}, "v1");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.ReplaysResource = ReplaysResource;
|
package/dist/resources/shop.d.ts
CHANGED
|
@@ -5,16 +5,17 @@ export declare class ShopResource {
|
|
|
5
5
|
constructor(client: FortniteAPI);
|
|
6
6
|
/**
|
|
7
7
|
* Get current shop items with optional filtering
|
|
8
|
-
* @param options -
|
|
9
|
-
* @param options.type - Filter by cosmetic type: outfit, emote, pickaxe, glider, backpack, wrap, music, loadingscreen, contrail, spray, toy, emoji, pet, bundle
|
|
8
|
+
* @param options.type - Filter by cosmetic type (e.g. outfit, emote, pickaxe, glider)
|
|
10
9
|
* @param options.section - Filter by shop section name (e.g. "Featured", "Daily", "Kicks")
|
|
11
|
-
* @param options.rarity - Filter by rarity
|
|
12
|
-
* @param options.search - Search items by name
|
|
10
|
+
* @param options.rarity - Filter by rarity (e.g. rare, epic, legendary)
|
|
11
|
+
* @param options.search - Search items by name
|
|
12
|
+
* @param options.lang - Language code (default: en)
|
|
13
13
|
*/
|
|
14
14
|
getCurrent(options?: {
|
|
15
15
|
type?: string;
|
|
16
16
|
section?: string;
|
|
17
17
|
rarity?: string;
|
|
18
18
|
search?: string;
|
|
19
|
+
lang?: string;
|
|
19
20
|
}): Promise<Shop>;
|
|
20
21
|
}
|
package/dist/resources/shop.js
CHANGED
|
@@ -7,11 +7,11 @@ class ShopResource {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Get current shop items with optional filtering
|
|
10
|
-
* @param options -
|
|
11
|
-
* @param options.type - Filter by cosmetic type: outfit, emote, pickaxe, glider, backpack, wrap, music, loadingscreen, contrail, spray, toy, emoji, pet, bundle
|
|
10
|
+
* @param options.type - Filter by cosmetic type (e.g. outfit, emote, pickaxe, glider)
|
|
12
11
|
* @param options.section - Filter by shop section name (e.g. "Featured", "Daily", "Kicks")
|
|
13
|
-
* @param options.rarity - Filter by rarity
|
|
14
|
-
* @param options.search - Search items by name
|
|
12
|
+
* @param options.rarity - Filter by rarity (e.g. rare, epic, legendary)
|
|
13
|
+
* @param options.search - Search items by name
|
|
14
|
+
* @param options.lang - Language code (default: en)
|
|
15
15
|
*/
|
|
16
16
|
async getCurrent(options) {
|
|
17
17
|
const params = new URLSearchParams();
|
|
@@ -23,6 +23,8 @@ class ShopResource {
|
|
|
23
23
|
params.set("rarity", options.rarity);
|
|
24
24
|
if (options?.search)
|
|
25
25
|
params.set("search", options.search);
|
|
26
|
+
if (options?.lang)
|
|
27
|
+
params.set("lang", options.lang);
|
|
26
28
|
const query = params.toString() ? `?${params.toString()}` : "";
|
|
27
29
|
return this.client.request(`/shop${query}`);
|
|
28
30
|
}
|