ani-client 2.0.3 → 2.1.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/dist/index.d.mts CHANGED
@@ -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" | "nextAiringEpisode">;
606
+ node: Pick<Media, "id" | "title" | "type" | "format" | "status" | "startDate" | "endDate" | "season" | "seasonYear" | "episodes" | "chapters" | "volumes" | "coverImage" | "genres" | "averageScore" | "meanScore" | "studios" | "siteUrl" | "nextAiringEpisode">;
607
607
  }
608
608
  interface MediaConnection {
609
609
  edges: MediaEdge[];
@@ -644,7 +644,7 @@ interface MediaStats {
644
644
  interface MediaRecommendationNode {
645
645
  id: number;
646
646
  rating: number | null;
647
- mediaRecommendation: Pick<Media, "id" | "title" | "type" | "format" | "coverImage" | "averageScore" | "siteUrl">;
647
+ mediaRecommendation: Pick<Media, "id" | "title" | "type" | "format" | "coverImage" | "averageScore" | "meanScore" | "episodes" | "chapters" | "volumes" | "nextAiringEpisode" | "season" | "seasonYear" | "startDate" | "endDate" | "studios" | "genres" | "siteUrl">;
648
648
  }
649
649
  interface NextAiringEpisode {
650
650
  id: number;
@@ -727,6 +727,8 @@ interface SearchMediaOptions {
727
727
  tagsExclude?: string[];
728
728
  /** Include or Exclude explicit content (default: false) */
729
729
  isAdult?: boolean;
730
+ /** Exclude certain media entries by ID */
731
+ idNotIn?: number[];
730
732
  /** Sort order */
731
733
  sort?: MediaSort[];
732
734
  /** Page number */
@@ -739,6 +741,8 @@ interface GeneralMediaQueryOptions {
739
741
  type?: MediaType;
740
742
  /** Include or Exclude explicit content (default: false) */
741
743
  isAdult?: boolean;
744
+ /** Exclude certain media entries by ID */
745
+ idNotIn?: number[];
742
746
  /** Page number */
743
747
  page?: number;
744
748
  /** Results per page (max 50) */
@@ -749,8 +753,8 @@ interface GetAiringOptions {
749
753
  airingAtGreater?: number;
750
754
  /** Only show episodes that aired before this UNIX timestamp */
751
755
  airingAtLesser?: number;
752
- /** Include or Exclude explicit content (default: false) */
753
- isAdult?: boolean;
756
+ /** Exclude certain media entries by ID */
757
+ idNotIn?: number[];
754
758
  /** Sort order (default: TIME_DESC) */
755
759
  sort?: AiringSort[];
756
760
  /** Page number */
@@ -761,6 +765,8 @@ interface GetAiringOptions {
761
765
  interface GetRecentChaptersOptions {
762
766
  /** Include or Exclude explicit content (default: false) */
763
767
  isAdult?: boolean;
768
+ /** Exclude certain media entries by ID */
769
+ idNotIn?: number[];
764
770
  /** Page number (default: 1) */
765
771
  page?: number;
766
772
  /** Results per page (default: 20, max 50) */
@@ -771,6 +777,8 @@ interface GetPlanningOptions {
771
777
  type?: MediaType;
772
778
  /** Include or Exclude explicit content (default: false) */
773
779
  isAdult?: boolean;
780
+ /** Exclude certain media entries by ID */
781
+ idNotIn?: number[];
774
782
  /** Sort order (default: POPULARITY_DESC) */
775
783
  sort?: MediaSort[];
776
784
  /** Page number */
@@ -814,6 +822,8 @@ interface GetSeasonOptions {
814
822
  type?: MediaType;
815
823
  /** Allow or disallow explicit content (defaults to False) */
816
824
  isAdult?: boolean;
825
+ /** Exclude certain media entries by ID */
826
+ idNotIn?: number[];
817
827
  /** Sort order (default: POPULARITY_DESC) */
818
828
  sort?: MediaSort[];
819
829
  /** Page number */
@@ -942,6 +952,44 @@ interface SearchCharacterOptions {
942
952
  voiceActors?: boolean;
943
953
  }
944
954
 
955
+ declare enum ReviewSort {
956
+ ID = "ID",
957
+ ID_DESC = "ID_DESC",
958
+ SCORE = "SCORE",
959
+ SCORE_DESC = "SCORE_DESC",
960
+ RATING = "RATING",
961
+ RATING_DESC = "RATING_DESC",
962
+ CREATED_AT = "CREATED_AT",
963
+ CREATED_AT_DESC = "CREATED_AT_DESC",
964
+ UPDATED_AT = "UPDATED_AT",
965
+ UPDATED_AT_DESC = "UPDATED_AT_DESC"
966
+ }
967
+ interface Review {
968
+ id: number;
969
+ userId: number;
970
+ mediaId: number;
971
+ mediaType: "ANIME" | "MANGA";
972
+ summary: string;
973
+ body: string;
974
+ rating: number;
975
+ ratingAmount: number;
976
+ userRating: "UP_VOTE" | "DOWN_VOTE" | "NO_VOTE";
977
+ score: number;
978
+ private: boolean;
979
+ siteUrl: string;
980
+ createdAt: number;
981
+ updatedAt: number;
982
+ user: User;
983
+ media: Media;
984
+ }
985
+ interface SearchReviewOptions {
986
+ mediaId?: number;
987
+ userId?: number;
988
+ sort?: ReviewSort[];
989
+ page?: number;
990
+ perPage?: number;
991
+ }
992
+
945
993
  /** Represents a forum thread on AniList. */
946
994
  interface Thread {
947
995
  id: number;
@@ -1293,6 +1341,19 @@ declare class AniListClient {
1293
1341
  * ```
1294
1342
  */
1295
1343
  getUserFavorites(idOrName: number | string, options?: UserFavoritesOptions): Promise<UserFavorites>;
1344
+ /**
1345
+ * Fetch a review by its AniList ID.
1346
+ *
1347
+ * @param id - The AniList review ID
1348
+ */
1349
+ getReview(id: number): Promise<Review>;
1350
+ /**
1351
+ * Search for reviews with optional filters.
1352
+ *
1353
+ * @param options - Search and filter options
1354
+ * @returns Paginated results with matching reviews
1355
+ */
1356
+ searchReviews(options?: SearchReviewOptions): Promise<PagedResult<Review>>;
1296
1357
  /**
1297
1358
  * Fetch a studio by its AniList ID.
1298
1359
  * Pass `include` to customise the number of media returned.
@@ -1412,4 +1473,4 @@ declare class RateLimiter {
1412
1473
 
1413
1474
  declare function parseAniListMarkdown(text: string): string;
1414
1475
 
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 };
1476
+ 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 Review, ReviewSort, type ScoreDistribution, type SearchCharacterOptions, type SearchMediaOptions, type SearchReviewOptions, 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
@@ -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" | "nextAiringEpisode">;
606
+ node: Pick<Media, "id" | "title" | "type" | "format" | "status" | "startDate" | "endDate" | "season" | "seasonYear" | "episodes" | "chapters" | "volumes" | "coverImage" | "genres" | "averageScore" | "meanScore" | "studios" | "siteUrl" | "nextAiringEpisode">;
607
607
  }
608
608
  interface MediaConnection {
609
609
  edges: MediaEdge[];
@@ -644,7 +644,7 @@ interface MediaStats {
644
644
  interface MediaRecommendationNode {
645
645
  id: number;
646
646
  rating: number | null;
647
- mediaRecommendation: Pick<Media, "id" | "title" | "type" | "format" | "coverImage" | "averageScore" | "siteUrl">;
647
+ mediaRecommendation: Pick<Media, "id" | "title" | "type" | "format" | "coverImage" | "averageScore" | "meanScore" | "episodes" | "chapters" | "volumes" | "nextAiringEpisode" | "season" | "seasonYear" | "startDate" | "endDate" | "studios" | "genres" | "siteUrl">;
648
648
  }
649
649
  interface NextAiringEpisode {
650
650
  id: number;
@@ -727,6 +727,8 @@ interface SearchMediaOptions {
727
727
  tagsExclude?: string[];
728
728
  /** Include or Exclude explicit content (default: false) */
729
729
  isAdult?: boolean;
730
+ /** Exclude certain media entries by ID */
731
+ idNotIn?: number[];
730
732
  /** Sort order */
731
733
  sort?: MediaSort[];
732
734
  /** Page number */
@@ -739,6 +741,8 @@ interface GeneralMediaQueryOptions {
739
741
  type?: MediaType;
740
742
  /** Include or Exclude explicit content (default: false) */
741
743
  isAdult?: boolean;
744
+ /** Exclude certain media entries by ID */
745
+ idNotIn?: number[];
742
746
  /** Page number */
743
747
  page?: number;
744
748
  /** Results per page (max 50) */
@@ -749,8 +753,8 @@ interface GetAiringOptions {
749
753
  airingAtGreater?: number;
750
754
  /** Only show episodes that aired before this UNIX timestamp */
751
755
  airingAtLesser?: number;
752
- /** Include or Exclude explicit content (default: false) */
753
- isAdult?: boolean;
756
+ /** Exclude certain media entries by ID */
757
+ idNotIn?: number[];
754
758
  /** Sort order (default: TIME_DESC) */
755
759
  sort?: AiringSort[];
756
760
  /** Page number */
@@ -761,6 +765,8 @@ interface GetAiringOptions {
761
765
  interface GetRecentChaptersOptions {
762
766
  /** Include or Exclude explicit content (default: false) */
763
767
  isAdult?: boolean;
768
+ /** Exclude certain media entries by ID */
769
+ idNotIn?: number[];
764
770
  /** Page number (default: 1) */
765
771
  page?: number;
766
772
  /** Results per page (default: 20, max 50) */
@@ -771,6 +777,8 @@ interface GetPlanningOptions {
771
777
  type?: MediaType;
772
778
  /** Include or Exclude explicit content (default: false) */
773
779
  isAdult?: boolean;
780
+ /** Exclude certain media entries by ID */
781
+ idNotIn?: number[];
774
782
  /** Sort order (default: POPULARITY_DESC) */
775
783
  sort?: MediaSort[];
776
784
  /** Page number */
@@ -814,6 +822,8 @@ interface GetSeasonOptions {
814
822
  type?: MediaType;
815
823
  /** Allow or disallow explicit content (defaults to False) */
816
824
  isAdult?: boolean;
825
+ /** Exclude certain media entries by ID */
826
+ idNotIn?: number[];
817
827
  /** Sort order (default: POPULARITY_DESC) */
818
828
  sort?: MediaSort[];
819
829
  /** Page number */
@@ -942,6 +952,44 @@ interface SearchCharacterOptions {
942
952
  voiceActors?: boolean;
943
953
  }
944
954
 
955
+ declare enum ReviewSort {
956
+ ID = "ID",
957
+ ID_DESC = "ID_DESC",
958
+ SCORE = "SCORE",
959
+ SCORE_DESC = "SCORE_DESC",
960
+ RATING = "RATING",
961
+ RATING_DESC = "RATING_DESC",
962
+ CREATED_AT = "CREATED_AT",
963
+ CREATED_AT_DESC = "CREATED_AT_DESC",
964
+ UPDATED_AT = "UPDATED_AT",
965
+ UPDATED_AT_DESC = "UPDATED_AT_DESC"
966
+ }
967
+ interface Review {
968
+ id: number;
969
+ userId: number;
970
+ mediaId: number;
971
+ mediaType: "ANIME" | "MANGA";
972
+ summary: string;
973
+ body: string;
974
+ rating: number;
975
+ ratingAmount: number;
976
+ userRating: "UP_VOTE" | "DOWN_VOTE" | "NO_VOTE";
977
+ score: number;
978
+ private: boolean;
979
+ siteUrl: string;
980
+ createdAt: number;
981
+ updatedAt: number;
982
+ user: User;
983
+ media: Media;
984
+ }
985
+ interface SearchReviewOptions {
986
+ mediaId?: number;
987
+ userId?: number;
988
+ sort?: ReviewSort[];
989
+ page?: number;
990
+ perPage?: number;
991
+ }
992
+
945
993
  /** Represents a forum thread on AniList. */
946
994
  interface Thread {
947
995
  id: number;
@@ -1293,6 +1341,19 @@ declare class AniListClient {
1293
1341
  * ```
1294
1342
  */
1295
1343
  getUserFavorites(idOrName: number | string, options?: UserFavoritesOptions): Promise<UserFavorites>;
1344
+ /**
1345
+ * Fetch a review by its AniList ID.
1346
+ *
1347
+ * @param id - The AniList review ID
1348
+ */
1349
+ getReview(id: number): Promise<Review>;
1350
+ /**
1351
+ * Search for reviews with optional filters.
1352
+ *
1353
+ * @param options - Search and filter options
1354
+ * @returns Paginated results with matching reviews
1355
+ */
1356
+ searchReviews(options?: SearchReviewOptions): Promise<PagedResult<Review>>;
1296
1357
  /**
1297
1358
  * Fetch a studio by its AniList ID.
1298
1359
  * Pass `include` to customise the number of media returned.
@@ -1412,4 +1473,4 @@ declare class RateLimiter {
1412
1473
 
1413
1474
  declare function parseAniListMarkdown(text: string): string;
1414
1475
 
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 };
1476
+ 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 Review, ReviewSort, type ScoreDistribution, type SearchCharacterOptions, type SearchMediaOptions, type SearchReviewOptions, 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 };