fnapi-js 1.0.0 → 1.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/package.json +5 -5
- package/src/client/ApiClient.js +2 -1
- package/src/client/Misc.js +21 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fnapi-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Unofficial API Wrapper for https://fortnite-api.com/",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
"lobbybot",
|
|
17
17
|
"fortnite-bot"
|
|
18
18
|
],
|
|
19
|
-
"author": "
|
|
19
|
+
"author": "AjaxFNC-YT",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
23
|
-
"url": "git+https://github.com/
|
|
23
|
+
"url": "git+https://github.com/AjaxFNC-YT/fnapi-js.git"
|
|
24
24
|
},
|
|
25
25
|
"bugs": {
|
|
26
|
-
"url": "https://github.com/
|
|
26
|
+
"url": "https://github.com/AjaxFNC-YT/fnapi-js/issues"
|
|
27
27
|
},
|
|
28
|
-
"homepage": "https://github.com/
|
|
28
|
+
"homepage": "https://github.com/AjaxFNC-YT/fnapi-js#readme",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"axios": "^1.9.0"
|
|
31
31
|
},
|
package/src/client/ApiClient.js
CHANGED
|
@@ -9,7 +9,7 @@ import Playlists from './Playlists.js';
|
|
|
9
9
|
import Shop from './Shop.js';
|
|
10
10
|
import Stats from './Stats.js';
|
|
11
11
|
import Banners from './Banners.js';
|
|
12
|
-
|
|
12
|
+
import Misc from './Misc.js';
|
|
13
13
|
|
|
14
14
|
class ApiClient {
|
|
15
15
|
constructor(config = {}) {
|
|
@@ -39,6 +39,7 @@ class ApiClient {
|
|
|
39
39
|
this.stats = new Stats(this);
|
|
40
40
|
this.shop = new Shop(this);
|
|
41
41
|
this.banners = new Banners(this);
|
|
42
|
+
this.misc = new Misc(this);
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
async request(method, path, data = null, options = {}) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import RequestFlags from '../enums/requestFlags.js';
|
|
2
|
+
import SearchOptions from '../types/SearchOptions.js';
|
|
3
|
+
|
|
4
|
+
class Misc {
|
|
5
|
+
constructor(apiClient) {
|
|
6
|
+
this.client = apiClient;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
async fixPath(path) {
|
|
10
|
+
return path
|
|
11
|
+
.replace(/^FortniteGame\/Content/, '/Game')
|
|
12
|
+
.replace(/FortniteGame\/Plugins\/GameFeatures\/BRCosmetics\/Content/, '/BRCosmetics')
|
|
13
|
+
.replace(/FortniteGame\/Plugins\/GameFeatures\/CosmeticShoes\/Content/, '/CosmeticShoes')
|
|
14
|
+
.split('/')
|
|
15
|
+
.slice(0, -1)
|
|
16
|
+
.join('/');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default Misc;
|