anilink-api-wrapper 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AniLink.js +10 -1
- package/dist/apis/anilist/interfaces/CoverImage.js +9 -0
- package/dist/apis/anilist/interfaces/ExternalLink.js +8 -0
- package/dist/apis/anilist/interfaces/FuzzyDate.js +6 -0
- package/dist/apis/anilist/interfaces/Image.js +7 -0
- package/dist/apis/anilist/interfaces/MediaListEntry.js +7 -0
- package/dist/apis/anilist/interfaces/Name.js +9 -0
- package/dist/apis/anilist/interfaces/NextAiringEpisode.js +8 -0
- package/dist/apis/anilist/interfaces/Ranking.js +13 -0
- package/dist/apis/anilist/interfaces/ScoreDistribution.js +7 -0
- package/dist/apis/anilist/interfaces/StatusDistribution.js +7 -0
- package/dist/apis/anilist/interfaces/StreamingEpisode.js +9 -0
- package/dist/apis/anilist/interfaces/Tag.js +12 -0
- package/dist/apis/anilist/interfaces/Title.js +9 -0
- package/dist/apis/anilist/interfaces/Trailer.js +8 -0
- package/dist/apis/anilist/interfaces/UserStats.js +13 -0
- package/dist/apis/anilist/interfaces/responses/AiringSchedule.js +12 -0
- package/dist/apis/anilist/interfaces/responses/Character.js +28 -0
- package/dist/apis/anilist/interfaces/responses/Media.js +208 -0
- package/dist/apis/anilist/interfaces/responses/MediaList.js +30 -0
- package/dist/apis/anilist/interfaces/responses/MediaListCollectionResponse.js +39 -0
- package/dist/apis/anilist/interfaces/responses/MediaTag.js +2 -0
- package/dist/apis/anilist/interfaces/responses/MediaTagCollection.js +2 -0
- package/dist/apis/anilist/interfaces/responses/MediaTrend.js +15 -0
- package/dist/apis/anilist/interfaces/responses/Staff.js +53 -0
- package/dist/apis/anilist/interfaces/responses/User.js +360 -0
- package/dist/apis/anilist/query/AiringSchedule.js +3 -115
- package/dist/apis/anilist/query/Character.js +2 -36
- package/dist/apis/anilist/query/GenreCollection.js +32 -0
- package/dist/apis/anilist/query/Media.js +3 -200
- package/dist/apis/anilist/query/MediaList.js +2 -137
- package/dist/apis/anilist/query/MediaListCollection.js +2 -623
- package/dist/apis/anilist/query/MediaTagCollection.js +35 -0
- package/dist/apis/anilist/query/MediaTrend.js +3 -117
- package/dist/apis/anilist/query/Staff.js +2 -75
- package/dist/apis/anilist/query/User.js +8 -546
- package/dist/apis/anilist/query/Viewer.js +35 -0
- package/package.json +3 -2
- package/.eslintignore +0 -1
- package/.github/workflows/code_quality.yml +0 -32
- package/.github/workflows/codeql.yml +0 -33
- package/.github/workflows/test.yml +0 -30
- package/__tests__/anilist.test.ts +0 -268
- package/babel.config.js +0 -6
- package/jest.config.js +0 -11
- package/src/AniLink.ts +0 -80
- package/src/apis/anilist/interfaces/ActivityHistory.ts +0 -5
- package/src/apis/anilist/interfaces/CoverImage.ts +0 -6
- package/src/apis/anilist/interfaces/Distribution.ts +0 -4
- package/src/apis/anilist/interfaces/ExternalLink.ts +0 -5
- package/src/apis/anilist/interfaces/Favoured.ts +0 -15
- package/src/apis/anilist/interfaces/FuzzyDate.ts +0 -5
- package/src/apis/anilist/interfaces/Image.ts +0 -4
- package/src/apis/anilist/interfaces/ListScores.ts +0 -4
- package/src/apis/anilist/interfaces/Media.ts +0 -59
- package/src/apis/anilist/interfaces/MediaListEntry.ts +0 -4
- package/src/apis/anilist/interfaces/MediaStatistics.ts +0 -23
- package/src/apis/anilist/interfaces/MediaStats.ts +0 -7
- package/src/apis/anilist/interfaces/Name.ts +0 -8
- package/src/apis/anilist/interfaces/NextAiringEpisode.ts +0 -5
- package/src/apis/anilist/interfaces/Ranking.ts +0 -10
- package/src/apis/anilist/interfaces/ScoreDistribution.ts +0 -4
- package/src/apis/anilist/interfaces/Staff.ts +0 -6
- package/src/apis/anilist/interfaces/Stat.ts +0 -24
- package/src/apis/anilist/interfaces/Statistics.ts +0 -6
- package/src/apis/anilist/interfaces/StatusDistribution.ts +0 -4
- package/src/apis/anilist/interfaces/StreamingEpisode.ts +0 -6
- package/src/apis/anilist/interfaces/Studio.ts +0 -4
- package/src/apis/anilist/interfaces/Tag.ts +0 -10
- package/src/apis/anilist/interfaces/Title.ts +0 -6
- package/src/apis/anilist/interfaces/Trailer.ts +0 -5
- package/src/apis/anilist/interfaces/UserStats.ts +0 -25
- package/src/apis/anilist/interfaces/responses/AiringSchedule.ts +0 -10
- package/src/apis/anilist/interfaces/responses/Character.ts +0 -26
- package/src/apis/anilist/interfaces/responses/Media.ts +0 -118
- package/src/apis/anilist/interfaces/responses/MediaList.ts +0 -24
- package/src/apis/anilist/interfaces/responses/MediaListCollectionResponse.ts +0 -37
- package/src/apis/anilist/interfaces/responses/MediaTrend.ts +0 -13
- package/src/apis/anilist/interfaces/responses/Staff.ts +0 -53
- package/src/apis/anilist/interfaces/responses/User.ts +0 -72
- package/src/apis/anilist/mutation/UpdateUser.ts +0 -162
- package/src/apis/anilist/query/AiringSchedule.ts +0 -160
- package/src/apis/anilist/query/Character.ts +0 -75
- package/src/apis/anilist/query/Media.ts +0 -295
- package/src/apis/anilist/query/MediaList.ts +0 -192
- package/src/apis/anilist/query/MediaListCollection.ts +0 -673
- package/src/apis/anilist/query/MediaTrend.ts +0 -169
- package/src/apis/anilist/query/Staff.ts +0 -122
- package/src/apis/anilist/query/User.ts +0 -567
- package/src/base/APIWrapper.ts +0 -7
- package/src/base/RequestHandler.ts +0 -21
- package/tsconfig.json +0 -15
|
@@ -8,21 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
-
var t = {};
|
|
13
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
-
t[p] = s[p];
|
|
15
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
-
t[p[i]] = s[p[i]];
|
|
19
|
-
}
|
|
20
|
-
return t;
|
|
21
|
-
};
|
|
22
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
12
|
exports.UserQuery = void 0;
|
|
24
13
|
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
25
14
|
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
|
+
const User_1 = require("../interfaces/responses/User");
|
|
26
16
|
class UserQuery extends APIWrapper_1.APIWrapper {
|
|
27
17
|
constructor(authToken) {
|
|
28
18
|
super('https://graphql.anilist.co');
|
|
@@ -30,542 +20,14 @@ class UserQuery extends APIWrapper_1.APIWrapper {
|
|
|
30
20
|
}
|
|
31
21
|
user(variables) {
|
|
32
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
// If isHTML is not provided in variables, default it to true
|
|
34
|
-
const _a = variables != null ? variables : {}, { isHTML = true } = _a, rest = __rest(_a, ["isHTML"]);
|
|
35
23
|
const query = `
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
medium
|
|
44
|
-
}
|
|
45
|
-
bannerImage
|
|
46
|
-
isFollowing
|
|
47
|
-
isFollower
|
|
48
|
-
isBlocked
|
|
49
|
-
bans
|
|
50
|
-
options {
|
|
51
|
-
titleLanguage
|
|
52
|
-
displayAdultContent
|
|
53
|
-
airingNotifications
|
|
54
|
-
profileColor
|
|
55
|
-
notificationOptions {
|
|
56
|
-
type
|
|
57
|
-
enabled
|
|
58
|
-
}
|
|
59
|
-
timezone
|
|
60
|
-
activityMergeTime
|
|
61
|
-
staffNameLanguage
|
|
62
|
-
restrictMessagesToFollowing
|
|
63
|
-
disabledListActivity {
|
|
64
|
-
disabled
|
|
65
|
-
type
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
mediaListOptions {
|
|
69
|
-
scoreFormat
|
|
70
|
-
rowOrder
|
|
71
|
-
animeList {
|
|
72
|
-
sectionOrder
|
|
73
|
-
splitCompletedSectionByFormat
|
|
74
|
-
customLists
|
|
75
|
-
advancedScoring
|
|
76
|
-
advancedScoringEnabled
|
|
77
|
-
}
|
|
78
|
-
mangaList {
|
|
79
|
-
sectionOrder
|
|
80
|
-
splitCompletedSectionByFormat
|
|
81
|
-
customLists
|
|
82
|
-
advancedScoring
|
|
83
|
-
advancedScoringEnabled
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
favourites {
|
|
87
|
-
anime (perPage: 50) {
|
|
88
|
-
edges {
|
|
89
|
-
node {
|
|
90
|
-
id
|
|
91
|
-
title {
|
|
92
|
-
romaji
|
|
93
|
-
english
|
|
94
|
-
native
|
|
95
|
-
userPreferred
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
nodes {
|
|
100
|
-
id
|
|
101
|
-
title {
|
|
102
|
-
romaji
|
|
103
|
-
english
|
|
104
|
-
native
|
|
105
|
-
userPreferred
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
manga (perPage: 50) {
|
|
110
|
-
edges {
|
|
111
|
-
node {
|
|
112
|
-
id
|
|
113
|
-
title {
|
|
114
|
-
romaji
|
|
115
|
-
english
|
|
116
|
-
native
|
|
117
|
-
userPreferred
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
nodes {
|
|
122
|
-
id
|
|
123
|
-
title {
|
|
124
|
-
romaji
|
|
125
|
-
english
|
|
126
|
-
native
|
|
127
|
-
userPreferred
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
characters (perPage: 50) {
|
|
132
|
-
edges {
|
|
133
|
-
id
|
|
134
|
-
role
|
|
135
|
-
name
|
|
136
|
-
voiceActors {
|
|
137
|
-
id
|
|
138
|
-
name {
|
|
139
|
-
first
|
|
140
|
-
last
|
|
141
|
-
full
|
|
142
|
-
native
|
|
143
|
-
}
|
|
144
|
-
image {
|
|
145
|
-
large
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
media {
|
|
149
|
-
id
|
|
150
|
-
title {
|
|
151
|
-
romaji
|
|
152
|
-
english
|
|
153
|
-
native
|
|
154
|
-
userPreferred
|
|
155
|
-
}
|
|
156
|
-
coverImage {
|
|
157
|
-
extraLarge
|
|
158
|
-
large
|
|
159
|
-
medium
|
|
160
|
-
color
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
favouriteOrder
|
|
164
|
-
node {
|
|
165
|
-
id
|
|
166
|
-
name {
|
|
167
|
-
first
|
|
168
|
-
last
|
|
169
|
-
full
|
|
170
|
-
native
|
|
171
|
-
}
|
|
172
|
-
image {
|
|
173
|
-
large
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
staff (perPage: 50) {
|
|
179
|
-
edges {
|
|
180
|
-
id
|
|
181
|
-
role
|
|
182
|
-
favouriteOrder
|
|
183
|
-
node {
|
|
184
|
-
id
|
|
185
|
-
name {
|
|
186
|
-
first
|
|
187
|
-
last
|
|
188
|
-
full
|
|
189
|
-
native
|
|
190
|
-
}
|
|
191
|
-
image {
|
|
192
|
-
large
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
studios (perPage: 50) {
|
|
198
|
-
edges {
|
|
199
|
-
id
|
|
200
|
-
isMain
|
|
201
|
-
favouriteOrder
|
|
202
|
-
node {
|
|
203
|
-
id
|
|
204
|
-
name
|
|
205
|
-
isAnimationStudio
|
|
206
|
-
siteUrl
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
statistics {
|
|
212
|
-
anime {
|
|
213
|
-
count
|
|
214
|
-
meanScore
|
|
215
|
-
standardDeviation
|
|
216
|
-
minutesWatched
|
|
217
|
-
episodesWatched
|
|
218
|
-
formats (limit: $animeStatLimit, sort: $animeStatSort) {
|
|
219
|
-
count
|
|
220
|
-
meanScore
|
|
221
|
-
minutesWatched
|
|
222
|
-
mediaIds
|
|
223
|
-
format
|
|
224
|
-
}
|
|
225
|
-
statuses (limit: $animeStatLimit, sort: $animeStatSort) {
|
|
226
|
-
count
|
|
227
|
-
meanScore
|
|
228
|
-
minutesWatched
|
|
229
|
-
mediaIds
|
|
230
|
-
status
|
|
231
|
-
}
|
|
232
|
-
scores (limit: $animeStatLimit, sort: $animeStatSort) {
|
|
233
|
-
count
|
|
234
|
-
meanScore
|
|
235
|
-
minutesWatched
|
|
236
|
-
mediaIds
|
|
237
|
-
score
|
|
238
|
-
}
|
|
239
|
-
lengths (limit: $animeStatLimit, sort: $animeStatSort) {
|
|
240
|
-
count
|
|
241
|
-
meanScore
|
|
242
|
-
minutesWatched
|
|
243
|
-
mediaIds
|
|
244
|
-
length
|
|
245
|
-
}
|
|
246
|
-
releaseYears (limit: $animeStatLimit, sort: $animeStatSort) {
|
|
247
|
-
count
|
|
248
|
-
meanScore
|
|
249
|
-
minutesWatched
|
|
250
|
-
mediaIds
|
|
251
|
-
releaseYear
|
|
252
|
-
}
|
|
253
|
-
startYears (limit: $animeStatLimit, sort: $animeStatSort) {
|
|
254
|
-
count
|
|
255
|
-
meanScore
|
|
256
|
-
minutesWatched
|
|
257
|
-
mediaIds
|
|
258
|
-
startYear
|
|
259
|
-
}
|
|
260
|
-
genres (limit: $animeStatLimit, sort: $animeStatSort) {
|
|
261
|
-
count
|
|
262
|
-
meanScore
|
|
263
|
-
minutesWatched
|
|
264
|
-
mediaIds
|
|
265
|
-
genre
|
|
266
|
-
}
|
|
267
|
-
tags (limit: $animeStatLimit, sort: $animeStatSort) {
|
|
268
|
-
count
|
|
269
|
-
meanScore
|
|
270
|
-
minutesWatched
|
|
271
|
-
mediaIds
|
|
272
|
-
tag {
|
|
273
|
-
id
|
|
274
|
-
name
|
|
275
|
-
description
|
|
276
|
-
category
|
|
277
|
-
rank
|
|
278
|
-
isGeneralSpoiler
|
|
279
|
-
isMediaSpoiler
|
|
280
|
-
isAdult
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
countries (limit: $animeStatLimit, sort: $animeStatSort) {
|
|
284
|
-
count
|
|
285
|
-
meanScore
|
|
286
|
-
minutesWatched
|
|
287
|
-
mediaIds
|
|
288
|
-
country
|
|
289
|
-
}
|
|
290
|
-
voiceActors (limit: $animeStatLimit, sort: $animeStatSort) {
|
|
291
|
-
count
|
|
292
|
-
meanScore
|
|
293
|
-
minutesWatched
|
|
294
|
-
mediaIds
|
|
295
|
-
voiceActor {
|
|
296
|
-
id
|
|
297
|
-
name {
|
|
298
|
-
first
|
|
299
|
-
last
|
|
300
|
-
full
|
|
301
|
-
native
|
|
302
|
-
alternative
|
|
303
|
-
userPreferred
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
characterIds
|
|
307
|
-
}
|
|
308
|
-
staff (limit: $animeStatLimit, sort: $animeStatSort) {
|
|
309
|
-
count
|
|
310
|
-
meanScore
|
|
311
|
-
minutesWatched
|
|
312
|
-
mediaIds
|
|
313
|
-
staff {
|
|
314
|
-
id
|
|
315
|
-
name {
|
|
316
|
-
first
|
|
317
|
-
last
|
|
318
|
-
full
|
|
319
|
-
native
|
|
320
|
-
alternative
|
|
321
|
-
userPreferred
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
studios (limit: $animeStatLimit, sort: $animeStatSort) {
|
|
326
|
-
count
|
|
327
|
-
meanScore
|
|
328
|
-
minutesWatched
|
|
329
|
-
mediaIds
|
|
330
|
-
studio {
|
|
331
|
-
id
|
|
332
|
-
name
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
manga {
|
|
337
|
-
count
|
|
338
|
-
meanScore
|
|
339
|
-
standardDeviation
|
|
340
|
-
chaptersRead
|
|
341
|
-
volumesRead
|
|
342
|
-
formats (limit: $mangaStatLimit, sort: $mangaStatSort) {
|
|
343
|
-
count
|
|
344
|
-
meanScore
|
|
345
|
-
chaptersRead
|
|
346
|
-
mediaIds
|
|
347
|
-
format
|
|
348
|
-
}
|
|
349
|
-
statuses (limit: $mangaStatLimit, sort: $mangaStatSort) {
|
|
350
|
-
count
|
|
351
|
-
meanScore
|
|
352
|
-
chaptersRead
|
|
353
|
-
mediaIds
|
|
354
|
-
status
|
|
355
|
-
}
|
|
356
|
-
scores (limit: $mangaStatLimit, sort: $mangaStatSort) {
|
|
357
|
-
count
|
|
358
|
-
meanScore
|
|
359
|
-
chaptersRead
|
|
360
|
-
mediaIds
|
|
361
|
-
score
|
|
362
|
-
}
|
|
363
|
-
lengths (limit: $mangaStatLimit, sort: $mangaStatSort) {
|
|
364
|
-
count
|
|
365
|
-
meanScore
|
|
366
|
-
chaptersRead
|
|
367
|
-
mediaIds
|
|
368
|
-
length
|
|
369
|
-
}
|
|
370
|
-
releaseYears (limit: $mangaStatLimit, sort: $mangaStatSort) {
|
|
371
|
-
count
|
|
372
|
-
meanScore
|
|
373
|
-
chaptersRead
|
|
374
|
-
mediaIds
|
|
375
|
-
releaseYear
|
|
376
|
-
}
|
|
377
|
-
startYears (limit: $mangaStatLimit, sort: $mangaStatSort) {
|
|
378
|
-
count
|
|
379
|
-
meanScore
|
|
380
|
-
chaptersRead
|
|
381
|
-
mediaIds
|
|
382
|
-
startYear
|
|
383
|
-
}
|
|
384
|
-
genres (limit: $mangaStatLimit, sort: $mangaStatSort) {
|
|
385
|
-
count
|
|
386
|
-
meanScore
|
|
387
|
-
chaptersRead
|
|
388
|
-
mediaIds
|
|
389
|
-
genre
|
|
390
|
-
}
|
|
391
|
-
tags (limit: $mangaStatLimit, sort: $mangaStatSort) {
|
|
392
|
-
count
|
|
393
|
-
meanScore
|
|
394
|
-
chaptersRead
|
|
395
|
-
mediaIds
|
|
396
|
-
tag {
|
|
397
|
-
id
|
|
398
|
-
name
|
|
399
|
-
description
|
|
400
|
-
category
|
|
401
|
-
rank
|
|
402
|
-
isGeneralSpoiler
|
|
403
|
-
isMediaSpoiler
|
|
404
|
-
isAdult
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
countries (limit: $mangaStatLimit, sort: $mangaStatSort) {
|
|
408
|
-
count
|
|
409
|
-
meanScore
|
|
410
|
-
chaptersRead
|
|
411
|
-
mediaIds
|
|
412
|
-
country
|
|
413
|
-
}
|
|
414
|
-
staff (limit: $mangaStatLimit, sort: $mangaStatSort) {
|
|
415
|
-
count
|
|
416
|
-
meanScore
|
|
417
|
-
chaptersRead
|
|
418
|
-
mediaIds
|
|
419
|
-
staff {
|
|
420
|
-
id
|
|
421
|
-
name {
|
|
422
|
-
first
|
|
423
|
-
last
|
|
424
|
-
full
|
|
425
|
-
native
|
|
426
|
-
alternative
|
|
427
|
-
userPreferred
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
studios (limit: $mangaStatLimit, sort: $mangaStatSort) {
|
|
432
|
-
count
|
|
433
|
-
meanScore
|
|
434
|
-
chaptersRead
|
|
435
|
-
mediaIds
|
|
436
|
-
studio {
|
|
437
|
-
id
|
|
438
|
-
name
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
stats {
|
|
444
|
-
watchedTime
|
|
445
|
-
chaptersRead
|
|
446
|
-
activityHistory {
|
|
447
|
-
date
|
|
448
|
-
amount
|
|
449
|
-
level
|
|
450
|
-
}
|
|
451
|
-
animeStatusDistribution {
|
|
452
|
-
status
|
|
453
|
-
amount
|
|
454
|
-
}
|
|
455
|
-
mangaStatusDistribution {
|
|
456
|
-
status
|
|
457
|
-
amount
|
|
458
|
-
}
|
|
459
|
-
animeScoreDistribution {
|
|
460
|
-
score
|
|
461
|
-
amount
|
|
462
|
-
}
|
|
463
|
-
mangaScoreDistribution {
|
|
464
|
-
score
|
|
465
|
-
amount
|
|
466
|
-
}
|
|
467
|
-
animeListScores {
|
|
468
|
-
meanScore
|
|
469
|
-
standardDeviation
|
|
470
|
-
}
|
|
471
|
-
mangaListScores {
|
|
472
|
-
meanScore
|
|
473
|
-
standardDeviation
|
|
474
|
-
}
|
|
475
|
-
favouredGenresOverview {
|
|
476
|
-
genre
|
|
477
|
-
amount
|
|
478
|
-
meanScore
|
|
479
|
-
timeWatched
|
|
480
|
-
}
|
|
481
|
-
favouredGenres {
|
|
482
|
-
genre
|
|
483
|
-
amount
|
|
484
|
-
meanScore
|
|
485
|
-
timeWatched
|
|
486
|
-
}
|
|
487
|
-
favouredTags {
|
|
488
|
-
tag {
|
|
489
|
-
id
|
|
490
|
-
name
|
|
491
|
-
description
|
|
492
|
-
category
|
|
493
|
-
rank
|
|
494
|
-
isGeneralSpoiler
|
|
495
|
-
isMediaSpoiler
|
|
496
|
-
isAdult
|
|
497
|
-
}
|
|
498
|
-
amount
|
|
499
|
-
meanScore
|
|
500
|
-
timeWatched
|
|
501
|
-
}
|
|
502
|
-
favouredActors {
|
|
503
|
-
staff {
|
|
504
|
-
id
|
|
505
|
-
name {
|
|
506
|
-
first
|
|
507
|
-
last
|
|
508
|
-
full
|
|
509
|
-
native
|
|
510
|
-
alternative
|
|
511
|
-
userPreferred
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
amount
|
|
515
|
-
meanScore
|
|
516
|
-
timeWatched
|
|
517
|
-
}
|
|
518
|
-
favouredStaff {
|
|
519
|
-
staff {
|
|
520
|
-
id
|
|
521
|
-
name {
|
|
522
|
-
first
|
|
523
|
-
last
|
|
524
|
-
full
|
|
525
|
-
native
|
|
526
|
-
alternative
|
|
527
|
-
userPreferred
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
amount
|
|
531
|
-
meanScore
|
|
532
|
-
timeWatched
|
|
533
|
-
}
|
|
534
|
-
favouredStudios {
|
|
535
|
-
studio {
|
|
536
|
-
id
|
|
537
|
-
name
|
|
538
|
-
}
|
|
539
|
-
amount
|
|
540
|
-
meanScore
|
|
541
|
-
timeWatched
|
|
542
|
-
}
|
|
543
|
-
favouredYears {
|
|
544
|
-
year
|
|
545
|
-
amount
|
|
546
|
-
meanScore
|
|
547
|
-
}
|
|
548
|
-
favouredFormats {
|
|
549
|
-
format
|
|
550
|
-
amount
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
unreadNotificationCount
|
|
554
|
-
siteUrl
|
|
555
|
-
donatorTier
|
|
556
|
-
donatorBadge
|
|
557
|
-
moderatorRoles
|
|
558
|
-
createdAt
|
|
559
|
-
updatedAt
|
|
560
|
-
previousNames {
|
|
561
|
-
name
|
|
562
|
-
createdAt
|
|
563
|
-
updatedAt
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
`;
|
|
568
|
-
const data = { query, variables: Object.assign({ isHTML }, rest) };
|
|
24
|
+
query ($id: Int, $name: String, $isModerator: Boolean, $search: String, $sort: [UserSort], $asHtml: Boolean, $animeStatLimit: Int, $mangaStatLimit: Int, $animeStatSort: [UserStatisticsSort], $mangaStatSort: [UserStatisticsSort]) {
|
|
25
|
+
User (id: $id, name: $name, isModerator: $isModerator, search: $search, sort: $sort) {
|
|
26
|
+
${User_1.UserSchema}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
const data = { query, variables };
|
|
569
31
|
return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
|
|
570
32
|
});
|
|
571
33
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ViewerQuery = void 0;
|
|
13
|
+
const APIWrapper_1 = require("../../../base/APIWrapper");
|
|
14
|
+
const RequestHandler_1 = require("../../../base/RequestHandler");
|
|
15
|
+
const User_1 = require("../interfaces/responses/User");
|
|
16
|
+
class ViewerQuery extends APIWrapper_1.APIWrapper {
|
|
17
|
+
constructor(authToken) {
|
|
18
|
+
super('https://graphql.anilist.co');
|
|
19
|
+
this.authToken = authToken;
|
|
20
|
+
}
|
|
21
|
+
viewer(variables) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const query = `
|
|
24
|
+
query ($asHtml: Boolean, $animeStatLimit: Int, $mangaStatLimit: Int, $animeStatSort: [UserStatisticsSort], $mangaStatSort: [UserStatisticsSort]) {
|
|
25
|
+
Viewer {
|
|
26
|
+
${User_1.UserSchema}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
const data = { query, variables };
|
|
31
|
+
return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ViewerQuery = ViewerQuery;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anilink-api-wrapper",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Anilist API Wrapper",
|
|
5
5
|
"main": "dist/AniLink.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "jest",
|
|
8
|
-
"build": "tsc"
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"prepublishOnly": "npm run build"
|
|
9
10
|
},
|
|
10
11
|
"keywords": [
|
|
11
12
|
"anilist",
|
package/.eslintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/__tests__/*
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Qodana
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
pull_request:
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- master
|
|
9
|
-
- 'releases/*'
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
qodana:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
permissions:
|
|
15
|
-
contents: read
|
|
16
|
-
pull-requests: write
|
|
17
|
-
checks: write
|
|
18
|
-
steps:
|
|
19
|
-
- uses: actions/checkout@v4
|
|
20
|
-
with:
|
|
21
|
-
ref: ${{ github.event.pull_request.head.sha }}
|
|
22
|
-
fetch-depth: 0
|
|
23
|
-
- name: Setup Node.js environment
|
|
24
|
-
uses: actions/setup-node@v4.0.2
|
|
25
|
-
with:
|
|
26
|
-
node-version: '21'
|
|
27
|
-
cache: 'npm'
|
|
28
|
-
- run: npm ci
|
|
29
|
-
- name: 'Qodana Scan'
|
|
30
|
-
uses: JetBrains/qodana-action@v2023.3.1
|
|
31
|
-
env:
|
|
32
|
-
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "CodeQL"
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: ["master"]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: ["master"]
|
|
8
|
-
schedule:
|
|
9
|
-
- cron: '0 7 * * 1'
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
analyze:
|
|
13
|
-
name: Analyze
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
permissions:
|
|
16
|
-
security-events: write
|
|
17
|
-
actions: read
|
|
18
|
-
contents: read
|
|
19
|
-
strategy:
|
|
20
|
-
fail-fast: false
|
|
21
|
-
matrix:
|
|
22
|
-
language: ['javascript-typescript']
|
|
23
|
-
steps:
|
|
24
|
-
- name: Checkout repository
|
|
25
|
-
uses: actions/checkout@v4
|
|
26
|
-
- name: Initialize CodeQL
|
|
27
|
-
uses: github/codeql-action/init@v3
|
|
28
|
-
with:
|
|
29
|
-
languages: ${{ matrix.language }}
|
|
30
|
-
- name: Perform CodeQL Analysis
|
|
31
|
-
uses: github/codeql-action/analyze@v3
|
|
32
|
-
with:
|
|
33
|
-
category: "/language:${{matrix.language}}"
|