@yaelouuu/fortnite-api 2.0.0 → 3.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 +2 -0
- package/dist/client.js +2 -0
- package/dist/resources/bundles.d.ts +2 -2
- package/dist/resources/weapons.d.ts +10 -0
- package/dist/resources/weapons.js +15 -0
- package/dist/types/index.d.ts +95 -6
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { CalendarResource } from "./resources/calendar";
|
|
|
5
5
|
import { BundlesResource } from "./resources/bundles";
|
|
6
6
|
import { OauthResource } from "./resources/oauth";
|
|
7
7
|
import { ParsingResource } from "./resources/parsing";
|
|
8
|
+
import { WeaponsResource } from "./resources/weapons";
|
|
8
9
|
export interface ClientOptions {
|
|
9
10
|
apiKey: string;
|
|
10
11
|
baseUrl?: string;
|
|
@@ -19,6 +20,7 @@ export declare class FortniteAPI {
|
|
|
19
20
|
bundles: BundlesResource;
|
|
20
21
|
oauth: OauthResource;
|
|
21
22
|
parsing: ParsingResource;
|
|
23
|
+
weapons: WeaponsResource;
|
|
22
24
|
constructor(options: ClientOptions);
|
|
23
25
|
/**
|
|
24
26
|
* Internal method to make HTTP requests
|
package/dist/client.js
CHANGED
|
@@ -9,6 +9,7 @@ const errors_1 = require("./errors");
|
|
|
9
9
|
const bundles_1 = require("./resources/bundles");
|
|
10
10
|
const oauth_1 = require("./resources/oauth");
|
|
11
11
|
const parsing_1 = require("./resources/parsing");
|
|
12
|
+
const weapons_1 = require("./resources/weapons");
|
|
12
13
|
class FortniteAPI {
|
|
13
14
|
constructor(options) {
|
|
14
15
|
this.apiKey = options.apiKey;
|
|
@@ -22,6 +23,7 @@ class FortniteAPI {
|
|
|
22
23
|
this.bundles = new bundles_1.BundlesResource(this);
|
|
23
24
|
this.oauth = new oauth_1.OauthResource(this);
|
|
24
25
|
this.parsing = new parsing_1.ParsingResource(this);
|
|
26
|
+
this.weapons = new weapons_1.WeaponsResource(this);
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* Internal method to make HTTP requests
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FortniteAPI } from "../client";
|
|
2
|
-
import { TournamentsBundle,
|
|
2
|
+
import { TournamentsBundle, Shop } from "../types";
|
|
3
3
|
export declare class BundlesResource {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: FortniteAPI);
|
|
@@ -10,5 +10,5 @@ export declare class BundlesResource {
|
|
|
10
10
|
/**
|
|
11
11
|
* Get current season information
|
|
12
12
|
*/
|
|
13
|
-
getBundlesShop(): Promise<
|
|
13
|
+
getBundlesShop(): Promise<Shop>;
|
|
14
14
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WeaponsResource = void 0;
|
|
4
|
+
class WeaponsResource {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Get weapons and infos
|
|
10
|
+
*/
|
|
11
|
+
async getWeapons() {
|
|
12
|
+
return this.client.request("/weapons");
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.WeaponsResource = WeaponsResource;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,12 +1,64 @@
|
|
|
1
1
|
export interface Shop {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
refreshIntervalHrs: number;
|
|
3
|
+
dailyPurchaseHrs: number;
|
|
4
|
+
expiration: string;
|
|
5
|
+
storefronts: Storefront[];
|
|
4
6
|
}
|
|
5
|
-
export interface
|
|
6
|
-
id: string;
|
|
7
|
+
export interface Storefront {
|
|
7
8
|
name: string;
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
catalogEntries: CatalogEntry[];
|
|
10
|
+
}
|
|
11
|
+
export interface CatalogEntry {
|
|
12
|
+
offerId: string;
|
|
13
|
+
devName: string;
|
|
14
|
+
offerType: string;
|
|
15
|
+
prices: Price[];
|
|
16
|
+
categories: string[];
|
|
17
|
+
dailyLimit: number;
|
|
18
|
+
weeklyLimit: number;
|
|
19
|
+
monthlyLimit: number;
|
|
20
|
+
refundable: boolean;
|
|
21
|
+
appStoreId: string[];
|
|
22
|
+
requirements: Requirement[];
|
|
23
|
+
metaInfo: MetaInfo[];
|
|
24
|
+
catalogGroup: string;
|
|
25
|
+
catalogGroupPriority: number;
|
|
26
|
+
sortPriority: number;
|
|
27
|
+
title: string;
|
|
28
|
+
shortDescription: string;
|
|
29
|
+
description: string;
|
|
30
|
+
displayAssetPath: string;
|
|
31
|
+
itemGrants: ItemGrant[];
|
|
32
|
+
giftInfo?: GiftInfo;
|
|
33
|
+
}
|
|
34
|
+
export interface Price {
|
|
35
|
+
currencyType: string;
|
|
36
|
+
currencySubType: string;
|
|
37
|
+
regularPrice: number;
|
|
38
|
+
dynamicRegularPrice: number;
|
|
39
|
+
finalPrice: number;
|
|
40
|
+
saleExpiration: string;
|
|
41
|
+
basePrice: number;
|
|
42
|
+
saleType?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface Requirement {
|
|
45
|
+
requirementType: string;
|
|
46
|
+
requiredId: string;
|
|
47
|
+
minQuantity: number;
|
|
48
|
+
}
|
|
49
|
+
export interface MetaInfo {
|
|
50
|
+
key: string;
|
|
51
|
+
value: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ItemGrant {
|
|
54
|
+
templateId: string;
|
|
55
|
+
quantity: number;
|
|
56
|
+
attributes: Record<string, any>;
|
|
57
|
+
}
|
|
58
|
+
export interface GiftInfo {
|
|
59
|
+
bIsEnabled: boolean;
|
|
60
|
+
forcedGiftBoxTemplateId: string;
|
|
61
|
+
purchaseRequirements: any[];
|
|
10
62
|
}
|
|
11
63
|
export interface TournamentsBundle {
|
|
12
64
|
}
|
|
@@ -128,3 +180,40 @@ export interface TournamentEligibilityResponse {
|
|
|
128
180
|
newest_tournament_date: string | null;
|
|
129
181
|
recent_tournaments: TournamentTrackerEntry[];
|
|
130
182
|
}
|
|
183
|
+
export interface Weapons {
|
|
184
|
+
key: WeaponsInfos;
|
|
185
|
+
}
|
|
186
|
+
export interface WeaponsInfos {
|
|
187
|
+
id: string;
|
|
188
|
+
displayName: string;
|
|
189
|
+
description: string;
|
|
190
|
+
rarity: string;
|
|
191
|
+
gameplayTags: GameplayTags;
|
|
192
|
+
icon: string;
|
|
193
|
+
type: string;
|
|
194
|
+
category: string | null;
|
|
195
|
+
season: number;
|
|
196
|
+
series: string;
|
|
197
|
+
stats: WeaponsStats;
|
|
198
|
+
}
|
|
199
|
+
export interface GameplayTags {
|
|
200
|
+
gameplayTags: Array<String>;
|
|
201
|
+
}
|
|
202
|
+
export interface WeaponsStats {
|
|
203
|
+
firingRate: number;
|
|
204
|
+
dynamicFiringRate: number;
|
|
205
|
+
burstFiringRate: number;
|
|
206
|
+
criticalDamageMultiplier: number;
|
|
207
|
+
vulnerabilityDamageMultiplier: number;
|
|
208
|
+
diceCritChance: number;
|
|
209
|
+
diceCritDamageMultiplier: number;
|
|
210
|
+
reloadTime: number;
|
|
211
|
+
damagePerBullet: number;
|
|
212
|
+
environmentDamagePerBullet: number;
|
|
213
|
+
clipSize: number;
|
|
214
|
+
ammoCostPerFire: number;
|
|
215
|
+
bulletsPerCartridge: number;
|
|
216
|
+
cartridgePerFire: number;
|
|
217
|
+
overheatedCooldownDelay: number;
|
|
218
|
+
maxDamagePerCartridge: number;
|
|
219
|
+
}
|