@yaelouuu/fortnite-api 5.0.0 → 5.1.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 +0 -0
- package/dist/client.js +0 -0
- package/dist/errors.d.ts +0 -0
- package/dist/errors.js +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/resources/battlepass.d.ts +0 -0
- package/dist/resources/battlepass.js +0 -0
- package/dist/resources/bundles.d.ts +0 -0
- package/dist/resources/bundles.js +0 -0
- package/dist/resources/calendar.d.ts +0 -0
- package/dist/resources/calendar.js +0 -0
- package/dist/resources/cosmetics.js +4 -0
- package/dist/resources/map.d.ts +10 -3
- package/dist/resources/map.js +18 -6
- package/dist/resources/oauth.d.ts +0 -0
- package/dist/resources/oauth.js +0 -0
- package/dist/resources/parsing.d.ts +0 -0
- package/dist/resources/parsing.js +0 -0
- package/dist/resources/profiles.d.ts +0 -0
- package/dist/resources/profiles.js +0 -0
- package/dist/resources/quests.d.ts +0 -0
- package/dist/resources/quests.js +0 -0
- package/dist/resources/shop.d.ts +0 -0
- package/dist/resources/shop.js +0 -0
- package/dist/resources/tournaments.d.ts +3 -5
- package/dist/resources/tournaments.js +7 -9
- package/dist/resources/weapons.d.ts +5 -1
- package/dist/resources/weapons.js +6 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +0 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
File without changes
|
package/dist/client.js
CHANGED
|
File without changes
|
package/dist/errors.d.ts
CHANGED
|
File without changes
|
package/dist/errors.js
CHANGED
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -22,6 +22,10 @@ class CosmeticsResource {
|
|
|
22
22
|
queryParams.set("set", params.set);
|
|
23
23
|
if (params?.search)
|
|
24
24
|
queryParams.set("search", params.search);
|
|
25
|
+
if (params?.season)
|
|
26
|
+
queryParams.set("season", params.season.toString());
|
|
27
|
+
if (params?.chapter)
|
|
28
|
+
queryParams.set("chapter", params.chapter.toString());
|
|
25
29
|
const query = queryParams.toString();
|
|
26
30
|
const endpoint = query ? `/cosmetics/all?${query}` : "/cosmetics/all";
|
|
27
31
|
return this.client.request(endpoint);
|
package/dist/resources/map.d.ts
CHANGED
|
@@ -5,14 +5,21 @@ export declare class MapResource {
|
|
|
5
5
|
constructor(client: FortniteAPI);
|
|
6
6
|
/**
|
|
7
7
|
* Get current Fortnite map with POIs
|
|
8
|
+
* @param version - Optional specific map version to retrieve
|
|
8
9
|
*/
|
|
9
|
-
getCurrent(): Promise<MapResponse>;
|
|
10
|
+
getCurrent(version?: string): Promise<MapResponse>;
|
|
10
11
|
/**
|
|
11
12
|
* Get current map image URL
|
|
13
|
+
* @param version - Optional specific map version to retrieve
|
|
12
14
|
*/
|
|
13
|
-
getImage(): Promise<MapImageResponse>;
|
|
15
|
+
getImage(version?: string): Promise<MapImageResponse>;
|
|
14
16
|
/**
|
|
15
17
|
* Get historical map data
|
|
18
|
+
* @param options.chapter - Filter by chapter number
|
|
19
|
+
* @param options.season - Filter by season number
|
|
16
20
|
*/
|
|
17
|
-
getHistory(
|
|
21
|
+
getHistory(options?: {
|
|
22
|
+
chapter?: number;
|
|
23
|
+
season?: number;
|
|
24
|
+
}): Promise<MapHistoryResponse>;
|
|
18
25
|
}
|
package/dist/resources/map.js
CHANGED
|
@@ -7,21 +7,33 @@ class MapResource {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Get current Fortnite map with POIs
|
|
10
|
+
* @param version - Optional specific map version to retrieve
|
|
10
11
|
*/
|
|
11
|
-
async getCurrent() {
|
|
12
|
-
|
|
12
|
+
async getCurrent(version) {
|
|
13
|
+
const query = version ? `?version=${encodeURIComponent(version)}` : "";
|
|
14
|
+
return this.client.request(`/map${query}`);
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* Get current map image URL
|
|
18
|
+
* @param version - Optional specific map version to retrieve
|
|
16
19
|
*/
|
|
17
|
-
async getImage() {
|
|
18
|
-
|
|
20
|
+
async getImage(version) {
|
|
21
|
+
const query = version ? `?version=${encodeURIComponent(version)}` : "";
|
|
22
|
+
return this.client.request(`/map/image${query}`);
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
25
|
* Get historical map data
|
|
26
|
+
* @param options.chapter - Filter by chapter number
|
|
27
|
+
* @param options.season - Filter by season number
|
|
22
28
|
*/
|
|
23
|
-
async getHistory() {
|
|
24
|
-
|
|
29
|
+
async getHistory(options) {
|
|
30
|
+
const params = new URLSearchParams();
|
|
31
|
+
if (options?.chapter)
|
|
32
|
+
params.set("chapter", options.chapter.toString());
|
|
33
|
+
if (options?.season)
|
|
34
|
+
params.set("season", options.season.toString());
|
|
35
|
+
const query = params.toString() ? `?${params.toString()}` : "";
|
|
36
|
+
return this.client.request(`/map/history${query}`);
|
|
25
37
|
}
|
|
26
38
|
}
|
|
27
39
|
exports.MapResource = MapResource;
|
|
File without changes
|
package/dist/resources/oauth.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/resources/quests.js
CHANGED
|
File without changes
|
package/dist/resources/shop.d.ts
CHANGED
|
File without changes
|
package/dist/resources/shop.js
CHANGED
|
File without changes
|
|
@@ -4,17 +4,15 @@ export declare class TournamentsResource {
|
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: FortniteAPI);
|
|
6
6
|
/**
|
|
7
|
-
* Get
|
|
8
|
-
* No parameters needed - uses API's default account
|
|
7
|
+
* Get currently active and upcoming tournaments, enriched with CMS metadata
|
|
9
8
|
*/
|
|
10
9
|
getCurrent(): Promise<any>;
|
|
11
10
|
/**
|
|
12
|
-
* Get past
|
|
13
|
-
* No parameters needed - uses API's default account
|
|
11
|
+
* Get all tournaments including past ones, enriched with CMS metadata
|
|
14
12
|
*/
|
|
15
13
|
getPast(): Promise<any>;
|
|
16
14
|
/**
|
|
17
|
-
* Get global events with metadata
|
|
15
|
+
* Get global events with metadata (alias for getCurrent)
|
|
18
16
|
*/
|
|
19
17
|
getGlobal(): Promise<any>;
|
|
20
18
|
getSessions(params: {
|
|
@@ -6,21 +6,19 @@ class TournamentsResource {
|
|
|
6
6
|
this.client = client;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Get
|
|
10
|
-
* No parameters needed - uses API's default account
|
|
9
|
+
* Get currently active and upcoming tournaments, enriched with CMS metadata
|
|
11
10
|
*/
|
|
12
11
|
async getCurrent() {
|
|
13
|
-
return this.client.request("/events/
|
|
12
|
+
return this.client.request("/events/global");
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
|
-
* Get past
|
|
17
|
-
* No parameters needed - uses API's default account
|
|
15
|
+
* Get all tournaments including past ones, enriched with CMS metadata
|
|
18
16
|
*/
|
|
19
17
|
async getPast() {
|
|
20
|
-
return this.client.request("/events/
|
|
18
|
+
return this.client.request("/events/global/history");
|
|
21
19
|
}
|
|
22
20
|
/**
|
|
23
|
-
* Get global events with metadata
|
|
21
|
+
* Get global events with metadata (alias for getCurrent)
|
|
24
22
|
*/
|
|
25
23
|
async getGlobal() {
|
|
26
24
|
return this.client.request("/events/global");
|
|
@@ -43,7 +41,7 @@ class TournamentsResource {
|
|
|
43
41
|
region: params.region,
|
|
44
42
|
platform: params.platform,
|
|
45
43
|
}).toString();
|
|
46
|
-
return this.client.request(`/events/
|
|
44
|
+
return this.client.request(`/events/player?${query}`, {
|
|
47
45
|
headers: {
|
|
48
46
|
"x-fortnite-token": fortniteToken,
|
|
49
47
|
},
|
|
@@ -78,7 +76,7 @@ class TournamentsResource {
|
|
|
78
76
|
},
|
|
79
77
|
}
|
|
80
78
|
: undefined;
|
|
81
|
-
return this.client.request(`/events/leaderboard?${query.toString()}`, options);
|
|
79
|
+
return this.client.request(`/events/global/leaderboard?${query.toString()}`, options);
|
|
82
80
|
}
|
|
83
81
|
/**
|
|
84
82
|
* Get tournament participation history for a player
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FortniteAPI } from "../client";
|
|
2
|
-
import { WeaponsResponse } from "../types";
|
|
2
|
+
import { WeaponsResponse, RarityDefinitionsResponse } from "../types";
|
|
3
3
|
export declare class WeaponsResource {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: FortniteAPI);
|
|
@@ -26,4 +26,8 @@ export declare class WeaponsResource {
|
|
|
26
26
|
ammoType?: string;
|
|
27
27
|
season?: string;
|
|
28
28
|
}): Promise<WeaponsResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Get rarity definitions (colors, display names, backend values)
|
|
31
|
+
*/
|
|
32
|
+
getRarityDefinitions(): Promise<RarityDefinitionsResponse>;
|
|
29
33
|
}
|
|
@@ -39,5 +39,11 @@ class WeaponsResource {
|
|
|
39
39
|
const query = params.toString() ? `?${params.toString()}` : "";
|
|
40
40
|
return this.client.request(`/weapons${query}`, {}, "v2");
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Get rarity definitions (colors, display names, backend values)
|
|
44
|
+
*/
|
|
45
|
+
async getRarityDefinitions() {
|
|
46
|
+
return this.client.request("/rarity", {}, "v2");
|
|
47
|
+
}
|
|
42
48
|
}
|
|
43
49
|
exports.WeaponsResource = WeaponsResource;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -720,6 +720,18 @@ export interface CosmeticsSearchParams {
|
|
|
720
720
|
rarity?: string;
|
|
721
721
|
set?: string;
|
|
722
722
|
search?: string;
|
|
723
|
+
season?: number;
|
|
724
|
+
chapter?: number;
|
|
725
|
+
}
|
|
726
|
+
export interface RarityDefinition {
|
|
727
|
+
value: string;
|
|
728
|
+
displayValue: string;
|
|
729
|
+
backendValue: string;
|
|
730
|
+
color: string;
|
|
731
|
+
}
|
|
732
|
+
export interface RarityDefinitionsResponse {
|
|
733
|
+
status: number;
|
|
734
|
+
data: RarityDefinition[];
|
|
723
735
|
}
|
|
724
736
|
export interface CrewPackResponse {
|
|
725
737
|
status: number;
|
package/dist/types/index.js
CHANGED
|
File without changes
|