clashofclans.js 2.4.0-dev.e127930 → 2.5.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/CHANGELOG.md +7 -0
- package/dist/rest/RequestHandler.js +2 -2
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## 2.5.0 (2021-12-30)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- Fix caching issue with unnecessary/invalid query params. ([#91](https://github.com/clashperk/clashofclans.js/pull/91))
|
|
10
|
+
- Added necessary methods to `RESTManager` class. ([#92](https://github.com/clashperk/clashofclans.js/pull/92))
|
|
11
|
+
|
|
5
12
|
## 2.4.0 (2021-12-28)
|
|
6
13
|
|
|
7
14
|
### Features
|
|
@@ -88,8 +88,8 @@ class RequestHandler {
|
|
|
88
88
|
if (!res?.ok && this.rejectIfNotValid) {
|
|
89
89
|
throw new HTTPError_1.HTTPError(data, res?.status ?? 504, path, maxAge, options.method);
|
|
90
90
|
}
|
|
91
|
-
if (this.cached && maxAge > 0 && options.cache !== false) {
|
|
92
|
-
await this.cached.set(path, { data, ttl: Date.now() + maxAge, status: res
|
|
91
|
+
if (this.cached && maxAge > 0 && options.cache !== false && res?.ok) {
|
|
92
|
+
await this.cached.set(path, { data, ttl: Date.now() + maxAge, status: res.status }, maxAge);
|
|
93
93
|
}
|
|
94
94
|
return { data, maxAge, status: res?.status ?? 504, path, ok: res?.status === 200 };
|
|
95
95
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clashofclans.js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "JavaScript library for interacting with the Clash of Clans API",
|
|
5
5
|
"author": "SUVAJIT <suvajit.me@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
"keywords": [
|
|
23
23
|
"clash-of-clans-api",
|
|
24
24
|
"clash-of-clans",
|
|
25
|
-
"clash-api"
|
|
25
|
+
"clash-api",
|
|
26
|
+
"supercell",
|
|
27
|
+
"coc"
|
|
26
28
|
],
|
|
27
29
|
"bugs": {
|
|
28
30
|
"url": "https://github.com/clashperk/clashofclans.js/issues"
|