anilink-api-wrapper 1.14.0 → 1.15.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
|
@@ -26,6 +26,7 @@ const Likes_1 = require("./apis/anilist/query/page/Likes");
|
|
|
26
26
|
const Markdown_1 = require("./apis/anilist/query/Markdown");
|
|
27
27
|
const AniChartUser_1 = require("./apis/anilist/query/AniChartUser");
|
|
28
28
|
const SiteStatistics_1 = require("./apis/anilist/query/SiteStatistics");
|
|
29
|
+
const ExternalLinkSourceCollection_1 = require("./apis/anilist/query/ExternalLinkSourceCollection");
|
|
29
30
|
class AniLink {
|
|
30
31
|
constructor(authToken) {
|
|
31
32
|
const userQueryInstance = new User_1.UserQuery(authToken);
|
|
@@ -52,6 +53,7 @@ class AniLink {
|
|
|
52
53
|
const markdownQueryInstance = new Markdown_1.MarkdownQuery(authToken);
|
|
53
54
|
const aniChartUserQueryInstance = new AniChartUser_1.AniChartUserQuery(authToken);
|
|
54
55
|
const siteStatisticsQueryInstance = new SiteStatistics_1.SiteStatisticsQuery(authToken);
|
|
56
|
+
const externalLinkSourceCollectionQueryInstance = new ExternalLinkSourceCollection_1.ExternalLinkSourceCollectionQuery(authToken);
|
|
55
57
|
const likesQueryInstance = new Likes_1.LikesQuery(authToken);
|
|
56
58
|
const updateUserMutationInstance = new UpdateUser_1.UpdateUserMutation(authToken);
|
|
57
59
|
this.anilist = {
|
|
@@ -80,6 +82,7 @@ class AniLink {
|
|
|
80
82
|
markdown: markdownQueryInstance.markdown.bind(markdownQueryInstance),
|
|
81
83
|
aniChartUser: aniChartUserQueryInstance.aniChartUser.bind(aniChartUserQueryInstance),
|
|
82
84
|
siteStatistics: siteStatisticsQueryInstance.siteStatistics.bind(siteStatisticsQueryInstance),
|
|
85
|
+
externalLinkSourceCollection: externalLinkSourceCollectionQueryInstance.externalLinkSourceCollection.bind(externalLinkSourceCollectionQueryInstance),
|
|
83
86
|
page: {
|
|
84
87
|
likes: likesQueryInstance.likes.bind(likesQueryInstance)
|
|
85
88
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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.ExternalLinkSourceCollectionQuery = void 0;
|
|
13
|
+
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
|
+
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
|
+
class ExternalLinkSourceCollectionQuery extends APIWrapper_1.APIWrapper {
|
|
16
|
+
constructor(authToken) {
|
|
17
|
+
super('https://graphql.anilist.co');
|
|
18
|
+
this.authToken = authToken;
|
|
19
|
+
}
|
|
20
|
+
externalLinkSourceCollection(variables) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const query = `
|
|
23
|
+
query ($id: Int, $type: ExternalLinkType, $mediaType: ExternalLinkMediaType) {
|
|
24
|
+
ExternalLinkSourceCollection (id: $id, type: $type, mediaType: $mediaType) {
|
|
25
|
+
id
|
|
26
|
+
url
|
|
27
|
+
site
|
|
28
|
+
siteId
|
|
29
|
+
type
|
|
30
|
+
language
|
|
31
|
+
color
|
|
32
|
+
icon
|
|
33
|
+
notes
|
|
34
|
+
isDisabled
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
const data = { query, variables };
|
|
39
|
+
return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.ExternalLinkSourceCollectionQuery = ExternalLinkSourceCollectionQuery;
|