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.
- package/LICENSE +21 -21
- package/README.md +523 -241
- package/dist/AniLink.d.ts +11397 -0
- package/dist/AniLink.mjs +6664 -0
- package/dist/anilist.d.ts +1 -0
- package/dist/anilist.mjs +5 -0
- package/package.json +111 -46
- package/dist/AniLink.js +0 -248
- package/dist/apis/anilist/Custom.js +0 -42
- package/dist/apis/anilist/interfaces/Activity.js +0 -436
- package/dist/apis/anilist/interfaces/Basic.js +0 -33
- package/dist/apis/anilist/interfaces/CoverImage.js +0 -15
- package/dist/apis/anilist/interfaces/Distribution.js +0 -23
- package/dist/apis/anilist/interfaces/ExternalLink.js +0 -14
- package/dist/apis/anilist/interfaces/Favoured.js +0 -2
- package/dist/apis/anilist/interfaces/FuzzyDate.js +0 -12
- package/dist/apis/anilist/interfaces/Image.js +0 -13
- package/dist/apis/anilist/interfaces/ListScores.js +0 -2
- package/dist/apis/anilist/interfaces/Media.js +0 -13
- package/dist/apis/anilist/interfaces/Name.js +0 -15
- package/dist/apis/anilist/interfaces/NextAiringEpisode.js +0 -14
- package/dist/apis/anilist/interfaces/Notification.js +0 -25
- package/dist/apis/anilist/interfaces/Ranking.js +0 -19
- package/dist/apis/anilist/interfaces/SiteTrend.js +0 -33
- package/dist/apis/anilist/interfaces/Staff.js +0 -2
- package/dist/apis/anilist/interfaces/Stat.js +0 -2
- package/dist/apis/anilist/interfaces/Statistics.js +0 -2
- package/dist/apis/anilist/interfaces/StreamingEpisode.js +0 -15
- package/dist/apis/anilist/interfaces/Studio.js +0 -2
- package/dist/apis/anilist/interfaces/Tag.js +0 -18
- package/dist/apis/anilist/interfaces/Title.js +0 -15
- package/dist/apis/anilist/interfaces/Trailer.js +0 -14
- package/dist/apis/anilist/interfaces/UserStats.js +0 -23
- package/dist/apis/anilist/interfaces/responses/mutation/Favourites.js +0 -83
- package/dist/apis/anilist/interfaces/responses/query/AiringSchedule.js +0 -18
- package/dist/apis/anilist/interfaces/responses/query/AniChartUser.js +0 -2
- package/dist/apis/anilist/interfaces/responses/query/Character.js +0 -34
- package/dist/apis/anilist/interfaces/responses/query/ExternalLinkSourceCollection.js +0 -2
- package/dist/apis/anilist/interfaces/responses/query/Media.js +0 -217
- package/dist/apis/anilist/interfaces/responses/query/MediaList.js +0 -36
- package/dist/apis/anilist/interfaces/responses/query/MediaListCollectionResponse.js +0 -49
- package/dist/apis/anilist/interfaces/responses/query/MediaTagCollection.js +0 -2
- package/dist/apis/anilist/interfaces/responses/query/MediaTrend.js +0 -21
- package/dist/apis/anilist/interfaces/responses/query/Notification.js +0 -166
- package/dist/apis/anilist/interfaces/responses/query/Recommendation.js +0 -23
- package/dist/apis/anilist/interfaces/responses/query/Review.js +0 -30
- package/dist/apis/anilist/interfaces/responses/query/SiteStatistics.js +0 -31
- package/dist/apis/anilist/interfaces/responses/query/Staff.js +0 -59
- package/dist/apis/anilist/interfaces/responses/query/Studio.js +0 -60
- package/dist/apis/anilist/interfaces/responses/query/Thread.js +0 -44
- package/dist/apis/anilist/interfaces/responses/query/ThreadComment.js +0 -31
- package/dist/apis/anilist/interfaces/responses/query/User.js +0 -366
- package/dist/apis/anilist/mutation/DeleteActivity.js +0 -61
- package/dist/apis/anilist/mutation/DeleteActivityReply.js +0 -61
- package/dist/apis/anilist/mutation/DeleteCustomList.js +0 -63
- package/dist/apis/anilist/mutation/DeleteMediaListEntry.js +0 -61
- package/dist/apis/anilist/mutation/DeleteReview.js +0 -61
- package/dist/apis/anilist/mutation/DeleteThread.js +0 -61
- package/dist/apis/anilist/mutation/DeleteThreadComment.js +0 -61
- package/dist/apis/anilist/mutation/SaveActivityReply.js +0 -66
- package/dist/apis/anilist/mutation/SaveListActivity.js +0 -64
- package/dist/apis/anilist/mutation/SaveMediaListEntry.js +0 -97
- package/dist/apis/anilist/mutation/SaveMessageActivity.js +0 -68
- package/dist/apis/anilist/mutation/SaveRecommendation.js +0 -66
- package/dist/apis/anilist/mutation/SaveReview.js +0 -68
- package/dist/apis/anilist/mutation/SaveTextActivity.js +0 -65
- package/dist/apis/anilist/mutation/SaveThread.js +0 -69
- package/dist/apis/anilist/mutation/SaveThreadComment.js +0 -67
- package/dist/apis/anilist/mutation/ToggleActivityPin.js +0 -64
- package/dist/apis/anilist/mutation/ToggleActivitySubscription.js +0 -64
- package/dist/apis/anilist/mutation/ToggleFavourite.js +0 -66
- package/dist/apis/anilist/mutation/ToggleFollow.js +0 -62
- package/dist/apis/anilist/mutation/ToggleLike.js +0 -64
- package/dist/apis/anilist/mutation/ToggleLikeV2.js +0 -64
- package/dist/apis/anilist/mutation/ToggleThreadSubscription.js +0 -64
- package/dist/apis/anilist/mutation/UpdateAniChartHighlights.js +0 -58
- package/dist/apis/anilist/mutation/UpdateAniChartSettings.js +0 -58
- package/dist/apis/anilist/mutation/UpdateFavouriteOrder.js +0 -73
- package/dist/apis/anilist/mutation/UpdateMediaListEntries.js +0 -93
- package/dist/apis/anilist/mutation/UpdateUser.js +0 -127
- package/dist/apis/anilist/query/Activity.js +0 -86
- package/dist/apis/anilist/query/ActivityReply.js +0 -60
- package/dist/apis/anilist/query/AiringSchedule.js +0 -78
- package/dist/apis/anilist/query/AniChartUser.js +0 -56
- package/dist/apis/anilist/query/Character.js +0 -70
- package/dist/apis/anilist/query/ExternalLinkSourceCollection.js +0 -68
- package/dist/apis/anilist/query/Follower.js +0 -64
- package/dist/apis/anilist/query/Following.js +0 -64
- package/dist/apis/anilist/query/GenreCollection.js +0 -46
- package/dist/apis/anilist/query/Markdown.js +0 -57
- package/dist/apis/anilist/query/Media.js +0 -134
- package/dist/apis/anilist/query/MediaList.js +0 -90
- package/dist/apis/anilist/query/MediaListCollection.js +0 -76
- package/dist/apis/anilist/query/MediaTagCollection.js +0 -57
- package/dist/apis/anilist/query/MediaTrend.js +0 -84
- package/dist/apis/anilist/query/Notification.js +0 -65
- package/dist/apis/anilist/query/Recommendation.js +0 -68
- package/dist/apis/anilist/query/Review.js +0 -64
- package/dist/apis/anilist/query/SiteStatistics.js +0 -78
- package/dist/apis/anilist/query/Staff.js +0 -79
- package/dist/apis/anilist/query/Studio.js +0 -82
- package/dist/apis/anilist/query/Thread.js +0 -68
- package/dist/apis/anilist/query/ThreadComment.js +0 -63
- package/dist/apis/anilist/query/User.js +0 -68
- package/dist/apis/anilist/query/Viewer.js +0 -65
- package/dist/apis/anilist/query/page/Activities.js +0 -97
- package/dist/apis/anilist/query/page/ActivityReplies.js +0 -71
- package/dist/apis/anilist/query/page/AiringSchedules.js +0 -89
- package/dist/apis/anilist/query/page/Characters.js +0 -81
- package/dist/apis/anilist/query/page/Followers.js +0 -75
- package/dist/apis/anilist/query/page/Followings.js +0 -75
- package/dist/apis/anilist/query/page/Likes.js +0 -71
- package/dist/apis/anilist/query/page/MediaLists.js +0 -101
- package/dist/apis/anilist/query/page/MediaTrends.js +0 -95
- package/dist/apis/anilist/query/page/Medias.js +0 -143
- package/dist/apis/anilist/query/page/Notifications.js +0 -73
- package/dist/apis/anilist/query/page/Recommendations.js +0 -79
- package/dist/apis/anilist/query/page/Reviews.js +0 -75
- package/dist/apis/anilist/query/page/Staffs.js +0 -90
- package/dist/apis/anilist/query/page/Studios.js +0 -93
- package/dist/apis/anilist/query/page/ThreadCommments.js +0 -74
- package/dist/apis/anilist/query/page/Threads.js +0 -79
- package/dist/apis/anilist/query/page/Users.js +0 -79
- package/dist/apis/anilist/types/ActivityType.js +0 -14
- package/dist/apis/anilist/types/DisabledListActivity.js +0 -11
- package/dist/apis/anilist/types/Format.js +0 -30
- package/dist/apis/anilist/types/FuzzyDate.js +0 -12
- package/dist/apis/anilist/types/MediaListOptions.js +0 -16
- package/dist/apis/anilist/types/NotificationOptions.js +0 -29
- package/dist/apis/anilist/types/RecommendationRating.js +0 -12
- package/dist/apis/anilist/types/Season.js +0 -13
- package/dist/apis/anilist/types/Sort.js +0 -265
- package/dist/apis/anilist/types/Source.js +0 -25
- package/dist/apis/anilist/types/Status.js +0 -26
- package/dist/apis/anilist/types/Type.js +0 -44
- package/dist/apis/anilist/types/UserStaffNameLanguage.js +0 -15
- package/dist/apis/anilist/types/UserTitleLanguage.js +0 -15
- package/dist/base/APIWrapper.js +0 -17
- package/dist/base/RequestHandler.js +0 -48
- package/dist/base/ValidateVariables.js +0 -125
|
@@ -1,70 +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.CharacterQuery = void 0;
|
|
13
|
-
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
|
-
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
|
-
const Character_1 = require("../interfaces/responses/query/Character");
|
|
16
|
-
const Sort_1 = require("../types/Sort");
|
|
17
|
-
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
18
|
-
/**
|
|
19
|
-
* `CharacterQuery` is a class representing a query for characters.
|
|
20
|
-
* It includes a method to get characters.
|
|
21
|
-
*/
|
|
22
|
-
class CharacterQuery extends APIWrapper_1.APIWrapper {
|
|
23
|
-
/**
|
|
24
|
-
* Constructs a new `CharacterQuery` 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
|
-
* `character` is a method that sends a query request to get characters.
|
|
34
|
-
*
|
|
35
|
-
* @param variables - The variables for the query.
|
|
36
|
-
* @returns The response from the query request.
|
|
37
|
-
*/
|
|
38
|
-
character(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
|
-
id: 'number',
|
|
45
|
-
isBirthday: 'boolean',
|
|
46
|
-
search: 'string',
|
|
47
|
-
id_not: 'number',
|
|
48
|
-
id_in: 'number[]',
|
|
49
|
-
id_not_in: 'number[]',
|
|
50
|
-
sort: Sort_1.CharacterSortMappings,
|
|
51
|
-
asHtml: 'boolean',
|
|
52
|
-
mediaSort: Sort_1.MediaSortMappings,
|
|
53
|
-
mediaOnList: 'boolean',
|
|
54
|
-
mediaPage: 'number',
|
|
55
|
-
mediaPerPage: 'number'
|
|
56
|
-
};
|
|
57
|
-
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
58
|
-
const query = `
|
|
59
|
-
query ($id: Int, $isBirthday: Boolean, $search: String, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $sort: [CharacterSort], $asHtml: Boolean, $mediaSort: [MediaSort], $mediaOnList: Boolean, $mediaPage: Int, $mediaPerPage: Int) {
|
|
60
|
-
Character (id: $id, isBirthday: $isBirthday, search: $search, id_not: $id_not, id_in: $id_in, id_not_in: $id_not_in, sort: $sort) {
|
|
61
|
-
${Character_1.CharacterSchema}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
`;
|
|
65
|
-
const data = { query, variables };
|
|
66
|
-
return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.CharacterQuery = CharacterQuery;
|
|
@@ -1,68 +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.ExternalLinkSourceCollectionQuery = void 0;
|
|
13
|
-
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
|
-
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
|
-
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
|
-
const Type_1 = require("../types/Type");
|
|
17
|
-
/**
|
|
18
|
-
* `ExternalLinkSourceCollectionQuery` is a class representing a query for external link source collections.
|
|
19
|
-
* It includes a method to get external link source collections.
|
|
20
|
-
*/
|
|
21
|
-
class ExternalLinkSourceCollectionQuery extends APIWrapper_1.APIWrapper {
|
|
22
|
-
/**
|
|
23
|
-
* Constructs a new `ExternalLinkSourceCollectionQuery` instance.
|
|
24
|
-
*
|
|
25
|
-
* @param authToken - The authentication token.
|
|
26
|
-
*/
|
|
27
|
-
constructor(authToken) {
|
|
28
|
-
super('https://graphql.anilist.co');
|
|
29
|
-
this.authToken = authToken;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* `externalLinkSourceCollection` is a method that sends a query request to get external link source collections.
|
|
33
|
-
*
|
|
34
|
-
* @param variables - The variables for the query. If not provided, an empty object will be used.
|
|
35
|
-
* @returns The response from the query request.
|
|
36
|
-
*/
|
|
37
|
-
externalLinkSourceCollection() {
|
|
38
|
-
return __awaiter(this, arguments, void 0, function* (variables = {}) {
|
|
39
|
-
const variableTypeMappings = {
|
|
40
|
-
id: 'number',
|
|
41
|
-
type: 'string',
|
|
42
|
-
mediaType: Type_1.MediaTypeMappings
|
|
43
|
-
};
|
|
44
|
-
if (Object(variables).length > 0) {
|
|
45
|
-
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
46
|
-
}
|
|
47
|
-
const query = `
|
|
48
|
-
query ($id: Int, $type: ExternalLinkType, $mediaType: ExternalLinkMediaType) {
|
|
49
|
-
ExternalLinkSourceCollection (id: $id, type: $type, mediaType: $mediaType) {
|
|
50
|
-
id
|
|
51
|
-
url
|
|
52
|
-
site
|
|
53
|
-
siteId
|
|
54
|
-
type
|
|
55
|
-
language
|
|
56
|
-
color
|
|
57
|
-
icon
|
|
58
|
-
notes
|
|
59
|
-
isDisabled
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
`;
|
|
63
|
-
const data = { query, variables };
|
|
64
|
-
return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.ExternalLinkSourceCollectionQuery = ExternalLinkSourceCollectionQuery;
|
|
@@ -1,64 +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.FollowerQuery = 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
|
-
* `FollowerQuery` is a class representing a query for followers.
|
|
20
|
-
* It includes a method to get followers.
|
|
21
|
-
*/
|
|
22
|
-
class FollowerQuery extends APIWrapper_1.APIWrapper {
|
|
23
|
-
/**
|
|
24
|
-
* Constructs a new `FollowerQuery` 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
|
-
* `follower` is a method that sends a query request to get followers.
|
|
34
|
-
*
|
|
35
|
-
* @param variables - The variables for the query.
|
|
36
|
-
* @returns The response from the query request.
|
|
37
|
-
*/
|
|
38
|
-
follower(variables) {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
if (!variables.userId) {
|
|
41
|
-
throw new Error('userId is required');
|
|
42
|
-
}
|
|
43
|
-
const variableTypeMappings = {
|
|
44
|
-
userId: 'number',
|
|
45
|
-
sort: Sort_1.UserSortMappings,
|
|
46
|
-
animeStatLimit: 'number',
|
|
47
|
-
mangaStatLimit: 'number',
|
|
48
|
-
animeStatSort: Sort_1.UserStatisticSortMappings,
|
|
49
|
-
mangaStatSort: Sort_1.UserStatisticSortMappings
|
|
50
|
-
};
|
|
51
|
-
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
52
|
-
const query = `
|
|
53
|
-
query ($userId: Int!, $sort: [UserSort], $asHtml: Boolean, $animeStatLimit: Int, $mangaStatLimit: Int, $animeStatSort: [UserStatisticsSort], $mangaStatSort: [UserStatisticsSort]) {
|
|
54
|
-
Follower (userId: $userId, sort: $sort) {
|
|
55
|
-
${User_1.UserSchema}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
const data = { query, variables };
|
|
60
|
-
return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.FollowerQuery = FollowerQuery;
|
|
@@ -1,64 +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.FollowingQuery = 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
|
-
* `FollowingQuery` is a class representing a query for following users.
|
|
20
|
-
* It includes a method to get following users.
|
|
21
|
-
*/
|
|
22
|
-
class FollowingQuery extends APIWrapper_1.APIWrapper {
|
|
23
|
-
/**
|
|
24
|
-
* Constructs a new `FollowingQuery` 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
|
-
* `following` is a method that sends a query request to get following users.
|
|
34
|
-
*
|
|
35
|
-
* @param variables - The variables for the query.
|
|
36
|
-
* @returns The response from the query request.
|
|
37
|
-
*/
|
|
38
|
-
following(variables) {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
if (!variables.userId) {
|
|
41
|
-
throw new Error('userId is required');
|
|
42
|
-
}
|
|
43
|
-
const variableTypeMappings = {
|
|
44
|
-
userId: 'number',
|
|
45
|
-
sort: Sort_1.UserSortMappings,
|
|
46
|
-
animeStatLimit: 'number',
|
|
47
|
-
mangaStatLimit: 'number',
|
|
48
|
-
animeStatSort: Sort_1.UserStatisticSortMappings,
|
|
49
|
-
mangaStatSort: Sort_1.UserStatisticSortMappings
|
|
50
|
-
};
|
|
51
|
-
(0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
|
|
52
|
-
const query = `
|
|
53
|
-
query ($userId: Int!, $sort: [UserSort], $asHtml: Boolean, $animeStatLimit: Int, $mangaStatLimit: Int, $animeStatSort: [UserStatisticsSort], $mangaStatSort: [UserStatisticsSort]) {
|
|
54
|
-
Following (userId: $userId, sort: $sort) {
|
|
55
|
-
${User_1.UserSchema}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
const data = { query, variables };
|
|
60
|
-
return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.FollowingQuery = FollowingQuery;
|
|
@@ -1,46 +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.GenreCollectionQuery = void 0;
|
|
13
|
-
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
|
-
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
|
-
/**
|
|
16
|
-
* `GenreCollectionQuery` is a class representing a query for genre collections.
|
|
17
|
-
* It includes a method to get genre collections.
|
|
18
|
-
*/
|
|
19
|
-
class GenreCollectionQuery extends APIWrapper_1.APIWrapper {
|
|
20
|
-
/**
|
|
21
|
-
* Constructs a new `GenreCollectionQuery` instance.
|
|
22
|
-
*
|
|
23
|
-
* @param authToken - The authentication token.
|
|
24
|
-
*/
|
|
25
|
-
constructor(authToken) {
|
|
26
|
-
super('https://graphql.anilist.co');
|
|
27
|
-
this.authToken = authToken;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* `genreCollection` is a method that sends a query request to get genre collections.
|
|
31
|
-
*
|
|
32
|
-
* @returns The response from the query request.
|
|
33
|
-
*/
|
|
34
|
-
genreCollection() {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
const query = `
|
|
37
|
-
query {
|
|
38
|
-
GenreCollection
|
|
39
|
-
}
|
|
40
|
-
`;
|
|
41
|
-
const data = { query };
|
|
42
|
-
return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.GenreCollectionQuery = GenreCollectionQuery;
|
|
@@ -1,57 +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.MarkdownQuery = void 0;
|
|
13
|
-
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
|
-
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
|
-
const ValidateVariables_1 = require("../../../base/ValidateVariables");
|
|
16
|
-
/**
|
|
17
|
-
* `MarkdownQuery` is a class representing a query for converting Markdown text to HTML.
|
|
18
|
-
* It includes a method to send the Markdown text and receive the converted HTML.
|
|
19
|
-
*/
|
|
20
|
-
class MarkdownQuery extends APIWrapper_1.APIWrapper {
|
|
21
|
-
/**
|
|
22
|
-
* Constructs a new `MarkdownQuery` instance.
|
|
23
|
-
*
|
|
24
|
-
* @param authToken - The authentication token.
|
|
25
|
-
*/
|
|
26
|
-
constructor(authToken) {
|
|
27
|
-
super('https://graphql.anilist.co');
|
|
28
|
-
this.authToken = authToken;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* `markdown` is a method that sends a query request to convert Markdown text to HTML.
|
|
32
|
-
*
|
|
33
|
-
* @param variables - The variables for the query.
|
|
34
|
-
* @returns The response from the query request.
|
|
35
|
-
*/
|
|
36
|
-
markdown(variables) {
|
|
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);
|
|
45
|
-
const query = `
|
|
46
|
-
query ($markdown: String!) {
|
|
47
|
-
Markdown (markdown: $markdown) {
|
|
48
|
-
html
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
`;
|
|
52
|
-
const data = { query, variables };
|
|
53
|
-
return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.MarkdownQuery = MarkdownQuery;
|
|
@@ -1,134 +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.MediaQuery = void 0;
|
|
13
|
-
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
|
-
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
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");
|
|
24
|
-
/**
|
|
25
|
-
* `MediaQuery` is a class representing a query for media data.
|
|
26
|
-
* It includes a method to send the media query and receive the response.
|
|
27
|
-
*/
|
|
28
|
-
class MediaQuery extends APIWrapper_1.APIWrapper {
|
|
29
|
-
/**
|
|
30
|
-
* Constructs a new `MediaQuery` instance.
|
|
31
|
-
*
|
|
32
|
-
* @param authToken - The authentication token.
|
|
33
|
-
*/
|
|
34
|
-
constructor(authToken) {
|
|
35
|
-
super('https://graphql.anilist.co');
|
|
36
|
-
this.authToken = authToken;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* `media` is a method that sends a query request to get media data.
|
|
40
|
-
*
|
|
41
|
-
* @param variables - The variables for the query.
|
|
42
|
-
* @returns The response from the query request.
|
|
43
|
-
*/
|
|
44
|
-
media(variables) {
|
|
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);
|
|
122
|
-
const query = `
|
|
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) {
|
|
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) {
|
|
125
|
-
${Media_1.MediaWithRelationsSchema}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
`;
|
|
129
|
-
const data = { query, variables };
|
|
130
|
-
return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
exports.MediaQuery = MediaQuery;
|
|
@@ -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.MediaListQuery = void 0;
|
|
13
|
-
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
|
-
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
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");
|
|
22
|
-
/**
|
|
23
|
-
* `MediaListQuery` is a class representing a query for media list data.
|
|
24
|
-
* It includes a method to send the media list query and receive the response.
|
|
25
|
-
*/
|
|
26
|
-
class MediaListQuery extends APIWrapper_1.APIWrapper {
|
|
27
|
-
/**
|
|
28
|
-
* Constructs a new `MediaListQuery` instance.
|
|
29
|
-
*
|
|
30
|
-
* @param authToken - The authentication token.
|
|
31
|
-
*/
|
|
32
|
-
constructor(authToken) {
|
|
33
|
-
super('https://graphql.anilist.co');
|
|
34
|
-
this.authToken = authToken;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* `mediaList` is a method that sends a query request to get media list data.
|
|
38
|
-
*
|
|
39
|
-
* @param variables - The variables for the query.
|
|
40
|
-
* @returns The response from the query request.
|
|
41
|
-
*/
|
|
42
|
-
mediaList(variables) {
|
|
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);
|
|
78
|
-
const query = `
|
|
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) {
|
|
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) {
|
|
81
|
-
${MediaList_1.MediaListSchema}
|
|
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.MediaListQuery = MediaListQuery;
|