1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
//! # AniList.moe
//!
//! A comprehensive, type-safe Rust wrapper for the AniList GraphQL API that provides
//! complete coverage of AniList's features including anime, manga, characters, staff, users,
//! social features, forums, activities, reviews, recommendations, and more.
//!
//! This crate provides a fully typed, async interface to interact with the AniList API,
//! supporting both authenticated and unauthenticated requests with comprehensive error
//! management and proper type safety throughout.
//!
//! ## Features
//!
//! - **Type Safety**: Fully typed responses - no more `serde_json::Value`
//! - **Complete API Coverage**: All major AniList endpoints including social features
//! - **Async/Await Support**: Built with tokio for high-performance async operations
//! - **Modular Design**: Separate endpoint modules for clean code organization
//! - **Authentication**: Full support for authenticated requests with Bearer tokens
//! - **Error Handling**: Comprehensive error types with detailed error messages
//! - **GraphQL Integration**: Direct GraphQL query execution with proper field mapping
//! - **Pagination**: Built-in support for paginated results across all endpoints
//! - **Convenience Functions**: 80+ helper functions for common queries
//!
//! ## Supported Endpoints
//!
//! ### Core Content
//! - **Anime**: Search, trending, popular, seasonal, airing schedules
//! - **Manga**: Search, trending, popular, releasing status
//! - **Characters**: Search, popular, detailed character information
//! - **Staff**: Search, popular, detailed staff information
//! - **Studios**: Search, studio information and productions
//!
//! ### Social & Community
//! - **Users**: Profiles, statistics, favorites, media lists, following
//! - **Forums**: Threads, comments, categories, moderation
//! - **Activities**: Text posts, message activities, list updates, replies
//! - **Reviews**: Create, read, update, delete user reviews with ratings
//! - **Recommendations**: Browse and manage anime/manga recommendations
//! - **Notifications**: Read, filter, and manage user notifications
//!
//! ### Scheduling & Discovery
//! - **Airing Schedules**: Upcoming episodes, recently aired, date-based filtering
//! - **Media Lists**: User anime/manga lists with status tracking
//!
//! ## Authentication
//!
//! Many endpoints require authentication. Get your access token from the
//! [AniList Developer Settings](https://anilist.co/settings/developer).
//!
//! ```bash
//! export ANILIST_TOKEN="your_access_token_here"
//! ```
//!
//! ## Rate Limiting
//!
//! AniList enforces a rate limit of 90 requests per minute. Be respectful of the API
//! and implement appropriate delays between requests in production applications.
//!
//! ## Examples
//!
//! ### Get Trending Anime
//!
//! ```rust,no_run
//! use anilist_moe::client::AniListClient;
//! use anilist_moe::AniListError;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), AniListError> {
//! let client = AniListClient::new();
//!
//! // Get trending anime with full type safety
//! let response = client.media().get_trending_anime(Some(1), Some(10)).await?;
//!
//! // Access typed data (Page<Vec<Media>>)
//! for anime in &response.data {
//! if let Some(title) = &anime.title {
//! if let Some(romaji) = &title.romaji {
//! println!("Anime: {}", romaji);
//! }
//! }
//! }
//!
//! Ok(())
//! }
//! ```
//!
//! ### Search and Get Details
//!
//! ```rust,no_run
//! use anilist_moe::client::AniListClient;
//! use anilist_moe::AniListError;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), AniListError> {
//! let client = AniListClient::new();
//!
//! // Search for anime
//! let search = client.media().search_anime("Steins Gate", Some(1), Some(5)).await?;
//!
//! if let Some(first) = search.data.first() {
//! // Get detailed information
//! let details = client.media().get_anime_by_id(first.id.unwrap()).await?;
//! let anime = &details;
//!
//! println!("Score: {}/100", anime.average_score.unwrap_or(0));
//! println!("Episodes: {}", anime.episodes.unwrap_or(0));
//! }
//!
//! Ok(())
//! }
//! ```
//!
//! ### Authenticated Usage
//!
//! ```rust,no_run
//! use anilist_moe::client::AniListClient;
//! use anilist_moe::AniListError;
//! use std::env;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), AniListError> {
//! let token = env::var("ANILIST_TOKEN").expect("ANILIST_TOKEN must be set");
//! let client = AniListClient::with_token(token);
//!
//! // Get current user
//! let user = client.user().get_current_user().await?;
//! println!("Logged in as: {}", user.name.unwrap_or_default());
//!
//! Ok(())
//! }
//! ```
//!
//! ### Error Handling
//!
//! ```rust,no_run
//! use anilist_moe::client::AniListClient;
//! use anilist_moe::errors::AniListError;
//!
//! #[tokio::main]
//! async fn main() {
//! let client = AniListClient::new();
//!
//! match client.media().get_anime_by_id(999999).await {
//! Ok(anime) => println!("Found: {:?}", anime),
//! Err(AniListError::Network(e)) => eprintln!("Network error: {}", e),
//! Err(AniListError::GraphQL { message, .. }) => eprintln!("API error: {}", message),
//! Err(AniListError::NotFound) => eprintln!("Not found"),
//! Err(AniListError::RateLimit { .. }) => eprintln!("Rate limited"),
//! Err(AniListError::RateLimitSimple) => eprintln!("Rate limited"),
//! Err(AniListError::BurstLimit) => eprintln!("Too many requests"),
//! Err(e) => eprintln!("Error: {:?}", e),
//! }
//! }
//! ```
pub use ;
pub use AniListError;