anilink-api-wrapper 1.29.2 → 2.0.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.
Files changed (140) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +523 -241
  3. package/dist/AniLink.d.ts +11397 -0
  4. package/dist/AniLink.mjs +6664 -0
  5. package/dist/anilist.d.ts +1 -0
  6. package/dist/anilist.mjs +5 -0
  7. package/package.json +111 -46
  8. package/dist/AniLink.js +0 -248
  9. package/dist/apis/anilist/Custom.js +0 -42
  10. package/dist/apis/anilist/interfaces/Activity.js +0 -436
  11. package/dist/apis/anilist/interfaces/Basic.js +0 -33
  12. package/dist/apis/anilist/interfaces/CoverImage.js +0 -15
  13. package/dist/apis/anilist/interfaces/Distribution.js +0 -23
  14. package/dist/apis/anilist/interfaces/ExternalLink.js +0 -14
  15. package/dist/apis/anilist/interfaces/Favoured.js +0 -2
  16. package/dist/apis/anilist/interfaces/FuzzyDate.js +0 -12
  17. package/dist/apis/anilist/interfaces/Image.js +0 -13
  18. package/dist/apis/anilist/interfaces/ListScores.js +0 -2
  19. package/dist/apis/anilist/interfaces/Media.js +0 -13
  20. package/dist/apis/anilist/interfaces/Name.js +0 -15
  21. package/dist/apis/anilist/interfaces/NextAiringEpisode.js +0 -14
  22. package/dist/apis/anilist/interfaces/Notification.js +0 -25
  23. package/dist/apis/anilist/interfaces/Ranking.js +0 -19
  24. package/dist/apis/anilist/interfaces/SiteTrend.js +0 -33
  25. package/dist/apis/anilist/interfaces/Staff.js +0 -2
  26. package/dist/apis/anilist/interfaces/Stat.js +0 -2
  27. package/dist/apis/anilist/interfaces/Statistics.js +0 -2
  28. package/dist/apis/anilist/interfaces/StreamingEpisode.js +0 -15
  29. package/dist/apis/anilist/interfaces/Studio.js +0 -2
  30. package/dist/apis/anilist/interfaces/Tag.js +0 -18
  31. package/dist/apis/anilist/interfaces/Title.js +0 -15
  32. package/dist/apis/anilist/interfaces/Trailer.js +0 -14
  33. package/dist/apis/anilist/interfaces/UserStats.js +0 -23
  34. package/dist/apis/anilist/interfaces/responses/mutation/Favourites.js +0 -83
  35. package/dist/apis/anilist/interfaces/responses/query/AiringSchedule.js +0 -18
  36. package/dist/apis/anilist/interfaces/responses/query/AniChartUser.js +0 -2
  37. package/dist/apis/anilist/interfaces/responses/query/Character.js +0 -34
  38. package/dist/apis/anilist/interfaces/responses/query/ExternalLinkSourceCollection.js +0 -2
  39. package/dist/apis/anilist/interfaces/responses/query/Media.js +0 -217
  40. package/dist/apis/anilist/interfaces/responses/query/MediaList.js +0 -36
  41. package/dist/apis/anilist/interfaces/responses/query/MediaListCollectionResponse.js +0 -49
  42. package/dist/apis/anilist/interfaces/responses/query/MediaTagCollection.js +0 -2
  43. package/dist/apis/anilist/interfaces/responses/query/MediaTrend.js +0 -21
  44. package/dist/apis/anilist/interfaces/responses/query/Notification.js +0 -166
  45. package/dist/apis/anilist/interfaces/responses/query/Recommendation.js +0 -23
  46. package/dist/apis/anilist/interfaces/responses/query/Review.js +0 -30
  47. package/dist/apis/anilist/interfaces/responses/query/SiteStatistics.js +0 -31
  48. package/dist/apis/anilist/interfaces/responses/query/Staff.js +0 -59
  49. package/dist/apis/anilist/interfaces/responses/query/Studio.js +0 -60
  50. package/dist/apis/anilist/interfaces/responses/query/Thread.js +0 -44
  51. package/dist/apis/anilist/interfaces/responses/query/ThreadComment.js +0 -31
  52. package/dist/apis/anilist/interfaces/responses/query/User.js +0 -366
  53. package/dist/apis/anilist/mutation/DeleteActivity.js +0 -61
  54. package/dist/apis/anilist/mutation/DeleteActivityReply.js +0 -61
  55. package/dist/apis/anilist/mutation/DeleteCustomList.js +0 -63
  56. package/dist/apis/anilist/mutation/DeleteMediaListEntry.js +0 -61
  57. package/dist/apis/anilist/mutation/DeleteReview.js +0 -61
  58. package/dist/apis/anilist/mutation/DeleteThread.js +0 -61
  59. package/dist/apis/anilist/mutation/DeleteThreadComment.js +0 -61
  60. package/dist/apis/anilist/mutation/SaveActivityReply.js +0 -66
  61. package/dist/apis/anilist/mutation/SaveListActivity.js +0 -64
  62. package/dist/apis/anilist/mutation/SaveMediaListEntry.js +0 -97
  63. package/dist/apis/anilist/mutation/SaveMessageActivity.js +0 -68
  64. package/dist/apis/anilist/mutation/SaveRecommendation.js +0 -66
  65. package/dist/apis/anilist/mutation/SaveReview.js +0 -68
  66. package/dist/apis/anilist/mutation/SaveTextActivity.js +0 -65
  67. package/dist/apis/anilist/mutation/SaveThread.js +0 -69
  68. package/dist/apis/anilist/mutation/SaveThreadComment.js +0 -67
  69. package/dist/apis/anilist/mutation/ToggleActivityPin.js +0 -64
  70. package/dist/apis/anilist/mutation/ToggleActivitySubscription.js +0 -64
  71. package/dist/apis/anilist/mutation/ToggleFavourite.js +0 -66
  72. package/dist/apis/anilist/mutation/ToggleFollow.js +0 -62
  73. package/dist/apis/anilist/mutation/ToggleLike.js +0 -64
  74. package/dist/apis/anilist/mutation/ToggleLikeV2.js +0 -64
  75. package/dist/apis/anilist/mutation/ToggleThreadSubscription.js +0 -64
  76. package/dist/apis/anilist/mutation/UpdateAniChartHighlights.js +0 -58
  77. package/dist/apis/anilist/mutation/UpdateAniChartSettings.js +0 -58
  78. package/dist/apis/anilist/mutation/UpdateFavouriteOrder.js +0 -73
  79. package/dist/apis/anilist/mutation/UpdateMediaListEntries.js +0 -93
  80. package/dist/apis/anilist/mutation/UpdateUser.js +0 -127
  81. package/dist/apis/anilist/query/Activity.js +0 -86
  82. package/dist/apis/anilist/query/ActivityReply.js +0 -60
  83. package/dist/apis/anilist/query/AiringSchedule.js +0 -78
  84. package/dist/apis/anilist/query/AniChartUser.js +0 -56
  85. package/dist/apis/anilist/query/Character.js +0 -70
  86. package/dist/apis/anilist/query/ExternalLinkSourceCollection.js +0 -68
  87. package/dist/apis/anilist/query/Follower.js +0 -64
  88. package/dist/apis/anilist/query/Following.js +0 -64
  89. package/dist/apis/anilist/query/GenreCollection.js +0 -46
  90. package/dist/apis/anilist/query/Markdown.js +0 -57
  91. package/dist/apis/anilist/query/Media.js +0 -134
  92. package/dist/apis/anilist/query/MediaList.js +0 -90
  93. package/dist/apis/anilist/query/MediaListCollection.js +0 -76
  94. package/dist/apis/anilist/query/MediaTagCollection.js +0 -57
  95. package/dist/apis/anilist/query/MediaTrend.js +0 -84
  96. package/dist/apis/anilist/query/Notification.js +0 -65
  97. package/dist/apis/anilist/query/Recommendation.js +0 -68
  98. package/dist/apis/anilist/query/Review.js +0 -64
  99. package/dist/apis/anilist/query/SiteStatistics.js +0 -78
  100. package/dist/apis/anilist/query/Staff.js +0 -79
  101. package/dist/apis/anilist/query/Studio.js +0 -82
  102. package/dist/apis/anilist/query/Thread.js +0 -68
  103. package/dist/apis/anilist/query/ThreadComment.js +0 -63
  104. package/dist/apis/anilist/query/User.js +0 -68
  105. package/dist/apis/anilist/query/Viewer.js +0 -65
  106. package/dist/apis/anilist/query/page/Activities.js +0 -97
  107. package/dist/apis/anilist/query/page/ActivityReplies.js +0 -71
  108. package/dist/apis/anilist/query/page/AiringSchedules.js +0 -89
  109. package/dist/apis/anilist/query/page/Characters.js +0 -81
  110. package/dist/apis/anilist/query/page/Followers.js +0 -75
  111. package/dist/apis/anilist/query/page/Followings.js +0 -75
  112. package/dist/apis/anilist/query/page/Likes.js +0 -71
  113. package/dist/apis/anilist/query/page/MediaLists.js +0 -101
  114. package/dist/apis/anilist/query/page/MediaTrends.js +0 -95
  115. package/dist/apis/anilist/query/page/Medias.js +0 -143
  116. package/dist/apis/anilist/query/page/Notifications.js +0 -73
  117. package/dist/apis/anilist/query/page/Recommendations.js +0 -79
  118. package/dist/apis/anilist/query/page/Reviews.js +0 -75
  119. package/dist/apis/anilist/query/page/Staffs.js +0 -90
  120. package/dist/apis/anilist/query/page/Studios.js +0 -93
  121. package/dist/apis/anilist/query/page/ThreadCommments.js +0 -74
  122. package/dist/apis/anilist/query/page/Threads.js +0 -79
  123. package/dist/apis/anilist/query/page/Users.js +0 -79
  124. package/dist/apis/anilist/types/ActivityType.js +0 -14
  125. package/dist/apis/anilist/types/DisabledListActivity.js +0 -11
  126. package/dist/apis/anilist/types/Format.js +0 -30
  127. package/dist/apis/anilist/types/FuzzyDate.js +0 -12
  128. package/dist/apis/anilist/types/MediaListOptions.js +0 -16
  129. package/dist/apis/anilist/types/NotificationOptions.js +0 -29
  130. package/dist/apis/anilist/types/RecommendationRating.js +0 -12
  131. package/dist/apis/anilist/types/Season.js +0 -13
  132. package/dist/apis/anilist/types/Sort.js +0 -265
  133. package/dist/apis/anilist/types/Source.js +0 -25
  134. package/dist/apis/anilist/types/Status.js +0 -26
  135. package/dist/apis/anilist/types/Type.js +0 -44
  136. package/dist/apis/anilist/types/UserStaffNameLanguage.js +0 -15
  137. package/dist/apis/anilist/types/UserTitleLanguage.js +0 -15
  138. package/dist/base/APIWrapper.js +0 -17
  139. package/dist/base/RequestHandler.js +0 -48
  140. package/dist/base/ValidateVariables.js +0 -125
