ani-client 2.0.1 → 2.0.3
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 +7 -0
- package/dist/index.d.mts +24 -4
- package/dist/index.d.ts +24 -4
- package/dist/index.js +72 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +72 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
- **Rate-limit protection** with exponential backoff, retries, and custom strategies
|
|
23
23
|
- **Request deduplication** — concurrent identical queries share a single in-flight request
|
|
24
24
|
- **Batch queries** — fetch up to 50 media/characters/staff in one API call
|
|
25
|
+
- **Paginated media relationships** — `getMediaCharacters()` and `getMediaStaff()` support paged results for large casts and staff listings
|
|
25
26
|
- **Auto-pagination** — async iterator that yields items across pages
|
|
26
27
|
- **AbortSignal support** — cancel globally or per-request with `withSignal()`
|
|
27
28
|
- **Injectable logger** — plug in `console`, pino, winston, or any compatible logger
|
|
@@ -58,6 +59,10 @@ const results = await client.searchMedia({
|
|
|
58
59
|
|
|
59
60
|
// Cross-platform lookup by MyAnimeList ID
|
|
60
61
|
const fma = await client.getMediaByMalId(5114);
|
|
62
|
+
|
|
63
|
+
// Paginated media relationships
|
|
64
|
+
const characters = await client.getMediaCharacters(1, { page: 1, perPage: 25, voiceActors: true });
|
|
65
|
+
const staff = await client.getMediaStaff(1, { page: 1, perPage: 25 });
|
|
61
66
|
```
|
|
62
67
|
|
|
63
68
|
## Features at a glance
|
|
@@ -134,6 +139,8 @@ for await (const anime of client.paginate(
|
|
|
134
139
|
const user = await client.getUser("AniList");
|
|
135
140
|
const favs = await client.getUserFavorites("AniList", { perPage: 50 });
|
|
136
141
|
const char = await client.getCharacter(1, { voiceActors: true });
|
|
142
|
+
const characters = await client.getMediaCharacters(1, { page: 1, perPage: 25, voiceActors: true });
|
|
143
|
+
const staff = await client.getMediaStaff(1, { page: 1, perPage: 25 });
|
|
137
144
|
const studio = await client.getStudio(21, { media: { perPage: 50 } });
|
|
138
145
|
const schedule = await client.getWeeklySchedule();
|
|
139
146
|
```
|
package/dist/index.d.mts
CHANGED
|
@@ -59,7 +59,7 @@ interface CacheOptions {
|
|
|
59
59
|
}
|
|
60
60
|
/** Rate limiter configuration options. */
|
|
61
61
|
interface RateLimitOptions {
|
|
62
|
-
/** Max requests per window (default:
|
|
62
|
+
/** Max requests per window (default: 25) */
|
|
63
63
|
maxRequests?: number;
|
|
64
64
|
/** Window size in ms (default: 60 000) */
|
|
65
65
|
windowMs?: number;
|
|
@@ -603,7 +603,7 @@ declare enum MediaRelationType {
|
|
|
603
603
|
}
|
|
604
604
|
interface MediaEdge {
|
|
605
605
|
relationType: MediaRelationType;
|
|
606
|
-
node: Pick<Media, "id" | "title" | "type" | "format" | "status" | "startDate" | "endDate" | "season" | "seasonYear" | "episodes" | "chapters" | "volumes" | "coverImage" | "genres" | "averageScore" | "studios" | "siteUrl">;
|
|
606
|
+
node: Pick<Media, "id" | "title" | "type" | "format" | "status" | "startDate" | "endDate" | "season" | "seasonYear" | "episodes" | "chapters" | "volumes" | "coverImage" | "genres" | "averageScore" | "studios" | "siteUrl" | "nextAiringEpisode">;
|
|
607
607
|
}
|
|
608
608
|
interface MediaConnection {
|
|
609
609
|
edges: MediaEdge[];
|
|
@@ -852,6 +852,24 @@ interface MediaIncludeOptions {
|
|
|
852
852
|
perPage?: number;
|
|
853
853
|
};
|
|
854
854
|
}
|
|
855
|
+
interface GetMediaCharactersOptions {
|
|
856
|
+
/** Page number */
|
|
857
|
+
page?: number;
|
|
858
|
+
/** Results per page (max 50) */
|
|
859
|
+
perPage?: number;
|
|
860
|
+
/** Disable default sort order */
|
|
861
|
+
sort?: boolean;
|
|
862
|
+
/** Include voice actors for each character edge */
|
|
863
|
+
voiceActors?: boolean;
|
|
864
|
+
}
|
|
865
|
+
interface GetMediaStaffOptions {
|
|
866
|
+
/** Page number */
|
|
867
|
+
page?: number;
|
|
868
|
+
/** Results per page (max 50) */
|
|
869
|
+
perPage?: number;
|
|
870
|
+
/** Disable default sort order */
|
|
871
|
+
sort?: boolean;
|
|
872
|
+
}
|
|
855
873
|
interface AiringSchedule {
|
|
856
874
|
id: number;
|
|
857
875
|
airingAt: number;
|
|
@@ -1198,6 +1216,8 @@ declare class AniListClient {
|
|
|
1198
1216
|
* @param include - Optional related data to include
|
|
1199
1217
|
*/
|
|
1200
1218
|
getMedia(id: number, include?: MediaIncludeOptions): Promise<Media>;
|
|
1219
|
+
getMediaCharacters(mediaId: number, options?: GetMediaCharactersOptions): Promise<PagedResult<MediaCharacterEdge>>;
|
|
1220
|
+
getMediaStaff(mediaId: number, options?: GetMediaStaffOptions): Promise<PagedResult<MediaStaffEdge>>;
|
|
1201
1221
|
/**
|
|
1202
1222
|
* Search for anime or manga.
|
|
1203
1223
|
*
|
|
@@ -1220,7 +1240,7 @@ declare class AniListClient {
|
|
|
1220
1240
|
*/
|
|
1221
1241
|
getRecentlyUpdatedManga(options?: GetRecentChaptersOptions): Promise<PagedResult<Media>>;
|
|
1222
1242
|
/**
|
|
1223
|
-
* @deprecated Use `getRecentlyUpdatedManga` instead. This alias will be removed in
|
|
1243
|
+
* @deprecated Use `getRecentlyUpdatedManga()` instead. This alias will be removed in v3.
|
|
1224
1244
|
*/
|
|
1225
1245
|
getAiredChapters(options?: GetRecentChaptersOptions): Promise<PagedResult<Media>>;
|
|
1226
1246
|
/**
|
|
@@ -1392,4 +1412,4 @@ declare class RateLimiter {
|
|
|
1392
1412
|
|
|
1393
1413
|
declare function parseAniListMarkdown(text: string): string;
|
|
1394
1414
|
|
|
1395
|
-
export { type AiringSchedule, AiringSort, AniListClient, type AniListClientOptions, AniListError, type AniListHooks, type CacheAdapter, type CacheOptions, type CacheStats, type Character, type CharacterImage, type CharacterIncludeOptions, type CharacterMediaEdge, type CharacterName, CharacterRole, CharacterSort, type DayOfWeek, type ExternalLink, type FavoriteCharacterNode, type FavoriteMediaNode, type FavoriteStaffNode, type FavoriteStudioNode, type FuzzyDate, type GetAiringOptions, type GetPlanningOptions, type GetRecentChaptersOptions, type GetRecommendationsOptions, type GetSeasonOptions, type GetUserMediaListOptions, type Logger, type Media, type MediaCharacterConnection, type MediaCharacterEdge, type MediaConnection, type MediaCoverImage, type MediaEdge, MediaFormat, type MediaIncludeOptions, type MediaListEntry, MediaListSort, MediaListStatus, type MediaRecommendationNode, MediaRelationType, MediaSeason, MediaSort, MediaSource, type MediaStaffConnection, type MediaStaffEdge, type MediaStats, MediaStatus, type MediaTag, type MediaTitle, type MediaTrailer, MediaType, MemoryCache, type NextAiringEpisode, type PageInfo, type PagedResult, type RateLimitInfo, type RateLimitOptions, RateLimiter, type Recommendation, RecommendationSort, RedisCache, type RedisCacheOptions, type RedisLikeClient, type ResponseMeta, type ScoreDistribution, type SearchCharacterOptions, type SearchMediaOptions, type SearchStaffOptions, type SearchStudioOptions, type SearchThreadOptions, type SearchUserOptions, type Staff, type StaffImage, type StaffIncludeOptions, type StaffMediaNode, type StaffName, StaffSort, type StatusDistribution, type StreamingEpisode, type Studio, type StudioConnection, type StudioIncludeOptions, StudioSort, type Thread, type ThreadCategory, type ThreadMediaCategory, ThreadSort, type User, type UserAvatar, type UserFavorites, type UserFavoritesOptions, UserSort, type UserStatistics, type VoiceActor, type WeeklySchedule, parseAniListMarkdown };
|
|
1415
|
+
export { type AiringSchedule, AiringSort, AniListClient, type AniListClientOptions, AniListError, type AniListHooks, type CacheAdapter, type CacheOptions, type CacheStats, type Character, type CharacterImage, type CharacterIncludeOptions, type CharacterMediaEdge, type CharacterName, CharacterRole, CharacterSort, type DayOfWeek, type ExternalLink, type FavoriteCharacterNode, type FavoriteMediaNode, type FavoriteStaffNode, type FavoriteStudioNode, type FuzzyDate, type GetAiringOptions, type GetMediaCharactersOptions, type GetMediaStaffOptions, type GetPlanningOptions, type GetRecentChaptersOptions, type GetRecommendationsOptions, type GetSeasonOptions, type GetUserMediaListOptions, type Logger, type Media, type MediaCharacterConnection, type MediaCharacterEdge, type MediaConnection, type MediaCoverImage, type MediaEdge, MediaFormat, type MediaIncludeOptions, type MediaListEntry, MediaListSort, MediaListStatus, type MediaRecommendationNode, MediaRelationType, MediaSeason, MediaSort, MediaSource, type MediaStaffConnection, type MediaStaffEdge, type MediaStats, MediaStatus, type MediaTag, type MediaTitle, type MediaTrailer, MediaType, MemoryCache, type NextAiringEpisode, type PageInfo, type PagedResult, type RateLimitInfo, type RateLimitOptions, RateLimiter, type Recommendation, RecommendationSort, RedisCache, type RedisCacheOptions, type RedisLikeClient, type ResponseMeta, type ScoreDistribution, type SearchCharacterOptions, type SearchMediaOptions, type SearchStaffOptions, type SearchStudioOptions, type SearchThreadOptions, type SearchUserOptions, type Staff, type StaffImage, type StaffIncludeOptions, type StaffMediaNode, type StaffName, StaffSort, type StatusDistribution, type StreamingEpisode, type Studio, type StudioConnection, type StudioIncludeOptions, StudioSort, type Thread, type ThreadCategory, type ThreadMediaCategory, ThreadSort, type User, type UserAvatar, type UserFavorites, type UserFavoritesOptions, UserSort, type UserStatistics, type VoiceActor, type WeeklySchedule, parseAniListMarkdown };
|
package/dist/index.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ interface CacheOptions {
|
|
|
59
59
|
}
|
|
60
60
|
/** Rate limiter configuration options. */
|
|
61
61
|
interface RateLimitOptions {
|
|
62
|
-
/** Max requests per window (default:
|
|
62
|
+
/** Max requests per window (default: 25) */
|
|
63
63
|
maxRequests?: number;
|
|
64
64
|
/** Window size in ms (default: 60 000) */
|
|
65
65
|
windowMs?: number;
|
|
@@ -603,7 +603,7 @@ declare enum MediaRelationType {
|
|
|
603
603
|
}
|
|
604
604
|
interface MediaEdge {
|
|
605
605
|
relationType: MediaRelationType;
|
|
606
|
-
node: Pick<Media, "id" | "title" | "type" | "format" | "status" | "startDate" | "endDate" | "season" | "seasonYear" | "episodes" | "chapters" | "volumes" | "coverImage" | "genres" | "averageScore" | "studios" | "siteUrl">;
|
|
606
|
+
node: Pick<Media, "id" | "title" | "type" | "format" | "status" | "startDate" | "endDate" | "season" | "seasonYear" | "episodes" | "chapters" | "volumes" | "coverImage" | "genres" | "averageScore" | "studios" | "siteUrl" | "nextAiringEpisode">;
|
|
607
607
|
}
|
|
608
608
|
interface MediaConnection {
|
|
609
609
|
edges: MediaEdge[];
|
|
@@ -852,6 +852,24 @@ interface MediaIncludeOptions {
|
|
|
852
852
|
perPage?: number;
|
|
853
853
|
};
|
|
854
854
|
}
|
|
855
|
+
interface GetMediaCharactersOptions {
|
|
856
|
+
/** Page number */
|
|
857
|
+
page?: number;
|
|
858
|
+
/** Results per page (max 50) */
|
|
859
|
+
perPage?: number;
|
|
860
|
+
/** Disable default sort order */
|
|
861
|
+
sort?: boolean;
|
|
862
|
+
/** Include voice actors for each character edge */
|
|
863
|
+
voiceActors?: boolean;
|
|
864
|
+
}
|
|
865
|
+
interface GetMediaStaffOptions {
|
|
866
|
+
/** Page number */
|
|
867
|
+
page?: number;
|
|
868
|
+
/** Results per page (max 50) */
|
|
869
|
+
perPage?: number;
|
|
870
|
+
/** Disable default sort order */
|
|
871
|
+
sort?: boolean;
|
|
872
|
+
}
|
|
855
873
|
interface AiringSchedule {
|
|
856
874
|
id: number;
|
|
857
875
|
airingAt: number;
|
|
@@ -1198,6 +1216,8 @@ declare class AniListClient {
|
|
|
1198
1216
|
* @param include - Optional related data to include
|
|
1199
1217
|
*/
|
|
1200
1218
|
getMedia(id: number, include?: MediaIncludeOptions): Promise<Media>;
|
|
1219
|
+
getMediaCharacters(mediaId: number, options?: GetMediaCharactersOptions): Promise<PagedResult<MediaCharacterEdge>>;
|
|
1220
|
+
getMediaStaff(mediaId: number, options?: GetMediaStaffOptions): Promise<PagedResult<MediaStaffEdge>>;
|
|
1201
1221
|
/**
|
|
1202
1222
|
* Search for anime or manga.
|
|
1203
1223
|
*
|
|
@@ -1220,7 +1240,7 @@ declare class AniListClient {
|
|
|
1220
1240
|
*/
|
|
1221
1241
|
getRecentlyUpdatedManga(options?: GetRecentChaptersOptions): Promise<PagedResult<Media>>;
|
|
1222
1242
|
/**
|
|
1223
|
-
* @deprecated Use `getRecentlyUpdatedManga` instead. This alias will be removed in
|
|
1243
|
+
* @deprecated Use `getRecentlyUpdatedManga()` instead. This alias will be removed in v3.
|
|
1224
1244
|
*/
|
|
1225
1245
|
getAiredChapters(options?: GetRecentChaptersOptions): Promise<PagedResult<Media>>;
|
|
1226
1246
|
/**
|
|
@@ -1392,4 +1412,4 @@ declare class RateLimiter {
|
|
|
1392
1412
|
|
|
1393
1413
|
declare function parseAniListMarkdown(text: string): string;
|
|
1394
1414
|
|
|
1395
|
-
export { type AiringSchedule, AiringSort, AniListClient, type AniListClientOptions, AniListError, type AniListHooks, type CacheAdapter, type CacheOptions, type CacheStats, type Character, type CharacterImage, type CharacterIncludeOptions, type CharacterMediaEdge, type CharacterName, CharacterRole, CharacterSort, type DayOfWeek, type ExternalLink, type FavoriteCharacterNode, type FavoriteMediaNode, type FavoriteStaffNode, type FavoriteStudioNode, type FuzzyDate, type GetAiringOptions, type GetPlanningOptions, type GetRecentChaptersOptions, type GetRecommendationsOptions, type GetSeasonOptions, type GetUserMediaListOptions, type Logger, type Media, type MediaCharacterConnection, type MediaCharacterEdge, type MediaConnection, type MediaCoverImage, type MediaEdge, MediaFormat, type MediaIncludeOptions, type MediaListEntry, MediaListSort, MediaListStatus, type MediaRecommendationNode, MediaRelationType, MediaSeason, MediaSort, MediaSource, type MediaStaffConnection, type MediaStaffEdge, type MediaStats, MediaStatus, type MediaTag, type MediaTitle, type MediaTrailer, MediaType, MemoryCache, type NextAiringEpisode, type PageInfo, type PagedResult, type RateLimitInfo, type RateLimitOptions, RateLimiter, type Recommendation, RecommendationSort, RedisCache, type RedisCacheOptions, type RedisLikeClient, type ResponseMeta, type ScoreDistribution, type SearchCharacterOptions, type SearchMediaOptions, type SearchStaffOptions, type SearchStudioOptions, type SearchThreadOptions, type SearchUserOptions, type Staff, type StaffImage, type StaffIncludeOptions, type StaffMediaNode, type StaffName, StaffSort, type StatusDistribution, type StreamingEpisode, type Studio, type StudioConnection, type StudioIncludeOptions, StudioSort, type Thread, type ThreadCategory, type ThreadMediaCategory, ThreadSort, type User, type UserAvatar, type UserFavorites, type UserFavoritesOptions, UserSort, type UserStatistics, type VoiceActor, type WeeklySchedule, parseAniListMarkdown };
|
|
1415
|
+
export { type AiringSchedule, AiringSort, AniListClient, type AniListClientOptions, AniListError, type AniListHooks, type CacheAdapter, type CacheOptions, type CacheStats, type Character, type CharacterImage, type CharacterIncludeOptions, type CharacterMediaEdge, type CharacterName, CharacterRole, CharacterSort, type DayOfWeek, type ExternalLink, type FavoriteCharacterNode, type FavoriteMediaNode, type FavoriteStaffNode, type FavoriteStudioNode, type FuzzyDate, type GetAiringOptions, type GetMediaCharactersOptions, type GetMediaStaffOptions, type GetPlanningOptions, type GetRecentChaptersOptions, type GetRecommendationsOptions, type GetSeasonOptions, type GetUserMediaListOptions, type Logger, type Media, type MediaCharacterConnection, type MediaCharacterEdge, type MediaConnection, type MediaCoverImage, type MediaEdge, MediaFormat, type MediaIncludeOptions, type MediaListEntry, MediaListSort, MediaListStatus, type MediaRecommendationNode, MediaRelationType, MediaSeason, MediaSort, MediaSource, type MediaStaffConnection, type MediaStaffEdge, type MediaStats, MediaStatus, type MediaTag, type MediaTitle, type MediaTrailer, MediaType, MemoryCache, type NextAiringEpisode, type PageInfo, type PagedResult, type RateLimitInfo, type RateLimitOptions, RateLimiter, type Recommendation, RecommendationSort, RedisCache, type RedisCacheOptions, type RedisLikeClient, type ResponseMeta, type ScoreDistribution, type SearchCharacterOptions, type SearchMediaOptions, type SearchStaffOptions, type SearchStudioOptions, type SearchThreadOptions, type SearchUserOptions, type Staff, type StaffImage, type StaffIncludeOptions, type StaffMediaNode, type StaffName, StaffSort, type StatusDistribution, type StreamingEpisode, type Studio, type StudioConnection, type StudioIncludeOptions, StudioSort, type Thread, type ThreadCategory, type ThreadMediaCategory, ThreadSort, type User, type UserAvatar, type UserFavorites, type UserFavoritesOptions, UserSort, type UserStatistics, type VoiceActor, type WeeklySchedule, parseAniListMarkdown };
|
package/dist/index.js
CHANGED
|
@@ -448,6 +448,13 @@ var RELATIONS_FIELDS = `
|
|
|
448
448
|
averageScore
|
|
449
449
|
studios { nodes { id name isAnimationStudio siteUrl } }
|
|
450
450
|
siteUrl
|
|
451
|
+
nextAiringEpisode {
|
|
452
|
+
id
|
|
453
|
+
airingAt
|
|
454
|
+
episode
|
|
455
|
+
mediaId
|
|
456
|
+
timeUntilAiring
|
|
457
|
+
}
|
|
451
458
|
}
|
|
452
459
|
}
|
|
453
460
|
}
|
|
@@ -967,6 +974,44 @@ query ($id: Int!) {
|
|
|
967
974
|
}
|
|
968
975
|
}`;
|
|
969
976
|
}
|
|
977
|
+
function buildMediaCharactersQuery(options = {}) {
|
|
978
|
+
const sortClause = options.sort === false ? "" : ", sort: [ROLE, RELEVANCE, ID]";
|
|
979
|
+
const voiceActorBlock = options.voiceActors ? `
|
|
980
|
+
voiceActors {
|
|
981
|
+
${VOICE_ACTOR_FIELDS_COMPACT}
|
|
982
|
+
}` : "";
|
|
983
|
+
return `
|
|
984
|
+
query ($mediaId: Int!, $page: Int, $perPage: Int) {
|
|
985
|
+
Media(id: $mediaId) {
|
|
986
|
+
characters(page: $page, perPage: $perPage${sortClause}) {
|
|
987
|
+
pageInfo { total perPage currentPage lastPage hasNextPage }
|
|
988
|
+
edges {
|
|
989
|
+
role
|
|
990
|
+
node {
|
|
991
|
+
${CHARACTER_FIELDS_COMPACT}
|
|
992
|
+
}${voiceActorBlock}
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}`;
|
|
997
|
+
}
|
|
998
|
+
function buildMediaStaffQuery(options = {}) {
|
|
999
|
+
const sortClause = options.sort === false ? "" : ", sort: [RELEVANCE, ID]";
|
|
1000
|
+
return `
|
|
1001
|
+
query ($mediaId: Int!, $page: Int, $perPage: Int) {
|
|
1002
|
+
Media(id: $mediaId) {
|
|
1003
|
+
staff(page: $page, perPage: $perPage${sortClause}) {
|
|
1004
|
+
pageInfo { total perPage currentPage lastPage hasNextPage }
|
|
1005
|
+
edges {
|
|
1006
|
+
role
|
|
1007
|
+
node {
|
|
1008
|
+
${STAFF_FIELDS}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
}`;
|
|
1014
|
+
}
|
|
970
1015
|
function buildBatchQuery(ids, typeName, fields, prefix) {
|
|
971
1016
|
const aliases = ids.map((id, i) => `${prefix}${i}: ${typeName}(id: ${id}) { ${fields} }`).join("\n ");
|
|
972
1017
|
return `query {
|
|
@@ -1619,6 +1664,25 @@ async function getMedia(client, id, include) {
|
|
|
1619
1664
|
const data = await client.request(query, { id });
|
|
1620
1665
|
return data.Media;
|
|
1621
1666
|
}
|
|
1667
|
+
async function getMediaCharacters(client, mediaId, options = {}) {
|
|
1668
|
+
validateId(mediaId, "mediaId");
|
|
1669
|
+
const query = buildMediaCharactersQuery(options);
|
|
1670
|
+
const data = await client.request(
|
|
1671
|
+
query,
|
|
1672
|
+
{ mediaId, page: options.page ?? 1, perPage: clampPerPage(options.perPage ?? 25) }
|
|
1673
|
+
);
|
|
1674
|
+
return { pageInfo: data.Media.characters.pageInfo, results: data.Media.characters.edges };
|
|
1675
|
+
}
|
|
1676
|
+
async function getMediaStaff(client, mediaId, options = {}) {
|
|
1677
|
+
validateId(mediaId, "mediaId");
|
|
1678
|
+
const query = buildMediaStaffQuery(options);
|
|
1679
|
+
const data = await client.request(query, {
|
|
1680
|
+
mediaId,
|
|
1681
|
+
page: options.page ?? 1,
|
|
1682
|
+
perPage: clampPerPage(options.perPage ?? 25)
|
|
1683
|
+
});
|
|
1684
|
+
return { pageInfo: data.Media.staff.pageInfo, results: data.Media.staff.edges };
|
|
1685
|
+
}
|
|
1622
1686
|
async function getMediaByMalId(client, malId, type) {
|
|
1623
1687
|
validateId(malId, "malId");
|
|
1624
1688
|
const data = await client.request(QUERY_MEDIA_BY_MAL_ID, {
|
|
@@ -1903,7 +1967,7 @@ function mapFavorites(fav) {
|
|
|
1903
1967
|
|
|
1904
1968
|
// src/client/index.ts
|
|
1905
1969
|
var DEFAULT_API_URL = "https://graphql.anilist.co";
|
|
1906
|
-
var LIB_VERSION = "2.0.
|
|
1970
|
+
var LIB_VERSION = "2.0.3" ;
|
|
1907
1971
|
var AniListClient = class {
|
|
1908
1972
|
apiUrl;
|
|
1909
1973
|
headers;
|
|
@@ -2046,6 +2110,12 @@ var AniListClient = class {
|
|
|
2046
2110
|
async getMedia(id, include) {
|
|
2047
2111
|
return getMedia(this, id, include);
|
|
2048
2112
|
}
|
|
2113
|
+
async getMediaCharacters(mediaId, options = {}) {
|
|
2114
|
+
return getMediaCharacters(this, mediaId, options);
|
|
2115
|
+
}
|
|
2116
|
+
async getMediaStaff(mediaId, options = {}) {
|
|
2117
|
+
return getMediaStaff(this, mediaId, options);
|
|
2118
|
+
}
|
|
2049
2119
|
/**
|
|
2050
2120
|
* Search for anime or manga.
|
|
2051
2121
|
*
|
|
@@ -2080,7 +2150,7 @@ var AniListClient = class {
|
|
|
2080
2150
|
return getRecentlyUpdatedManga(this, options);
|
|
2081
2151
|
}
|
|
2082
2152
|
/**
|
|
2083
|
-
* @deprecated Use `getRecentlyUpdatedManga` instead. This alias will be removed in
|
|
2153
|
+
* @deprecated Use `getRecentlyUpdatedManga()` instead. This alias will be removed in v3.
|
|
2084
2154
|
*/
|
|
2085
2155
|
async getAiredChapters(options = {}) {
|
|
2086
2156
|
return this.getRecentlyUpdatedManga(options);
|