@tutkli/jikan-ts 2.1.0 → 3.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/README.md +61 -58
- package/dist/chunk-b9f01kcn.js +1 -0
- package/dist/chunk-ygw2424n.js +1 -0
- package/dist/client.d.ts +19 -0
- package/dist/client.js +1 -0
- package/dist/clients/anime.client.d.ts +123 -0
- package/dist/clients/base.client.d.ts +45 -0
- package/dist/clients/characters.client.d.ts +46 -0
- package/dist/clients/clubs.client.d.ts +39 -0
- package/dist/clients/genres.client.d.ts +21 -0
- package/dist/clients/jikan.client.d.ts +41 -0
- package/dist/clients/magazines.client.d.ts +9 -0
- package/dist/clients/manga.client.d.ts +84 -0
- package/dist/clients/people.client.d.ts +46 -0
- package/dist/clients/producers.client.d.ts +31 -0
- package/dist/clients/random.client.d.ts +27 -0
- package/dist/clients/recommendations.client.d.ts +21 -0
- package/dist/clients/reviews.client.d.ts +21 -0
- package/dist/clients/schedules.client.d.ts +16 -0
- package/dist/clients/seasons.client.d.ts +32 -0
- package/dist/clients/top.client.d.ts +36 -0
- package/dist/clients/watch.client.d.ts +27 -0
- package/dist/config/cache.d.ts +11 -0
- package/dist/config/ky.config.d.ts +11 -0
- package/dist/config/logging.config.d.ts +4 -0
- package/dist/constants/base.const.d.ts +1 -0
- package/dist/endpoints/anime.endpoints.d.ts +23 -0
- package/dist/endpoints/characters.endpoints.d.ts +9 -0
- package/dist/endpoints/clubs.endpoints.d.ts +7 -0
- package/dist/endpoints/genres.endpoints.d.ts +4 -0
- package/dist/endpoints/magazines.endpoints.d.ts +3 -0
- package/dist/endpoints/manga.endpoints.d.ts +16 -0
- package/dist/endpoints/people.endpoints.d.ts +9 -0
- package/dist/endpoints/producers.endpoints.d.ts +6 -0
- package/dist/endpoints/random.endpoints.d.ts +7 -0
- package/dist/endpoints/recommendations.endpoints.d.ts +4 -0
- package/dist/endpoints/reviews.endpoints.d.ts +4 -0
- package/dist/endpoints/schedules.endpoints.d.ts +3 -0
- package/dist/endpoints/seasons.endpoints.d.ts +6 -0
- package/dist/endpoints/top.endpoints.d.ts +7 -0
- package/dist/endpoints/watch.endpoints.d.ts +6 -0
- package/dist/index.d.ts +1 -940
- package/dist/index.js +1 -1
- package/dist/models/Anime/anime-character.model.d.ts +4 -0
- package/dist/models/Anime/anime-episode.model.d.ts +12 -0
- package/dist/models/Anime/anime-picture.model.d.ts +4 -0
- package/dist/models/Anime/anime-staff.model.d.ts +5 -0
- package/dist/models/Anime/anime-statistics.model.d.ts +5 -0
- package/dist/models/Anime/anime-video.model.d.ts +32 -0
- package/dist/models/Anime/anime.model.d.ts +60 -0
- package/dist/models/Anime/index.d.ts +7 -0
- package/dist/models/Character/character.model.d.ts +28 -0
- package/dist/models/Character/index.d.ts +1 -0
- package/dist/models/Common/character.model.d.ts +18 -0
- package/dist/models/Common/external-link.model.d.ts +4 -0
- package/dist/models/Common/forum.model.d.ts +16 -0
- package/dist/models/Common/image.model.d.ts +11 -0
- package/dist/models/Common/index.d.ts +12 -0
- package/dist/models/Common/more-info.model.d.ts +3 -0
- package/dist/models/Common/news.model.d.ts +13 -0
- package/dist/models/Common/person.model.d.ts +7 -0
- package/dist/models/Common/recommendation.model.d.ts +12 -0
- package/dist/models/Common/relation.model.d.ts +10 -0
- package/dist/models/Common/resource.model.d.ts +35 -0
- package/dist/models/Common/seasons-list.model.d.ts +5 -0
- package/dist/models/Common/statistics.model.d.ts +12 -0
- package/dist/models/Genre/genre.model.d.ts +5 -0
- package/dist/models/Genre/index.d.ts +1 -0
- package/dist/models/Manga/index.d.ts +2 -0
- package/dist/models/Manga/manga-statistics.model.d.ts +5 -0
- package/dist/models/Manga/manga.model.d.ts +37 -0
- package/dist/models/Params/characters-params.model.d.ts +10 -0
- package/dist/models/Params/genres-params.model.d.ts +1 -0
- package/dist/models/Params/index.d.ts +7 -0
- package/dist/models/Params/pagination-params.model.d.ts +3 -0
- package/dist/models/Params/schedules-params.model.d.ts +9 -0
- package/dist/models/Params/search-params.model.d.ts +47 -0
- package/dist/models/Params/seasons-params.model.d.ts +12 -0
- package/dist/models/Params/top-params.model.d.ts +28 -0
- package/dist/models/Person/index.d.ts +2 -0
- package/dist/models/Person/person-params.model.d.ts +10 -0
- package/dist/models/Person/person.model.d.ts +50 -0
- package/dist/models/Producer/index.d.ts +2 -0
- package/dist/models/Producer/producer-params.model.d.ts +10 -0
- package/dist/models/Producer/producer.model.d.ts +14 -0
- package/dist/models/Recommendation/index.d.ts +1 -0
- package/dist/models/Recommendation/recommendation.model.d.ts +18 -0
- package/dist/models/Response/index.d.ts +1 -0
- package/dist/models/Response/response.model.d.ts +15 -0
- package/dist/models/Review/index.d.ts +2 -0
- package/dist/models/Review/review-params.model.d.ts +5 -0
- package/dist/models/Review/review.model.d.ts +42 -0
- package/dist/models/UserUpdate/index.d.ts +1 -0
- package/dist/models/UserUpdate/user-update.model.d.ts +24 -0
- package/dist/models/clubs/clubs-params.model.d.ts +14 -0
- package/dist/models/clubs/clubs.model.d.ts +25 -0
- package/dist/models/index.d.ts +12 -0
- package/dist/models/magazine/magazine.model.d.ts +16 -0
- package/dist/models/watch/watch.model.d.ts +21 -0
- package/dist/types.d.ts +21 -0
- package/dist/types.js +1 -0
- package/package.json +62 -40
package/README.md
CHANGED
|
@@ -4,118 +4,121 @@
|
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
12
|
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
|
-
> Jikan API wrapper for
|
|
15
|
+
> Jikan API wrapper for TypeScript and Node.js with built-in typing.
|
|
16
16
|
|
|
17
17
|
## Features
|
|
18
18
|
|
|
19
19
|
- 💅 Fully typed
|
|
20
|
-
- ♻
|
|
21
|
-
- 📄
|
|
20
|
+
- ♻ Built-in in-memory response cache (TTL-based)
|
|
21
|
+
- 📄 Request logging
|
|
22
22
|
- 📦 ESM with tree shaking support
|
|
23
23
|
|
|
24
24
|
## Installation
|
|
25
25
|
|
|
26
|
+
### Full client (with ky)
|
|
27
|
+
|
|
26
28
|
```bash
|
|
27
|
-
npm install
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
npm install @tutkli/jikan-ts ky
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Types only (zero runtime dependencies)
|
|
33
|
+
|
|
34
|
+
If you want to use the types and endpoint constants to build your own HTTP client:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install @tutkli/jikan-ts
|
|
30
38
|
```
|
|
31
39
|
|
|
32
40
|
## Example
|
|
33
41
|
|
|
34
|
-
Using
|
|
42
|
+
### Using the types-only import
|
|
35
43
|
|
|
36
44
|
```ts
|
|
37
|
-
import {
|
|
45
|
+
import type { Anime, JikanResponse } from '@tutkli/jikan-ts/types'
|
|
46
|
+
import { AnimeEndpoints, BASE_URL } from '@tutkli/jikan-ts/types'
|
|
47
|
+
|
|
48
|
+
// Build your own HTTP client using the provided types and endpoints
|
|
49
|
+
const response = await fetch(
|
|
50
|
+
`${BASE_URL}${AnimeEndpoints.AnimeById.replace('{id}', '1')}`
|
|
51
|
+
)
|
|
52
|
+
const data: JikanResponse<Anime> = await response.json()
|
|
53
|
+
```
|
|
38
54
|
|
|
39
|
-
|
|
55
|
+
### Using a specific client, like **AnimeClient**
|
|
40
56
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
57
|
+
```ts
|
|
58
|
+
import { AnimeClient, JikanResponse, Anime } from '@tutkli/jikan-ts'
|
|
59
|
+
|
|
60
|
+
const animeClient = new AnimeClient()
|
|
61
|
+
|
|
62
|
+
animeClient.getAnimeById(1).then((response: JikanResponse<Anime>) => {
|
|
63
|
+
/* ... */
|
|
64
|
+
})
|
|
46
65
|
```
|
|
47
66
|
|
|
48
|
-
|
|
67
|
+
### Using the **JikanClient**
|
|
49
68
|
|
|
50
69
|
```ts
|
|
51
|
-
import { JikanClient, JikanResponse, Anime } from '@tutkli/jikan-ts'
|
|
70
|
+
import { JikanClient, JikanResponse, Anime } from '@tutkli/jikan-ts'
|
|
52
71
|
|
|
53
|
-
const jikanClient = new JikanClient()
|
|
72
|
+
const jikanClient = new JikanClient()
|
|
54
73
|
|
|
55
|
-
jikanClient.anime
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/* ... */
|
|
59
|
-
})
|
|
74
|
+
jikanClient.anime.getAnimeById(1).then((response: JikanResponse<Anime>) => {
|
|
75
|
+
/* ... */
|
|
76
|
+
})
|
|
60
77
|
```
|
|
61
78
|
|
|
62
79
|
## Client configuration
|
|
63
80
|
|
|
64
81
|
### Cache Configuration
|
|
65
82
|
|
|
66
|
-
Jikan-ts uses
|
|
67
|
-
To
|
|
83
|
+
Jikan-ts uses a built-in in-memory cache with TTL-based expiry (default: 5 minutes).
|
|
84
|
+
To customize the cache, pass the `cacheOptions` argument when instantiating a client:
|
|
68
85
|
|
|
69
86
|
```ts
|
|
70
|
-
import { AnimeClient } from '@tutkli/jikan-ts'
|
|
87
|
+
import { AnimeClient } from '@tutkli/jikan-ts'
|
|
71
88
|
|
|
72
89
|
const animeClient = new AnimeClient({
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
);
|
|
90
|
+
cacheOptions: { ttl: 10 * 60 * 1000 } // 10 minutes
|
|
91
|
+
})
|
|
76
92
|
```
|
|
77
93
|
|
|
78
|
-
### Custom
|
|
94
|
+
### Custom Ky Instance
|
|
79
95
|
|
|
80
|
-
Jikan uses
|
|
96
|
+
Jikan-ts uses [Ky](https://github.com/sindresorhus/ky) as its HTTP client. You can provide your own Ky instance via the optional `kyInstance` argument:
|
|
81
97
|
|
|
82
98
|
```ts
|
|
83
|
-
import { AnimeClient } from '@tutkli/jikan-ts'
|
|
84
|
-
import
|
|
99
|
+
import { AnimeClient } from '@tutkli/jikan-ts'
|
|
100
|
+
import ky from 'ky'
|
|
85
101
|
|
|
86
102
|
const animeClient = new AnimeClient({
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
)
|
|
103
|
+
kyInstance: ky.create({
|
|
104
|
+
/* ... */
|
|
105
|
+
})
|
|
106
|
+
})
|
|
90
107
|
```
|
|
91
108
|
|
|
92
|
-
For more information, check out the [axios-cache-interceptor Documentation](https://axios-cache-interceptor.js.org/).
|
|
93
|
-
|
|
94
109
|
### Logging
|
|
95
110
|
|
|
96
111
|
To enable logging, pass the `enableLogging` argument as `true`.
|
|
97
112
|
|
|
98
113
|
```ts
|
|
99
|
-
import { AnimeClient } from '@tutkli/jikan-ts'
|
|
114
|
+
import { AnimeClient } from '@tutkli/jikan-ts'
|
|
100
115
|
|
|
101
116
|
const animeClient = new AnimeClient({
|
|
102
|
-
|
|
103
|
-
})
|
|
117
|
+
enableLogging: true
|
|
118
|
+
})
|
|
104
119
|
```
|
|
105
120
|
|
|
106
|
-
##
|
|
107
|
-
|
|
108
|
-
- AnimeClient
|
|
109
|
-
- CharactersClient
|
|
110
|
-
- GenresClient
|
|
111
|
-
- MangaClient
|
|
112
|
-
- TopClient
|
|
113
|
-
- SchedulesClient
|
|
114
|
-
- SeasonsClient
|
|
115
|
-
- RandomClient
|
|
116
|
-
- JikanClient (Main client)
|
|
117
|
-
|
|
118
|
-
## Leave you feedback
|
|
121
|
+
## Leave your feedback
|
|
119
122
|
|
|
120
123
|
- Did you find this project useful? [Leave a ⭐](https://github.com/tutkli/jikan-ts)
|
|
121
124
|
- Found a problem? [Create an issue 🔎](https://github.com/tutkli/jikan-ts/issues)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as R,B as K,C as D,D as Q,E as S,F as v,G as o,H as V,I as k,J as X,u as U,v as c,w as N,x as j,y as F,z as l}from"./chunk-ygw2424n.js";import p from"ky";class Z{cache=new Map;ttl;constructor($={}){this.ttl=$.ttl??300000}get($){let x=this.cache.get($);if(!x)return;if(Date.now()>x.expiry){this.cache.delete($);return}return x.data}set($,x){this.cache.set($,{data:x,expiry:Date.now()+this.ttl})}}var E=($)=>{console.info(`[Request] ${$.method.toUpperCase()} | ${$.url}`)},h=($,x,I)=>{if(I.ok)console.info(`[Request Response] ${$.method.toUpperCase()} | ${$.url}`);else console.error(`[Response Error] CODE ${I.status} | ${I.statusText}`)},m=($)=>{return console.error(`[Request Error] CODE ${$.response?.status??"UNKNOWN"} | ${$.message}`),$};function Y($={}){let x=new Z($.cacheOptions);if($.kyInstance)return{api:$.kyInstance,cache:x};return{api:p.create({prefixUrl:c,headers:{"Content-Type":"application/json"},retry:0,hooks:$.enableLogging?{beforeRequest:[E],afterResponse:[h],beforeError:[m]}:{}}),cache:x}}class H{api;cache;constructor($={}){if($._cache&&$.kyInstance)this.api=$.kyInstance,this.cache=$._cache;else{let{api:x,cache:I}=Y({enableLogging:$.enableLogging,cacheOptions:$.cacheOptions,kyInstance:$.kyInstance});this.api=x,this.cache=I}}async getResource($,x={},I={}){let q=this.replacePathParams($,x),L=this.buildCacheKey(q,I),g=this.cache.get(L);if(g)return g;let r=q.startsWith("/")?q.slice(1):q,C=this.cleanParams(I),P=await this.api.get(r,{searchParams:Object.keys(C).length>0?C:void 0}).json();return this.cache.set(L,P),P}buildCacheKey($,x){let I=Object.entries(x).filter(([,q])=>q!==void 0).sort(([q],[L])=>q.localeCompare(L)).map(([q,L])=>`${q}=${L}`).join("&");return I?`${$}?${I}`:$}cleanParams($){return Object.fromEntries(Object.entries($).filter(([,x])=>x!==void 0))}replacePathParams($,x){let I=$;for(let q of Object.keys(x)){if(!RegExp(`{${q}}`).exec(I))throw Error(`Path does not contain "${q}" parameter.`);I=I.replace(`{${q}}`,String(x[q]))}return I}}class _ extends H{getAnimeFullById($){return this.getResource(U.animeFullById,{id:$})}getAnimeById($){return this.getResource(U.animeById,{id:$})}getAnimeCharacters($){return this.getResource(U.animeCharacters,{id:$})}getAnimeStaff($){return this.getResource(U.animeStaff,{id:$})}getAnimeEpisodes($,x=1){return this.getResource(U.animeEpisodes,{id:$},{page:x})}getAnimeEpisodeById($,x){return this.getResource(U.animeEpisodeById,{id:$,episode:x})}getAnimeNews($,x){return this.getResource(U.animeNews,{id:$},{page:x})}getAnimeForum($,x){return this.getResource(U.animeForum,{id:$},x?{filter:x}:void 0)}getAnimeVideos($){return this.getResource(U.animeVideos,{id:$})}getAnimeEpisodeVideos($,x=1){return this.getResource(U.animeVideosEpisodes,{id:$},{page:x})}getAnimePictures($){return this.getResource(U.animePictures,{id:$})}getAnimeStatistics($){return this.getResource(U.animeStatistics,{id:$})}getAnimeMoreInfo($){return this.getResource(U.animeMoreInfo,{id:$})}getAnimeRecommendations($){return this.getResource(U.animeRecommendations,{id:$})}getAnimeRelations($){return this.getResource(U.animeRelations,{id:$})}getAnimeExternal($){return this.getResource(U.animeExternal,{id:$})}getAnimeStreaming($){return this.getResource(U.animeStreaming,{id:$})}getAnimeThemes($){return this.getResource(U.animeThemes,{id:$})}getAnimeUserUpdates($,x=1){return this.getResource(U.animeUserUpdates,{id:$},{page:x})}getAnimeReviews($,x){return this.getResource(U.animeReviews,{id:$},x)}getAnimeSearch($){return this.getResource(U.animeSearch,{},$)}}class f extends H{getCharacterFullById($){return this.getResource(N.characterFullById,{id:$})}getCharacterById($){return this.getResource(N.characterById,{id:$})}getCharacterAnime($){return this.getResource(N.characterAnime,{id:$})}getCharacterManga($){return this.getResource(N.charactersManga,{id:$})}getCharacterVoiceActors($){return this.getResource(N.characterVoiceActors,{id:$})}getCharacterPictures($){return this.getResource(N.characterPictures,{id:$})}getCharacterSearch($){return this.getResource(N.characterSearch,{},$)}}class y extends H{getClubsById($){return this.getResource(j.clubById,{id:$})}getClubMembers($,x={}){return this.getResource(j.clubMembers,{id:$},x)}getClubStaff($){return this.getResource(j.clubStaff,{id:$})}getClubRelations($){return this.getResource(j.clubRelations,{id:$})}getClubSearch($={}){return this.getResource(j.clubSearch,{},$)}}class J extends H{getAnimeGenres($){return this.getResource(F.animeGenres,{},{filter:$})}getMangaGenres($){return this.getResource(F.mangaGenres,{},{filter:$})}}class z extends H{getMagazines($={}){return this.getResource(l.magazines,{},$)}}class W extends H{getMangaFullById($){return this.getResource(R.mangaFullById,{id:$})}getMangaById($){return this.getResource(R.mangaById,{id:$})}getMangaCharacters($){return this.getResource(R.mangaCharacters,{id:$})}getMangaNews($){return this.getResource(R.mangaNews,{id:$})}getMangaTopics($,x){return this.getResource(R.mangaTopics,{id:$},x?{filter:x}:void 0)}getMangaPictures($){return this.getResource(R.mangaPictures,{id:$})}getMangaStatistics($){return this.getResource(R.mangaStatistics,{id:$})}getMangaMoreInfo($){return this.getResource(R.mangaMoreInfo,{id:$})}getMangaRecommendations($){return this.getResource(R.mangaRecommendations,{id:$})}getMangaRelations($){return this.getResource(R.mangaRelations,{id:$})}getMangaExternal($){return this.getResource(R.mangaExternal,{id:$})}getMangaUserUpdates($,x=1){return this.getResource(R.mangaUserUpdates,{id:$},{page:x})}getMangaReviews($,x){return this.getResource(R.mangaReviews,{id:$},x)}getMangaSearch($){return this.getResource(R.mangaSearch,{},$)}}class B extends H{getPersonFullById($){return this.getResource(K.personFullById,{id:$})}getPersonById($){return this.getResource(K.personById,{id:$})}getPersonAnime($){return this.getResource(K.personAnime,{id:$})}getPersonVoices($){return this.getResource(K.personVoices,{id:$})}getPersonManga($){return this.getResource(K.personManga,{id:$})}getPersonPictures($){return this.getResource(K.personPictures,{id:$})}getPeopleSearch($){return this.getResource(K.peopleSearch,{},$)}}class T extends H{getProducerFullById($){return this.getResource(D.producerFullById,{id:$})}getProducerById($){return this.getResource(D.producerById,{id:$})}getProducerExternal($){return this.getResource(D.producerExternal,{id:$})}getProducersSearch($){return this.getResource(D.producersSearch,{},$)}}class G extends H{getRandomAnime(){return this.getResource(Q.randomAnime)}getRandomManga(){return this.getResource(Q.randomManga)}getRandomCharacters(){return this.getResource(Q.randomCharacters)}getRandomPerson(){return this.getResource(Q.randomPeople)}}class w extends H{getRecentAnimeRecommendations($){return this.getResource(S.recentAnimeRecommendations,{},$)}getRecentMangaRecommendations($){return this.getResource(S.recentMangaRecommendations,{},$)}}class A extends H{getRecentAnimeReviews($){return this.getResource(v.animeReviews,{},$)}getRecentMangaReviews($){return this.getResource(v.mangaReviews,{},$)}}class u extends H{getSchedules($){return this.getResource(o.schedules,{},$)}}class M extends H{getSeason($,x,I){return this.getResource(V.season,{year:$,season:x},I)}getSeasonNow($){return this.getResource(V.seasonNow,{},$)}getSeasonsList(){return this.getResource(V.seasonsList)}getSeasonUpcoming($){return this.getResource(V.seasonUpcoming,{},$)}}class b extends H{getTopAnime($){return this.getResource(k.topAnime,{},$)}getTopManga($){return this.getResource(k.topManga,{},$)}getTopCharacters($){return this.getResource(k.topCharacters,{},$)}getTopPeople($){return this.getResource(k.topPeople,{},$)}getTopReviews($){return this.getResource(k.topReviews,{},$)}}class O extends H{getWatchRecentEpisodes(){return this.getResource(X.watchRecentEpisodes)}getWatchPopularEpisodes(){return this.getResource(X.watchPopularEpisodes)}getWatchRecentPromos($={}){return this.getResource(X.watchRecentPromos,{},$)}getWatchPopularPromos(){return this.getResource(X.watchPopularPromos)}}class d{anime;characters;clubs;genres;magazines;manga;people;producers;top;schedules;seasons;random;recommendations;reviews;watch;constructor($={}){let{api:x,cache:I}=Y({enableLogging:$.enableLogging,cacheOptions:$.cacheOptions,kyInstance:$.kyInstance}),q={...$,kyInstance:x,_cache:I};this.anime=new _(q),this.characters=new f(q),this.clubs=new y(q),this.genres=new J(q),this.magazines=new z(q),this.manga=new W(q),this.people=new B(q),this.producers=new T(q),this.top=new b(q),this.schedules=new u(q),this.seasons=new M(q),this.random=new G(q),this.recommendations=new w(q),this.reviews=new A(q),this.watch=new O(q)}}export{E as a,h as b,m as c,H as d,_ as e,f,y as g,J as h,z as i,W as j,B as k,T as l,G as m,w as n,A as o,u as p,M as q,b as r,O as s,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="https://api.jikan.moe/v4";var n={animeFullById:"/anime/{id}/full",animeById:"/anime/{id}",animeCharacters:"/anime/{id}/characters",animeStaff:"/anime/{id}/staff",animeEpisodes:"/anime/{id}/episodes",animeEpisodeById:"/anime/{id}/episodes/{episode}",animeNews:"/anime/{id}/news",animeForum:"/anime/{id}/forum",animeVideos:"/anime/{id}/videos",animeVideosEpisodes:"/anime/{id}/videos/episodes",animePictures:"/anime/{id}/pictures",animeStatistics:"/anime/{id}/statistics",animeMoreInfo:"/anime/{id}/moreinfo",animeRecommendations:"/anime/{id}/recommendations",animeUserUpdates:"/anime/{id}/userupdates",animeReviews:"/anime/{id}/reviews",animeRelations:"/anime/{id}/relations",animeThemes:"/anime/{id}/themes",animeExternal:"/anime/{id}/external",animeStreaming:"/anime/{id}/streaming",animeSearch:"/anime"};var a={characterFullById:"/characters/{id}/full",characterById:"/characters/{id}",characterAnime:"/characters/{id}/anime",charactersManga:"/characters/{id}/manga",characterVoiceActors:"/characters/{id}/voices",characterPictures:"/characters/{id}/pictures",characterSearch:"/characters"};var o={clubById:"/clubs/{id}",clubMembers:"/clubs/{id}/members",clubStaff:"/clubs/{id}/staff",clubRelations:"/clubs/{id}/relations",clubSearch:"/clubs"};var m={animeGenres:"/genres/anime",mangaGenres:"/genres/manga"};var l={magazines:"/magazines"};var u={mangaSearch:"/manga",mangaFullById:"/manga/{id}/full",mangaById:"/manga/{id}",mangaCharacters:"/manga/{id}/characters",mangaNews:"/manga/{id}/news",mangaTopics:"/manga/{id}/forum",mangaPictures:"/manga/{id}/pictures",mangaStatistics:"/manga/{id}/statistics",mangaMoreInfo:"/manga/{id}/moreinfo",mangaRelations:"/manga/{id}/relations",mangaExternal:"/manga/{id}/external",mangaRecommendations:"/manga/{id}/recommendations",mangaUserUpdates:"/manga/{id}/userupdates",mangaReviews:"/manga/{id}/reviews"};var d={personFullById:"/people/{id}/full",personById:"/people/{id}",personAnime:"/people/{id}/anime",personVoices:"/people/{id}/voices",personManga:"/people/{id}/manga",personPictures:"/people/{id}/pictures",peopleSearch:"/people"};var x={producerFullById:"/producers/{id}/full",producerById:"/producers/{id}",producerExternal:"/producers/{id}/external",producersSearch:"/producers"};var h={randomAnime:"/random/anime",randomManga:"/random/manga",randomCharacters:"/random/characters",randomPeople:"/random/people",randomUsers:"/random/users"};var R={recentAnimeRecommendations:"/recommendations/anime",recentMangaRecommendations:"/recommendations/manga"};var _={animeReviews:"/reviews/anime",mangaReviews:"/reviews/manga"};var C={schedules:"/schedules"};var v={season:"/seasons/{year}/{season}",seasonNow:"/seasons/now",seasonsList:"/seasons",seasonUpcoming:"/seasons/upcoming"};var A={topAnime:"/top/anime",topManga:"/top/manga",topCharacters:"/top/characters",topPeople:"/top/people",topReviews:"/top/reviews"};var w={watchRecentEpisodes:"/watch/episodes",watchPopularEpisodes:"/watch/episodes/popular",watchRecentPromos:"/watch/promos",watchPopularPromos:"/watch/promos/popular"};export{n as u,e as v,a as w,o as x,m as y,l as z,u as A,d as B,x as C,h as D,R as E,_ as F,C as G,v as H,A as I,w as J};
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from './clients/anime.client';
|
|
2
|
+
export * from './clients/base.client';
|
|
3
|
+
export * from './clients/characters.client';
|
|
4
|
+
export * from './clients/clubs.client';
|
|
5
|
+
export * from './clients/genres.client';
|
|
6
|
+
export * from './clients/jikan.client';
|
|
7
|
+
export * from './clients/magazines.client';
|
|
8
|
+
export * from './clients/manga.client';
|
|
9
|
+
export * from './clients/people.client';
|
|
10
|
+
export * from './clients/producers.client';
|
|
11
|
+
export * from './clients/random.client';
|
|
12
|
+
export * from './clients/recommendations.client';
|
|
13
|
+
export * from './clients/reviews.client';
|
|
14
|
+
export * from './clients/schedules.client';
|
|
15
|
+
export * from './clients/seasons.client';
|
|
16
|
+
export * from './clients/top.client';
|
|
17
|
+
export * from './clients/watch.client';
|
|
18
|
+
export * from './config/logging.config';
|
|
19
|
+
export * from './types';
|
package/dist/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c,b as d,c as e,d as f,e as g,f as i,g as k,h as m,i as o,j as q,k as s,l as u,m as w,n as y,o as A,p as C,q as E,r as G,s as I,t as J}from"./chunk-b9f01kcn.js";import{A as p,B as r,C as t,D as v,E as x,F as z,G as B,H as D,I as F,J as H,u as a,v as b,w as h,x as j,y as l,z as n}from"./chunk-ygw2424n.js";export{c as loggingBeforeRequest,e as loggingBeforeError,d as loggingAfterResponse,H as WatchEndpoints,I as WatchClient,F as TopEndpoints,G as TopClient,D as SeasonsEndpoints,E as SeasonsClient,B as SchedulesEndpoints,C as SchedulesClient,z as ReviewsEndpoints,A as ReviewsClient,x as RecommendationsEndpoints,y as RecommendationsClient,v as RandomEndpoints,w as RandomClient,t as ProducersEndpoints,u as ProducersClient,r as PeopleEndpoints,s as PeopleClient,p as MangaEndpoints,q as MangaClient,n as MagazinesEndpoints,o as MagazinesClient,J as JikanClient,l as GenresEndpoints,m as GenresClient,j as ClubsEndpoints,k as ClubsClient,h as CharactersEndpoints,i as CharactersClient,f as BaseClient,b as BASE_URL,a as AnimeEndpoints,g as AnimeClient};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { Anime, AnimeCharacter, AnimeEpisode, AnimeEpisodeVideo, AnimePicture, AnimeReview, AnimeSearchParams, AnimeStaff, AnimeStatistics, AnimeTheme, AnimeUserUpdate, AnimeVideos, ForumFilter, JikanExternalLink, JikanForum, JikanMoreInfo, JikanNews, JikanRelation, Recommendation, ReviewsParams } from '../models';
|
|
2
|
+
import { BaseClient } from './base.client';
|
|
3
|
+
/**
|
|
4
|
+
* **Anime Client**
|
|
5
|
+
*
|
|
6
|
+
* Client used to access the Anime Endpoints:
|
|
7
|
+
*
|
|
8
|
+
* See also: [Jikan Documentation](https://docs.api.jikan.moe/)
|
|
9
|
+
*/
|
|
10
|
+
export declare class AnimeClient extends BaseClient {
|
|
11
|
+
/**
|
|
12
|
+
* Get complete anime resource data
|
|
13
|
+
* @param id anime id
|
|
14
|
+
*/
|
|
15
|
+
getAnimeFullById(id: number): Promise<import("../models").JikanResponse<Anime>>;
|
|
16
|
+
/**
|
|
17
|
+
* Get anime resource
|
|
18
|
+
* @param id anime id
|
|
19
|
+
*/
|
|
20
|
+
getAnimeById(id: number): Promise<import("../models").JikanResponse<Anime>>;
|
|
21
|
+
/**
|
|
22
|
+
* Get characters of a specific anime
|
|
23
|
+
* @param id anime id
|
|
24
|
+
*/
|
|
25
|
+
getAnimeCharacters(id: number): Promise<import("../models").JikanResponse<AnimeCharacter[]>>;
|
|
26
|
+
/**
|
|
27
|
+
* Get staff of a specific Anime
|
|
28
|
+
* @param id anime id
|
|
29
|
+
*/
|
|
30
|
+
getAnimeStaff(id: number): Promise<import("../models").JikanResponse<AnimeStaff[]>>;
|
|
31
|
+
/**
|
|
32
|
+
* Get a list of all the episodes of a specific anime
|
|
33
|
+
* @param id anime id
|
|
34
|
+
* @param page page number
|
|
35
|
+
*/
|
|
36
|
+
getAnimeEpisodes(id: number, page?: number): Promise<import("../models").JikanResponse<AnimeEpisode[]>>;
|
|
37
|
+
/**
|
|
38
|
+
* Get a single episode of a specific anime by its id
|
|
39
|
+
* @param anime_id anime id
|
|
40
|
+
* @param episode_id episode id
|
|
41
|
+
*/
|
|
42
|
+
getAnimeEpisodeById(anime_id: number, episode_id: number): Promise<import("../models").JikanResponse<AnimeEpisode>>;
|
|
43
|
+
/**
|
|
44
|
+
* Get a list of news articles related to the anime
|
|
45
|
+
* @param id anime id
|
|
46
|
+
* @param page page number
|
|
47
|
+
*/
|
|
48
|
+
getAnimeNews(id: number, page: number): Promise<import("../models").JikanResponse<JikanNews[]>>;
|
|
49
|
+
/**
|
|
50
|
+
* Get a list of forum topics related to the anime
|
|
51
|
+
* @param id anime id
|
|
52
|
+
* @param filter filter topics
|
|
53
|
+
*/
|
|
54
|
+
getAnimeForum(id: number, filter?: ForumFilter): Promise<import("../models").JikanResponse<JikanForum[]>>;
|
|
55
|
+
/**
|
|
56
|
+
* Get videos related to the anime
|
|
57
|
+
* @param id anime id
|
|
58
|
+
*/
|
|
59
|
+
getAnimeVideos(id: number): Promise<import("../models").JikanResponse<AnimeVideos>>;
|
|
60
|
+
/**
|
|
61
|
+
* Get episode videos related to the anime
|
|
62
|
+
* @param id anime id
|
|
63
|
+
* @param page page number
|
|
64
|
+
*/
|
|
65
|
+
getAnimeEpisodeVideos(id: number, page?: number): Promise<import("../models").JikanResponse<AnimeEpisodeVideo[]>>;
|
|
66
|
+
/**
|
|
67
|
+
* Get pictures related to the Anime
|
|
68
|
+
* @param id anime id
|
|
69
|
+
*/
|
|
70
|
+
getAnimePictures(id: number): Promise<import("../models").JikanResponse<AnimePicture[]>>;
|
|
71
|
+
/**
|
|
72
|
+
* Get statistics related to the Anime
|
|
73
|
+
* @param id anime id
|
|
74
|
+
*/
|
|
75
|
+
getAnimeStatistics(id: number): Promise<import("../models").JikanResponse<AnimeStatistics>>;
|
|
76
|
+
/**
|
|
77
|
+
* Get more info related to the anime
|
|
78
|
+
* @param id anime id
|
|
79
|
+
*/
|
|
80
|
+
getAnimeMoreInfo(id: number): Promise<import("../models").JikanResponse<JikanMoreInfo>>;
|
|
81
|
+
/**
|
|
82
|
+
* Get recommendations based on the anime
|
|
83
|
+
* @param id anime id
|
|
84
|
+
*/
|
|
85
|
+
getAnimeRecommendations(id: number): Promise<import("../models").JikanResponse<Recommendation[]>>;
|
|
86
|
+
/**
|
|
87
|
+
* Get anime relations
|
|
88
|
+
* @param id anime id
|
|
89
|
+
*/
|
|
90
|
+
getAnimeRelations(id: number): Promise<import("../models").JikanResponse<JikanRelation[]>>;
|
|
91
|
+
/**
|
|
92
|
+
* Get anime external links
|
|
93
|
+
* @param id anime id
|
|
94
|
+
*/
|
|
95
|
+
getAnimeExternal(id: number): Promise<import("../models").JikanResponse<JikanExternalLink[]>>;
|
|
96
|
+
/**
|
|
97
|
+
* Get anime streaming links
|
|
98
|
+
* @param id anime id
|
|
99
|
+
*/
|
|
100
|
+
getAnimeStreaming(id: number): Promise<import("../models").JikanResponse<JikanExternalLink[]>>;
|
|
101
|
+
/**
|
|
102
|
+
* Get anime themes (openings and endings)
|
|
103
|
+
* @param id anime id
|
|
104
|
+
*/
|
|
105
|
+
getAnimeThemes(id: number): Promise<import("../models").JikanResponse<AnimeTheme>>;
|
|
106
|
+
/**
|
|
107
|
+
* Get user updates for the anime
|
|
108
|
+
* @param id anime id
|
|
109
|
+
* @param page page number
|
|
110
|
+
*/
|
|
111
|
+
getAnimeUserUpdates(id: number, page?: number): Promise<import("../models").JikanResponse<AnimeUserUpdate[]>>;
|
|
112
|
+
/**
|
|
113
|
+
* Get reviews for the anime
|
|
114
|
+
* @param id anime id
|
|
115
|
+
* @param params review parameters
|
|
116
|
+
*/
|
|
117
|
+
getAnimeReviews(id: number, params?: Partial<ReviewsParams>): Promise<import("../models").JikanResponse<AnimeReview[]>>;
|
|
118
|
+
/**
|
|
119
|
+
* Get all the Animes within the given filter. Returns all the Animes if no filters are given.
|
|
120
|
+
* @param searchParams Filter parameters
|
|
121
|
+
*/
|
|
122
|
+
getAnimeSearch(searchParams?: Partial<AnimeSearchParams>): Promise<import("../models").JikanResponse<Anime[]>>;
|
|
123
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { KyInstance } from 'ky';
|
|
2
|
+
import type { CacheOptions, ResponseCache } from '../config/cache';
|
|
3
|
+
import type { JikanResponse } from '../models';
|
|
4
|
+
/**
|
|
5
|
+
* **Client Args**
|
|
6
|
+
*
|
|
7
|
+
* Used to pass optional configuration for logging and cache to the clients.
|
|
8
|
+
*/
|
|
9
|
+
export interface ClientArgs {
|
|
10
|
+
/**
|
|
11
|
+
* **EnableLogging**
|
|
12
|
+
* Enables logging request responses.
|
|
13
|
+
*/
|
|
14
|
+
enableLogging: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* **Cache Options**
|
|
17
|
+
* Options for cache.
|
|
18
|
+
*/
|
|
19
|
+
cacheOptions: Partial<CacheOptions>;
|
|
20
|
+
/**
|
|
21
|
+
* **Ky Instance**
|
|
22
|
+
* The ability to build your own ky instance if you need it
|
|
23
|
+
*/
|
|
24
|
+
kyInstance?: KyInstance;
|
|
25
|
+
/** @internal Used to share cache between JikanClient sub-clients */
|
|
26
|
+
_cache?: ResponseCache;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* **Base Client**
|
|
30
|
+
*
|
|
31
|
+
* This client is responsible for creating a Ky Instance and the cache and logging configurations
|
|
32
|
+
*/
|
|
33
|
+
export declare abstract class BaseClient {
|
|
34
|
+
private api;
|
|
35
|
+
private cache;
|
|
36
|
+
constructor(clientOptions?: Partial<ClientArgs>);
|
|
37
|
+
protected getResource<T>(endpoint: string, pathParams?: {
|
|
38
|
+
[key in string]: unknown;
|
|
39
|
+
}, params?: {
|
|
40
|
+
[key in string]: unknown;
|
|
41
|
+
}): Promise<JikanResponse<T>>;
|
|
42
|
+
private buildCacheKey;
|
|
43
|
+
private cleanParams;
|
|
44
|
+
private replacePathParams;
|
|
45
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Character, CharacterAnime, CharacterFull, CharacterManga, CharactersSearchParams, CharacterVoiceActor, JikanImagesCollection } from '../models';
|
|
2
|
+
import { BaseClient } from './base.client';
|
|
3
|
+
/**
|
|
4
|
+
* **Characters Client**
|
|
5
|
+
*
|
|
6
|
+
* Client used to access the Character Endpoints:
|
|
7
|
+
*
|
|
8
|
+
* See also: [Jikan Documentation](https://docs.api.jikan.moe/)
|
|
9
|
+
*/
|
|
10
|
+
export declare class CharactersClient extends BaseClient {
|
|
11
|
+
/**
|
|
12
|
+
* Get complete Character data
|
|
13
|
+
* @param id The Character ID
|
|
14
|
+
*/
|
|
15
|
+
getCharacterFullById(id: number): Promise<import("../models").JikanResponse<CharacterFull>>;
|
|
16
|
+
/**
|
|
17
|
+
* Get Character data
|
|
18
|
+
* @param id The Character ID
|
|
19
|
+
*/
|
|
20
|
+
getCharacterById(id: number): Promise<import("../models").JikanResponse<Character>>;
|
|
21
|
+
/**
|
|
22
|
+
* Get Character anime data
|
|
23
|
+
* @param id The Character ID
|
|
24
|
+
*/
|
|
25
|
+
getCharacterAnime(id: number): Promise<import("../models").JikanResponse<CharacterAnime[]>>;
|
|
26
|
+
/**
|
|
27
|
+
* Get Character manga data
|
|
28
|
+
* @param id The Character ID
|
|
29
|
+
*/
|
|
30
|
+
getCharacterManga(id: number): Promise<import("../models").JikanResponse<CharacterManga[]>>;
|
|
31
|
+
/**
|
|
32
|
+
* Get Character voices data
|
|
33
|
+
* @param id The Character ID
|
|
34
|
+
*/
|
|
35
|
+
getCharacterVoiceActors(id: number): Promise<import("../models").JikanResponse<CharacterVoiceActor[]>>;
|
|
36
|
+
/**
|
|
37
|
+
* Get Character pictures data
|
|
38
|
+
* @param id The Character ID
|
|
39
|
+
*/
|
|
40
|
+
getCharacterPictures(id: number): Promise<import("../models").JikanResponse<JikanImagesCollection[]>>;
|
|
41
|
+
/**
|
|
42
|
+
* Get all the Characters within the given filter. Returns all Characters if no filters are given.
|
|
43
|
+
* @param searchParams Filter parameters
|
|
44
|
+
*/
|
|
45
|
+
getCharacterSearch(searchParams: Partial<CharactersSearchParams>): Promise<import("../models").JikanResponse<Character[]>>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { PaginationParams } from '../models';
|
|
2
|
+
import type { ClubSearchParams } from '../models/clubs/clubs-params.model';
|
|
3
|
+
import type { Club, ClubMember, ClubRelations, ClubStaff } from '../models/clubs/clubs.model';
|
|
4
|
+
import { BaseClient } from './base.client';
|
|
5
|
+
/**
|
|
6
|
+
* **Club Client**
|
|
7
|
+
*
|
|
8
|
+
* Client used to access the Club Endpoints.
|
|
9
|
+
*
|
|
10
|
+
* See also: [Jikan Documentation](https://docs.api.jikan.moe/)
|
|
11
|
+
*/
|
|
12
|
+
export declare class ClubsClient extends BaseClient {
|
|
13
|
+
/**
|
|
14
|
+
* @returns Club resource
|
|
15
|
+
* @param id Club ID
|
|
16
|
+
*/
|
|
17
|
+
getClubsById(id: number): Promise<import("../models").JikanResponse<Club>>;
|
|
18
|
+
/**
|
|
19
|
+
* @returns Club members resource
|
|
20
|
+
* @param id Club ID
|
|
21
|
+
* @param params
|
|
22
|
+
*/
|
|
23
|
+
getClubMembers(id: number, params?: Partial<PaginationParams>): Promise<import("../models").JikanResponse<ClubMember[]>>;
|
|
24
|
+
/**
|
|
25
|
+
* @returns Club staff
|
|
26
|
+
* @param id Club ID
|
|
27
|
+
*/
|
|
28
|
+
getClubStaff(id: number): Promise<import("../models").JikanResponse<ClubStaff[]>>;
|
|
29
|
+
/**
|
|
30
|
+
* @returns Club relations
|
|
31
|
+
* @param id Club ID
|
|
32
|
+
*/
|
|
33
|
+
getClubRelations(id: number): Promise<import("../models").JikanResponse<ClubRelations>>;
|
|
34
|
+
/**
|
|
35
|
+
* @returns Search results for Clubs
|
|
36
|
+
* @param params
|
|
37
|
+
*/
|
|
38
|
+
getClubSearch(params?: Partial<ClubSearchParams>): Promise<import("../models").JikanResponse<Club[]>>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Genre, GenresFilter } from '../models';
|
|
2
|
+
import { BaseClient } from './base.client';
|
|
3
|
+
/**
|
|
4
|
+
* **Genres Client**
|
|
5
|
+
*
|
|
6
|
+
* Client used to access the Genres Endpoints:
|
|
7
|
+
*
|
|
8
|
+
* See also: [Jikan Documentation](https://docs.api.jikan.moe/)
|
|
9
|
+
*/
|
|
10
|
+
export declare class GenresClient extends BaseClient {
|
|
11
|
+
/**
|
|
12
|
+
* Get Anime genres
|
|
13
|
+
* @param filter Type of the desired genres
|
|
14
|
+
*/
|
|
15
|
+
getAnimeGenres(filter?: GenresFilter): Promise<import("../models").JikanResponse<Genre[]>>;
|
|
16
|
+
/**
|
|
17
|
+
* Get Manga genres
|
|
18
|
+
* @param filter Type of the desired genres
|
|
19
|
+
*/
|
|
20
|
+
getMangaGenres(filter?: GenresFilter): Promise<import("../models").JikanResponse<Genre[]>>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ClientArgs } from './base.client';
|
|
2
|
+
import { AnimeClient } from './anime.client';
|
|
3
|
+
import { CharactersClient } from './characters.client';
|
|
4
|
+
import { ClubsClient } from './clubs.client';
|
|
5
|
+
import { GenresClient } from './genres.client';
|
|
6
|
+
import { MagazinesClient } from './magazines.client';
|
|
7
|
+
import { MangaClient } from './manga.client';
|
|
8
|
+
import { PeopleClient } from './people.client';
|
|
9
|
+
import { ProducersClient } from './producers.client';
|
|
10
|
+
import { RandomClient } from './random.client';
|
|
11
|
+
import { RecommendationsClient } from './recommendations.client';
|
|
12
|
+
import { ReviewsClient } from './reviews.client';
|
|
13
|
+
import { SchedulesClient } from './schedules.client';
|
|
14
|
+
import { SeasonsClient } from './seasons.client';
|
|
15
|
+
import { TopClient } from './top.client';
|
|
16
|
+
import { WatchClient } from './watch.client';
|
|
17
|
+
/**
|
|
18
|
+
* **Jikan Client**
|
|
19
|
+
*
|
|
20
|
+
* The main client used to access all the Jikan Endpoints:
|
|
21
|
+
*
|
|
22
|
+
* See also: [Jikan Documentation](https://docs.api.jikan.moe/)
|
|
23
|
+
*/
|
|
24
|
+
export declare class JikanClient {
|
|
25
|
+
anime: AnimeClient;
|
|
26
|
+
characters: CharactersClient;
|
|
27
|
+
clubs: ClubsClient;
|
|
28
|
+
genres: GenresClient;
|
|
29
|
+
magazines: MagazinesClient;
|
|
30
|
+
manga: MangaClient;
|
|
31
|
+
people: PeopleClient;
|
|
32
|
+
producers: ProducersClient;
|
|
33
|
+
top: TopClient;
|
|
34
|
+
schedules: SchedulesClient;
|
|
35
|
+
seasons: SeasonsClient;
|
|
36
|
+
random: RandomClient;
|
|
37
|
+
recommendations: RecommendationsClient;
|
|
38
|
+
reviews: ReviewsClient;
|
|
39
|
+
watch: WatchClient;
|
|
40
|
+
constructor(clientOptions?: Partial<ClientArgs>);
|
|
41
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Magazine, MagazineSearchParams } from '../models/magazine/magazine.model';
|
|
2
|
+
import { BaseClient } from './base.client';
|
|
3
|
+
export declare class MagazinesClient extends BaseClient {
|
|
4
|
+
/**
|
|
5
|
+
* @returns Magazines collection
|
|
6
|
+
* @param params
|
|
7
|
+
*/
|
|
8
|
+
getMagazines(params?: Partial<MagazineSearchParams>): Promise<import("..").JikanResponse<Magazine[]>>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { CommonCharacter, ForumFilter, JikanExternalLink, JikanForum, JikanImages, JikanMoreInfo, JikanNews, JikanRelation, Manga, MangaReview, MangaSearchParams, MangaStatistics, MangaUserUpdate, Recommendation, ReviewsParams } from '../models';
|
|
2
|
+
import { BaseClient } from './base.client';
|
|
3
|
+
/**
|
|
4
|
+
* **Manga Client**
|
|
5
|
+
*
|
|
6
|
+
* Client used to access the Manga Endpoints:
|
|
7
|
+
*
|
|
8
|
+
* See also: [Jikan Documentation](https://docs.api.jikan.moe/)
|
|
9
|
+
*/
|
|
10
|
+
export declare class MangaClient extends BaseClient {
|
|
11
|
+
/**
|
|
12
|
+
* Get a Manga with full information by its ID
|
|
13
|
+
* @param id The Manga ID
|
|
14
|
+
*/
|
|
15
|
+
getMangaFullById(id: number): Promise<import("../models").JikanResponse<Manga>>;
|
|
16
|
+
/**
|
|
17
|
+
* Get a Manga by its ID
|
|
18
|
+
* @param id The Manga ID
|
|
19
|
+
*/
|
|
20
|
+
getMangaById(id: number): Promise<import("../models").JikanResponse<Manga>>;
|
|
21
|
+
/**
|
|
22
|
+
* Get Characters of a specific Manga
|
|
23
|
+
* @param id The Manga ID
|
|
24
|
+
*/
|
|
25
|
+
getMangaCharacters(id: number): Promise<import("../models").JikanResponse<CommonCharacter[]>>;
|
|
26
|
+
/**
|
|
27
|
+
* Get a list of manga news
|
|
28
|
+
* @param id The Manga ID
|
|
29
|
+
*/
|
|
30
|
+
getMangaNews(id: number): Promise<import("../models").JikanResponse<JikanNews[]>>;
|
|
31
|
+
/**
|
|
32
|
+
* Get a list og manga forum topics
|
|
33
|
+
* @param id The manga ID
|
|
34
|
+
* @param filter Filter topics
|
|
35
|
+
*/
|
|
36
|
+
getMangaTopics(id: number, filter?: ForumFilter): Promise<import("../models").JikanResponse<JikanForum[]>>;
|
|
37
|
+
/**
|
|
38
|
+
* Get Pictures related to a specific Manga
|
|
39
|
+
* @param id The Manga ID
|
|
40
|
+
*/
|
|
41
|
+
getMangaPictures(id: number): Promise<import("../models").JikanResponse<JikanImages[]>>;
|
|
42
|
+
/**
|
|
43
|
+
* Get Statistics related to a specific Manga
|
|
44
|
+
* @param id The Manga ID
|
|
45
|
+
*/
|
|
46
|
+
getMangaStatistics(id: number): Promise<import("../models").JikanResponse<MangaStatistics>>;
|
|
47
|
+
/**
|
|
48
|
+
* Get more info related to the manga
|
|
49
|
+
* @param id manga id
|
|
50
|
+
*/
|
|
51
|
+
getMangaMoreInfo(id: number): Promise<import("../models").JikanResponse<JikanMoreInfo>>;
|
|
52
|
+
/**
|
|
53
|
+
* Get Recommendations related to a specific Manga
|
|
54
|
+
* @param id The Manga ID
|
|
55
|
+
*/
|
|
56
|
+
getMangaRecommendations(id: number): Promise<import("../models").JikanResponse<Recommendation[]>>;
|
|
57
|
+
/**
|
|
58
|
+
* Get anime Relations
|
|
59
|
+
* @param id manga id
|
|
60
|
+
*/
|
|
61
|
+
getMangaRelations(id: number): Promise<import("../models").JikanResponse<JikanRelation[]>>;
|
|
62
|
+
/**
|
|
63
|
+
* Get manga external links
|
|
64
|
+
* @param id manga id
|
|
65
|
+
*/
|
|
66
|
+
getMangaExternal(id: number): Promise<import("../models").JikanResponse<JikanExternalLink[]>>;
|
|
67
|
+
/**
|
|
68
|
+
* Get user updates for the manga
|
|
69
|
+
* @param id manga id
|
|
70
|
+
* @param page page number
|
|
71
|
+
*/
|
|
72
|
+
getMangaUserUpdates(id: number, page?: number): Promise<import("../models").JikanResponse<MangaUserUpdate[]>>;
|
|
73
|
+
/**
|
|
74
|
+
* Get reviews for the manga
|
|
75
|
+
* @param id manga id
|
|
76
|
+
* @param params review parameters
|
|
77
|
+
*/
|
|
78
|
+
getMangaReviews(id: number, params?: Partial<ReviewsParams>): Promise<import("../models").JikanResponse<MangaReview[]>>;
|
|
79
|
+
/**
|
|
80
|
+
* Get all the filtered Mangas. Returns all the Mangas if no filters are given.
|
|
81
|
+
* @param searchParams Filter parameters
|
|
82
|
+
*/
|
|
83
|
+
getMangaSearch(searchParams?: Partial<MangaSearchParams>): Promise<import("../models").JikanResponse<Manga[]>>;
|
|
84
|
+
}
|