@tutkli/jikan-ts 0.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/.editorconfig +16 -0
- package/.eslintignore +17 -0
- package/.eslintrc.json +27 -0
- package/.prettierrc.json +8 -0
- package/CHANGELOG.md +30 -0
- package/LICENSE +21 -0
- package/README.md +64 -0
- package/dist/index.d.ts +671 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +584 -0
- package/dist/index.js.map +1 -0
- package/jest.config.js +25 -0
- package/package.json +60 -0
- package/src/__tests__/anime-client.spec.ts +33 -0
- package/src/__tests__/manga-client.spec.ts +33 -0
- package/src/__tests__/top-client.spec.ts +33 -0
- package/src/clients/anime.client.ts +233 -0
- package/src/clients/base.client.ts +82 -0
- package/src/clients/index.ts +4 -0
- package/src/clients/jikan.client.ts +28 -0
- package/src/clients/manga.client.ts +142 -0
- package/src/clients/top.client.ts +52 -0
- package/src/config/cache.config.ts +8 -0
- package/src/config/index.ts +2 -0
- package/src/config/logger.config.ts +25 -0
- package/src/constants/base.constant.ts +3 -0
- package/src/constants/endpoints.constant.ts +29 -0
- package/src/constants/index.ts +2 -0
- package/src/index.ts +4 -0
- package/src/models/Anime/anime-character.model.ts +11 -0
- package/src/models/Anime/anime-episode.model.ts +12 -0
- package/src/models/Anime/anime-picture.model.ts +5 -0
- package/src/models/Anime/anime-staff.model.ts +6 -0
- package/src/models/Anime/anime-statistics.model.ts +6 -0
- package/src/models/Anime/anime-video.model.ts +38 -0
- package/src/models/Anime/anime.model.ts +95 -0
- package/src/models/Anime/index.ts +7 -0
- package/src/models/Common/character.model.ts +18 -0
- package/src/models/Common/image.model.ts +12 -0
- package/src/models/Common/index.ts +6 -0
- package/src/models/Common/person.model.ts +8 -0
- package/src/models/Common/recommendation.model.ts +12 -0
- package/src/models/Common/resource.model.ts +31 -0
- package/src/models/Common/statistics.model.ts +13 -0
- package/src/models/Manga/index.ts +2 -0
- package/src/models/Manga/manga-statistics.model.ts +6 -0
- package/src/models/Manga/manga.model.ts +58 -0
- package/src/models/Params/index.ts +2 -0
- package/src/models/Params/search-params.model.ts +72 -0
- package/src/models/Params/top-params.model.ts +41 -0
- package/src/models/Response/index.ts +1 -0
- package/src/models/Response/response.model.ts +21 -0
- package/src/models/index.ts +4 -0
- package/tsconfig.eslint.json +5 -0
- package/tsconfig.json +23 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Editor configuration, see https://editorconfig.org
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 2
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
|
|
11
|
+
[*.ts]
|
|
12
|
+
quote_type = single
|
|
13
|
+
|
|
14
|
+
[*.md]
|
|
15
|
+
max_line_length = off
|
|
16
|
+
trim_trailing_whitespace = false
|
package/.eslintignore
ADDED
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"es2022": true,
|
|
4
|
+
"node": true
|
|
5
|
+
},
|
|
6
|
+
"parser": "@typescript-eslint/parser",
|
|
7
|
+
"extends": [
|
|
8
|
+
"plugin:@typescript-eslint/recommended",
|
|
9
|
+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
10
|
+
"plugin:jest/recommended",
|
|
11
|
+
"prettier",
|
|
12
|
+
"plugin:prettier/recommended"
|
|
13
|
+
],
|
|
14
|
+
"parserOptions": {
|
|
15
|
+
"ecmaVersion": 2022,
|
|
16
|
+
"sourceType": "module",
|
|
17
|
+
"project": "./tsconfig.eslint.json"
|
|
18
|
+
},
|
|
19
|
+
"rules": {
|
|
20
|
+
"prettier/prettier": [
|
|
21
|
+
"error",
|
|
22
|
+
{
|
|
23
|
+
"endOfLine": "auto"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
package/.prettierrc.json
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# v0.5.0 (12/11/2022)
|
|
2
|
+
|
|
3
|
+
### Test
|
|
4
|
+
|
|
5
|
+
- Added Client tests
|
|
6
|
+
|
|
7
|
+
<!-- CHANGELOG SPLIT MARKER -->
|
|
8
|
+
|
|
9
|
+
# v0.4.0 (12/11/2022)
|
|
10
|
+
|
|
11
|
+
### Clients
|
|
12
|
+
|
|
13
|
+
- Added TopClient
|
|
14
|
+
- Added search queryParams to AnimeClient, MangaClient and TopClient.
|
|
15
|
+
|
|
16
|
+
### Docs
|
|
17
|
+
|
|
18
|
+
- Improve models and clients documentation
|
|
19
|
+
|
|
20
|
+
<!-- CHANGELOG SPLIT MARKER -->
|
|
21
|
+
|
|
22
|
+
# v0.3.0 (12/11/2022)
|
|
23
|
+
|
|
24
|
+
### Clients
|
|
25
|
+
|
|
26
|
+
- More endpoints added to the MangaClient:
|
|
27
|
+
- getMangaCharacters
|
|
28
|
+
- getMangaPictures
|
|
29
|
+
- getMangaStatistics
|
|
30
|
+
- getMangaRecommendations
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Clara Castillo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# jikan-ts
|
|
2
|
+
|
|
3
|
+
## What it is
|
|
4
|
+
|
|
5
|
+
Node.js wrapper of the Jikan API with build-in typings.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Built-in typings
|
|
10
|
+
- Axios with Request Cache
|
|
11
|
+
- Logging Configuration
|
|
12
|
+
- Fully Tree-Shakable
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install --save @tutkli/jikan-ts
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Basic Example
|
|
21
|
+
|
|
22
|
+
Using a specific client, like AnimeClient:
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { AnimeClient } from '@tutkli/jikan-ts';
|
|
26
|
+
|
|
27
|
+
(async () => {
|
|
28
|
+
const api = new AnimeClient();
|
|
29
|
+
|
|
30
|
+
await api
|
|
31
|
+
.getAnimeById(1)
|
|
32
|
+
.then((jikanResponse) => console.log(jikanResponse.data.title)) // will output "Cowboy Bebob"
|
|
33
|
+
.catch((error) => console.error(error));
|
|
34
|
+
})();
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or, using the JikanClient:
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
import { JikanClient } from '@tutkli/jikan-ts';
|
|
41
|
+
|
|
42
|
+
(async () => {
|
|
43
|
+
const api = new JikanClient();
|
|
44
|
+
|
|
45
|
+
await api.anime
|
|
46
|
+
.getAnimeById(1)
|
|
47
|
+
.then((jikanResponse) => console.log(jikanResponse.data.title)) // will output "Cowboy Bebob"
|
|
48
|
+
.catch((error) => console.error(error));
|
|
49
|
+
})();
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Available Clients
|
|
53
|
+
|
|
54
|
+
- AnimeClient
|
|
55
|
+
- MangaClient
|
|
56
|
+
- TopClient
|
|
57
|
+
- JikanClient (Main client)
|
|
58
|
+
|
|
59
|
+
## Leave you feedback
|
|
60
|
+
|
|
61
|
+
- Did you find this project useful? [Leave a ⭐](https://github.com/tutkli/jikan-ts)
|
|
62
|
+
- Found a problem? [Create an issue 🔎](https://github.com/tutkli/jikan-ts/issues)
|
|
63
|
+
- Want to contribute? [Submit a PR 📑](https://github.com/tutkli/jikan-ts/pulls)
|
|
64
|
+
|