@yaelouuu/fortnite-api 4.6.0 → 5.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/resources/shop.d.ts +12 -2
- package/dist/resources/shop.js +18 -3
- package/dist/resources/weapons.d.ts +13 -3
- package/dist/resources/weapons.js +18 -3
- package/dist/types/index.d.ts +68 -24
- package/package.json +1 -1
package/dist/resources/shop.d.ts
CHANGED
|
@@ -4,7 +4,17 @@ export declare class ShopResource {
|
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: FortniteAPI);
|
|
6
6
|
/**
|
|
7
|
-
* Get current shop items
|
|
7
|
+
* Get current shop items with optional filtering
|
|
8
|
+
* @param options - Query options
|
|
9
|
+
* @param options.type - Filter by cosmetic type: outfit, emote, pickaxe, glider, backpack, wrap, music, loadingscreen, contrail, spray, toy, emoji, pet, bundle
|
|
10
|
+
* @param options.section - Filter by shop section name (e.g. "Featured", "Daily", "Kicks")
|
|
11
|
+
* @param options.rarity - Filter by rarity: common, uncommon, rare, epic, legendary, mythic
|
|
12
|
+
* @param options.search - Search items by name (e.g. "galaxy", "travis")
|
|
8
13
|
*/
|
|
9
|
-
getCurrent(
|
|
14
|
+
getCurrent(options?: {
|
|
15
|
+
type?: string;
|
|
16
|
+
section?: string;
|
|
17
|
+
rarity?: string;
|
|
18
|
+
search?: string;
|
|
19
|
+
}): Promise<Shop>;
|
|
10
20
|
}
|
package/dist/resources/shop.js
CHANGED
|
@@ -6,10 +6,25 @@ class ShopResource {
|
|
|
6
6
|
this.client = client;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Get current shop items
|
|
9
|
+
* Get current shop items with optional filtering
|
|
10
|
+
* @param options - Query options
|
|
11
|
+
* @param options.type - Filter by cosmetic type: outfit, emote, pickaxe, glider, backpack, wrap, music, loadingscreen, contrail, spray, toy, emoji, pet, bundle
|
|
12
|
+
* @param options.section - Filter by shop section name (e.g. "Featured", "Daily", "Kicks")
|
|
13
|
+
* @param options.rarity - Filter by rarity: common, uncommon, rare, epic, legendary, mythic
|
|
14
|
+
* @param options.search - Search items by name (e.g. "galaxy", "travis")
|
|
10
15
|
*/
|
|
11
|
-
async getCurrent() {
|
|
12
|
-
|
|
16
|
+
async getCurrent(options) {
|
|
17
|
+
const params = new URLSearchParams();
|
|
18
|
+
if (options?.type)
|
|
19
|
+
params.set("type", options.type);
|
|
20
|
+
if (options?.section)
|
|
21
|
+
params.set("section", options.section);
|
|
22
|
+
if (options?.rarity)
|
|
23
|
+
params.set("rarity", options.rarity);
|
|
24
|
+
if (options?.search)
|
|
25
|
+
params.set("search", options.search);
|
|
26
|
+
const query = params.toString() ? `?${params.toString()}` : "";
|
|
27
|
+
return this.client.request(`/shop${query}`);
|
|
13
28
|
}
|
|
14
29
|
}
|
|
15
30
|
exports.ShopResource = ShopResource;
|
|
@@ -6,14 +6,24 @@ export declare class WeaponsResource {
|
|
|
6
6
|
/**
|
|
7
7
|
* Get weapons data with optional filtering
|
|
8
8
|
* @param options - Query options
|
|
9
|
-
* @param options.version - Version filter: "current" (
|
|
10
|
-
* @param options.category - Filter by category: assault-
|
|
9
|
+
* @param options.version - Version filter: "current" (loot pool), "all" (every weapon), or a specific patch like "39.50"
|
|
10
|
+
* @param options.category - Filter by category: assault-rifle, shotgun, smg, sniper, pistol, explosive, bow, crossbow, melee, light-machine-gun
|
|
11
11
|
* @param options.search - Search weapons by name (e.g. "pump", "assault", "bolt")
|
|
12
|
-
* @
|
|
12
|
+
* @param options.gamemode - Filter by gamemode: "br" (Battle Royale) or "og" (OG mode)
|
|
13
|
+
* @param options.rarity - Filter by rarity: common, uncommon, rare, epic, legendary, mythic, transcendent
|
|
14
|
+
* @param options.type - Filter by weapon type: ranged, melee, consumable, trap, gadget
|
|
15
|
+
* @param options.ammoType - Filter by ammo type: light, medium, heavy, shells, rockets, energy, arrows
|
|
16
|
+
* @param options.season - Filter by season availability: "CH6S7" or "6.7" format
|
|
17
|
+
* @returns Weapons response with metadata, availableSeasons, and weapon data
|
|
13
18
|
*/
|
|
14
19
|
getWeapons(options?: {
|
|
15
20
|
version?: string;
|
|
16
21
|
category?: string;
|
|
17
22
|
search?: string;
|
|
23
|
+
gamemode?: "br" | "og";
|
|
24
|
+
rarity?: string;
|
|
25
|
+
type?: string;
|
|
26
|
+
ammoType?: string;
|
|
27
|
+
season?: string;
|
|
18
28
|
}): Promise<WeaponsResponse>;
|
|
19
29
|
}
|
|
@@ -8,10 +8,15 @@ class WeaponsResource {
|
|
|
8
8
|
/**
|
|
9
9
|
* Get weapons data with optional filtering
|
|
10
10
|
* @param options - Query options
|
|
11
|
-
* @param options.version - Version filter: "current" (
|
|
12
|
-
* @param options.category - Filter by category: assault-
|
|
11
|
+
* @param options.version - Version filter: "current" (loot pool), "all" (every weapon), or a specific patch like "39.50"
|
|
12
|
+
* @param options.category - Filter by category: assault-rifle, shotgun, smg, sniper, pistol, explosive, bow, crossbow, melee, light-machine-gun
|
|
13
13
|
* @param options.search - Search weapons by name (e.g. "pump", "assault", "bolt")
|
|
14
|
-
* @
|
|
14
|
+
* @param options.gamemode - Filter by gamemode: "br" (Battle Royale) or "og" (OG mode)
|
|
15
|
+
* @param options.rarity - Filter by rarity: common, uncommon, rare, epic, legendary, mythic, transcendent
|
|
16
|
+
* @param options.type - Filter by weapon type: ranged, melee, consumable, trap, gadget
|
|
17
|
+
* @param options.ammoType - Filter by ammo type: light, medium, heavy, shells, rockets, energy, arrows
|
|
18
|
+
* @param options.season - Filter by season availability: "CH6S7" or "6.7" format
|
|
19
|
+
* @returns Weapons response with metadata, availableSeasons, and weapon data
|
|
15
20
|
*/
|
|
16
21
|
async getWeapons(options) {
|
|
17
22
|
const params = new URLSearchParams();
|
|
@@ -21,6 +26,16 @@ class WeaponsResource {
|
|
|
21
26
|
params.set("category", options.category);
|
|
22
27
|
if (options?.search)
|
|
23
28
|
params.set("search", options.search);
|
|
29
|
+
if (options?.gamemode)
|
|
30
|
+
params.set("gamemode", options.gamemode);
|
|
31
|
+
if (options?.rarity)
|
|
32
|
+
params.set("rarity", options.rarity);
|
|
33
|
+
if (options?.type)
|
|
34
|
+
params.set("type", options.type);
|
|
35
|
+
if (options?.ammoType)
|
|
36
|
+
params.set("ammoType", options.ammoType);
|
|
37
|
+
if (options?.season)
|
|
38
|
+
params.set("season", options.season);
|
|
24
39
|
const query = params.toString() ? `?${params.toString()}` : "";
|
|
25
40
|
return this.client.request(`/weapons${query}`, {}, "v2");
|
|
26
41
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface CatalogEntry {
|
|
|
12
12
|
offerId: string;
|
|
13
13
|
devName: string;
|
|
14
14
|
offerType: string;
|
|
15
|
-
prices:
|
|
15
|
+
prices: ShopPrice[];
|
|
16
16
|
categories: string[];
|
|
17
17
|
dailyLimit: number;
|
|
18
18
|
weeklyLimit: number;
|
|
@@ -28,18 +28,57 @@ export interface CatalogEntry {
|
|
|
28
28
|
shortDescription: string;
|
|
29
29
|
description: string;
|
|
30
30
|
displayAssetPath: string;
|
|
31
|
-
itemGrants:
|
|
31
|
+
itemGrants: EnrichedItemGrant[];
|
|
32
32
|
giftInfo?: GiftInfo;
|
|
33
|
+
bundle: ShopBundle | null;
|
|
34
|
+
sectionId: string | null;
|
|
35
|
+
sectionDisplayName: string;
|
|
36
|
+
sectionPriority: number;
|
|
37
|
+
sectionBackground: string | null;
|
|
38
|
+
offerVisual: string | null;
|
|
39
|
+
tileSize: string | null;
|
|
33
40
|
}
|
|
34
|
-
export interface
|
|
41
|
+
export interface ShopPrice {
|
|
35
42
|
currencyType: string;
|
|
36
|
-
currencySubType: string;
|
|
37
43
|
regularPrice: number;
|
|
38
|
-
dynamicRegularPrice: number;
|
|
39
44
|
finalPrice: number;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
saleType: string | null;
|
|
46
|
+
}
|
|
47
|
+
export interface ShopBundle {
|
|
48
|
+
name: string | null;
|
|
49
|
+
info: string;
|
|
50
|
+
items: number;
|
|
51
|
+
regularPrice: number;
|
|
52
|
+
finalPrice: number;
|
|
53
|
+
discount: number | null;
|
|
54
|
+
}
|
|
55
|
+
export interface EnrichedItemGrant {
|
|
56
|
+
templateId: string;
|
|
57
|
+
quantity: number;
|
|
58
|
+
attributes: Record<string, any>;
|
|
59
|
+
cosmetic: CosmeticEnrichment | null;
|
|
60
|
+
}
|
|
61
|
+
export interface CosmeticEnrichment {
|
|
62
|
+
type: string;
|
|
63
|
+
name: string;
|
|
64
|
+
displayName: string;
|
|
65
|
+
description: string;
|
|
66
|
+
shortDescription: string;
|
|
67
|
+
rarity: string;
|
|
68
|
+
images: {
|
|
69
|
+
icon: string | null;
|
|
70
|
+
largeIcon: string | null;
|
|
71
|
+
};
|
|
72
|
+
gender: string | null;
|
|
73
|
+
tags: string[];
|
|
74
|
+
set: {
|
|
75
|
+
value: string;
|
|
76
|
+
backendValue: string;
|
|
77
|
+
} | null;
|
|
78
|
+
introduction: {
|
|
79
|
+
chapter: number | null;
|
|
80
|
+
season: number | null;
|
|
81
|
+
};
|
|
43
82
|
}
|
|
44
83
|
export interface Requirement {
|
|
45
84
|
requirementType: string;
|
|
@@ -50,11 +89,6 @@ export interface MetaInfo {
|
|
|
50
89
|
key: string;
|
|
51
90
|
value: string;
|
|
52
91
|
}
|
|
53
|
-
export interface ItemGrant {
|
|
54
|
-
templateId: string;
|
|
55
|
-
quantity: number;
|
|
56
|
-
attributes: Record<string, any>;
|
|
57
|
-
}
|
|
58
92
|
export interface GiftInfo {
|
|
59
93
|
bIsEnabled: boolean;
|
|
60
94
|
forcedGiftBoxTemplateId: string;
|
|
@@ -180,17 +214,21 @@ export interface TournamentEligibilityResponse {
|
|
|
180
214
|
newest_tournament_date: string | null;
|
|
181
215
|
recent_tournaments: TournamentTrackerEntry[];
|
|
182
216
|
}
|
|
217
|
+
export interface SeasonEntry {
|
|
218
|
+
chapter: number;
|
|
219
|
+
season: number;
|
|
220
|
+
patch: string;
|
|
221
|
+
}
|
|
183
222
|
export interface WeaponsResponse {
|
|
184
223
|
version: string;
|
|
185
224
|
count: number;
|
|
186
|
-
source: "
|
|
187
|
-
|
|
225
|
+
source: "cue4parse" | "lootpool" | "map-archives";
|
|
226
|
+
availableSeasons: SeasonEntry[];
|
|
188
227
|
lootPool?: {
|
|
189
228
|
patchVersion: string;
|
|
190
229
|
lastUpdated: string;
|
|
191
230
|
replaysProcessed: number;
|
|
192
231
|
};
|
|
193
|
-
message?: string;
|
|
194
232
|
data: Record<string, WeaponsInfos>;
|
|
195
233
|
}
|
|
196
234
|
/** @deprecated Use WeaponsResponse instead */
|
|
@@ -200,13 +238,22 @@ export interface WeaponsInfos {
|
|
|
200
238
|
displayName: string;
|
|
201
239
|
description: string;
|
|
202
240
|
rarity: string;
|
|
203
|
-
gameplayTags: GameplayTags;
|
|
204
|
-
icon: string;
|
|
205
241
|
type: string;
|
|
206
242
|
category: string | null;
|
|
207
|
-
season:
|
|
208
|
-
|
|
209
|
-
|
|
243
|
+
season: {
|
|
244
|
+
chapter: number;
|
|
245
|
+
season: number;
|
|
246
|
+
} | null;
|
|
247
|
+
introductionSeason: {
|
|
248
|
+
chapter: number;
|
|
249
|
+
season: number;
|
|
250
|
+
} | null;
|
|
251
|
+
seasons: SeasonEntry[];
|
|
252
|
+
gamemode: "br" | "og";
|
|
253
|
+
ammoType: string | null;
|
|
254
|
+
triggerType: string | null;
|
|
255
|
+
tags: string[];
|
|
256
|
+
searchTags: string;
|
|
210
257
|
stats: WeaponsStats;
|
|
211
258
|
images: {
|
|
212
259
|
icon: string | null;
|
|
@@ -214,9 +261,6 @@ export interface WeaponsInfos {
|
|
|
214
261
|
largeIcon: string | null;
|
|
215
262
|
};
|
|
216
263
|
}
|
|
217
|
-
export interface GameplayTags {
|
|
218
|
-
gameplayTags: Array<String>;
|
|
219
|
-
}
|
|
220
264
|
export interface WeaponsStats {
|
|
221
265
|
firingRate: number;
|
|
222
266
|
dynamicFiringRate: number;
|