anilink-api-wrapper 1.12.0 → 1.14.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
@@ -23,6 +23,9 @@ const Thread_1 = require("./apis/anilist/query/Thread");
23
23
  const ThreadComment_1 = require("./apis/anilist/query/ThreadComment");
24
24
  const Recommendation_1 = require("./apis/anilist/query/Recommendation");
25
25
  const Likes_1 = require("./apis/anilist/query/page/Likes");
26
+ const Markdown_1 = require("./apis/anilist/query/Markdown");
27
+ const AniChartUser_1 = require("./apis/anilist/query/AniChartUser");
28
+ const SiteStatistics_1 = require("./apis/anilist/query/SiteStatistics");
26
29
  class AniLink {
27
30
  constructor(authToken) {
28
31
  const userQueryInstance = new User_1.UserQuery(authToken);
@@ -46,6 +49,9 @@ class AniLink {
46
49
  const threadQueryInstance = new Thread_1.ThreadQuery(authToken);
47
50
  const threadCommentQueryInstance = new ThreadComment_1.ThreadCommentQuery(authToken);
48
51
  const recommendationQueryInstance = new Recommendation_1.RecommendationQuery(authToken);
52
+ const markdownQueryInstance = new Markdown_1.MarkdownQuery(authToken);
53
+ const aniChartUserQueryInstance = new AniChartUser_1.AniChartUserQuery(authToken);
54
+ const siteStatisticsQueryInstance = new SiteStatistics_1.SiteStatisticsQuery(authToken);
49
55
  const likesQueryInstance = new Likes_1.LikesQuery(authToken);
50
56
  const updateUserMutationInstance = new UpdateUser_1.UpdateUserMutation(authToken);
51
57
  this.anilist = {
@@ -71,6 +77,9 @@ class AniLink {
71
77
  thread: threadQueryInstance.thread.bind(threadQueryInstance),
72
78
  threadComment: threadCommentQueryInstance.threadComment.bind(threadCommentQueryInstance),
73
79
  recommendation: recommendationQueryInstance.recommmendation.bind(recommendationQueryInstance),
80
+ markdown: markdownQueryInstance.markdown.bind(markdownQueryInstance),
81
+ aniChartUser: aniChartUserQueryInstance.aniChartUser.bind(aniChartUserQueryInstance),
82
+ siteStatistics: siteStatisticsQueryInstance.siteStatistics.bind(siteStatisticsQueryInstance),
74
83
  page: {
75
84
  likes: likesQueryInstance.likes.bind(likesQueryInstance)
76
85
  }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SiteTrendSchema = void 0;
4
+ exports.SiteTrendSchema = `
5
+ date
6
+ count
7
+ change
8
+ `;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SiteTrendConnectionSchema = void 0;
4
+ const SiteTrend_1 = require("./SiteTrend");
5
+ exports.SiteTrendConnectionSchema = `
6
+ pageInfo {
7
+ total
8
+ perPage
9
+ currentPage
10
+ lastPage
11
+ hasNextPage
12
+ }
13
+ edges {
14
+ node {
15
+ ${SiteTrend_1.SiteTrendSchema}
16
+ }
17
+ }
18
+ nodes {
19
+ ${SiteTrend_1.SiteTrendSchema}
20
+ }
21
+ `;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SiteStatisticsSchema = void 0;
4
+ const SiteTrendConnection_1 = require("../SiteTrendConnection");
5
+ exports.SiteStatisticsSchema = `
6
+ users (sort: $usersSort, page: $usersPage, perPage: $usersPerPage) {
7
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
8
+ }
9
+ anime (sort: $animeSort, page: $animePage, perPage: $animePerPage) {
10
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
11
+ }
12
+ manga (sort: $mangaSort, page: $mangaPage, perPage: $mangaPerPage) {
13
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
14
+ }
15
+ characters (sort: $charactersSort, page: $charactersPage, perPage: $charactersPerPage) {
16
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
17
+ }
18
+ staff (sort: $staffSort, page: $staffPage, perPage: $staffPerPage) {
19
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
20
+ }
21
+ studios (sort: $studiosSort, page: $studiosPage, perPage: $studiosPerPage) {
22
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
23
+ }
24
+ reviews (sort: $reviewsSort, page: $reviewsPage, perPage: $reviewsPerPage) {
25
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
26
+ }
27
+ `;
@@ -0,0 +1,39 @@
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.AniChartUserQuery = void 0;
13
+ const APIWrapper_1 = require("../../../base/APIWrapper");
14
+ const RequestHandler_1 = require("../../../base/RequestHandler");
15
+ const BasicUser_1 = require("../interfaces/BasicUser");
16
+ class AniChartUserQuery extends APIWrapper_1.APIWrapper {
17
+ constructor(authToken) {
18
+ super('https://graphql.anilist.co');
19
+ this.authToken = authToken;
20
+ }
21
+ aniChartUser() {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const query = `
24
+ query {
25
+ AniChartUser {
26
+ user {
27
+ ${BasicUser_1.BasicUserSchema}
28
+ }
29
+ settings
30
+ highlights
31
+ }
32
+ }
33
+ `;
34
+ const data = { query };
35
+ return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
36
+ });
37
+ }
38
+ }
39
+ exports.AniChartUserQuery = AniChartUserQuery;
@@ -0,0 +1,34 @@
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.MarkdownQuery = void 0;
13
+ const APIWrapper_1 = require("../../../base/APIWrapper");
14
+ const RequestHandler_1 = require("../../../base/RequestHandler");
15
+ class MarkdownQuery extends APIWrapper_1.APIWrapper {
16
+ constructor(authToken) {
17
+ super('https://graphql.anilist.co');
18
+ this.authToken = authToken;
19
+ }
20
+ markdown(variables) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ const query = `
23
+ query ($markdown: String!) {
24
+ Markdown (markdown: $markdown) {
25
+ html
26
+ }
27
+ }
28
+ `;
29
+ const data = { query, variables };
30
+ return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
31
+ });
32
+ }
33
+ }
34
+ exports.MarkdownQuery = MarkdownQuery;
@@ -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.SiteStatisticsQuery = void 0;
13
+ const APIWrapper_1 = require("../../../base/APIWrapper");
14
+ const RequestHandler_1 = require("../../../base/RequestHandler");
15
+ const SiteStatistics_1 = require("../interfaces/responses/SiteStatistics");
16
+ class SiteStatisticsQuery extends APIWrapper_1.APIWrapper {
17
+ constructor(authToken) {
18
+ super('https://graphql.anilist.co');
19
+ this.authToken = authToken;
20
+ }
21
+ siteStatistics(variables) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const query = `
24
+ query ($usersSort: [SiteTrendSort], $usersPage: Int, $usersPerPage: Int, $animeSort: [SiteTrendSort], $animePage: Int, $animePerPage: Int, $mangaSort: [SiteTrendSort], $mangaPage: Int, $mangaPerPage: Int, $charactersSort: [SiteTrendSort], $charactersPage: Int, $charactersPerPage: Int, $staffSort: [SiteTrendSort], $staffPage: Int, $staffPerPage: Int, $studiosSort: [SiteTrendSort], $studiosPage: Int, $studiosPerPage: Int, $reviewsSort: [SiteTrendSort], $reviewsPage: Int, $reviewsPerPage: Int) {
25
+ SiteStatistics {
26
+ ${SiteStatistics_1.SiteStatisticsSchema}
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.SiteStatisticsQuery = SiteStatisticsQuery;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anilink-api-wrapper",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "description": "Anilist API Wrapper",
5
5
  "main": "dist/AniLink.js",
6
6
  "scripts": {