@@ -1,79 +0,0 @@
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.RecommendationsQuery = void 0;
13
- const APIWrapper_1 = require("../../../../base/APIWrapper");
14
- const RequestHandler_1 = require("../../../../base/RequestHandler");
15
- const Recommendation_1 = require("../../interfaces/responses/query/Recommendation");
16
- const Sort_1 = require("../../types/Sort");
17
- const ValidateVariables_1 = require("../../../../base/ValidateVariables");
18
- /**
19
- * `RecommendationsQuery` is a class representing a query for recommendations.
20
- * It includes a method to get recommendations.
21
- */
22
- class RecommendationsQuery extends APIWrapper_1.APIWrapper {
23
- /**
24
- * Constructs a new `RecommendationsQuery` instance.
25
- *
26
- * @param authToken - The authentication token.
27
- */
28
- constructor(authToken) {
29
- super('https://graphql.anilist.co');
30
- this.authToken = authToken;
31
- }
32
- /**
33
- * `recommendations` is a method that sends a query request to get recommendations.
34
- *
35
- * @param variables - The variables for the query.
36
- * @returns The response from the query request.
37
- */
38
- recommendations(variables) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- if (!variables) {
41
- throw new Error('At least one variable must be set');
42
- }
43
- const variableTypeMappings = {
44
- page: 'number',
45
- perPage: 'number',
46
- id: 'number',
47
- mediaId: 'number',
48
- mediaRecommendationId: 'number',
49
- userId: 'number',
50
- rating: 'number',
51
- onList: 'boolean',
52
- rating_greater: 'number',
53
- rating_lesser: 'number',
54
- sort: Sort_1.RecommendationSortMappings,
55
- asHtml: 'boolean'
56
- };
57
- (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
58
- const query = `
59
- query ($page: Int, $perPage: Int, $id: Int, $mediaId: Int, $mediaRecommendationId: Int, $userId: Int, $rating: Int, $onList: Boolean, $rating_greater: Int, $rating_lesser: Int, $sort: [RecommendationSort], $asHtml: Boolean) {
60
- Page (page: $page, perPage: $perPage) {
61
- pageInfo {
62
- total
63
- perPage
64
- currentPage
65
- lastPage
66
- hasNextPage
67
- }
68
- recommendations (id: $id, mediaId: $mediaId, mediaRecommendationId: $mediaRecommendationId, userId: $userId, rating: $rating, onList: $onList, rating_greater: $rating_greater, rating_lesser: $rating_lesser, sort: $sort) {
69
- ${Recommendation_1.RecommendationSchema}
70
- }
71
- }
72
- }
73
- `;
74
- const data = { query, variables };
75
- return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
76
- });
77
- }
78
- }
79
- exports.RecommendationsQuery = RecommendationsQuery;
@@ -1,75 +0,0 @@
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.ReviewsQuery = void 0;
13
- const APIWrapper_1 = require("../../../../base/APIWrapper");
14
- const RequestHandler_1 = require("../../../../base/RequestHandler");
15
- const Review_1 = require("../../interfaces/responses/query/Review");
16
- const Sort_1 = require("../../types/Sort");
17
- const ValidateVariables_1 = require("../../../../base/ValidateVariables");
18
- /**
19
- * `ReviewsQuery` is a class representing a query for reviews.
20
- * It includes a method to get reviews.
21
- */
22
- class ReviewsQuery extends APIWrapper_1.APIWrapper {
23
- /**
24
- * Constructs a new `ReviewsQuery` instance.
25
- *
26
- * @param authToken - The authentication token.
27
- */
28
- constructor(authToken) {
29
- super('https://graphql.anilist.co');
30
- this.authToken = authToken;
31
- }
32
- /**
33
- * `reviews` is a method that sends a query request to get reviews.
34
- *
35
- * @param variables - The variables for the query.
36
- * @returns The response from the query request.
37
- */
38
- reviews(variables) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- if (!variables) {
41
- throw new Error('At least one variable must be set');
42
- }
43
- const variableTypeMappings = {
44
- page: 'number',
45
- perPage: 'number',
46
- id: 'number',
47
- mediaId: 'number',
48
- userId: 'number',
49
- mediaType: 'string',
50
- sort: Sort_1.ReviewSortMappings,
51
- asHtml: 'boolean'
52
- };
53
- (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
54
- const query = `
55
- query ($page: Int, $perPage: Int, $id: Int, $mediaId: Int, $userId: Int, $mediaType: MediaType, $sort: [ReviewSort], $asHtml: Boolean) {
56
- Page (page: $page, perPage: $perPage) {
57
- pageInfo {
58
- total
59
- perPage
60
- currentPage
61
- lastPage
62
- hasNextPage
63
- }
64
- reviews (id: $id, mediaId: $mediaId, userId: $userId, mediaType: $mediaType, sort: $sort) {
65
- ${Review_1.ReviewSchema}
66
- }
67
- }
68
- }
69
- `;
70
- const data = { query, variables };
71
- return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
72
- });
73
- }
74
- }
75
- exports.ReviewsQuery = ReviewsQuery;
@@ -1,90 +0,0 @@
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.StaffsQuery = void 0;
13
- const APIWrapper_1 = require("../../../../base/APIWrapper");
14
- const RequestHandler_1 = require("../../../../base/RequestHandler");
15
- const Staff_1 = require("../../interfaces/responses/query/Staff");
16
- const Sort_1 = require("../../types/Sort");
17
- const Type_1 = require("../../types/Type");
18
- const ValidateVariables_1 = require("../../../../base/ValidateVariables");
19
- /**
20
- * `StaffsQuery` is a class representing a query for staffs.
21
- * It includes a method to get staffs.
22
- */
23
- class StaffsQuery extends APIWrapper_1.APIWrapper {
24
- /**
25
- * Constructs a new `StaffsQuery` instance.
26
- *
27
- * @param authToken - The authentication token.
28
- */
29
- constructor(authToken) {
30
- super('https://graphql.anilist.co');
31
- this.authToken = authToken;
32
- }
33
- /**
34
- * `staffs` is a method that sends a query request to get staffs.
35
- *
36
- * @param variables - The variables for the query.
37
- * @returns The response from the query request.
38
- */
39
- staffs(variables) {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- if (!variables) {
42
- throw new Error('At least one variable must be set');
43
- }
44
- const variableTypeMappings = {
45
- page: 'number',
46
- perPage: 'number',
47
- id: 'number',
48
- isBirthday: 'boolean',
49
- search: 'String',
50
- id_not: 'number',
51
- id_in: 'number[]',
52
- id_not_in: 'number[]',
53
- sort: Sort_1.StaffSortMappings,
54
- asHtml: 'boolean',
55
- staffMediaSort: Sort_1.MediaSortMappings,
56
- staffMediaType: Type_1.MediaTypeMappings,
57
- staffMediaOnList: 'boolean',
58
- staffMediaPage: 'number',
59
- staffMediaPerPage: 'number',
60
- charactersSort: Sort_1.CharacterSortMappings,
61
- charactersPage: 'number',
62
- charactersPerPage: 'number',
63
- characterMediaSort: Sort_1.MediaSortMappings,
64
- characterMediaOnList: 'boolean',
65
- characterMediaPage: 'number',
66
- characterMediaPerPage: 'number'
67
- };
68
- (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
69
- const query = `
70
- query ($page: Int, $perPage: Int, $id: Int, $isBirthday: Boolean, $search: String, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $sort: [StaffSort], $asHtml: Boolean, $staffMediaSort: [MediaSort], $staffMediaType: MediaType, $staffMediaOnList: Boolean, $staffMediaPage: Int, $staffMediaPerPage: Int, $charactersSort: [CharacterSort], $charactersPage: Int, $charactersPerPage: Int, $characterMediaSort: [MediaSort], $characterMediaOnList: Boolean, $characterMediaPage: Int, $characterMediaPerPage: Int) {
71
- Page (page: $page, perPage: $perPage) {
72
- pageInfo {
73
- total
74
- perPage
75
- currentPage
76
- lastPage
77
- hasNextPage
78
- }
79
- staff (id: $id, isBirthday: $isBirthday, search: $search, id_not: $id_not, id_in: $id_in, id_not_in: $id_not_in, sort: $sort) {
80
- ${Staff_1.StaffSchema}
81
- }
82
- }
83
- }
84
- `;
85
- const data = { query, variables };
86
- return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
87
- });
88
- }
89
- }
90
- exports.StaffsQuery = StaffsQuery;
@@ -1,93 +0,0 @@
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.StudiosQuery = void 0;
13
- const APIWrapper_1 = require("../../../../base/APIWrapper");
14
- const RequestHandler_1 = require("../../../../base/RequestHandler");
15
- const Studio_1 = require("../../interfaces/responses/query/Studio");
16
- const Sort_1 = require("../../types/Sort");
17
- const ValidateVariables_1 = require("../../../../base/ValidateVariables");
18
- /**
19
- * `StudiosQuery` is a class representing a query for studios.
20
- * It includes a method to get studios.
21
- */
22
- class StudiosQuery extends APIWrapper_1.APIWrapper {
23
- /**
24
- * Constructs a new `StudiosQuery` instance.
25
- *
26
- * @param authToken - The authentication token.
27
- */
28
- constructor(authToken) {
29
- super('https://graphql.anilist.co');
30
- this.authToken = authToken;
31
- }
32
- /**
33
- * `studios` is a method that sends a query request to get studios.
34
- *
35
- * @param variables - The variables for the query.
36
- * @returns The response from the query request.
37
- */
38
- studios(variables) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- if (!variables) {
41
- throw new Error('At least one variable must be provided');
42
- }
43
- const variableTypeMappings = {
44
- page: 'number',
45
- perPage: 'number',
46
- id: 'number',
47
- search: 'string',
48
- id_not: 'number',
49
- id_in: 'number[]',
50
- id_not_in: 'number[]',
51
- sort: Sort_1.StudioSortMappings,
52
- asHtml: 'boolean',
53
- mediaSort: Sort_1.MediaSortMappings,
54
- mediaIsMain: 'boolean',
55
- mediaOnList: 'boolean',
56
- mediaPage: 'number',
57
- mediaPerPage: 'number',
58
- staffMediaSort: Sort_1.MediaSortMappings,
59
- staffMediaType: 'string',
60
- staffMediaOnList: 'boolean',
61
- staffMediaPage: 'number',
62
- staffMediaPerPage: 'number',
63
- charactersSort: Sort_1.CharacterSortMappings,
64
- charactersPage: 'number',
65
- charactersPerPage: 'number',
66
- characterMediaSort: Sort_1.MediaSortMappings,
67
- characterMediaOnList: 'boolean',
68
- characterMediaPage: 'number',
69
- characterMediaPerPage: 'number'
70
- };
71
- (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
72
- const query = `
73
- query ($page: Int, $perPage: Int, $id: Int, $search: String, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $sort: [StudioSort], $asHtml: Boolean, $mediaSort: [MediaSort], $mediaIsMain: Boolean, $mediaOnList: Boolean, $mediaPage: Int, $mediaPerPage: Int, $staffMediaSort: [MediaSort], $staffMediaType: MediaType, $staffMediaOnList: Boolean, $staffMediaPage: Int, $staffMediaPerPage: Int, $charactersSort: [CharacterSort], $charactersPage: Int, $charactersPerPage: Int, $characterMediaSort: [MediaSort], $characterMediaOnList: Boolean, $characterMediaPage: Int, $characterMediaPerPage: Int) {
74
- Page (page: $page, perPage: $perPage) {
75
- pageInfo {
76
- total
77
- perPage
78
- currentPage
79
- lastPage
80
- hasNextPage
81
- }
82
- studios (id: $id, search: $search, id_not: $id_not, id_in: $id_in, id_not_in: $id_not_in, sort: $sort) {
83
- ${Studio_1.StudioSchema}
84
- }
85
- }
86
- }
87
- `;
88
- const data = { query, variables };
89
- return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
90
- });
91
- }
92
- }
93
- exports.StudiosQuery = StudiosQuery;
@@ -1,74 +0,0 @@
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.ThreadCommentsQuery = void 0;
13
- const APIWrapper_1 = require("../../../../base/APIWrapper");
14
- const RequestHandler_1 = require("../../../../base/RequestHandler");
15
- const ThreadComment_1 = require("../../interfaces/responses/query/ThreadComment");
16
- const Sort_1 = require("../../types/Sort");
17
- const ValidateVariables_1 = require("../../../../base/ValidateVariables");
18
- /**
19
- * `ThreadCommentsQuery` is a class representing a query for thread comments.
20
- * It includes a method to get thread comments.
21
- */
22
- class ThreadCommentsQuery extends APIWrapper_1.APIWrapper {
23
- /**
24
- * Constructs a new `ThreadCommentsQuery` instance.
25
- *
26
- * @param authToken - The authentication token.
27
- */
28
- constructor(authToken) {
29
- super('https://graphql.anilist.co');
30
- this.authToken = authToken;
31
- }
32
- /**
33
- * `threadComments` is a method that sends a query request to get thread comments.
34
- *
35
- * @param variables - The variables for the query.
36
- * @returns The response from the query request.
37
- */
38
- threadComments(variables) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- if (!variables) {
41
- throw new Error('At least one variable must be provided');
42
- }
43
- const variableTypeMappings = {
44
- page: 'number',
45
- perPage: 'number',
46
- id: 'number',
47
- threadId: 'number',
48
- userId: 'number',
49
- sort: Sort_1.ThreadSortMappings,
50
- asHtml: 'boolean'
51
- };
52
- (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
53
- const query = `
54
- query ($page: Int, $perPage: Int, $id: Int, $threadId: Int, $userId: Int, $sort: [ThreadCommentSort], $asHtml: Boolean) {
55
- Page (page: $page, perPage: $perPage) {
56
- pageInfo {
57
- total
58
- perPage
59
- currentPage
60
- lastPage
61
- hasNextPage
62
- }
63
- threadComments (id: $id, threadId: $threadId, userId: $userId, sort: $sort) {
64
- ${ThreadComment_1.ThreadCommentSchema}
65
- }
66
- }
67
- }
68
- `;
69
- const data = { query, variables };
70
- return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
71
- });
72
- }
73
- }
74
- exports.ThreadCommentsQuery = ThreadCommentsQuery;
@@ -1,79 +0,0 @@
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.ThreadsQuery = void 0;
13
- const APIWrapper_1 = require("../../../../base/APIWrapper");
14
- const RequestHandler_1 = require("../../../../base/RequestHandler");
15
- const Thread_1 = require("../../interfaces/responses/query/Thread");
16
- const Sort_1 = require("../../types/Sort");
17
- const ValidateVariables_1 = require("../../../../base/ValidateVariables");
18
- /**
19
- * `ThreadsQuery` is a class representing a query for threads.
20
- * It includes a method to get threads.
21
- */
22
- class ThreadsQuery extends APIWrapper_1.APIWrapper {
23
- /**
24
- * Constructs a new `ThreadsQuery` instance.
25
- *
26
- * @param authToken - The authentication token.
27
- */
28
- constructor(authToken) {
29
- super('https://graphql.anilist.co');
30
- this.authToken = authToken;
31
- }
32
- /**
33
- * `threads` is a method that sends a query request to get threads.
34
- *
35
- * @param variables - The variables for the query.
36
- * @returns The response from the query request.
37
- */
38
- threads(variables) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- if (!variables) {
41
- throw new Error('At least one variable must be provided');
42
- }
43
- const variableTypeMappings = {
44
- page: 'number',
45
- perPage: 'number',
46
- id: 'number',
47
- userId: 'number',
48
- replyUserId: 'number',
49
- subscribed: 'boolean',
50
- categoryId: 'number',
51
- mediaCategoryId: 'number',
52
- search: 'string',
53
- id_in: 'number[]',
54
- sort: Sort_1.ThreadSortMappings,
55
- asHtml: 'boolean'
56
- };
57
- (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
58
- const query = `
59
- query ($page: Int, $perPage: Int, $id: Int, $userId: Int, $replyUserId: Int, $subscribed: Boolean, $categoryId: Int, $mediaCategoryId: Int, $search: String, $id_in: [Int], $sort: [ThreadSort], $asHtml: Boolean) {
60
- Page (page: $page, perPage: $perPage) {
61
- pageInfo {
62
- total
63
- perPage
64
- currentPage
65
- lastPage
66
- hasNextPage
67
- }
68
- threads (id: $id, userId: $userId, replyUserId: $replyUserId, subscribed: $subscribed, categoryId: $categoryId, mediaCategoryId: $mediaCategoryId, search: $search, id_in: $id_in, sort: $sort) {
69
- ${Thread_1.ThreadSchema}
70
- }
71
- }
72
- }
73
- `;
74
- const data = { query, variables };
75
- return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
76
- });
77
- }
78
- }
79
- exports.ThreadsQuery = ThreadsQuery;
@@ -1,79 +0,0 @@
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.UsersQuery = void 0;
13
- const APIWrapper_1 = require("../../../../base/APIWrapper");
14
- const RequestHandler_1 = require("../../../../base/RequestHandler");
15
- const User_1 = require("../../interfaces/responses/query/User");
16
- const Sort_1 = require("../../types/Sort");
17
- const ValidateVariables_1 = require("../../../../base/ValidateVariables");
18
- /**
19
- * `UsersQuery` is a class representing a query for users.
20
- * It includes a method to get users.
21
- */
22
- class UsersQuery extends APIWrapper_1.APIWrapper {
23
- /**
24
- * Constructs a new `UsersQuery` instance.
25
- *
26
- * @param authToken - The authentication token.
27
- */
28
- constructor(authToken) {
29
- super('https://graphql.anilist.co');
30
- this.authToken = authToken;
31
- }
32
- /**
33
- * `users` is a method that sends a query request to get users.
34
- *
35
- * @param variables - The variables for the query.
36
- * @returns The response from the query request.
37
- */
38
- users(variables) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- if (!variables) {
41
- throw new Error('At least one variable must be provided');
42
- }
43
- const variableTypeMappings = {
44
- page: 'number',
45
- perPage: 'number',
46
- id: 'number',
47
- name: 'string',
48
- isModerator: 'boolean',
49
- search: 'string',
50
- sort: Sort_1.UserSortMappings,
51
- asHtml: 'boolean',
52
- animeStatLimit: 'number',
53
- mangaStatLimit: 'number',
54
- animeStatSort: Sort_1.UserStatisticSortMappings,
55
- mangaStatSort: Sort_1.UserStatisticSortMappings
56
- };
57
- (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
58
- const query = `
59
- query ($page: Int, $perPage: Int, $id: Int, $name: String, $isModerator: Boolean, $search: String, $sort: [UserSort], $asHtml: Boolean, $animeStatLimit: Int, $mangaStatLimit: Int, $animeStatSort: [UserStatisticsSort], $mangaStatSort: [UserStatisticsSort]) {
60
- Page (page: $page, perPage: $perPage) {
61
- pageInfo {
62
- total
63
- perPage
64
- currentPage
65
- lastPage
66
- hasNextPage
67
- }
68
- users (id: $id, name: $name, isModerator: $isModerator, search: $search, sort: $sort) {
69
- ${User_1.UserSchema}
70
- }
71
- }
72
- }
73
- `;
74
- const data = { query, variables };
75
- return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
76
- });
77
- }
78
- }
79
- exports.UsersQuery = UsersQuery;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActivityTypeMappings = void 0;
4
- /**
5
- * `ActivityTypeMappings` is a mapping of `ActivityType` enum values to their corresponding string values.
6
- * It can be one of the following: 'TEXT', 'ANIME_LIST', 'MANGA_LIST', 'MESSAGE', 'MEDIA_LIST'.
7
- */
8
- exports.ActivityTypeMappings = [
9
- 'TEXT',
10
- 'ANIME_LIST',
11
- 'MANGA_LIST',
12
- 'MESSAGE',
13
- 'MEDIA_LIST'
14
- ];
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DisabledListActivityMapping = void 0;
4
- /**
5
- * `DisabledListActivityMapping` is a constant that maps the `DisabledListActivity` fields to their expected types.
6
- * The `disabled` field is mapped to 'boolean', and the `type` field is mapped to an array of possible values.
7
- */
8
- exports.DisabledListActivityMapping = {
9
- disabled: 'boolean',
10
- type: ['CURRENT', 'PLANNING', 'COMPLETED', 'DROPPED', 'PAUSED', 'REPEATING']
11
- };
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScoreFormatMapping = exports.MediaFormatMappings = void 0;
4
- /**
5
- * `MediaFormatMappings` is a mapping of `MediaFormat` enum values to their corresponding string values.
6
- * It can be one of the following: 'TV', 'TV_SHORT', 'MOVIE', 'SPECIAL', 'OVA', 'ONA', 'MUSIC', 'MANGA', 'NOVEL', 'ONE_SHOT'.
7
- */
8
- exports.MediaFormatMappings = [
9
- 'TV',
10
- 'TV_SHORT',
11
- 'MOVIE',
12
- 'SPECIAL',
13
- 'OVA',
14
- 'ONA',
15
- 'MUSIC',
16
- 'MANGA',
17
- 'NOVEL',
18
- 'ONE_SHOT'
19
- ];
20
- /**
21
- * `ScoreFormatMapping` is a mapping of `ScoreFormat` values to their string representations.
22
- * It can be one of the following: 'POINT_100', 'POINT_10_DECIMAL', 'POINT_10', 'POINT_5', 'POINT_3'.
23
- */
24
- exports.ScoreFormatMapping = [
25
- 'POINT_100',
26
- 'POINT_10_DECIMAL',
27
- 'POINT_10',
28
- 'POINT_5',
29
- 'POINT_3'
30
- ];
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FuzzyDateMappings = void 0;
4
- /**
5
- * `FuzzyDateMappings` is a constant that maps the `FuzzyDateInput` fields to their expected types.
6
- * The `year`, `month`, and `day` fields are mapped to 'number'.
7
- */
8
- exports.FuzzyDateMappings = {
9
- year: 'number',
10
- month: 'number',
11
- day: 'number'
12
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MediaListOptionsMapping = void 0;
4
- /**
5
- * `MediaListOptionsMapping` is a constant that maps the `MediaListOptions` fields to their expected types.
6
- * The `sectionOrder`, `customLists`, `advancedScoring`, and `theme` fields are mapped to 'string',
7
- * and the `splitCompletedSectionByFormat` and `advancedScoringEnabled` fields are mapped to 'boolean'.
8
- */
9
- exports.MediaListOptionsMapping = {
10
- sectionOrder: 'string',
11
- splitCompletedSectionByFormat: 'boolean',
12
- customLists: 'string',
13
- advancedScoring: 'string',
14
- advancedScoringEnabled: 'boolean',
15
- theme: 'string'
16
- };