anilink-api-wrapper 1.13.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
@@ -25,6 +25,7 @@ const Recommendation_1 = require("./apis/anilist/query/Recommendation");
25
25
  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
+ const SiteStatistics_1 = require("./apis/anilist/query/SiteStatistics");
28
29
  class AniLink {
29
30
  constructor(authToken) {
30
31
  const userQueryInstance = new User_1.UserQuery(authToken);
@@ -50,6 +51,7 @@ class AniLink {
50
51
  const recommendationQueryInstance = new Recommendation_1.RecommendationQuery(authToken);
51
52
  const markdownQueryInstance = new Markdown_1.MarkdownQuery(authToken);
52
53
  const aniChartUserQueryInstance = new AniChartUser_1.AniChartUserQuery(authToken);
54
+ const siteStatisticsQueryInstance = new SiteStatistics_1.SiteStatisticsQuery(authToken);
53
55
  const likesQueryInstance = new Likes_1.LikesQuery(authToken);
54
56
  const updateUserMutationInstance = new UpdateUser_1.UpdateUserMutation(authToken);
55
57
  this.anilist = {
@@ -77,6 +79,7 @@ class AniLink {
77
79
  recommendation: recommendationQueryInstance.recommmendation.bind(recommendationQueryInstance),
78
80
  markdown: markdownQueryInstance.markdown.bind(markdownQueryInstance),
79
81
  aniChartUser: aniChartUserQueryInstance.aniChartUser.bind(aniChartUserQueryInstance),
82
+ siteStatistics: siteStatisticsQueryInstance.siteStatistics.bind(siteStatisticsQueryInstance),
80
83
  page: {
81
84
  likes: likesQueryInstance.likes.bind(likesQueryInstance)
82
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,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,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.13.0",
3
+ "version": "1.14.0",
4
4
  "description": "Anilist API Wrapper",
5
5
  "main": "dist/AniLink.js",
6
6
  "scripts": {