anilink-api-wrapper 1.29.2 → 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/LICENSE +21 -21
- package/README.md +71 -241
- package/dist/AniLink.d.ts +12329 -0
- package/dist/AniLink.mjs +7298 -0
- package/dist/anilist.d.ts +1 -0
- package/dist/anilist.mjs +5 -0
- package/dist/mal.d.ts +1 -0
- package/dist/mal.mjs +5 -0
- package/package.json +121 -46
- package/dist/AniLink.js +0 -248
- package/dist/apis/anilist/Custom.js +0 -42
- package/dist/apis/anilist/interfaces/Activity.js +0 -436
- package/dist/apis/anilist/interfaces/Basic.js +0 -33
- package/dist/apis/anilist/interfaces/CoverImage.js +0 -15
- package/dist/apis/anilist/interfaces/Distribution.js +0 -23
- package/dist/apis/anilist/interfaces/ExternalLink.js +0 -14
- package/dist/apis/anilist/interfaces/Favoured.js +0 -2
- package/dist/apis/anilist/interfaces/FuzzyDate.js +0 -12
- package/dist/apis/anilist/interfaces/Image.js +0 -13
- package/dist/apis/anilist/interfaces/ListScores.js +0 -2
- package/dist/apis/anilist/interfaces/Media.js +0 -13
- package/dist/apis/anilist/interfaces/Name.js +0 -15
- package/dist/apis/anilist/interfaces/NextAiringEpisode.js +0 -14
- package/dist/apis/anilist/interfaces/Notification.js +0 -25
- package/dist/apis/anilist/interfaces/Ranking.js +0 -19
- package/dist/apis/anilist/interfaces/SiteTrend.js +0 -33
- package/dist/apis/anilist/interfaces/Staff.js +0 -2
- package/dist/apis/anilist/interfaces/Stat.js +0 -2
- package/dist/apis/anilist/interfaces/Statistics.js +0 -2
- package/dist/apis/anilist/interfaces/StreamingEpisode.js +0 -15
- package/dist/apis/anilist/interfaces/Studio.js +0 -2
- package/dist/apis/anilist/interfaces/Tag.js +0 -18
- package/dist/apis/anilist/interfaces/Title.js +0 -15
- package/dist/apis/anilist/interfaces/Trailer.js +0 -14
- package/dist/apis/anilist/interfaces/UserStats.js +0 -23
- package/dist/apis/anilist/interfaces/responses/mutation/Favourites.js +0 -83
- package/dist/apis/anilist/interfaces/responses/query/AiringSchedule.js +0 -18
- package/dist/apis/anilist/interfaces/responses/query/AniChartUser.js +0 -2
- package/dist/apis/anilist/interfaces/responses/query/Character.js +0 -34
- package/dist/apis/anilist/interfaces/responses/query/ExternalLinkSourceCollection.js +0 -2
- package/dist/apis/anilist/interfaces/responses/query/Media.js +0 -217
- package/dist/apis/anilist/interfaces/responses/query/MediaList.js +0 -36
- package/dist/apis/anilist/interfaces/responses/query/MediaListCollectionResponse.js +0 -49
- package/dist/apis/anilist/interfaces/responses/query/MediaTagCollection.js +0 -2
- package/dist/apis/anilist/interfaces/responses/query/MediaTrend.js +0 -21
- package/dist/apis/anilist/interfaces/responses/query/Notification.js +0 -166
- package/dist/apis/anilist/interfaces/responses/query/Recommendation.js +0 -23
- package/dist/apis/anilist/interfaces/responses/query/Review.js +0 -30
- package/dist/apis/anilist/interfaces/responses/query/SiteStatistics.js +0 -31
- package/dist/apis/anilist/interfaces/responses/query/Staff.js +0 -59
- package/dist/apis/anilist/interfaces/responses/query/Studio.js +0 -60
- package/dist/apis/anilist/interfaces/responses/query/Thread.js +0 -44
- package/dist/apis/anilist/interfaces/responses/query/ThreadComment.js +0 -31
- package/dist/apis/anilist/interfaces/responses/query/User.js +0 -366
- package/dist/apis/anilist/mutation/DeleteActivity.js +0 -61
- package/dist/apis/anilist/mutation/DeleteActivityReply.js +0 -61
- package/dist/apis/anilist/mutation/DeleteCustomList.js +0 -63
- package/dist/apis/anilist/mutation/DeleteMediaListEntry.js +0 -61
- package/dist/apis/anilist/mutation/DeleteReview.js +0 -61
- package/dist/apis/anilist/mutation/DeleteThread.js +0 -61
- package/dist/apis/anilist/mutation/DeleteThreadComment.js +0 -61
- package/dist/apis/anilist/mutation/SaveActivityReply.js +0 -66
- package/dist/apis/anilist/mutation/SaveListActivity.js +0 -64
- package/dist/apis/anilist/mutation/SaveMediaListEntry.js +0 -97
- package/dist/apis/anilist/mutation/SaveMessageActivity.js +0 -68
- package/dist/apis/anilist/mutation/SaveRecommendation.js +0 -66
- package/dist/apis/anilist/mutation/SaveReview.js +0 -68
- package/dist/apis/anilist/mutation/SaveTextActivity.js +0 -65
- package/dist/apis/anilist/mutation/SaveThread.js +0 -69
- package/dist/apis/anilist/mutation/SaveThreadComment.js +0 -67
- package/dist/apis/anilist/mutation/ToggleActivityPin.js +0 -64
- package/dist/apis/anilist/mutation/ToggleActivitySubscription.js +0 -64
- package/dist/apis/anilist/mutation/ToggleFavourite.js +0 -66
- package/dist/apis/anilist/mutation/ToggleFollow.js +0 -62
- package/dist/apis/anilist/mutation/ToggleLike.js +0 -64
- package/dist/apis/anilist/mutation/ToggleLikeV2.js +0 -64
- package/dist/apis/anilist/mutation/ToggleThreadSubscription.js +0 -64
- package/dist/apis/anilist/mutation/UpdateAniChartHighlights.js +0 -58
- package/dist/apis/anilist/mutation/UpdateAniChartSettings.js +0 -58
- package/dist/apis/anilist/mutation/UpdateFavouriteOrder.js +0 -73
- package/dist/apis/anilist/mutation/UpdateMediaListEntries.js +0 -93
- package/dist/apis/anilist/mutation/UpdateUser.js +0 -127
- package/dist/apis/anilist/query/Activity.js +0 -86
- package/dist/apis/anilist/query/ActivityReply.js +0 -60
- package/dist/apis/anilist/query/AiringSchedule.js +0 -78
- package/dist/apis/anilist/query/AniChartUser.js +0 -56
- package/dist/apis/anilist/query/Character.js +0 -70
- package/dist/apis/anilist/query/ExternalLinkSourceCollection.js +0 -68
- package/dist/apis/anilist/query/Follower.js +0 -64
- package/dist/apis/anilist/query/Following.js +0 -64
- package/dist/apis/anilist/query/GenreCollection.js +0 -46
- package/dist/apis/anilist/query/Markdown.js +0 -57
- package/dist/apis/anilist/query/Media.js +0 -134
- package/dist/apis/anilist/query/MediaList.js +0 -90
- package/dist/apis/anilist/query/MediaListCollection.js +0 -76
- package/dist/apis/anilist/query/MediaTagCollection.js +0 -57
- package/dist/apis/anilist/query/MediaTrend.js +0 -84
- package/dist/apis/anilist/query/Notification.js +0 -65
- package/dist/apis/anilist/query/Recommendation.js +0 -68
- package/dist/apis/anilist/query/Review.js +0 -64
- package/dist/apis/anilist/query/SiteStatistics.js +0 -78
- package/dist/apis/anilist/query/Staff.js +0 -79
- package/dist/apis/anilist/query/Studio.js +0 -82
- package/dist/apis/anilist/query/Thread.js +0 -68
- package/dist/apis/anilist/query/ThreadComment.js +0 -63
- package/dist/apis/anilist/query/User.js +0 -68
- package/dist/apis/anilist/query/Viewer.js +0 -65
- package/dist/apis/anilist/query/page/Activities.js +0 -97
- package/dist/apis/anilist/query/page/ActivityReplies.js +0 -71
- package/dist/apis/anilist/query/page/AiringSchedules.js +0 -89
- package/dist/apis/anilist/query/page/Characters.js +0 -81
- package/dist/apis/anilist/query/page/Followers.js +0 -75
- package/dist/apis/anilist/query/page/Followings.js +0 -75
- package/dist/apis/anilist/query/page/Likes.js +0 -71
- package/dist/apis/anilist/query/page/MediaLists.js +0 -101
- package/dist/apis/anilist/query/page/MediaTrends.js +0 -95
- package/dist/apis/anilist/query/page/Medias.js +0 -143
- package/dist/apis/anilist/query/page/Notifications.js +0 -73
- package/dist/apis/anilist/query/page/Recommendations.js +0 -79
- package/dist/apis/anilist/query/page/Reviews.js +0 -75
- package/dist/apis/anilist/query/page/Staffs.js +0 -90
- package/dist/apis/anilist/query/page/Studios.js +0 -93
- package/dist/apis/anilist/query/page/ThreadCommments.js +0 -74
- package/dist/apis/anilist/query/page/Threads.js +0 -79
- package/dist/apis/anilist/query/page/Users.js +0 -79
- package/dist/apis/anilist/types/ActivityType.js +0 -14
- package/dist/apis/anilist/types/DisabledListActivity.js +0 -11
- package/dist/apis/anilist/types/Format.js +0 -30
- package/dist/apis/anilist/types/FuzzyDate.js +0 -12
- package/dist/apis/anilist/types/MediaListOptions.js +0 -16
- package/dist/apis/anilist/types/NotificationOptions.js +0 -29
- package/dist/apis/anilist/types/RecommendationRating.js +0 -12
- package/dist/apis/anilist/types/Season.js +0 -13
- package/dist/apis/anilist/types/Sort.js +0 -265
- package/dist/apis/anilist/types/Source.js +0 -25
- package/dist/apis/anilist/types/Status.js +0 -26
- package/dist/apis/anilist/types/Type.js +0 -44
- package/dist/apis/anilist/types/UserStaffNameLanguage.js +0 -15
- package/dist/apis/anilist/types/UserTitleLanguage.js +0 -15
- package/dist/base/APIWrapper.js +0 -17
- package/dist/base/RequestHandler.js +0 -48
- package/dist/base/ValidateVariables.js +0 -125
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 RLAlpha49
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 RLAlpha49
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,241 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
AniLink
|
|
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
|
-
#### Query Methods
|
|
73
|
-
|
|
74
|
-
The `anilist.query` section is further divided into main query methods and page query methods. The main query methods return a single piece of data, while the page query methods return pages of data.
|
|
75
|
-
|
|
76
|
-
List of main query methods in `anilist.query`:
|
|
77
|
-
|
|
78
|
-
- user
|
|
79
|
-
- media
|
|
80
|
-
- mediaTrend
|
|
81
|
-
- airingSchedule
|
|
82
|
-
- character
|
|
83
|
-
- staff
|
|
84
|
-
- mediaList
|
|
85
|
-
- mediaListCollection
|
|
86
|
-
- genreCollection
|
|
87
|
-
- mediaTagCollection
|
|
88
|
-
- viewer
|
|
89
|
-
- notification
|
|
90
|
-
- studio
|
|
91
|
-
- review
|
|
92
|
-
- activity
|
|
93
|
-
- activityReply
|
|
94
|
-
- following
|
|
95
|
-
- follower
|
|
96
|
-
- thread
|
|
97
|
-
- threadComment
|
|
98
|
-
- recommendation
|
|
99
|
-
- markdown
|
|
100
|
-
- aniChartUser
|
|
101
|
-
- siteStatistics
|
|
102
|
-
- externalLinkSourceCollection
|
|
103
|
-
|
|
104
|
-
List of page query methods in `anilist.query.page`:
|
|
105
|
-
|
|
106
|
-
- users
|
|
107
|
-
- medias
|
|
108
|
-
- characters
|
|
109
|
-
- staffs
|
|
110
|
-
- studios
|
|
111
|
-
- mediaLists
|
|
112
|
-
- airingSchedules
|
|
113
|
-
- mediaTrends
|
|
114
|
-
- notifications
|
|
115
|
-
- followers
|
|
116
|
-
- following
|
|
117
|
-
- activities
|
|
118
|
-
- activityReplies
|
|
119
|
-
- threads
|
|
120
|
-
- threadComments
|
|
121
|
-
- reviews
|
|
122
|
-
- recommendations
|
|
123
|
-
- likes
|
|
124
|
-
|
|
125
|
-
#### Mutation Methods
|
|
126
|
-
|
|
127
|
-
List of methods in `anilist.mutation`:
|
|
128
|
-
|
|
129
|
-
- updateUser
|
|
130
|
-
- saveMediaListEntry
|
|
131
|
-
- updateMediaListEntries
|
|
132
|
-
- deleteMediaListEntries
|
|
133
|
-
- deleteCustomLists
|
|
134
|
-
- saveTextActivity
|
|
135
|
-
- saveMessageActivity
|
|
136
|
-
- deleteActivity
|
|
137
|
-
- toggleActivityPin
|
|
138
|
-
- toggleActivitySubscription
|
|
139
|
-
- saveActivityReply
|
|
140
|
-
- deleteActivityReply
|
|
141
|
-
- toggleLike
|
|
142
|
-
- toggleLikeV2
|
|
143
|
-
- toggleFollow
|
|
144
|
-
- toggleFavourite
|
|
145
|
-
- updateFavouriteOrder
|
|
146
|
-
- saveReview
|
|
147
|
-
- deleteReview
|
|
148
|
-
- saveRecommendation
|
|
149
|
-
- saveThread
|
|
150
|
-
- deleteThread
|
|
151
|
-
- toggleThreadSubscription
|
|
152
|
-
- saveThreadComment
|
|
153
|
-
- deleteThreadComment
|
|
154
|
-
- updateAniChartSettings
|
|
155
|
-
- updateAniChartHighlights
|
|
156
|
-
|
|
157
|
-
### Error Handling
|
|
158
|
-
|
|
159
|
-
AniLink will throw an error if the AniList API returns an error. You can catch these errors using a try-catch block.
|
|
160
|
-
|
|
161
|
-
```typescript
|
|
162
|
-
try {
|
|
163
|
-
const user = await aniLink.anilist.query.user({id: 542244});
|
|
164
|
-
console.log(user);
|
|
165
|
-
} catch (error) {
|
|
166
|
-
console.error(error);
|
|
167
|
-
}
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
This includes status codes and error messages returned by the AniList API. Here is an example rate limit handler to catch the errors thrown by AniLink:
|
|
171
|
-
|
|
172
|
-
##### Typescript
|
|
173
|
-
|
|
174
|
-
```typescript
|
|
175
|
-
async function handleRateLimit(apiCall: () => Promise<any>, retryAfter = 60) {
|
|
176
|
-
try {
|
|
177
|
-
let response;
|
|
178
|
-
try {
|
|
179
|
-
response = await apiCall();
|
|
180
|
-
} catch (error) {
|
|
181
|
-
throw error;
|
|
182
|
-
}
|
|
183
|
-
console.log(response.data);
|
|
184
|
-
return response;
|
|
185
|
-
} catch (error: any) {
|
|
186
|
-
if (error.response && error.response.status === 429) {
|
|
187
|
-
console.log('Rate limit exceeded, waiting for 1 minute before retrying...');
|
|
188
|
-
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
|
|
189
|
-
console.log('Retrying...');
|
|
190
|
-
return handleRateLimit(apiCall, retryAfter);
|
|
191
|
-
} else {
|
|
192
|
-
if (error.response && error.response.data) {
|
|
193
|
-
throw error.response.data;
|
|
194
|
-
} else {
|
|
195
|
-
throw error.response || error;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
##### Javascript
|
|
203
|
-
|
|
204
|
-
```javascript
|
|
205
|
-
async function handleRateLimit(apiCall, retryAfter = 60) {
|
|
206
|
-
// Same as above
|
|
207
|
-
}
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
The possible error codes returned by the AniList API are:
|
|
211
|
-
- 400: Bad Request (e.g. missing variables, invalid variables, or invalid query)
|
|
212
|
-
- 401: Unauthorized (e.g. invalid authentication token)
|
|
213
|
-
- 404: Not Found (e.g. user not found)
|
|
214
|
-
- 429: Too Many Requests (e.g. rate limit exceeded)
|
|
215
|
-
- 500: Internal Server Error (e.g. AniList server error)
|
|
216
|
-
|
|
217
|
-
#### Missing or Invalid Variables
|
|
218
|
-
|
|
219
|
-
AniLink will also throw an error if any variables are missing or invalid. For example, if you try to query a user providing a string instead of a number for ID, AniLink will throw an error. Most variables are optional however there a few that are required.
|
|
220
|
-
```typescript
|
|
221
|
-
try {
|
|
222
|
-
const user = await aniLink.anilist.query.user({id: '542244'});
|
|
223
|
-
console.log(user);
|
|
224
|
-
} catch (error) {
|
|
225
|
-
console.error(error);
|
|
226
|
-
}
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
Example Error Thrown:
|
|
230
|
-
|
|
231
|
-
```typescript
|
|
232
|
-
Invalid id: 542244. Expected type: number
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
### Examples
|
|
236
|
-
|
|
237
|
-
See the [ANILIST_API_EXAMPLES](https://github.com/RLAlpha49/AniLink/blob/master/Examples/ANILIST_API_EXAMPLES.md) for examples of how to use AniLink to interact with the AniList API.
|
|
238
|
-
|
|
239
|
-
## License
|
|
240
|
-
|
|
241
|
-
This project is licensed under the MIT License - see the [LICENSE](https://github.com/RLAlpha49/AniLink/blob/master/LICENSE) file for details.
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs-src/public/logo.png" alt="AniLink" width="256" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">AniLink</h1>
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/anilink-api-wrapper)
|
|
8
|
+
[](https://www.npmjs.com/package/anilink-api-wrapper)
|
|
9
|
+
[](https://github.com/RLAlpha49/AniLink/blob/master/LICENSE)
|
|
10
|
+
[](https://github.com/RLAlpha49/AniLink/actions/workflows/ci.yml)
|
|
11
|
+
[](https://github.com/RLAlpha49/AniLink/actions/workflows/codeql.yml)
|
|
12
|
+
[](https://anilink.alpha49.com/)
|
|
13
|
+
|
|
14
|
+
A typed TypeScript wrapper for the [AniList GraphQL API](https://docs.anilist.co/) and the [MyAnimeList REST API](https://myanimelist.net/apiconfig/references/api/v2). One class, two isolated provider surfaces, normalized errors, retries, and a generated operation reference.
|
|
15
|
+
|
|
16
|
+
## Quickstart
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install anilink-api-wrapper
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { AniLink } from "anilink-api-wrapper";
|
|
24
|
+
|
|
25
|
+
// AniList (GraphQL) — public queries need no token
|
|
26
|
+
const aniLink = new AniLink();
|
|
27
|
+
const anime = await aniLink.anilist.query.media({ id: 21, type: "ANIME" });
|
|
28
|
+
|
|
29
|
+
// MyAnimeList (REST) — isolated credential slot
|
|
30
|
+
const client = new AniLink({ mal: { accessToken: "mal-token" } });
|
|
31
|
+
const malAnime = await client.mal.anime.get(21, { fields: ["id", "title", "main_picture"] });
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## What you can do
|
|
35
|
+
|
|
36
|
+
| Provider | Namespace | Capabilities |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| **AniList** | `aniLink.anilist` | Queries, page queries, mutations, pagination helpers, `custom()`, data helpers |
|
|
39
|
+
| **MyAnimeList** | `aniLink.mal` | `anime.get` and `user.me` REST reads with field selection |
|
|
40
|
+
|
|
41
|
+
Both surfaces share one transport layer (timeouts, retries, pacing, circuit breaker, hooks) while keeping credentials and transport settings isolated per provider slot.
|
|
42
|
+
|
|
43
|
+
## Documentation
|
|
44
|
+
|
|
45
|
+
| Surface | Start here |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| **Guides** | [Introduction](https://anilink.alpha49.com/introduction) · [Getting started](https://anilink.alpha49.com/getting-started) · [Provider configuration](https://anilink.alpha49.com/provider-configuration) · [Per-request options](https://anilink.alpha49.com/per-request-options) · [Error handling](https://anilink.alpha49.com/error-handling) · [Retries & resilience](https://anilink.alpha49.com/retries-and-resilience) · [Cancellation & timeouts](https://anilink.alpha49.com/cancellation-and-timeouts) · [Observability](https://anilink.alpha49.com/observability) · [Recipes](https://anilink.alpha49.com/recipes) · [TypeScript patterns](https://anilink.alpha49.com/typescript-patterns) · [Troubleshooting](https://anilink.alpha49.com/troubleshooting) |
|
|
48
|
+
| **AniList guides** | [Authentication](https://anilink.alpha49.com/guides/anilist/authentication) · [Client configuration](https://anilink.alpha49.com/guides/anilist/configuration) · [Querying](https://anilink.alpha49.com/guides/anilist/querying) · [Page queries](https://anilink.alpha49.com/guides/anilist/page-queries) · [Pagination](https://anilink.alpha49.com/guides/anilist/pagination) · [Mutations](https://anilink.alpha49.com/guides/anilist/mutations) · [Custom queries](https://anilink.alpha49.com/guides/anilist/custom-queries) · [Helpers](https://anilink.alpha49.com/guides/anilist/helpers) |
|
|
49
|
+
| **MAL guides** | [Authentication](https://anilink.alpha49.com/guides/mal/authentication) · [Client configuration](https://anilink.alpha49.com/guides/mal/configuration) · [Operations](https://anilink.alpha49.com/guides/mal/operations) |
|
|
50
|
+
| **Operation reference** | [Overview](https://anilink.alpha49.com/operations/) · [AniList catalog](https://anilink.alpha49.com/operations/anilist) · [MAL catalog](https://anilink.alpha49.com/operations/mal) |
|
|
51
|
+
| **API reference (TypeDoc)** | [AniLink](https://anilink.alpha49.com/classes/AniLink.AniLink.html) — full generated reference at the [docs root](https://anilink.alpha49.com/) |
|
|
52
|
+
|
|
53
|
+
## Development
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install # install dependencies
|
|
57
|
+
npm run check # typecheck, lint, tests, format, JSDoc, api-compare, build
|
|
58
|
+
npm run docs:generate # TypeDoc + operation reference + guides site into docs/
|
|
59
|
+
npm run docs:dev # serve the guides site locally
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
See the [contributing guide](CONTRIBUTING.md) for workflow details.
|
|
63
|
+
|
|
64
|
+
## Resources
|
|
65
|
+
|
|
66
|
+
- [Changelog](CHANGELOG.md) and [GitHub Releases](https://github.com/RLAlpha49/AniLink/releases)
|
|
67
|
+
- [Contributing guide](CONTRIBUTING.md)
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
[MIT](https://github.com/RLAlpha49/AniLink/blob/master/LICENSE)
|