anilink-api-wrapper 1.9.0 → 1.10.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/AniLink.js
CHANGED
|
@@ -20,6 +20,7 @@ const ActivityReply_1 = require("./apis/anilist/query/ActivityReply");
|
|
|
20
20
|
const Following_1 = require("./apis/anilist/query/Following");
|
|
21
21
|
const Follower_1 = require("./apis/anilist/query/Follower");
|
|
22
22
|
const Thread_1 = require("./apis/anilist/query/Thread");
|
|
23
|
+
const ThreadComment_1 = require("./apis/anilist/query/ThreadComment");
|
|
23
24
|
class AniLink {
|
|
24
25
|
constructor(authToken) {
|
|
25
26
|
const userQueryInstance = new User_1.UserQuery(authToken);
|
|
@@ -41,6 +42,7 @@ class AniLink {
|
|
|
41
42
|
const followingQueryInstance = new Following_1.FollowingQuery(authToken);
|
|
42
43
|
const followerQueryInstance = new Follower_1.FollowerQuery(authToken);
|
|
43
44
|
const threadQueryInstance = new Thread_1.ThreadQuery(authToken);
|
|
45
|
+
const threadCommentQueryInstance = new ThreadComment_1.ThreadCommentQuery(authToken);
|
|
44
46
|
const updateUserMutationInstance = new UpdateUser_1.UpdateUserMutation(authToken);
|
|
45
47
|
this.anilist = {
|
|
46
48
|
query: {
|
|
@@ -62,7 +64,8 @@ class AniLink {
|
|
|
62
64
|
activityReply: activityReplyQueryInstance.activityReply.bind(activityReplyQueryInstance),
|
|
63
65
|
following: followingQueryInstance.following.bind(followingQueryInstance),
|
|
64
66
|
follower: followerQueryInstance.follower.bind(followerQueryInstance),
|
|
65
|
-
thread: threadQueryInstance.thread.bind(threadQueryInstance)
|
|
67
|
+
thread: threadQueryInstance.thread.bind(threadQueryInstance),
|
|
68
|
+
threadComment: threadCommentQueryInstance.threadComment.bind(threadCommentQueryInstance)
|
|
66
69
|
},
|
|
67
70
|
mutation: {
|
|
68
71
|
updateUser: updateUserMutationInstance.updateUser.bind(updateUserMutationInstance)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThreadCommentSchema = void 0;
|
|
4
|
+
const Thread_1 = require("./Thread");
|
|
5
|
+
const BasicUser_1 = require("../BasicUser");
|
|
6
|
+
exports.ThreadCommentSchema = `
|
|
7
|
+
id
|
|
8
|
+
userId
|
|
9
|
+
threadId
|
|
10
|
+
comment (asHtml: $asHtml)
|
|
11
|
+
likeCount
|
|
12
|
+
isLiked
|
|
13
|
+
siteUrl
|
|
14
|
+
createdAt
|
|
15
|
+
updatedAt
|
|
16
|
+
thread {
|
|
17
|
+
${Thread_1.ThreadSchema}
|
|
18
|
+
}
|
|
19
|
+
user {
|
|
20
|
+
${BasicUser_1.BasicUserSchema}
|
|
21
|
+
}
|
|
22
|
+
likes {
|
|
23
|
+
${BasicUser_1.BasicUserSchema}
|
|
24
|
+
}
|
|
25
|
+
childComments
|
|
26
|
+
isLocked
|
|
27
|
+
`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ThreadCommentQuery = void 0;
|
|
13
|
+
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
|
+
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
|
+
const ThreadComment_1 = require("../interfaces/responses/ThreadComment");
|
|
16
|
+
class ThreadCommentQuery extends APIWrapper_1.APIWrapper {
|
|
17
|
+
constructor(authToken) {
|
|
18
|
+
super('https://graphql.anilist.co');
|
|
19
|
+
this.authToken = authToken;
|
|
20
|
+
}
|
|
21
|
+
threadComment(variables) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const query = `
|
|
24
|
+
query ($id: Int, $threadId: Int, $userId: Int, $sort: [ThreadCommentSort], $asHtml: Boolean) {
|
|
25
|
+
ThreadComment (id: $id, threadId: $threadId, userId: $userId, sort: $sort) {
|
|
26
|
+
${ThreadComment_1.ThreadCommentSchema}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
const data = { query, variables };
|
|
31
|
+
return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ThreadCommentQuery = ThreadCommentQuery;
|