anilink-api-wrapper 1.6.0 → 1.7.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
|
@@ -16,6 +16,7 @@ const Notification_1 = require("./apis/anilist/query/Notification");
|
|
|
16
16
|
const Studio_1 = require("./apis/anilist/query/Studio");
|
|
17
17
|
const Review_1 = require("./apis/anilist/query/Review");
|
|
18
18
|
const Activity_1 = require("./apis/anilist/query/Activity");
|
|
19
|
+
const ActivityReply_1 = require("./apis/anilist/query/ActivityReply");
|
|
19
20
|
class AniLink {
|
|
20
21
|
constructor(authToken) {
|
|
21
22
|
const userQueryInstance = new User_1.UserQuery(authToken);
|
|
@@ -33,6 +34,7 @@ class AniLink {
|
|
|
33
34
|
const studioQueryInstance = new Studio_1.StudioQuery(authToken);
|
|
34
35
|
const reviewQueryInstance = new Review_1.ReviewQuery(authToken);
|
|
35
36
|
const activityQueryInstance = new Activity_1.ActivityQuery(authToken);
|
|
37
|
+
const activityReplyQueryInstance = new ActivityReply_1.ActivityReplyQuery(authToken);
|
|
36
38
|
const updateUserMutationInstance = new UpdateUser_1.UpdateUserMutation(authToken);
|
|
37
39
|
this.anilist = {
|
|
38
40
|
query: {
|
|
@@ -50,7 +52,8 @@ class AniLink {
|
|
|
50
52
|
notification: notificationQueryInstance.notification.bind(notificationQueryInstance),
|
|
51
53
|
studio: studioQueryInstance.studio.bind(studioQueryInstance),
|
|
52
54
|
review: reviewQueryInstance.review.bind(reviewQueryInstance),
|
|
53
|
-
activity: activityQueryInstance.activity.bind(activityQueryInstance)
|
|
55
|
+
activity: activityQueryInstance.activity.bind(activityQueryInstance),
|
|
56
|
+
activityReply: activityReplyQueryInstance.activityReply.bind(activityReplyQueryInstance)
|
|
54
57
|
},
|
|
55
58
|
mutation: {
|
|
56
59
|
updateUser: updateUserMutationInstance.updateUser.bind(updateUserMutationInstance)
|
|
@@ -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.ActivityReplyQuery = void 0;
|
|
13
|
+
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
|
+
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
|
+
const ActivityReply_1 = require("../interfaces/ActivityReply");
|
|
16
|
+
class ActivityReplyQuery extends APIWrapper_1.APIWrapper {
|
|
17
|
+
constructor(authToken) {
|
|
18
|
+
super('https://graphql.anilist.co');
|
|
19
|
+
this.authToken = authToken;
|
|
20
|
+
}
|
|
21
|
+
activityReply(variables) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const query = `
|
|
24
|
+
query ($id: Int, $activityId: Int, $asHtml: Boolean) {
|
|
25
|
+
ActivityReply (id: $id, activityId: $activityId) {
|
|
26
|
+
${ActivityReply_1.ActivityReplySchema}
|
|
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.ActivityReplyQuery = ActivityReplyQuery;
|