anilink-api-wrapper 1.17.4 → 1.17.6
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 +319 -0
- package/dist/AniLink.js +10 -0
- package/dist/apis/anilist/interfaces/Activity.js +8 -0
- package/dist/apis/anilist/interfaces/ActivityNotification.js +4 -0
- package/dist/apis/anilist/interfaces/ActivityReply.js +4 -0
- package/dist/apis/anilist/interfaces/BasicComment.js +4 -0
- package/dist/apis/anilist/interfaces/BasicThread.js +4 -0
- package/dist/apis/anilist/interfaces/BasicUser.js +4 -0
- package/dist/apis/anilist/interfaces/CoverImage.js +4 -0
- package/dist/apis/anilist/interfaces/ExternalLink.js +4 -0
- package/dist/apis/anilist/interfaces/FuzzyDate.js +4 -0
- package/dist/apis/anilist/interfaces/Image.js +4 -0
- package/dist/apis/anilist/interfaces/MediaListEntry.js +4 -0
- package/dist/apis/anilist/interfaces/Name.js +4 -0
- package/dist/apis/anilist/interfaces/NextAiringEpisode.js +4 -0
- package/dist/apis/anilist/interfaces/Ranking.js +4 -0
- package/dist/apis/anilist/interfaces/ScoreDistribution.js +4 -0
- package/dist/apis/anilist/interfaces/SiteTrend.js +4 -0
- package/dist/apis/anilist/interfaces/SiteTrendConnection.js +4 -0
- package/dist/apis/anilist/interfaces/StatusDistribution.js +4 -0
- package/dist/apis/anilist/interfaces/StreamingEpisode.js +4 -0
- package/dist/apis/anilist/interfaces/Tag.js +4 -0
- package/dist/apis/anilist/interfaces/ThreadNotification.js +4 -0
- package/dist/apis/anilist/interfaces/Title.js +4 -0
- package/dist/apis/anilist/interfaces/Trailer.js +4 -0
- package/dist/apis/anilist/interfaces/UserStats.js +8 -0
- package/dist/apis/anilist/interfaces/responses/query/AiringSchedule.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/Character.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/Media.js +8 -0
- package/dist/apis/anilist/interfaces/responses/query/MediaList.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/MediaListCollectionResponse.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/MediaTrend.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/Notification.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/Recommendation.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/Review.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/SiteStatistics.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/Staff.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/Studio.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/Thread.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/ThreadComment.js +4 -0
- package/dist/apis/anilist/interfaces/responses/query/User.js +4 -0
- package/dist/apis/anilist/mutation/SaveMediaListEntry.js +15 -0
- package/dist/apis/anilist/mutation/UpdateMediaListEntries.js +15 -0
- package/dist/apis/anilist/mutation/UpdateUser.js +15 -0
- package/dist/apis/anilist/query/Activity.js +15 -0
- package/dist/apis/anilist/query/ActivityReply.js +15 -0
- package/dist/apis/anilist/query/AiringSchedule.js +15 -0
- package/dist/apis/anilist/query/AniChartUser.js +14 -0
- package/dist/apis/anilist/query/Character.js +15 -0
- package/dist/apis/anilist/query/ExternalLinkSourceCollection.js +17 -2
- package/dist/apis/anilist/query/Follower.js +15 -0
- package/dist/apis/anilist/query/Following.js +15 -0
- package/dist/apis/anilist/query/GenreCollection.js +14 -0
- package/dist/apis/anilist/query/Markdown.js +15 -0
- package/dist/apis/anilist/query/Media.js +15 -0
- package/dist/apis/anilist/query/MediaList.js +15 -0
- package/dist/apis/anilist/query/MediaListCollection.js +15 -0
- package/dist/apis/anilist/query/MediaTagCollection.js +17 -2
- package/dist/apis/anilist/query/MediaTrend.js +15 -0
- package/dist/apis/anilist/query/Notification.js +15 -0
- package/dist/apis/anilist/query/Recommendation.js +15 -0
- package/dist/apis/anilist/query/Review.js +15 -0
- package/dist/apis/anilist/query/SiteStatistics.js +17 -2
- package/dist/apis/anilist/query/Staff.js +15 -0
- package/dist/apis/anilist/query/Studio.js +15 -0
- package/dist/apis/anilist/query/Thread.js +15 -0
- package/dist/apis/anilist/query/ThreadComment.js +15 -0
- package/dist/apis/anilist/query/User.js +15 -0
- package/dist/apis/anilist/query/Viewer.js +15 -0
- package/dist/apis/anilist/query/page/Activities.js +15 -0
- package/dist/apis/anilist/query/page/ActivityReplies.js +15 -0
- package/dist/apis/anilist/query/page/AiringSchedules.js +15 -0
- package/dist/apis/anilist/query/page/Characters.js +15 -0
- package/dist/apis/anilist/query/page/Followers.js +15 -0
- package/dist/apis/anilist/query/page/Followings.js +15 -0
- package/dist/apis/anilist/query/page/Likes.js +15 -0
- package/dist/apis/anilist/query/page/MediaLists.js +15 -0
- package/dist/apis/anilist/query/page/MediaTrends.js +15 -0
- package/dist/apis/anilist/query/page/Medias.js +13 -0
- package/dist/apis/anilist/query/page/Notifications.js +15 -0
- package/dist/apis/anilist/query/page/Recommendations.js +15 -0
- package/dist/apis/anilist/query/page/Reviews.js +15 -0
- package/dist/apis/anilist/query/page/Staffs.js +15 -0
- package/dist/apis/anilist/query/page/Studios.js +15 -0
- package/dist/apis/anilist/query/page/ThreadCommments.js +15 -0
- package/dist/apis/anilist/query/page/Threads.js +15 -0
- package/dist/apis/anilist/query/page/Users.js +15 -0
- package/dist/base/APIWrapper.js +8 -0
- package/dist/base/RequestHandler.js +9 -0
- package/package.json +4 -1
- package/typedoc.json +15 -0
|
@@ -13,11 +13,26 @@ exports.ReviewsQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../../base/RequestHandler");
|
|
15
15
|
const Review_1 = require("../../interfaces/responses/query/Review");
|
|
16
|
+
/**
|
|
17
|
+
* `ReviewsQuery` is a class representing a query for reviews.
|
|
18
|
+
* It includes a method to get reviews.
|
|
19
|
+
*/
|
|
16
20
|
class ReviewsQuery extends APIWrapper_1.APIWrapper {
|
|
21
|
+
/**
|
|
22
|
+
* Constructs a new `ReviewsQuery` instance.
|
|
23
|
+
*
|
|
24
|
+
* @param authToken - The authentication token.
|
|
25
|
+
*/
|
|
17
26
|
constructor(authToken) {
|
|
18
27
|
super('https://graphql.anilist.co');
|
|
19
28
|
this.authToken = authToken;
|
|
20
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* `reviews` is a method that sends a query request to get reviews.
|
|
32
|
+
*
|
|
33
|
+
* @param variables - The variables for the query.
|
|
34
|
+
* @returns The response from the query request.
|
|
35
|
+
*/
|
|
21
36
|
reviews(variables) {
|
|
22
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
38
|
const query = `
|
|
@@ -13,11 +13,26 @@ exports.StaffsQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../../base/RequestHandler");
|
|
15
15
|
const Staff_1 = require("../../interfaces/responses/query/Staff");
|
|
16
|
+
/**
|
|
17
|
+
* `StaffsQuery` is a class representing a query for staffs.
|
|
18
|
+
* It includes a method to get staffs.
|
|
19
|
+
*/
|
|
16
20
|
class StaffsQuery extends APIWrapper_1.APIWrapper {
|
|
21
|
+
/**
|
|
22
|
+
* Constructs a new `StaffsQuery` instance.
|
|
23
|
+
*
|
|
24
|
+
* @param authToken - The authentication token.
|
|
25
|
+
*/
|
|
17
26
|
constructor(authToken) {
|
|
18
27
|
super('https://graphql.anilist.co');
|
|
19
28
|
this.authToken = authToken;
|
|
20
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* `staffs` is a method that sends a query request to get staffs.
|
|
32
|
+
*
|
|
33
|
+
* @param variables - The variables for the query.
|
|
34
|
+
* @returns The response from the query request.
|
|
35
|
+
*/
|
|
21
36
|
staffs(variables) {
|
|
22
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
38
|
const query = `
|
|
@@ -13,11 +13,26 @@ exports.StudiosQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../../base/RequestHandler");
|
|
15
15
|
const Studio_1 = require("../../interfaces/responses/query/Studio");
|
|
16
|
+
/**
|
|
17
|
+
* `StudiosQuery` is a class representing a query for studios.
|
|
18
|
+
* It includes a method to get studios.
|
|
19
|
+
*/
|
|
16
20
|
class StudiosQuery extends APIWrapper_1.APIWrapper {
|
|
21
|
+
/**
|
|
22
|
+
* Constructs a new `StudiosQuery` instance.
|
|
23
|
+
*
|
|
24
|
+
* @param authToken - The authentication token.
|
|
25
|
+
*/
|
|
17
26
|
constructor(authToken) {
|
|
18
27
|
super('https://graphql.anilist.co');
|
|
19
28
|
this.authToken = authToken;
|
|
20
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* `studios` is a method that sends a query request to get studios.
|
|
32
|
+
*
|
|
33
|
+
* @param variables - The variables for the query.
|
|
34
|
+
* @returns The response from the query request.
|
|
35
|
+
*/
|
|
21
36
|
studios(variables) {
|
|
22
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
38
|
const query = `
|
|
@@ -13,11 +13,26 @@ exports.ThreadCommentsQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../../base/RequestHandler");
|
|
15
15
|
const ThreadComment_1 = require("../../interfaces/responses/query/ThreadComment");
|
|
16
|
+
/**
|
|
17
|
+
* `ThreadCommentsQuery` is a class representing a query for thread comments.
|
|
18
|
+
* It includes a method to get thread comments.
|
|
19
|
+
*/
|
|
16
20
|
class ThreadCommentsQuery extends APIWrapper_1.APIWrapper {
|
|
21
|
+
/**
|
|
22
|
+
* Constructs a new `ThreadCommentsQuery` instance.
|
|
23
|
+
*
|
|
24
|
+
* @param authToken - The authentication token.
|
|
25
|
+
*/
|
|
17
26
|
constructor(authToken) {
|
|
18
27
|
super('https://graphql.anilist.co');
|
|
19
28
|
this.authToken = authToken;
|
|
20
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* `threadComments` is a method that sends a query request to get thread comments.
|
|
32
|
+
*
|
|
33
|
+
* @param variables - The variables for the query.
|
|
34
|
+
* @returns The response from the query request.
|
|
35
|
+
*/
|
|
21
36
|
threadComments(variables) {
|
|
22
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
38
|
const query = `
|
|
@@ -13,11 +13,26 @@ exports.ThreadsQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../../base/RequestHandler");
|
|
15
15
|
const Thread_1 = require("../../interfaces/responses/query/Thread");
|
|
16
|
+
/**
|
|
17
|
+
* `ThreadsQuery` is a class representing a query for threads.
|
|
18
|
+
* It includes a method to get threads.
|
|
19
|
+
*/
|
|
16
20
|
class ThreadsQuery extends APIWrapper_1.APIWrapper {
|
|
21
|
+
/**
|
|
22
|
+
* Constructs a new `ThreadsQuery` instance.
|
|
23
|
+
*
|
|
24
|
+
* @param authToken - The authentication token.
|
|
25
|
+
*/
|
|
17
26
|
constructor(authToken) {
|
|
18
27
|
super('https://graphql.anilist.co');
|
|
19
28
|
this.authToken = authToken;
|
|
20
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* `threads` is a method that sends a query request to get threads.
|
|
32
|
+
*
|
|
33
|
+
* @param variables - The variables for the query.
|
|
34
|
+
* @returns The response from the query request.
|
|
35
|
+
*/
|
|
21
36
|
threads(variables) {
|
|
22
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
38
|
const query = `
|
|
@@ -13,11 +13,26 @@ exports.UsersQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../../base/RequestHandler");
|
|
15
15
|
const User_1 = require("../../interfaces/responses/query/User");
|
|
16
|
+
/**
|
|
17
|
+
* `UsersQuery` is a class representing a query for users.
|
|
18
|
+
* It includes a method to get users.
|
|
19
|
+
*/
|
|
16
20
|
class UsersQuery extends APIWrapper_1.APIWrapper {
|
|
21
|
+
/**
|
|
22
|
+
* Constructs a new `UsersQuery` instance.
|
|
23
|
+
*
|
|
24
|
+
* @param authToken - The authentication token.
|
|
25
|
+
*/
|
|
17
26
|
constructor(authToken) {
|
|
18
27
|
super('https://graphql.anilist.co');
|
|
19
28
|
this.authToken = authToken;
|
|
20
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* `users` is a method that sends a query request to get users.
|
|
32
|
+
*
|
|
33
|
+
* @param variables - The variables for the query.
|
|
34
|
+
* @returns The response from the query request.
|
|
35
|
+
*/
|
|
21
36
|
users(variables) {
|
|
22
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
38
|
const query = `
|
package/dist/base/APIWrapper.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.APIWrapper = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* `APIWrapper` is a base class for API wrappers.
|
|
6
|
+
* It provides a basic structure that can be extended by specific API wrappers.
|
|
7
|
+
*/
|
|
4
8
|
class APIWrapper {
|
|
9
|
+
/**
|
|
10
|
+
* Constructs a new `APIWrapper` instance.
|
|
11
|
+
* @param baseURL - The base URL for the API.
|
|
12
|
+
*/
|
|
5
13
|
constructor(baseURL) {
|
|
6
14
|
this.baseURL = baseURL;
|
|
7
15
|
}
|
|
@@ -14,6 +14,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.sendRequest = void 0;
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
|
+
/**
|
|
18
|
+
* Sends a request to the specified URL.
|
|
19
|
+
* @param url - The URL to send the request to.
|
|
20
|
+
* @param method - The HTTP method to use ('GET' or 'POST').
|
|
21
|
+
* @param data - The data to send with the request.
|
|
22
|
+
* @param token - The authentication token to include in the request headers.
|
|
23
|
+
* @returns The data from the response.
|
|
24
|
+
* @throws An error if the request fails.
|
|
25
|
+
*/
|
|
17
26
|
const sendRequest = (url, method, data, token) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
27
|
const headers = {
|
|
19
28
|
'Content-Type': 'application/json',
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anilink-api-wrapper",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.6",
|
|
4
4
|
"description": "Anilist API Wrapper",
|
|
5
5
|
"main": "dist/AniLink.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "jest",
|
|
8
8
|
"build": "tsc",
|
|
9
|
+
"generate-docs": "typedoc --entryPoints ./src --entryPointStrategy expand --out docs --plugin typedoc-theme-hierarchy --theme hierarchy",
|
|
9
10
|
"prepublishOnly": "npm run build"
|
|
10
11
|
},
|
|
11
12
|
"keywords": [
|
|
@@ -24,6 +25,8 @@
|
|
|
24
25
|
"standard": "^17.1.0",
|
|
25
26
|
"ts-jest": "^29.1.2",
|
|
26
27
|
"ts-standard": "^12.0.2",
|
|
28
|
+
"typedoc": "^0.25.13",
|
|
29
|
+
"typedoc-theme-hierarchy": "^4.1.2",
|
|
27
30
|
"typescript": "^5.4.5"
|
|
28
31
|
},
|
|
29
32
|
"dependencies": {
|
package/typedoc.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"out": "./docs",
|
|
3
|
+
"entryPoints": ["./src"],
|
|
4
|
+
"entryPointStrategy": "expand",
|
|
5
|
+
"exclude": ["**/__tests__/**"],
|
|
6
|
+
"name": "AniLink",
|
|
7
|
+
"readme": "README.md",
|
|
8
|
+
"plugin": ["typedoc-theme-hierarchy"],
|
|
9
|
+
"theme": "hierarchy",
|
|
10
|
+
"tsconfig": "./tsconfig.json",
|
|
11
|
+
"excludePrivate": true,
|
|
12
|
+
"excludeProtected": true,
|
|
13
|
+
"excludeExternals": true,
|
|
14
|
+
"includeVersion": true
|
|
15
|
+
}
|