@tutkli/jikan-ts 2.2.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.
Files changed (102) hide show
  1. package/README.md +60 -65
  2. package/dist/chunk-b9f01kcn.js +1 -0
  3. package/dist/chunk-ygw2424n.js +1 -0
  4. package/dist/client.d.ts +19 -0
  5. package/dist/client.js +1 -0
  6. package/dist/clients/anime.client.d.ts +123 -0
  7. package/dist/clients/base.client.d.ts +45 -0
  8. package/dist/clients/characters.client.d.ts +46 -0
  9. package/dist/clients/clubs.client.d.ts +39 -0
  10. package/dist/clients/genres.client.d.ts +21 -0
  11. package/dist/clients/jikan.client.d.ts +41 -0
  12. package/dist/clients/magazines.client.d.ts +9 -0
  13. package/dist/clients/manga.client.d.ts +84 -0
  14. package/dist/clients/people.client.d.ts +46 -0
  15. package/dist/clients/producers.client.d.ts +31 -0
  16. package/dist/clients/random.client.d.ts +27 -0
  17. package/dist/clients/recommendations.client.d.ts +21 -0
  18. package/dist/clients/reviews.client.d.ts +21 -0
  19. package/dist/clients/schedules.client.d.ts +16 -0
  20. package/dist/clients/seasons.client.d.ts +32 -0
  21. package/dist/clients/top.client.d.ts +36 -0
  22. package/dist/clients/watch.client.d.ts +27 -0
  23. package/dist/config/cache.d.ts +11 -0
  24. package/dist/config/ky.config.d.ts +11 -0
  25. package/dist/config/logging.config.d.ts +4 -0
  26. package/dist/constants/base.const.d.ts +1 -0
  27. package/dist/endpoints/anime.endpoints.d.ts +23 -0
  28. package/dist/endpoints/characters.endpoints.d.ts +9 -0
  29. package/dist/endpoints/clubs.endpoints.d.ts +7 -0
  30. package/dist/endpoints/genres.endpoints.d.ts +4 -0
  31. package/dist/endpoints/magazines.endpoints.d.ts +3 -0
  32. package/dist/endpoints/manga.endpoints.d.ts +16 -0
  33. package/dist/endpoints/people.endpoints.d.ts +9 -0
  34. package/dist/endpoints/producers.endpoints.d.ts +6 -0
  35. package/dist/endpoints/random.endpoints.d.ts +7 -0
  36. package/dist/endpoints/recommendations.endpoints.d.ts +4 -0
  37. package/dist/endpoints/reviews.endpoints.d.ts +4 -0
  38. package/dist/endpoints/schedules.endpoints.d.ts +3 -0
  39. package/dist/endpoints/seasons.endpoints.d.ts +6 -0
  40. package/dist/endpoints/top.endpoints.d.ts +7 -0
  41. package/dist/endpoints/watch.endpoints.d.ts +6 -0
  42. package/dist/index.d.ts +1 -1049
  43. package/dist/index.js +1 -1
  44. package/dist/models/Anime/anime-character.model.d.ts +4 -0
  45. package/dist/models/Anime/anime-episode.model.d.ts +12 -0
  46. package/dist/models/Anime/anime-picture.model.d.ts +4 -0
  47. package/dist/models/Anime/anime-staff.model.d.ts +5 -0
  48. package/dist/models/Anime/anime-statistics.model.d.ts +5 -0
  49. package/dist/models/Anime/anime-video.model.d.ts +32 -0
  50. package/dist/models/Anime/anime.model.d.ts +60 -0
  51. package/dist/models/Anime/index.d.ts +7 -0
  52. package/dist/models/Character/character.model.d.ts +28 -0
  53. package/dist/models/Character/index.d.ts +1 -0
  54. package/dist/models/Common/character.model.d.ts +18 -0
  55. package/dist/models/Common/external-link.model.d.ts +4 -0
  56. package/dist/models/Common/forum.model.d.ts +16 -0
  57. package/dist/models/Common/image.model.d.ts +11 -0
  58. package/dist/models/Common/index.d.ts +12 -0
  59. package/dist/models/Common/more-info.model.d.ts +3 -0
  60. package/dist/models/Common/news.model.d.ts +13 -0
  61. package/dist/models/Common/person.model.d.ts +7 -0
  62. package/dist/models/Common/recommendation.model.d.ts +12 -0
  63. package/dist/models/Common/relation.model.d.ts +10 -0
  64. package/dist/models/Common/resource.model.d.ts +35 -0
  65. package/dist/models/Common/seasons-list.model.d.ts +5 -0
  66. package/dist/models/Common/statistics.model.d.ts +12 -0
  67. package/dist/models/Genre/genre.model.d.ts +5 -0
  68. package/dist/models/Genre/index.d.ts +1 -0
  69. package/dist/models/Manga/index.d.ts +2 -0
  70. package/dist/models/Manga/manga-statistics.model.d.ts +5 -0
  71. package/dist/models/Manga/manga.model.d.ts +37 -0
  72. package/dist/models/Params/characters-params.model.d.ts +10 -0
  73. package/dist/models/Params/genres-params.model.d.ts +1 -0
  74. package/dist/models/Params/index.d.ts +7 -0
  75. package/dist/models/Params/pagination-params.model.d.ts +3 -0
  76. package/dist/models/Params/schedules-params.model.d.ts +9 -0
  77. package/dist/models/Params/search-params.model.d.ts +47 -0
  78. package/dist/models/Params/seasons-params.model.d.ts +12 -0
  79. package/dist/models/Params/top-params.model.d.ts +28 -0
  80. package/dist/models/Person/index.d.ts +2 -0
  81. package/dist/models/Person/person-params.model.d.ts +10 -0
  82. package/dist/models/Person/person.model.d.ts +50 -0
  83. package/dist/models/Producer/index.d.ts +2 -0
  84. package/dist/models/Producer/producer-params.model.d.ts +10 -0
  85. package/dist/models/Producer/producer.model.d.ts +14 -0
  86. package/dist/models/Recommendation/index.d.ts +1 -0
  87. package/dist/models/Recommendation/recommendation.model.d.ts +18 -0
  88. package/dist/models/Response/index.d.ts +1 -0
  89. package/dist/models/Response/response.model.d.ts +15 -0
  90. package/dist/models/Review/index.d.ts +2 -0
  91. package/dist/models/Review/review-params.model.d.ts +5 -0
  92. package/dist/models/Review/review.model.d.ts +42 -0
  93. package/dist/models/UserUpdate/index.d.ts +1 -0
  94. package/dist/models/UserUpdate/user-update.model.d.ts +24 -0
  95. package/dist/models/clubs/clubs-params.model.d.ts +14 -0
  96. package/dist/models/clubs/clubs.model.d.ts +25 -0
  97. package/dist/models/index.d.ts +12 -0
  98. package/dist/models/magazine/magazine.model.d.ts +16 -0
  99. package/dist/models/watch/watch.model.d.ts +21 -0
  100. package/dist/types.d.ts +21 -0
  101. package/dist/types.js +1 -0
  102. package/package.json +61 -35
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var o={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"};import T from"axios";import{setupCache as U}from"axios-cache-interceptor";var S="https://api.jikan.moe/v4";var F=(e)=>{return"cache"in e.defaults},g=(e,r={})=>{let m=e??T.create({baseURL:S,headers:{"Content-Type":"application/json"}});if(F(m))return m;return U(m,{...r,cacheTakeover:!1})};var I=(e)=>{return console.info(`[Request] ${e.method?.toUpperCase()??""} | ${e.url??""}`),e},V=(e)=>{throw console.error(`[Request Error] CODE ${e.code??"UNKNOWN"} | ${e.message}`),e},v=(e)=>{return console.info(`[Request Response] ${e.config.method?.toUpperCase()??""} | ${e.config.url??""}`,e.data),e},w=(e)=>{throw console.error(`[ Response Error ] CODE ${e.code??"UNKNOWN"} | ${e.message}`),e};class t{api;constructor(e={}){if(this.api=g(e.axiosInstance,e.cacheOptions),e.enableLogging)this.addLoggingInterceptors()}async getResource(e,r={},m={}){return(await this.api.get(this.replacePathParams(e,r),{params:m})).data}replacePathParams(e,r){let m=e;for(let c of Object.keys(r)){if(!RegExp(`{${c}}`).exec(m))throw new Error(`Path does not contain "${c}" parameter.`);m=m.replace(`{${c}}`,String(r[c]))}return m}addLoggingInterceptors(){this.api.interceptors.request.use((e)=>I(e),(e)=>V(e)),this.api.interceptors.response.use((e)=>v(e),(e)=>w(e))}}class f extends t{getAnimeFullById(e){return this.getResource(o.animeFullById,{id:e})}getAnimeById(e){return this.getResource(o.animeById,{id:e})}getAnimeCharacters(e){return this.getResource(o.animeCharacters,{id:e})}getAnimeStaff(e){return this.getResource(o.animeStaff,{id:e})}getAnimeEpisodes(e,r=1){return this.getResource(o.animeEpisodes,{id:e},{page:r})}getAnimeEpisodeById(e,r){return this.getResource(o.animeEpisodeById,{id:e,episode:r})}getAnimeNews(e,r){return this.getResource(o.animeNews,{id:e},{page:r})}getAnimeForum(e,r){return this.getResource(o.animeForum,{id:e},r?{filter:r}:void 0)}getAnimeVideos(e){return this.getResource(o.animeVideos,{id:e})}getAnimeEpisodeVideos(e,r=1){return this.getResource(o.animeVideosEpisodes,{id:e},{page:r})}getAnimePictures(e){return this.getResource(o.animePictures,{id:e})}getAnimeStatistics(e){return this.getResource(o.animeStatistics,{id:e})}getAnimeMoreInfo(e){return this.getResource(o.animeMoreInfo,{id:e})}getAnimeRecommendations(e){return this.getResource(o.animeRecommendations,{id:e})}getAnimeRelations(e){return this.getResource(o.animeRelations,{id:e})}getAnimeExternal(e){return this.getResource(o.animeExternal,{id:e})}getAnimeSearch(e){return this.getResource(o.animeSearch,{},e)}}var i={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"};class l extends t{getCharacterFullById(e){return this.getResource(i.characterFullById,{id:e})}getCharacterById(e){return this.getResource(i.characterById,{id:e})}getCharacterAnime(e){return this.getResource(i.characterAnime,{id:e})}getCharacterManga(e){return this.getResource(i.charactersManga,{id:e})}getCharacterVoiceActors(e){return this.getResource(i.characterVoiceActors,{id:e})}getCharacterPictures(e){return this.getResource(i.characterPictures,{id:e})}getCharacterSearch(e){return this.getResource(i.characterSearch,{},e)}}var n={clubById:"/clubs/{id}",clubMembers:"/clubs/{id}/members",clubStaff:"/clubs/{id}/staff",clubRelations:"/clubs/{id}/relations",clubSearch:"/clubs"};class y extends t{getClubsById(e){return this.getResource(n.clubById,{id:e})}getClubMembers(e,r={}){return this.getResource(n.clubMembers,{id:e},r)}getClubStaff(e){return this.getResource(n.clubStaff,{id:e})}getClubRelations(e){return this.getResource(n.clubRelations,{id:e})}getClubSearch(e={}){return this.getResource(n.clubSearch,{},e)}}var b={animeGenres:"/genres/anime",mangaGenres:"/genres/manga"};class k extends t{getAnimeGenres(e){return this.getResource(b.animeGenres,{},{filter:e})}getMangaGenres(e){return this.getResource(b.mangaGenres,{},{filter:e})}}var N={magazines:"/magazines"};class R extends t{getMagazines(e={}){return this.getResource(N.magazines,{},e)}}var a={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"};class J extends t{getMangaFullById(e){return this.getResource(a.mangaFullById,{id:e})}getMangaById(e){return this.getResource(a.mangaById,{id:e})}getMangaCharacters(e){return this.getResource(a.mangaCharacters,{id:e})}getMangaNews(e){return this.getResource(a.mangaNews,{id:e})}getMangaTopics(e,r){return this.getResource(a.mangaTopics,{id:e},r?{filter:r}:void 0)}getMangaPictures(e){return this.getResource(a.mangaPictures,{id:e})}getMangaStatistics(e){return this.getResource(a.mangaStatistics,{id:e})}getMangaMoreInfo(e){return this.getResource(a.mangaMoreInfo,{id:e})}getMangaRecommendations(e){return this.getResource(a.mangaRecommendations,{id:e})}getMangaRelations(e){return this.getResource(a.mangaRelations,{id:e})}getMangaExternal(e){return this.getResource(a.mangaExternal,{id:e})}getMangaSearch(e){return this.getResource(a.mangaSearch,{},e)}}var p={randomAnime:"/random/anime",randomManga:"/random/manga",randomCharacters:"/random/characters"};class h extends t{getRandomAnime(){return this.getResource(p.randomAnime)}getRandomManga(){return this.getResource(p.randomManga)}getRandomCharacters(){return this.getResource(p.randomCharacters)}}var M={schedules:"/schedules"};class _ extends t{getSchedules(e){return this.getResource(M.schedules,{},e)}}var s={season:"/seasons/{year}/{season}",seasonNow:"/seasons/now",seasonsList:"/seasons",seasonUpcoming:"/seasons/upcoming"};class d extends t{getSeason(e,r,m){return this.getResource(s.season,{year:e,season:r},m)}getSeasonNow(e){return this.getResource(s.seasonNow,{},e)}getSeasonsList(){return this.getResource(s.seasonsList)}getSeasonUpcoming(e){return this.getResource(s.seasonUpcoming,{},e)}}var x={topAnime:"/top/anime",topManga:"/top/manga",topCharacters:"/top/characters"};class A extends t{getTopAnime(e){return this.getResource(x.topAnime,{},e)}getTopManga(e){return this.getResource(x.topManga,{},e)}getTopCharacters(e){return this.getResource(x.topCharacters,{},e)}}var u={watchRecentEpisodes:"/watch/episodes",watchPopularEpisodes:"/watch/episodes/popular",watchRecentPromos:"/watch/promos",watchPopularPromos:"/watch/promos/popular"};class C extends t{getWatchRecentEpisodes(){return this.getResource(u.watchRecentEpisodes)}getWatchPopularEpisodes(){return this.getResource(u.watchPopularEpisodes)}getWatchRecentPromos(e={}){return this.getResource(u.watchRecentPromos,{},e)}getWatchPopularPromos(){return this.getResource(u.watchPopularPromos)}}class ${anime;characters;clubs;genres;magazines;manga;top;schedules;seasons;random;watch;constructor(e={}){let r=g(e.axiosInstance,e.cacheOptions);this.anime=new f({axiosInstance:r,...e}),this.characters=new l({axiosInstance:r,...e}),this.clubs=new y({axiosInstance:r,...e}),this.genres=new k({axiosInstance:r,...e}),this.magazines=new R({axiosInstance:r,...e}),this.manga=new J({axiosInstance:r,...e}),this.top=new A({axiosInstance:r,...e}),this.schedules=new _({axiosInstance:r,...e}),this.seasons=new d({axiosInstance:r,...e}),this.random=new h({axiosInstance:r,...e}),this.watch=new C({axiosInstance:r,...e})}}export{w as handleResponseError,v as handleResponse,V as handleRequestError,I as handleRequest,u as WatchEndpoints,C as WatchClient,x as TopEndpoints,A as TopClient,s as SeasonsEndpoints,d as SeasonsClient,_ as SchedulesClient,p as RandomEndpoints,h as RandomClient,a as MangaEndpoints,J as MangaClient,N as MagazinesEndpoints,R as MagazinesClient,$ as JikanClient,b as GenresEndpoints,k as GenresClient,n as ClubsEndpoints,y as ClubsClient,i as CharactersEndpoints,l as CharactersClient,t as BaseClient,S as BASE_URL,o as AnimeEndpoints,f as AnimeClient};
1
+ import{a as m,b as p,c as t,d as x,e as a,f as c,g,h as i,i as k,j as n,k as s,l as v,m as y,n as A,o as C,p as E,q as G,r as I,s as K,t as L}from"./chunk-b9f01kcn.js";import{A as l,B as q,C as u,D as w,E as z,F as B,G as D,H as F,I as H,J,u as e,v as f,w as b,x as d,y as h,z as j}from"./chunk-ygw2424n.js";export{m as loggingBeforeRequest,t as loggingBeforeError,p as loggingAfterResponse,J as WatchEndpoints,K as WatchClient,H as TopEndpoints,I as TopClient,F as SeasonsEndpoints,G as SeasonsClient,D as SchedulesEndpoints,E as SchedulesClient,B as ReviewsEndpoints,C as ReviewsClient,z as RecommendationsEndpoints,A as RecommendationsClient,w as RandomEndpoints,y as RandomClient,u as ProducersEndpoints,v as ProducersClient,q as PeopleEndpoints,s as PeopleClient,l as MangaEndpoints,n as MangaClient,j as MagazinesEndpoints,k as MagazinesClient,L as JikanClient,h as GenresEndpoints,i as GenresClient,d as ClubsEndpoints,g as ClubsClient,b as CharactersEndpoints,c as CharactersClient,x as BaseClient,f as BASE_URL,e as AnimeEndpoints,a as AnimeClient};
@@ -0,0 +1,4 @@
1
+ import type { CharacterVoiceActor, CommonCharacter } from '../Common';
2
+ export interface AnimeCharacter extends CommonCharacter {
3
+ voice_actors: CharacterVoiceActor[];
4
+ }
@@ -0,0 +1,12 @@
1
+ export interface AnimeEpisode {
2
+ mal_id: number;
3
+ url: string;
4
+ title: string;
5
+ title_japanese: string | null;
6
+ title_romanji: string | null;
7
+ duration: number | null;
8
+ aired: string | null;
9
+ filler: boolean;
10
+ recap: boolean;
11
+ synopsis: string | null;
12
+ }
@@ -0,0 +1,4 @@
1
+ import type { JikanImages } from '../Common';
2
+ export interface AnimePicture {
3
+ images: JikanImages;
4
+ }
@@ -0,0 +1,5 @@
1
+ import type { JikanPerson } from '../Common';
2
+ export interface AnimeStaff {
3
+ person: JikanPerson;
4
+ positions: string[];
5
+ }
@@ -0,0 +1,5 @@
1
+ import type { Statistics } from '../Common';
2
+ export interface AnimeStatistics extends Statistics {
3
+ watching: number;
4
+ plan_to_watch: number;
5
+ }
@@ -0,0 +1,32 @@
1
+ import type { JikanImages, JikanImagesCollection } from '../Common';
2
+ export interface AnimeVideos {
3
+ promo: AnimePromoVideo[];
4
+ episodes: AnimeEpisodeVideo[];
5
+ music_videos: AnimeMusicVideo[];
6
+ }
7
+ export type AnimePromoVideo = {
8
+ title: string;
9
+ trailer: AnimeYoutubeVideo;
10
+ };
11
+ export interface AnimeYoutubeVideo {
12
+ youtube_id: string | null;
13
+ url: string | null;
14
+ embed_url: string | null;
15
+ images?: JikanImagesCollection;
16
+ }
17
+ export interface AnimeEpisodeVideo {
18
+ mal_id: number;
19
+ url: string;
20
+ title: string;
21
+ episode: string;
22
+ images: JikanImages;
23
+ }
24
+ export interface AnimeMusicVideo {
25
+ title: string;
26
+ video: AnimeYoutubeVideo;
27
+ meta: AnimeVideoMeta;
28
+ }
29
+ export interface AnimeVideoMeta {
30
+ title: string | null;
31
+ author: string | null;
32
+ }
@@ -0,0 +1,60 @@
1
+ import type { JikanImages, JikanNamedResource, JikanResource, JikanResourcePeriod, JikanResourceRelation, JikanResourceTitle } from '../Common';
2
+ import type { AnimeYoutubeVideo } from './anime-video.model';
3
+ export interface Anime {
4
+ mal_id: number;
5
+ url: string;
6
+ images: JikanImages;
7
+ trailer: AnimeYoutubeVideo;
8
+ approved: boolean;
9
+ titles: JikanResourceTitle[];
10
+ title: string;
11
+ title_english?: string | null;
12
+ title_japanese?: string | null;
13
+ title_synonyms: string[];
14
+ type: AnimeType | null;
15
+ source: string | null;
16
+ episodes: number | null;
17
+ status: AnimeStatus | null;
18
+ airing: boolean;
19
+ aired: JikanResourcePeriod;
20
+ duration: string | null;
21
+ rating?: AnimeRatingString | null;
22
+ score: number | null;
23
+ scored_by: number | null;
24
+ rank: number | null;
25
+ popularity: number | null;
26
+ members: number | null;
27
+ favorites: number | null;
28
+ synopsis: string | null;
29
+ background: string | null;
30
+ season: AnimeSeason | null;
31
+ year: number | null;
32
+ broadcast: AnimeBroadcast;
33
+ producers: JikanResource[];
34
+ licensors: JikanResource[];
35
+ studios: JikanResource[];
36
+ genres: JikanResource[];
37
+ explicit_genres: JikanResource[];
38
+ themes: JikanResource[];
39
+ demographics: JikanResource[];
40
+ relations?: JikanResourceRelation[];
41
+ theme?: AnimeTheme;
42
+ external?: JikanNamedResource[];
43
+ streaming?: JikanNamedResource[];
44
+ }
45
+ export interface AnimeBroadcast {
46
+ day: string | null;
47
+ time: string | null;
48
+ timezone: string | null;
49
+ string: string | null;
50
+ }
51
+ export interface AnimeTheme {
52
+ openings: string[];
53
+ endings: string[];
54
+ }
55
+ export type AnimeType = 'TV' | 'OVA' | 'Movie' | 'Special' | 'ONA' | 'Music';
56
+ export type AnimeSearchType = 'tv' | 'movie' | 'ova' | 'special' | 'ona' | 'music' | 'cm' | 'pv' | 'tv_special';
57
+ export type AnimeStatus = 'Finished Airing' | 'Currently Airing' | 'Not yet aired';
58
+ export type AnimeRating = 'g' | 'pg' | 'pg13' | 'r17' | 'r' | 'rx';
59
+ export type AnimeRatingString = 'G - All Ages' | 'PG - Children' | 'PG-13 - Teens 13 or older' | 'R - 17+ (violence & profanity)' | 'R+ - Mild Nudity' | 'Rx - Hentai';
60
+ export type AnimeSeason = 'spring' | 'summer' | 'fall' | 'winter';
@@ -0,0 +1,7 @@
1
+ export * from './anime.model';
2
+ export * from './anime-character.model';
3
+ export * from './anime-episode.model';
4
+ export * from './anime-picture.model';
5
+ export * from './anime-staff.model';
6
+ export * from './anime-statistics.model';
7
+ export * from './anime-video.model';
@@ -0,0 +1,28 @@
1
+ import type { CharacterRole, CharacterVoiceActor, CommonCharacterData, JikanImages } from '../Common';
2
+ export interface Character {
3
+ mal_id: number;
4
+ url: string;
5
+ images: JikanImages;
6
+ name: string;
7
+ name_kanji: string | null;
8
+ nicknames: string[];
9
+ favorites: number;
10
+ about: string | null;
11
+ }
12
+ export interface CharacterFull extends Character {
13
+ anime: CharacterAnime[];
14
+ manga: CharacterManga[];
15
+ voices: CharacterVoiceActor[];
16
+ }
17
+ export interface CharacterAnime {
18
+ role: CharacterRole;
19
+ anime: CommonCharacterData & {
20
+ title: string;
21
+ };
22
+ }
23
+ export interface CharacterManga {
24
+ role: CharacterRole;
25
+ manga: CommonCharacterData & {
26
+ title: string;
27
+ };
28
+ }
@@ -0,0 +1 @@
1
+ export * from './character.model';
@@ -0,0 +1,18 @@
1
+ import type { JikanImages } from './image.model';
2
+ import type { JikanPerson } from './person.model';
3
+ export interface CommonCharacter {
4
+ character: CommonCharacterData & {
5
+ name: string;
6
+ };
7
+ role: CharacterRole;
8
+ }
9
+ export interface CommonCharacterData {
10
+ mal_id: number;
11
+ url: string;
12
+ images: JikanImages;
13
+ }
14
+ export interface CharacterVoiceActor {
15
+ person: JikanPerson;
16
+ language: string;
17
+ }
18
+ export type CharacterRole = string;
@@ -0,0 +1,4 @@
1
+ export interface JikanExternalLink {
2
+ name: string;
3
+ url: string;
4
+ }
@@ -0,0 +1,16 @@
1
+ export interface JikanForum {
2
+ mal_id: number;
3
+ url: string;
4
+ title: string;
5
+ date: string;
6
+ author_username: string;
7
+ author_url: string;
8
+ comments: number;
9
+ last_comment: {
10
+ url: string;
11
+ author_username: string;
12
+ author_url: string;
13
+ date: string | null;
14
+ };
15
+ }
16
+ export type ForumFilter = 'all' | 'episode' | 'other';
@@ -0,0 +1,11 @@
1
+ export interface JikanImages {
2
+ jpg: JikanImagesCollection;
3
+ webp?: JikanImagesCollection;
4
+ }
5
+ export interface JikanImagesCollection {
6
+ image_url: string;
7
+ small_image_url?: string;
8
+ medium_image_url?: string;
9
+ large_image_url?: string;
10
+ maximum_image_url?: string;
11
+ }
@@ -0,0 +1,12 @@
1
+ export * from './character.model';
2
+ export * from './external-link.model';
3
+ export * from './forum.model';
4
+ export * from './image.model';
5
+ export * from './more-info.model';
6
+ export * from './news.model';
7
+ export * from './person.model';
8
+ export * from './recommendation.model';
9
+ export * from './relation.model';
10
+ export * from './resource.model';
11
+ export * from './seasons-list.model';
12
+ export * from './statistics.model';
@@ -0,0 +1,3 @@
1
+ export interface JikanMoreInfo {
2
+ moreinfo: string;
3
+ }
@@ -0,0 +1,13 @@
1
+ import type { JikanImages } from './image.model';
2
+ export interface JikanNews {
3
+ mal_id: number;
4
+ url: string;
5
+ title: string;
6
+ date: string;
7
+ author_username: string;
8
+ author_url: string;
9
+ forum_url: string;
10
+ images: JikanImages;
11
+ comments: number;
12
+ excerpt: string;
13
+ }
@@ -0,0 +1,7 @@
1
+ import type { JikanImages } from './image.model';
2
+ export interface JikanPerson {
3
+ mal_id: number;
4
+ url: string;
5
+ images: JikanImages;
6
+ name: string;
7
+ }
@@ -0,0 +1,12 @@
1
+ import type { JikanImages } from './image.model';
2
+ export interface Recommendation {
3
+ entry: RecommendationEntry;
4
+ url: string;
5
+ votes: number;
6
+ }
7
+ export interface RecommendationEntry {
8
+ mal_id: number;
9
+ url: string;
10
+ images: JikanImages;
11
+ title: string;
12
+ }
@@ -0,0 +1,10 @@
1
+ export interface JikanRelation {
2
+ relation: string;
3
+ entry: RelationEntry[];
4
+ }
5
+ export interface RelationEntry {
6
+ mal_id: number;
7
+ type: string;
8
+ name: string;
9
+ url: string;
10
+ }
@@ -0,0 +1,35 @@
1
+ export interface JikanResource {
2
+ mal_id: number;
3
+ type: string;
4
+ name: string;
5
+ url: string;
6
+ }
7
+ export interface JikanNamedResource {
8
+ name: string;
9
+ url: string;
10
+ }
11
+ export interface JikanResourceTitle {
12
+ type: string;
13
+ title: string;
14
+ }
15
+ export interface JikanResourcePeriod {
16
+ from: string | null;
17
+ to: string | null;
18
+ prop: {
19
+ from: {
20
+ day: number | null;
21
+ month: number | null;
22
+ year: number | null;
23
+ };
24
+ to: {
25
+ day: number | null;
26
+ month: number | null;
27
+ year: number | null;
28
+ };
29
+ string: string | null;
30
+ };
31
+ }
32
+ export interface JikanResourceRelation {
33
+ relation: string;
34
+ entry: JikanResource[];
35
+ }
@@ -0,0 +1,5 @@
1
+ import type { AnimeSeason } from '../Anime';
2
+ export interface SeasonsListData {
3
+ year: number;
4
+ seasons: AnimeSeason[];
5
+ }
@@ -0,0 +1,12 @@
1
+ export interface Statistics {
2
+ completed: number;
3
+ on_hold: number;
4
+ dropped: number;
5
+ total: number;
6
+ scores: StatisticsScore[];
7
+ }
8
+ export interface StatisticsScore {
9
+ score: number;
10
+ votes: number;
11
+ percentage: number;
12
+ }
@@ -0,0 +1,5 @@
1
+ import type { JikanNamedResource } from '../Common';
2
+ export interface Genre extends JikanNamedResource {
3
+ mal_id: number;
4
+ count: number;
5
+ }
@@ -0,0 +1 @@
1
+ export * from './genre.model';
@@ -0,0 +1,2 @@
1
+ export * from './manga.model';
2
+ export * from './manga-statistics.model';
@@ -0,0 +1,5 @@
1
+ import type { Statistics } from '../Common';
2
+ export interface MangaStatistics extends Statistics {
3
+ reading: number;
4
+ plan_to_read: number;
5
+ }
@@ -0,0 +1,37 @@
1
+ import type { JikanImages, JikanNamedResource, JikanResource, JikanResourcePeriod, JikanResourceRelation, JikanResourceTitle } from '../Common';
2
+ export interface Manga {
3
+ mal_id: number;
4
+ url: string;
5
+ images: JikanImages;
6
+ approved: boolean;
7
+ titles: JikanResourceTitle[];
8
+ title: string;
9
+ title_english?: string | null;
10
+ title_japanese: string | null;
11
+ title_synonyms?: string[];
12
+ type: MangaType | null;
13
+ chapters: number | null;
14
+ volumes: number | null;
15
+ status: MangaStatus;
16
+ publishing: boolean;
17
+ published: JikanResourcePeriod;
18
+ score: number | null;
19
+ scored_by: number | null;
20
+ rank: number | null;
21
+ popularity: number | null;
22
+ members: number | null;
23
+ favorites: number | null;
24
+ synopsis: string | null;
25
+ background: string | null;
26
+ authors: JikanResource[];
27
+ serializations: JikanResource[];
28
+ genres: JikanResource[];
29
+ explicit_genres: JikanResource[];
30
+ themes: JikanResource[];
31
+ demographics: JikanResource[];
32
+ relations?: JikanResourceRelation[];
33
+ external?: JikanNamedResource[];
34
+ }
35
+ export type MangaType = 'Manga' | 'Novel' | 'Light Novel' | 'One-shot' | 'Doujinshi' | 'Manhua' | 'Manhwa' | 'OEL';
36
+ export type MangaSearchType = 'manga' | 'novel' | 'lightnovel' | 'oneshot' | 'doujin' | 'manhwa' | 'manhua';
37
+ export type MangaStatus = 'Finished' | 'Publishing' | 'On Hiatus' | 'Discontinued' | 'Not yet published';
@@ -0,0 +1,10 @@
1
+ import type { SortOptions } from './search-params.model';
2
+ export interface CharactersSearchParams {
3
+ page?: number;
4
+ limit?: number;
5
+ q?: string;
6
+ order_by?: CharactersSearchOrder;
7
+ sort?: SortOptions;
8
+ letter?: string;
9
+ }
10
+ export type CharactersSearchOrder = 'mal_id' | 'name' | 'favorites';
@@ -0,0 +1 @@
1
+ export type GenresFilter = 'genres' | 'explicit_genres' | 'themes' | 'demographics';
@@ -0,0 +1,7 @@
1
+ export * from './characters-params.model';
2
+ export * from './genres-params.model';
3
+ export * from './pagination-params.model';
4
+ export * from './schedules-params.model';
5
+ export * from './search-params.model';
6
+ export * from './seasons-params.model';
7
+ export * from './top-params.model';
@@ -0,0 +1,3 @@
1
+ export type PaginationParams = {
2
+ page: number;
3
+ };
@@ -0,0 +1,9 @@
1
+ export interface SchedulesParams {
2
+ page?: number;
3
+ limit?: number;
4
+ filter?: SchedulesFilter;
5
+ kids?: boolean;
6
+ sfw?: boolean;
7
+ unapproved?: boolean;
8
+ }
9
+ export type SchedulesFilter = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday' | 'unknown' | 'other';
@@ -0,0 +1,47 @@
1
+ import type { AnimeRating, AnimeSearchType } from '../Anime';
2
+ import type { MangaSearchType } from '../Manga';
3
+ export type SortOptions = 'asc' | 'desc';
4
+ export type SearchOrder = 'mal_id' | 'title' | 'start_date' | 'end_date' | 'score' | 'scored_by' | 'rank' | 'popularity' | 'members' | 'favorites';
5
+ export type AnimeSearchOrder = 'type' | 'rating' | 'episodes' | 'status' | SearchOrder;
6
+ export type AnimeSearchStatus = 'airing' | 'complete' | 'upcoming';
7
+ export type MangaSearchOrder = 'chapters' | 'volumes' | 'status' | SearchOrder;
8
+ export type MangaSearchStatus = 'publishing' | 'complete' | 'hiatus' | 'discontinued' | 'upcoming';
9
+ export interface JikanSearchParams {
10
+ q?: string;
11
+ page?: number;
12
+ limit?: number;
13
+ score?: number;
14
+ min_score?: number;
15
+ max_score?: number;
16
+ sfw?: boolean;
17
+ genres?: string;
18
+ genres_exclude?: string;
19
+ sort?: SortOptions;
20
+ letter?: string;
21
+ producers?: string;
22
+ start_date?: string;
23
+ end_date?: string;
24
+ unapproved?: boolean;
25
+ }
26
+ /**
27
+ * QueryParams used in **getMangaSearch** call
28
+ *
29
+ * See also: [Jikan API Documentation](https://docs.api.jikan.moe/#tag/manga/operation/getMangaSearch)
30
+ */
31
+ export interface MangaSearchParams extends JikanSearchParams {
32
+ type?: MangaSearchType;
33
+ status?: MangaSearchStatus;
34
+ order_by?: MangaSearchOrder;
35
+ magazines?: string;
36
+ }
37
+ /**
38
+ * QueryParams used in **getAnimeSearch** call
39
+ *
40
+ * See also: [Jikan API Documentation](https://docs.api.jikan.moe/#tag/anime/operation/getAnimeSearch)
41
+ */
42
+ export interface AnimeSearchParams extends JikanSearchParams {
43
+ type?: AnimeSearchType;
44
+ status?: AnimeSearchStatus;
45
+ rating?: AnimeRating;
46
+ order_by?: AnimeSearchOrder;
47
+ }
@@ -0,0 +1,12 @@
1
+ import type { AnimeSearchType } from '../Anime';
2
+ export interface JikanSeasonsParams {
3
+ page?: number;
4
+ limit?: number;
5
+ filter?: AnimeSearchType;
6
+ sfw?: boolean;
7
+ unapproved?: boolean;
8
+ }
9
+ /**
10
+ * QueryParams used in **getSeasonNow** call
11
+ */
12
+ export type SeasonNowParams = Omit<JikanSeasonsParams, 'filter'>;
@@ -0,0 +1,28 @@
1
+ import type { AnimeSearchType } from '../Anime';
2
+ import type { MangaSearchType } from '../Manga';
3
+ type TopFilter = 'upcoming' | 'bypopularity' | 'favorite';
4
+ export type TopAnimeFilter = 'airing' | TopFilter;
5
+ export type TopMangaFilter = 'publishing' | TopFilter;
6
+ export interface JikanTopParams {
7
+ page?: number;
8
+ limit?: number;
9
+ }
10
+ /**
11
+ * QueryParams used in **getTopAnime** call
12
+ *
13
+ * See also: [Jikan API Documentation](https://docs.api.jikan.moe/#tag/top/operation/getTopAnime)
14
+ */
15
+ export interface AnimeTopParams extends JikanTopParams {
16
+ type?: AnimeSearchType;
17
+ filter?: TopAnimeFilter;
18
+ }
19
+ /**
20
+ * QueryParams used in **getTopManga** call
21
+ *
22
+ * See also: [Jikan API Documentation](https://docs.api.jikan.moe/#tag/top/operation/getTopManga)
23
+ */
24
+ export interface MangaTopParams extends JikanTopParams {
25
+ type?: MangaSearchType;
26
+ filter?: TopMangaFilter;
27
+ }
28
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './person.model';
2
+ export * from './person-params.model';
@@ -0,0 +1,10 @@
1
+ import type { SortOptions } from '../Params';
2
+ export type PeopleSearchOrder = 'mal_id' | 'name' | 'birthday' | 'favorites';
3
+ export interface PeopleSearchParams {
4
+ page?: number;
5
+ limit?: number;
6
+ q?: string;
7
+ order_by?: PeopleSearchOrder;
8
+ sort?: SortOptions;
9
+ letter?: string;
10
+ }
@@ -0,0 +1,50 @@
1
+ import type { JikanImages } from '../Common';
2
+ export interface Person {
3
+ mal_id: number;
4
+ url: string;
5
+ website_url: string | null;
6
+ images: JikanImages;
7
+ name: string;
8
+ given_name: string | null;
9
+ family_name: string | null;
10
+ alternate_names: string[];
11
+ birthday: string | null;
12
+ favorites: number;
13
+ about: string | null;
14
+ }
15
+ export interface PersonFull extends Person {
16
+ anime: PersonAnimePosition[];
17
+ manga: PersonMangaPosition[];
18
+ voices: PersonVoiceActingRole[];
19
+ }
20
+ export interface PersonAnimePosition {
21
+ position: string;
22
+ anime: PersonAnimeReference;
23
+ }
24
+ export interface PersonMangaPosition {
25
+ position: string;
26
+ manga: PersonMangaReference;
27
+ }
28
+ export interface PersonVoiceActingRole {
29
+ role: string;
30
+ anime: PersonAnimeReference;
31
+ character: PersonCharacterReference;
32
+ }
33
+ export interface PersonAnimeReference {
34
+ mal_id: number;
35
+ url: string;
36
+ images: JikanImages;
37
+ title: string;
38
+ }
39
+ export interface PersonMangaReference {
40
+ mal_id: number;
41
+ url: string;
42
+ images: JikanImages;
43
+ title: string;
44
+ }
45
+ export interface PersonCharacterReference {
46
+ mal_id: number;
47
+ url: string;
48
+ images: JikanImages;
49
+ name: string;
50
+ }
@@ -0,0 +1,2 @@
1
+ export * from './producer.model';
2
+ export * from './producer-params.model';