anilink-api-wrapper 1.18.6 → 1.19.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 +7 -1
- package/dist/AniLink.js +1 -1
- package/dist/apis/anilist/mutation/SaveMediaListEntry.js +2 -2
- 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
|
@@ -13,6 +13,14 @@ exports.MediasQuery = 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 Season_1 = require("../../types/Season");
|
|
18
|
+
const Type_1 = require("../../types/Type");
|
|
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
|
* `MediasQuery` is a class that extends the `APIWrapper` class.
|
|
18
26
|
* It defines the `medias` method that returns a `MediaResponse`.
|
|
@@ -33,6 +41,84 @@ class MediasQuery extends APIWrapper_1.APIWrapper {
|
|
|
33
41
|
*/
|
|
34
42
|
medias(variables) {
|
|
35
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
|
+
page: 'number',
|
|
49
|
+
perPage: 'number',
|
|
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);
|
|
36
122
|
const query = `
|
|
37
123
|
query ($page: Int, $perPage: Int, $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) {
|
|
38
124
|
Page (page: $page, perPage: $perPage) {
|
|
@@ -13,6 +13,8 @@ exports.NotificationsQuery = 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
|
* `NotificationsQuery` is a class representing a query for notifications.
|
|
18
20
|
* It includes a method to get notifications.
|
|
@@ -35,6 +37,18 @@ class NotificationsQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
notifications(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
|
+
page: 'number',
|
|
45
|
+
perPage: 'number',
|
|
46
|
+
type: Type_1.NotificationTypeMappings,
|
|
47
|
+
resetNotificationCount: 'boolean',
|
|
48
|
+
type_in: Type_1.NotificationTypeMappings,
|
|
49
|
+
asHtml: 'boolean'
|
|
50
|
+
};
|
|
51
|
+
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
38
52
|
const query = `
|
|
39
53
|
query ($page: Int, $perPage: Int, $type: NotificationType, $resetNotificationCount: Boolean, $type_in: [NotificationType], $asHtml: Boolean) {
|
|
40
54
|
Page (page: $page, perPage: $perPage) {
|
|
@@ -13,6 +13,8 @@ exports.RecommendationsQuery = 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
|
* `RecommendationsQuery` is a class representing a query for recommendations.
|
|
18
20
|
* It includes a method to get recommendations.
|
|
@@ -35,6 +37,24 @@ class RecommendationsQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
recommendations(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
|
+
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);
|
|
38
58
|
const query = `
|
|
39
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) {
|
|
40
60
|
Page (page: $page, perPage: $perPage) {
|
|
@@ -13,6 +13,8 @@ exports.ReviewsQuery = 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
|
* `ReviewsQuery` is a class representing a query for reviews.
|
|
18
20
|
* It includes a method to get reviews.
|
|
@@ -35,6 +37,20 @@ class ReviewsQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
reviews(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
|
+
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);
|
|
38
54
|
const query = `
|
|
39
55
|
query ($page: Int, $perPage: Int, $id: Int, $mediaId: Int, $userId: Int, $mediaType: MediaType, $sort: [ReviewSort], $asHtml: Boolean) {
|
|
40
56
|
Page (page: $page, perPage: $perPage) {
|
|
@@ -13,6 +13,9 @@ exports.StaffsQuery = 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
|
* `StaffsQuery` is a class representing a query for staffs.
|
|
18
21
|
* It includes a method to get staffs.
|
|
@@ -35,6 +38,34 @@ class StaffsQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
38
|
*/
|
|
36
39
|
staffs(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
|
+
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);
|
|
38
69
|
const query = `
|
|
39
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) {
|
|
40
71
|
Page (page: $page, perPage: $perPage) {
|
|
@@ -13,6 +13,8 @@ exports.StudiosQuery = 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
|
* `StudiosQuery` is a class representing a query for studios.
|
|
18
20
|
* It includes a method to get studios.
|
|
@@ -35,6 +37,38 @@ class StudiosQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
studios(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
|
+
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);
|
|
38
72
|
const query = `
|
|
39
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) {
|
|
40
74
|
Page (page: $page, perPage: $perPage) {
|
|
@@ -13,6 +13,8 @@ exports.ThreadCommentsQuery = 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
|
* `ThreadCommentsQuery` is a class representing a query for thread comments.
|
|
18
20
|
* It includes a method to get thread comments.
|
|
@@ -35,6 +37,19 @@ class ThreadCommentsQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
threadComments(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
|
+
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);
|
|
38
53
|
const query = `
|
|
39
54
|
query ($page: Int, $perPage: Int, $id: Int, $threadId: Int, $userId: Int, $sort: [ThreadCommentSort], $asHtml: Boolean) {
|
|
40
55
|
Page (page: $page, perPage: $perPage) {
|
|
@@ -13,6 +13,8 @@ exports.ThreadsQuery = 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
|
* `ThreadsQuery` is a class representing a query for threads.
|
|
18
20
|
* It includes a method to get threads.
|
|
@@ -35,6 +37,24 @@ class ThreadsQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
threads(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
|
+
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);
|
|
38
58
|
const query = `
|
|
39
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) {
|
|
40
60
|
Page (page: $page, perPage: $perPage) {
|
|
@@ -13,6 +13,8 @@ exports.UsersQuery = 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
|
* `UsersQuery` is a class representing a query for users.
|
|
18
20
|
* It includes a method to get users.
|
|
@@ -35,6 +37,24 @@ class UsersQuery extends APIWrapper_1.APIWrapper {
|
|
|
35
37
|
*/
|
|
36
38
|
users(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
|
+
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);
|
|
38
58
|
const query = `
|
|
39
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]) {
|
|
40
60
|
Page (page: $page, perPage: $perPage) {
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MediaSeasonMappings = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* `MediaSeasonMappings` is a mapping of `MediaSeason` enum values to their corresponding string values.
|
|
6
|
+
* It can be one of the following: 'WINTER', 'SPRING', 'SUMMER', 'FALL'.
|
|
7
|
+
*/
|
|
8
|
+
exports.MediaSeasonMappings = [
|
|
9
|
+
'WINTER',
|
|
10
|
+
'SPRING',
|
|
11
|
+
'SUMMER',
|
|
12
|
+
'FALL'
|
|
13
|
+
];
|