anilink-api-wrapper 1.18.6 → 1.20.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/README.md +49 -17
- package/dist/AniLink.js +11 -2
- package/dist/apis/anilist/interfaces/Activity.js +28 -1
- package/dist/apis/anilist/mutation/DeleteCustomList.js +60 -0
- package/dist/apis/anilist/mutation/DeleteMediaListEntry.js +58 -0
- package/dist/apis/anilist/mutation/SaveMediaListEntry.js +2 -2
- package/dist/apis/anilist/mutation/SaveTextActivity.js +62 -0
- package/dist/apis/anilist/mutation/UpdateMediaListEntries.js +2 -2
- package/dist/apis/anilist/mutation/UpdateUser.js +2 -2
- package/dist/apis/anilist/query/Activity.js +2 -2
- package/dist/apis/anilist/query/ActivityReply.js +1 -1
- package/dist/apis/anilist/query/AiringSchedule.js +2 -2
- package/dist/apis/anilist/query/Character.js +20 -0
- package/dist/apis/anilist/query/ExternalLinkSourceCollection.js +10 -0
- package/dist/apis/anilist/query/Follower.js +14 -0
- package/dist/apis/anilist/query/Following.js +14 -0
- package/dist/apis/anilist/query/Markdown.js +9 -1
- package/dist/apis/anilist/query/Media.js +84 -0
- package/dist/apis/anilist/query/MediaList.js +40 -0
- package/dist/apis/anilist/query/MediaListCollection.js +32 -0
- package/dist/apis/anilist/query/MediaTagCollection.js +7 -0
- package/dist/apis/anilist/query/MediaTrend.js +34 -0
- package/dist/apis/anilist/query/Notification.js +12 -0
- package/dist/apis/anilist/query/Recommendation.js +20 -2
- package/dist/apis/anilist/query/Review.js +14 -0
- package/dist/apis/anilist/query/SiteStatistics.js +28 -0
- package/dist/apis/anilist/query/Staff.js +29 -0
- package/dist/apis/anilist/query/Studio.js +32 -0
- package/dist/apis/anilist/query/Thread.js +18 -0
- package/dist/apis/anilist/query/ThreadComment.js +13 -0
- package/dist/apis/anilist/query/User.js +18 -0
- package/dist/apis/anilist/query/Viewer.js +14 -2
- package/dist/apis/anilist/query/page/Activities.js +38 -0
- package/dist/apis/anilist/query/page/ActivityReplies.js +12 -0
- package/dist/apis/anilist/query/page/AiringSchedules.js +30 -0
- package/dist/apis/anilist/query/page/Characters.js +22 -0
- package/dist/apis/anilist/query/page/Followers.js +16 -0
- package/dist/apis/anilist/query/page/Followings.js +16 -0
- package/dist/apis/anilist/query/page/Likes.js +12 -0
- package/dist/apis/anilist/query/page/MediaLists.js +42 -0
- package/dist/apis/anilist/query/page/MediaTrends.js +36 -0
- package/dist/apis/anilist/query/page/Medias.js +86 -0
- package/dist/apis/anilist/query/page/Notifications.js +14 -0
- package/dist/apis/anilist/query/page/Recommendations.js +20 -0
- package/dist/apis/anilist/query/page/Reviews.js +16 -0
- package/dist/apis/anilist/query/page/Staffs.js +31 -0
- package/dist/apis/anilist/query/page/Studios.js +34 -0
- package/dist/apis/anilist/query/page/ThreadCommments.js +15 -0
- package/dist/apis/anilist/query/page/Threads.js +20 -0
- package/dist/apis/anilist/query/page/Users.js +20 -0
- package/dist/apis/anilist/types/Format.js +30 -0
- package/dist/apis/anilist/types/Season.js +13 -0
- package/dist/apis/anilist/types/Sort.js +240 -1
- package/dist/apis/anilist/types/Source.js +25 -0
- package/dist/apis/anilist/types/Status.js +26 -0
- package/dist/apis/anilist/types/Type.js +44 -0
- package/package.json +1 -1
- package/.eslintrc.js +0 -16
- package/.gitattributes +0 -1
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.MarkdownQuery = void 0;
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
15
16
|
/**
|
|
16
17
|
* `MarkdownQuery` is a class representing a query for converting markdown text to HTML.
|
|
17
18
|
* It includes a method to send the markdown text and receive the converted HTML.
|
|
@@ -27,13 +28,20 @@ class MarkdownQuery extends APIWrapper_1.APIWrapper {
|
|
|
27
28
|
this.authToken = authToken;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
|
-
* `markdown` is a method that sends a query request to convert
|
|
31
|
+
* `markdown` is a method that sends a query request to convert Markdown text to HTML.
|
|
31
32
|
*
|
|
32
33
|
* @param variables - The variables for the query.
|
|
33
34
|
* @returns The response from the query request.
|
|
34
35
|
*/
|
|
35
36
|
markdown(variables) {
|
|
36
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (!variables.markdown) {
|
|
39
|
+
throw new Error('Markdown variable is required.');
|
|
40
|
+
}
|
|
41
|
+
const variableTypeMapppings = {
|
|
42
|
+
markdown: 'string'
|
|
43
|
+
};
|
|
44
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMapppings);
|
|
37
45
|
const query = `
|
|
38
46
|
query ($markdown: String!) {
|
|
39
47
|
Markdown (markdown: $markdown) {
|
|
@@ -13,6 +13,14 @@ exports.MediaQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const Media_1 = require("../interfaces/responses/query/Media");
|
|
16
|
+
const FuzzyDate_1 = require("../types/FuzzyDate");
|
|
17
|
+
const Type_1 = require("../types/Type");
|
|
18
|
+
const Season_1 = require("../types/Season");
|
|
19
|
+
const Format_1 = require("../types/Format");
|
|
20
|
+
const Status_1 = require("../types/Status");
|
|
21
|
+
const Source_1 = require("../types/Source");
|
|
22
|
+
const Sort_1 = require("../types/Sort");
|
|
23
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
24
|
/**
|
|
17
25
|
* `MediaQuery` is a class representing a query for media data.
|
|
18
26
|
* It includes a method to send the media query and receive the response.
|
|
@@ -35,6 +43,82 @@ class MediaQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
43
|
*/
|
|
36
44
|
media(variables) {
|
|
37
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
if (!variables) {
|
|
47
|
+
throw new Error('At least one variable must be set');
|
|
48
|
+
}
|
|
49
|
+
const variableTypeMappings = {
|
|
50
|
+
id: 'number',
|
|
51
|
+
idMal: 'number',
|
|
52
|
+
startDate: FuzzyDate_1.FuzzyDateMappings,
|
|
53
|
+
endDate: FuzzyDate_1.FuzzyDateMappings,
|
|
54
|
+
season: Season_1.MediaSeasonMappings,
|
|
55
|
+
seasonYear: 'number',
|
|
56
|
+
type: Type_1.MediaTypeMappings,
|
|
57
|
+
format: Format_1.MediaFormatMappings,
|
|
58
|
+
status: Status_1.MediaStatusMappings,
|
|
59
|
+
episodes: 'number',
|
|
60
|
+
duration: 'number',
|
|
61
|
+
chapters: 'number',
|
|
62
|
+
volumes: 'number',
|
|
63
|
+
isAdult: 'boolean',
|
|
64
|
+
genre: 'string',
|
|
65
|
+
tag: 'string',
|
|
66
|
+
minimumTagRank: 'number',
|
|
67
|
+
tagCategory: 'string',
|
|
68
|
+
onList: 'boolean',
|
|
69
|
+
licensedBy: 'string',
|
|
70
|
+
licensedById: 'number',
|
|
71
|
+
averageScore: 'number',
|
|
72
|
+
popularity: 'number',
|
|
73
|
+
source: Source_1.MediaSourceMappings,
|
|
74
|
+
countryOfOrigin: 'CountryCode',
|
|
75
|
+
isLicensed: 'boolean',
|
|
76
|
+
search: 'string',
|
|
77
|
+
id_not: 'number',
|
|
78
|
+
id_in: 'number[]',
|
|
79
|
+
id_not_in: 'number[]',
|
|
80
|
+
idMal_not: 'number',
|
|
81
|
+
idMal_in: 'number[]',
|
|
82
|
+
idMal_not_in: 'number[]',
|
|
83
|
+
startDate_greater: FuzzyDate_1.FuzzyDateMappings,
|
|
84
|
+
startDate_lesser: FuzzyDate_1.FuzzyDateMappings,
|
|
85
|
+
startDate_like: 'string',
|
|
86
|
+
endDate_greater: FuzzyDate_1.FuzzyDateMappings,
|
|
87
|
+
endDate_lesser: FuzzyDate_1.FuzzyDateMappings,
|
|
88
|
+
endDate_like: 'string',
|
|
89
|
+
format_in: Format_1.MediaFormatMappings,
|
|
90
|
+
format_not: Format_1.MediaFormatMappings,
|
|
91
|
+
format_not_in: Format_1.MediaFormatMappings,
|
|
92
|
+
status_in: Status_1.MediaStatusMappings,
|
|
93
|
+
status_not: Status_1.MediaStatusMappings,
|
|
94
|
+
status_not_in: Status_1.MediaStatusMappings,
|
|
95
|
+
episodes_greater: 'number',
|
|
96
|
+
episodes_lesser: 'number',
|
|
97
|
+
duration_greater: 'number',
|
|
98
|
+
duration_lesser: 'number',
|
|
99
|
+
chapters_greater: 'number',
|
|
100
|
+
chapters_lesser: 'number',
|
|
101
|
+
volumes_greater: 'number',
|
|
102
|
+
volumes_lesser: 'number',
|
|
103
|
+
genre_in: 'string[]',
|
|
104
|
+
genre_not_in: 'string[]',
|
|
105
|
+
tag_in: 'string[]',
|
|
106
|
+
tag_not_in: 'string[]',
|
|
107
|
+
tagCategory_in: 'string[]',
|
|
108
|
+
tagCategory_not_in: 'string[]',
|
|
109
|
+
licensedBy_in: 'string[]',
|
|
110
|
+
licensedById_in: 'number[]',
|
|
111
|
+
averageScore_not: 'number',
|
|
112
|
+
averageScore_greater: 'number',
|
|
113
|
+
averageScore_lesser: 'number',
|
|
114
|
+
popularity_not: 'number',
|
|
115
|
+
popularity_greater: 'number',
|
|
116
|
+
popularity_lesser: 'number',
|
|
117
|
+
source_in: Source_1.MediaSourceMappings,
|
|
118
|
+
sort: Sort_1.MediaSortMappings,
|
|
119
|
+
asHtml: 'boolean'
|
|
120
|
+
};
|
|
121
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
122
|
const query = `
|
|
39
123
|
query ($id: Int, $idMal: Int, $startDate: FuzzyDateInt, $endDate: FuzzyDateInt, $season: MediaSeason, $seasonYear: Int, $type: MediaType, $format: MediaFormat, $status: MediaStatus, $episodes: Int, $duration: Int, $chapters: Int, $volumes: Int, $isAdult: Boolean, $genre: String, $tag: String, $minimumTagRank: Int, $tagCategory: String, $onList: Boolean, $licensedBy: String, $licensedById: Int, $averageScore: Int, $popularity: Int, $source: MediaSource, $countryOfOrigin: CountryCode, $isLicensed: Boolean, $search: String, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $idMal_not: Int, $idMal_in: [Int], $idMal_not_in: [Int], $startDate_greater: FuzzyDateInt, $startDate_lesser: FuzzyDateInt, $startDate_like: String, $endDate_greater: FuzzyDateInt, $endDate_lesser: FuzzyDateInt, $endDate_like: String, $format_in: [MediaFormat], $format_not: MediaFormat, $format_not_in: [MediaFormat], $status_in: [MediaStatus], $status_not: MediaStatus, $status_not_in: [MediaStatus], $episodes_greater: Int, $episodes_lesser: Int, $duration_greater: Int, $duration_lesser: Int, $chapters_greater: Int, $chapters_lesser: Int, $volumes_greater: Int, $volumes_lesser: Int, $genre_in: [String], $genre_not_in: [String], $tag_in: [String], $tag_not_in: [String], $tagCategory_in: [String], $tagCategory_not_in: [String], $licensedBy_in: [String], $licensedById_in: [Int], $averageScore_not: Int, $averageScore_greater: Int, $averageScore_lesser: Int, $popularity_not: Int, $popularity_greater: Int, $popularity_lesser: Int, $source_in: [MediaSource], $sort: [MediaSort], $asHtml: Boolean) {
|
|
40
124
|
Media (id: $id, idMal: $idMal, startDate: $startDate, endDate: $endDate, season: $season, seasonYear: $seasonYear, type: $type, format: $format, status: $status, episodes: $episodes, duration: $duration, chapters: $chapters, volumes: $volumes, isAdult: $isAdult, genre: $genre, tag: $tag, minimumTagRank: $minimumTagRank, tagCategory: $tagCategory, onList: $onList, licensedBy: $licensedBy, licensedById: $licensedById, averageScore: $averageScore, popularity: $popularity, source: $source, countryOfOrigin: $countryOfOrigin, isLicensed: $isLicensed, search: $search, id_not: $id_not, id_in: $id_in, id_not_in: $id_not_in, idMal_not: $idMal_not, idMal_in: $idMal_in, idMal_not_in: $idMal_not_in, startDate_greater: $startDate_greater, startDate_lesser: $startDate_lesser, startDate_like: $startDate_like, endDate_greater: $endDate_greater, endDate_lesser: $endDate_lesser, endDate_like: $endDate_like, format_in: $format_in, format_not: $format_not, format_not_in: $format_not_in, status_in: $status_in, status_not: $status_not, status_not_in: $status_not_in, episodes_greater: $episodes_greater, episodes_lesser: $episodes_lesser, duration_greater: $duration_greater, duration_lesser: $duration_lesser, chapters_greater: $chapters_greater, chapters_lesser: $chapters_lesser, volumes_greater: $volumes_greater, volumes_lesser: $volumes_lesser, genre_in: $genre_in, genre_not_in: $genre_not_in, tag_in: $tag_in, tag_not_in: $tag_not_in, tagCategory_in: $tagCategory_in, tagCategory_not_in: $tagCategory_not_in, licensedBy_in: $licensedBy_in, licensedById_in: $licensedById_in, averageScore_not: $averageScore_not, averageScore_greater: $averageScore_greater, averageScore_lesser: $averageScore_lesser, popularity_not: $popularity_not, popularity_greater: $popularity_greater, popularity_lesser: $popularity_lesser, source_in: $source_in, sort: $sort) {
|
|
@@ -13,6 +13,12 @@ exports.MediaListQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const MediaList_1 = require("../interfaces/responses/query/MediaList");
|
|
16
|
+
const Type_1 = require("../types/Type");
|
|
17
|
+
const Status_1 = require("../types/Status");
|
|
18
|
+
const FuzzyDate_1 = require("../types/FuzzyDate");
|
|
19
|
+
const Sort_1 = require("../types/Sort");
|
|
20
|
+
const Format_1 = require("../types/Format");
|
|
21
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
22
|
/**
|
|
17
23
|
* `MediaListQuery` is a class representing a query for media list data.
|
|
18
24
|
* It includes a method to send the media list query and receive the response.
|
|
@@ -35,6 +41,40 @@ class MediaListQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
41
|
*/
|
|
36
42
|
mediaList(variables) {
|
|
37
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
if (!variables) {
|
|
45
|
+
throw new Error('At least one variable must be set');
|
|
46
|
+
}
|
|
47
|
+
const variableTypeMappings = {
|
|
48
|
+
id: 'number',
|
|
49
|
+
userId: 'number',
|
|
50
|
+
userName: 'string',
|
|
51
|
+
type: Type_1.MediaTypeMappings,
|
|
52
|
+
status: Status_1.MediaListStatusMappings,
|
|
53
|
+
mediaId: 'number',
|
|
54
|
+
isFollowing: 'boolean',
|
|
55
|
+
notes: 'string',
|
|
56
|
+
startedAt: FuzzyDate_1.FuzzyDateMappings,
|
|
57
|
+
completedAt: FuzzyDate_1.FuzzyDateMappings,
|
|
58
|
+
compareWithAuthList: 'boolean',
|
|
59
|
+
userId_in: 'number[]',
|
|
60
|
+
status_in: Status_1.MediaListStatusMappings,
|
|
61
|
+
status_not_in: Status_1.MediaListStatusMappings,
|
|
62
|
+
status_not: Status_1.MediaListStatusMappings,
|
|
63
|
+
mediaId_in: 'number[]',
|
|
64
|
+
mediaId_not_in: 'number[]',
|
|
65
|
+
notes_like: 'string',
|
|
66
|
+
startedAt_greater: FuzzyDate_1.FuzzyDateMappings,
|
|
67
|
+
startedAt_lesser: FuzzyDate_1.FuzzyDateMappings,
|
|
68
|
+
startedAt_like: 'string',
|
|
69
|
+
completedAt_greater: FuzzyDate_1.FuzzyDateMappings,
|
|
70
|
+
completedAt_lesser: FuzzyDate_1.FuzzyDateMappings,
|
|
71
|
+
completedAt_like: 'string',
|
|
72
|
+
sort: Sort_1.MediaListSortMappings,
|
|
73
|
+
scoreFormat: Format_1.ScoreFormatMapping,
|
|
74
|
+
asArray: 'boolean',
|
|
75
|
+
asHtml: 'boolean'
|
|
76
|
+
};
|
|
77
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
78
|
const query = `
|
|
39
79
|
query ($id: Int, $userId: Int, $userName: String, $type: MediaType, $status: MediaListStatus, $mediaId: Int, $isFollowing: Boolean, $notes: String, $startedAt: FuzzyDateInt, $completedAt: FuzzyDateInt, $compareWithAuthList: Boolean, $userId_in: [Int], $status_in: [MediaListStatus], $status_not_in: [MediaListStatus], $status_not: MediaListStatus, $mediaId_in: [Int], $mediaId_not_in: [Int], $notes_like: String, $startedAt_greater: FuzzyDateInt, $startedAt_lesser: FuzzyDateInt, $startedAt_like: String, $completedAt_greater: FuzzyDateInt, $completedAt_lesser: FuzzyDateInt, $completedAt_like: String, $ScoreFormat: ScoreFormat, $asArray: Boolean, $asHtml: Boolean) {
|
|
40
80
|
MediaList (id: $id, userId: $userId, userName: $userName, type: $type, status: $status, mediaId: $mediaId, isFollowing: $isFollowing, notes: $notes, startedAt: $startedAt, completedAt: $completedAt, compareWithAuthList: $compareWithAuthList, userId_in: $userId_in, status_in: $status_in, status_not_in: $status_not_in, status_not: $status_not, mediaId_in: $mediaId_in, mediaId_not_in: $mediaId_not_in, notes_like: $notes_like, startedAt_greater: $startedAt_greater, startedAt_lesser: $startedAt_lesser, startedAt_like: $startedAt_like, completedAt_greater: $completedAt_greater, completedAt_lesser: $completedAt_lesser, completedAt_like: $completedAt_like) {
|
|
@@ -13,6 +13,11 @@ exports.MediaListCollectionQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const MediaListCollectionResponse_1 = require("../interfaces/responses/query/MediaListCollectionResponse");
|
|
16
|
+
const Type_1 = require("../types/Type");
|
|
17
|
+
const Status_1 = require("../types/Status");
|
|
18
|
+
const FuzzyDate_1 = require("../types/FuzzyDate");
|
|
19
|
+
const Sort_1 = require("../types/Sort");
|
|
20
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
21
|
/**
|
|
17
22
|
* `MediaListCollectionQuery` is a class representing a query for media list collection data.
|
|
18
23
|
* It includes a method to send the media list collection query and receive the response.
|
|
@@ -35,6 +40,33 @@ class MediaListCollectionQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
40
|
*/
|
|
36
41
|
mediaListCollection(variables) {
|
|
37
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
if (!variables) {
|
|
44
|
+
throw new Error('At least one variable must be set');
|
|
45
|
+
}
|
|
46
|
+
const variableTypeMappings = {
|
|
47
|
+
userId: 'number',
|
|
48
|
+
userName: 'string',
|
|
49
|
+
type: Type_1.MediaTypeMappings,
|
|
50
|
+
status: 'string',
|
|
51
|
+
notes: 'string',
|
|
52
|
+
startedAt: FuzzyDate_1.FuzzyDateMappings,
|
|
53
|
+
completedAt: FuzzyDate_1.FuzzyDateMappings,
|
|
54
|
+
forceSingleCompletedList: 'boolean',
|
|
55
|
+
chunk: 'number',
|
|
56
|
+
perChunk: 'number',
|
|
57
|
+
status_in: Status_1.MediaListStatusMappings,
|
|
58
|
+
status_not_in: Status_1.MediaListStatusMappings,
|
|
59
|
+
status_not: Status_1.MediaListStatusMappings,
|
|
60
|
+
notes_like: 'string',
|
|
61
|
+
startedAt_greater: FuzzyDate_1.FuzzyDateMappings,
|
|
62
|
+
startedAt_lesser: FuzzyDate_1.FuzzyDateMappings,
|
|
63
|
+
startedAt_like: 'string',
|
|
64
|
+
completedAt_greater: FuzzyDate_1.FuzzyDateMappings,
|
|
65
|
+
completedAt_lesser: FuzzyDate_1.FuzzyDateMappings,
|
|
66
|
+
completedAt_like: 'string',
|
|
67
|
+
sort: Sort_1.MediaListSortMappings
|
|
68
|
+
};
|
|
69
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
70
|
const query = MediaListCollectionResponse_1.MediaListCollectionQuerySchema;
|
|
39
71
|
const data = { query, variables };
|
|
40
72
|
return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
|
|
@@ -13,6 +13,7 @@ exports.MediaTagCollectionQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const Tag_1 = require("../interfaces/Tag");
|
|
16
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
17
|
/**
|
|
17
18
|
* `MediaTagCollectionQuery` is a class representing a query for media tag collection data.
|
|
18
19
|
* It includes a method to send the media tag collection query and receive the response.
|
|
@@ -35,6 +36,12 @@ class MediaTagCollectionQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
36
|
*/
|
|
36
37
|
mediaTagCollection() {
|
|
37
38
|
return __awaiter(this, arguments, void 0, function* (variables = {}) {
|
|
39
|
+
const variableTypeMappings = {
|
|
40
|
+
status: 'number'
|
|
41
|
+
};
|
|
42
|
+
if (Object(variables).length > 0) {
|
|
43
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
44
|
+
}
|
|
38
45
|
const query = `
|
|
39
46
|
query ($status: Int) {
|
|
40
47
|
MediaTagCollection (status: $status) {
|
|
@@ -13,6 +13,8 @@ exports.MediaTrendQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const MediaTrend_1 = require("../interfaces/responses/query/MediaTrend");
|
|
16
|
+
const Sort_1 = require("../types/Sort");
|
|
17
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
18
|
/**
|
|
17
19
|
* `MediaTrendQuery` is a class representing a query for media trend data.
|
|
18
20
|
* It includes a method to send the media trend query and receive the response.
|
|
@@ -35,6 +37,38 @@ class MediaTrendQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
mediaTrend(variables) {
|
|
37
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
|
+
mediaId: 'number',
|
|
45
|
+
date: 'number',
|
|
46
|
+
trending: 'number',
|
|
47
|
+
averageScore: 'number',
|
|
48
|
+
popularity: 'number',
|
|
49
|
+
episode: 'number',
|
|
50
|
+
releasing: 'boolean',
|
|
51
|
+
mediaId_not: 'number',
|
|
52
|
+
mediaId_in: 'number[]',
|
|
53
|
+
mediaId_not_in: 'number[]',
|
|
54
|
+
date_greater: 'number',
|
|
55
|
+
date_lesser: 'number',
|
|
56
|
+
trending_greater: 'number',
|
|
57
|
+
trending_lesser: 'number',
|
|
58
|
+
trending_not: 'number',
|
|
59
|
+
averageScore_greater: 'number',
|
|
60
|
+
averageScore_lesser: 'number',
|
|
61
|
+
averageScore_not: 'number',
|
|
62
|
+
popularity_greater: 'number',
|
|
63
|
+
popularity_lesser: 'number',
|
|
64
|
+
popularity_not: 'number',
|
|
65
|
+
episode_greater: 'number',
|
|
66
|
+
episode_lesser: 'number',
|
|
67
|
+
episode_not: 'number',
|
|
68
|
+
sort: Sort_1.MediaTrendSortMappings,
|
|
69
|
+
asHtml: 'boolean'
|
|
70
|
+
};
|
|
71
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
72
|
const query = `
|
|
39
73
|
query ($mediaId: Int, $date: Int, $trending: Int, $averageScore: Int, $popularity: Int, $episode: Int, $releasing: Boolean, $mediaId_not: Int, $mediaId_in: [Int], $mediaId_not_in: [Int], $date_greater: Int, $date_lesser: Int, $trending_greater: Int, $trending_lesser: Int, $trending_not: Int, $averageScore_greater: Int, $averageScore_lesser: Int, $averageScore_not: Int, $popularity_greater: Int, $popularity_lesser: Int, $popularity_not: Int, $episode_greater: Int, $episode_lesser: Int, $episode_not: Int, $sort: [MediaTrendSort], $asHtml: Boolean) {
|
|
40
74
|
MediaTrend (mediaId: $mediaId, date: $date, trending: $trending, averageScore: $averageScore, popularity: $popularity, episode: $episode, releasing: $releasing, mediaId_not: $mediaId_not, mediaId_in: $mediaId_in, mediaId_not_in: $mediaId_not_in, date_greater: $date_greater, date_lesser: $date_lesser, trending_greater: $trending_greater, trending_lesser: $trending_lesser, trending_not: $trending_not, averageScore_greater: $averageScore_greater, averageScore_lesser: $averageScore_lesser, averageScore_not: $averageScore_not, popularity_greater: $popularity_greater, popularity_lesser: $popularity_lesser, popularity_not: $popularity_not, episode_greater: $episode_greater, episode_lesser: $episode_lesser, episode_not: $episode_not, sort: $sort) {
|
|
@@ -13,6 +13,8 @@ exports.NotificationQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const Notification_1 = require("../interfaces/responses/query/Notification");
|
|
16
|
+
const Type_1 = require("../types/Type");
|
|
17
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
18
|
/**
|
|
17
19
|
* `NotificationQuery` is a class representing a query for notification data.
|
|
18
20
|
* It includes a method to send the notification query and receive the response.
|
|
@@ -35,6 +37,16 @@ class NotificationQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
notification(variables) {
|
|
37
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
|
+
type: Type_1.NotificationTypeMappings,
|
|
45
|
+
resetNotificationCount: 'boolean',
|
|
46
|
+
type_in: Type_1.NotificationTypeMappings,
|
|
47
|
+
asHtml: 'boolean'
|
|
48
|
+
};
|
|
49
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
50
|
const query = `
|
|
39
51
|
query ($type: NotificationType, $resetNotificationCount: Boolean, $type_in: [NotificationType], $asHtml: Boolean) {
|
|
40
52
|
Notification (type: $type, resetNotificationCount: $resetNotificationCount, type_in: $type_in) {
|
|
@@ -13,6 +13,8 @@ exports.RecommendationQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const Recommendation_1 = require("../interfaces/responses/query/Recommendation");
|
|
16
|
+
const Sort_1 = require("../types/Sort");
|
|
17
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
18
|
/**
|
|
17
19
|
* `RecommendationQuery` is a class representing a query for recommendation data.
|
|
18
20
|
* It includes a method to send the recommendation query and receive the response.
|
|
@@ -28,13 +30,29 @@ class RecommendationQuery extends APIWrapper_1.APIWrapper {
|
|
|
28
30
|
this.authToken = authToken;
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
|
-
* `
|
|
33
|
+
* `recommendation` is a method that sends a query request to get recommendation data.
|
|
32
34
|
*
|
|
33
35
|
* @param variables - The variables for the query.
|
|
34
36
|
* @returns The response from the query request.
|
|
35
37
|
*/
|
|
36
|
-
|
|
38
|
+
recommendation(variables) {
|
|
37
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
|
+
id: 'number',
|
|
45
|
+
mediaId: 'number',
|
|
46
|
+
mediaRecommendationId: 'number',
|
|
47
|
+
userId: 'number',
|
|
48
|
+
rating: 'number',
|
|
49
|
+
onList: 'boolean',
|
|
50
|
+
rating_greater: 'number',
|
|
51
|
+
rating_lesser: 'number',
|
|
52
|
+
sort: Sort_1.RecommendationSortMappings,
|
|
53
|
+
asHtml: 'boolean'
|
|
54
|
+
};
|
|
55
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
56
|
const query = `
|
|
39
57
|
query ($id: Int, $mediaId: Int, $mediaRecommendationId: Int, $userId: Int, $rating: Int, $onList: Boolean, $rating_greater: Int, $rating_lesser: Int, $sort: [RecommendationSort], $asHtml: Boolean) {
|
|
40
58
|
Recommendation (id: $id, mediaId: $mediaId, mediaRecommendationId: $mediaRecommendationId, userId: $userId, rating: $rating, onList: $onList, rating_greater: $rating_greater, rating_lesser: $rating_lesser, sort: $sort) {
|
|
@@ -13,6 +13,8 @@ exports.ReviewQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const Review_1 = require("../interfaces/responses/query/Review");
|
|
16
|
+
const Sort_1 = require("../types/Sort");
|
|
17
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
18
|
/**
|
|
17
19
|
* `ReviewQuery` is a class representing a query for review data.
|
|
18
20
|
* It includes a method to send the review query and receive the response.
|
|
@@ -35,6 +37,18 @@ class ReviewQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
review(variables) {
|
|
37
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
|
+
id: 'number',
|
|
45
|
+
mediaId: 'number',
|
|
46
|
+
userId: 'number',
|
|
47
|
+
mediaType: 'string',
|
|
48
|
+
sort: Sort_1.ReviewSortMappings,
|
|
49
|
+
asHtml: 'boolean'
|
|
50
|
+
};
|
|
51
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
52
|
const query = `
|
|
39
53
|
query ($id: Int, $mediaId: Int, $userId: Int, $mediaType: MediaType, $sort: [ReviewSort], $asHtml: Boolean) {
|
|
40
54
|
Review (id: $id, mediaId: $mediaId, userId: $userId, mediaType: $mediaType, sort: $sort) {
|
|
@@ -13,6 +13,8 @@ exports.SiteStatisticsQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const SiteStatistics_1 = require("../interfaces/responses/query/SiteStatistics");
|
|
16
|
+
const Sort_1 = require("../types/Sort");
|
|
17
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
18
|
/**
|
|
17
19
|
* `SiteStatisticsQuery` is a class representing a query for site statistics data.
|
|
18
20
|
* It includes a method to send the site statistics query and receive the response.
|
|
@@ -35,6 +37,32 @@ class SiteStatisticsQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
siteStatistics() {
|
|
37
39
|
return __awaiter(this, arguments, void 0, function* (variables = {}) {
|
|
40
|
+
const variableTypeMappings = {
|
|
41
|
+
usersSort: Sort_1.SiteTrendSortMappings,
|
|
42
|
+
usersPage: 'number',
|
|
43
|
+
usersPerPage: 'number',
|
|
44
|
+
animeSort: Sort_1.SiteTrendSortMappings,
|
|
45
|
+
animePage: 'number',
|
|
46
|
+
animePerPage: 'number',
|
|
47
|
+
mangaSort: Sort_1.SiteTrendSortMappings,
|
|
48
|
+
mangaPage: 'number',
|
|
49
|
+
mangaPerPage: 'number',
|
|
50
|
+
charactersSort: Sort_1.SiteTrendSortMappings,
|
|
51
|
+
charactersPage: 'number',
|
|
52
|
+
charactersPerPage: 'number',
|
|
53
|
+
staffSort: Sort_1.SiteTrendSortMappings,
|
|
54
|
+
staffPage: 'number',
|
|
55
|
+
staffPerPage: 'number',
|
|
56
|
+
studiosSort: Sort_1.SiteTrendSortMappings,
|
|
57
|
+
studiosPage: 'number',
|
|
58
|
+
studiosPerPage: 'number',
|
|
59
|
+
reviewsSort: Sort_1.SiteTrendSortMappings,
|
|
60
|
+
reviewsPage: 'number',
|
|
61
|
+
reviewsPerPage: 'number'
|
|
62
|
+
};
|
|
63
|
+
if (Object(variables).length > 0) {
|
|
64
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
65
|
+
}
|
|
38
66
|
const query = `
|
|
39
67
|
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) {
|
|
40
68
|
SiteStatistics {
|
|
@@ -13,6 +13,9 @@ exports.StaffQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
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");
|
|
16
19
|
/**
|
|
17
20
|
* `StaffQuery` is a class representing a query for staff data.
|
|
18
21
|
* It includes a method to send the staff query and receive the response.
|
|
@@ -35,6 +38,32 @@ class StaffQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
38
|
*/
|
|
36
39
|
staff(variables) {
|
|
37
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
|
+
id: 'number',
|
|
46
|
+
isBirthday: 'boolean',
|
|
47
|
+
search: 'String',
|
|
48
|
+
id_not: 'number',
|
|
49
|
+
id_in: 'number[]',
|
|
50
|
+
id_not_in: 'number[]',
|
|
51
|
+
sort: Sort_1.StaffSortMappings,
|
|
52
|
+
asHtml: 'boolean',
|
|
53
|
+
staffMediaSort: Sort_1.MediaSortMappings,
|
|
54
|
+
staffMediaType: Type_1.MediaTypeMappings,
|
|
55
|
+
staffMediaOnList: 'boolean',
|
|
56
|
+
staffMediaPage: 'number',
|
|
57
|
+
staffMediaPerPage: 'number',
|
|
58
|
+
charactersSort: Sort_1.CharacterSortMappings,
|
|
59
|
+
charactersPage: 'number',
|
|
60
|
+
charactersPerPage: 'number',
|
|
61
|
+
characterMediaSort: Sort_1.MediaSortMappings,
|
|
62
|
+
characterMediaOnList: 'boolean',
|
|
63
|
+
characterMediaPage: 'number',
|
|
64
|
+
characterMediaPerPage: 'number'
|
|
65
|
+
};
|
|
66
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
67
|
const query = `
|
|
39
68
|
query ($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) {
|
|
40
69
|
Staff (id: $id, isBirthday: $isBirthday, search: $search, id_not: $id_not, id_in: $id_in, id_not_in: $id_not_in, sort: $sort) {
|
|
@@ -13,6 +13,8 @@ exports.StudioQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const Studio_1 = require("../interfaces/responses/query/Studio");
|
|
16
|
+
const Sort_1 = require("../types/Sort");
|
|
17
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
18
|
/**
|
|
17
19
|
* `StudioQuery` is a class representing a query for studio data.
|
|
18
20
|
* It includes a method to send the studio query and receive the response.
|
|
@@ -35,6 +37,36 @@ class StudioQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
studio(variables) {
|
|
37
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
|
+
id: 'number',
|
|
45
|
+
search: 'string',
|
|
46
|
+
id_not: 'number',
|
|
47
|
+
id_in: 'number[]',
|
|
48
|
+
id_not_in: 'number[]',
|
|
49
|
+
sort: Sort_1.StudioSortMappings,
|
|
50
|
+
asHtml: 'boolean',
|
|
51
|
+
mediaSort: Sort_1.MediaSortMappings,
|
|
52
|
+
mediaIsMain: 'boolean',
|
|
53
|
+
mediaOnList: 'boolean',
|
|
54
|
+
mediaPage: 'number',
|
|
55
|
+
mediaPerPage: 'number',
|
|
56
|
+
staffMediaSort: Sort_1.MediaSortMappings,
|
|
57
|
+
staffMediaType: 'string',
|
|
58
|
+
staffMediaOnList: 'boolean',
|
|
59
|
+
staffMediaPage: 'number',
|
|
60
|
+
staffMediaPerPage: 'number',
|
|
61
|
+
charactersSort: Sort_1.CharacterSortMappings,
|
|
62
|
+
charactersPage: 'number',
|
|
63
|
+
charactersPerPage: 'number',
|
|
64
|
+
characterMediaSort: Sort_1.MediaSortMappings,
|
|
65
|
+
characterMediaOnList: 'boolean',
|
|
66
|
+
characterMediaPage: 'number',
|
|
67
|
+
characterMediaPerPage: 'number'
|
|
68
|
+
};
|
|
69
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
70
|
const query = `
|
|
39
71
|
query ($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) {
|
|
40
72
|
Studio (id: $id, search: $search, id_not: $id_not, id_in: $id_in, id_not_in: $id_not_in, sort: $sort) {
|
|
@@ -13,6 +13,8 @@ exports.ThreadQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const Thread_1 = require("../interfaces/responses/query/Thread");
|
|
16
|
+
const Sort_1 = require("../types/Sort");
|
|
17
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
18
|
/**
|
|
17
19
|
* `ThreadQuery` is a class representing a query for thread data.
|
|
18
20
|
* It includes a method to send the thread query and receive the response.
|
|
@@ -35,6 +37,22 @@ class ThreadQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
thread(variables) {
|
|
37
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
|
+
id: 'number',
|
|
45
|
+
userId: 'number',
|
|
46
|
+
replyUserId: 'number',
|
|
47
|
+
subscribed: 'boolean',
|
|
48
|
+
categoryId: 'number',
|
|
49
|
+
mediaCategoryId: 'number',
|
|
50
|
+
search: 'string',
|
|
51
|
+
id_in: 'number[]',
|
|
52
|
+
sort: Sort_1.ThreadSortMappings,
|
|
53
|
+
asHtml: 'boolean'
|
|
54
|
+
};
|
|
55
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
56
|
const query = `
|
|
39
57
|
query ($id: Int, $userId: Int, $replyUserId: Int, $subscribed: Boolean, $categoryId: Int, $mediaCategoryId: Int, $search: String, $id_in: [Int], $sort: [ThreadSort], $asHtml: Boolean) {
|
|
40
58
|
Thread (id: $id, userId: $userId, replyUserId: $replyUserId, subscribed: $subscribed, categoryId: $categoryId, mediaCategoryId: $mediaCategoryId, search: $search, id_in: $id_in, sort: $sort) {
|
|
@@ -13,6 +13,8 @@ exports.ThreadCommentQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const ThreadComment_1 = require("../interfaces/responses/query/ThreadComment");
|
|
16
|
+
const Sort_1 = require("../types/Sort");
|
|
17
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
18
|
/**
|
|
17
19
|
* `ThreadCommentQuery` is a class representing a query for thread comment data.
|
|
18
20
|
* It includes a method to send the thread comment query and receive the response.
|
|
@@ -35,6 +37,17 @@ class ThreadCommentQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
threadComment(variables) {
|
|
37
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
|
+
id: 'number',
|
|
45
|
+
threadId: 'number',
|
|
46
|
+
userId: 'number',
|
|
47
|
+
sort: Sort_1.ThreadSortMappings,
|
|
48
|
+
asHtml: 'boolean'
|
|
49
|
+
};
|
|
50
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
51
|
const query = `
|
|
39
52
|
query ($id: Int, $threadId: Int, $userId: Int, $sort: [ThreadCommentSort], $asHtml: Boolean) {
|
|
40
53
|
ThreadComment (id: $id, threadId: $threadId, userId: $userId, sort: $sort) {
|
|
@@ -13,6 +13,8 @@ exports.UserQuery = void 0;
|
|
|
13
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
15
|
const User_1 = require("../interfaces/responses/query/User");
|
|
16
|
+
const Sort_1 = require("../types/Sort");
|
|
17
|
+
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
18
|
/**
|
|
17
19
|
* `UserQuery` is a class representing a query for user data.
|
|
18
20
|
* It includes a method to send the user query and receive the response.
|
|
@@ -35,6 +37,22 @@ class UserQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
user(variables) {
|
|
37
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
|
+
id: 'number',
|
|
45
|
+
name: 'string',
|
|
46
|
+
isModerator: 'boolean',
|
|
47
|
+
search: 'string',
|
|
48
|
+
sort: Sort_1.UserSortMappings,
|
|
49
|
+
asHtml: 'boolean',
|
|
50
|
+
animeStatLimit: 'number',
|
|
51
|
+
mangaStatLimit: 'number',
|
|
52
|
+
animeStatSort: Sort_1.UserStatisticSortMappings,
|
|
53
|
+
mangaStatSort: Sort_1.UserStatisticSortMappings
|
|
54
|
+
};
|
|
55
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
56
|
const query = `
|
|
39
57
|
query ($id: Int, $name: String, $isModerator: Boolean, $search: String, $sort: [UserSort], $asHtml: Boolean, $animeStatLimit: Int, $mangaStatLimit: Int, $animeStatSort: [UserStatisticsSort], $mangaStatSort: [UserStatisticsSort]) {
|
|
40
58
|
User (id: $id, name: $name, isModerator: $isModerator, search: $search, sort: $sort) {
|