anilink-api-wrapper 1.29.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +71 -241
  3. package/dist/AniLink.d.ts +12329 -0
  4. package/dist/AniLink.mjs +7298 -0
  5. package/dist/anilist.d.ts +1 -0
  6. package/dist/anilist.mjs +5 -0
  7. package/dist/mal.d.ts +1 -0
  8. package/dist/mal.mjs +5 -0
  9. package/package.json +121 -46
  10. package/dist/AniLink.js +0 -248
  11. package/dist/apis/anilist/Custom.js +0 -42
  12. package/dist/apis/anilist/interfaces/Activity.js +0 -436
  13. package/dist/apis/anilist/interfaces/Basic.js +0 -33
  14. package/dist/apis/anilist/interfaces/CoverImage.js +0 -15
  15. package/dist/apis/anilist/interfaces/Distribution.js +0 -23
  16. package/dist/apis/anilist/interfaces/ExternalLink.js +0 -14
  17. package/dist/apis/anilist/interfaces/Favoured.js +0 -2
  18. package/dist/apis/anilist/interfaces/FuzzyDate.js +0 -12
  19. package/dist/apis/anilist/interfaces/Image.js +0 -13
  20. package/dist/apis/anilist/interfaces/ListScores.js +0 -2
  21. package/dist/apis/anilist/interfaces/Media.js +0 -13
  22. package/dist/apis/anilist/interfaces/Name.js +0 -15
  23. package/dist/apis/anilist/interfaces/NextAiringEpisode.js +0 -14
  24. package/dist/apis/anilist/interfaces/Notification.js +0 -25
  25. package/dist/apis/anilist/interfaces/Ranking.js +0 -19
  26. package/dist/apis/anilist/interfaces/SiteTrend.js +0 -33
  27. package/dist/apis/anilist/interfaces/Staff.js +0 -2
  28. package/dist/apis/anilist/interfaces/Stat.js +0 -2
  29. package/dist/apis/anilist/interfaces/Statistics.js +0 -2
  30. package/dist/apis/anilist/interfaces/StreamingEpisode.js +0 -15
  31. package/dist/apis/anilist/interfaces/Studio.js +0 -2
  32. package/dist/apis/anilist/interfaces/Tag.js +0 -18
  33. package/dist/apis/anilist/interfaces/Title.js +0 -15
  34. package/dist/apis/anilist/interfaces/Trailer.js +0 -14
  35. package/dist/apis/anilist/interfaces/UserStats.js +0 -23
  36. package/dist/apis/anilist/interfaces/responses/mutation/Favourites.js +0 -83
  37. package/dist/apis/anilist/interfaces/responses/query/AiringSchedule.js +0 -18
  38. package/dist/apis/anilist/interfaces/responses/query/AniChartUser.js +0 -2
  39. package/dist/apis/anilist/interfaces/responses/query/Character.js +0 -34
  40. package/dist/apis/anilist/interfaces/responses/query/ExternalLinkSourceCollection.js +0 -2
  41. package/dist/apis/anilist/interfaces/responses/query/Media.js +0 -217
  42. package/dist/apis/anilist/interfaces/responses/query/MediaList.js +0 -36
  43. package/dist/apis/anilist/interfaces/responses/query/MediaListCollectionResponse.js +0 -49
  44. package/dist/apis/anilist/interfaces/responses/query/MediaTagCollection.js +0 -2
  45. package/dist/apis/anilist/interfaces/responses/query/MediaTrend.js +0 -21
  46. package/dist/apis/anilist/interfaces/responses/query/Notification.js +0 -166
  47. package/dist/apis/anilist/interfaces/responses/query/Recommendation.js +0 -23
  48. package/dist/apis/anilist/interfaces/responses/query/Review.js +0 -30
  49. package/dist/apis/anilist/interfaces/responses/query/SiteStatistics.js +0 -31
  50. package/dist/apis/anilist/interfaces/responses/query/Staff.js +0 -59
  51. package/dist/apis/anilist/interfaces/responses/query/Studio.js +0 -60
  52. package/dist/apis/anilist/interfaces/responses/query/Thread.js +0 -44
  53. package/dist/apis/anilist/interfaces/responses/query/ThreadComment.js +0 -31
  54. package/dist/apis/anilist/interfaces/responses/query/User.js +0 -366
  55. package/dist/apis/anilist/mutation/DeleteActivity.js +0 -61
  56. package/dist/apis/anilist/mutation/DeleteActivityReply.js +0 -61
  57. package/dist/apis/anilist/mutation/DeleteCustomList.js +0 -63
  58. package/dist/apis/anilist/mutation/DeleteMediaListEntry.js +0 -61
  59. package/dist/apis/anilist/mutation/DeleteReview.js +0 -61
  60. package/dist/apis/anilist/mutation/DeleteThread.js +0 -61
  61. package/dist/apis/anilist/mutation/DeleteThreadComment.js +0 -61
  62. package/dist/apis/anilist/mutation/SaveActivityReply.js +0 -66
  63. package/dist/apis/anilist/mutation/SaveListActivity.js +0 -64
  64. package/dist/apis/anilist/mutation/SaveMediaListEntry.js +0 -97
  65. package/dist/apis/anilist/mutation/SaveMessageActivity.js +0 -68
  66. package/dist/apis/anilist/mutation/SaveRecommendation.js +0 -66
  67. package/dist/apis/anilist/mutation/SaveReview.js +0 -68
  68. package/dist/apis/anilist/mutation/SaveTextActivity.js +0 -65
  69. package/dist/apis/anilist/mutation/SaveThread.js +0 -69
  70. package/dist/apis/anilist/mutation/SaveThreadComment.js +0 -67
  71. package/dist/apis/anilist/mutation/ToggleActivityPin.js +0 -64
  72. package/dist/apis/anilist/mutation/ToggleActivitySubscription.js +0 -64
  73. package/dist/apis/anilist/mutation/ToggleFavourite.js +0 -66
  74. package/dist/apis/anilist/mutation/ToggleFollow.js +0 -62
  75. package/dist/apis/anilist/mutation/ToggleLike.js +0 -64
  76. package/dist/apis/anilist/mutation/ToggleLikeV2.js +0 -64
  77. package/dist/apis/anilist/mutation/ToggleThreadSubscription.js +0 -64
  78. package/dist/apis/anilist/mutation/UpdateAniChartHighlights.js +0 -58
  79. package/dist/apis/anilist/mutation/UpdateAniChartSettings.js +0 -58
  80. package/dist/apis/anilist/mutation/UpdateFavouriteOrder.js +0 -73
  81. package/dist/apis/anilist/mutation/UpdateMediaListEntries.js +0 -93
  82. package/dist/apis/anilist/mutation/UpdateUser.js +0 -127
  83. package/dist/apis/anilist/query/Activity.js +0 -86
  84. package/dist/apis/anilist/query/ActivityReply.js +0 -60
  85. package/dist/apis/anilist/query/AiringSchedule.js +0 -78
  86. package/dist/apis/anilist/query/AniChartUser.js +0 -56
  87. package/dist/apis/anilist/query/Character.js +0 -70
  88. package/dist/apis/anilist/query/ExternalLinkSourceCollection.js +0 -68
  89. package/dist/apis/anilist/query/Follower.js +0 -64
  90. package/dist/apis/anilist/query/Following.js +0 -64
  91. package/dist/apis/anilist/query/GenreCollection.js +0 -46
  92. package/dist/apis/anilist/query/Markdown.js +0 -57
  93. package/dist/apis/anilist/query/Media.js +0 -134
  94. package/dist/apis/anilist/query/MediaList.js +0 -90
  95. package/dist/apis/anilist/query/MediaListCollection.js +0 -76
  96. package/dist/apis/anilist/query/MediaTagCollection.js +0 -57
  97. package/dist/apis/anilist/query/MediaTrend.js +0 -84
  98. package/dist/apis/anilist/query/Notification.js +0 -65
  99. package/dist/apis/anilist/query/Recommendation.js +0 -68
  100. package/dist/apis/anilist/query/Review.js +0 -64
  101. package/dist/apis/anilist/query/SiteStatistics.js +0 -78
  102. package/dist/apis/anilist/query/Staff.js +0 -79
  103. package/dist/apis/anilist/query/Studio.js +0 -82
  104. package/dist/apis/anilist/query/Thread.js +0 -68
  105. package/dist/apis/anilist/query/ThreadComment.js +0 -63
  106. package/dist/apis/anilist/query/User.js +0 -68
  107. package/dist/apis/anilist/query/Viewer.js +0 -65
  108. package/dist/apis/anilist/query/page/Activities.js +0 -97
  109. package/dist/apis/anilist/query/page/ActivityReplies.js +0 -71
  110. package/dist/apis/anilist/query/page/AiringSchedules.js +0 -89
  111. package/dist/apis/anilist/query/page/Characters.js +0 -81
  112. package/dist/apis/anilist/query/page/Followers.js +0 -75
  113. package/dist/apis/anilist/query/page/Followings.js +0 -75
  114. package/dist/apis/anilist/query/page/Likes.js +0 -71
  115. package/dist/apis/anilist/query/page/MediaLists.js +0 -101
  116. package/dist/apis/anilist/query/page/MediaTrends.js +0 -95
  117. package/dist/apis/anilist/query/page/Medias.js +0 -143
  118. package/dist/apis/anilist/query/page/Notifications.js +0 -73
  119. package/dist/apis/anilist/query/page/Recommendations.js +0 -79
  120. package/dist/apis/anilist/query/page/Reviews.js +0 -75
  121. package/dist/apis/anilist/query/page/Staffs.js +0 -90
  122. package/dist/apis/anilist/query/page/Studios.js +0 -93
  123. package/dist/apis/anilist/query/page/ThreadCommments.js +0 -74
  124. package/dist/apis/anilist/query/page/Threads.js +0 -79
  125. package/dist/apis/anilist/query/page/Users.js +0 -79
  126. package/dist/apis/anilist/types/ActivityType.js +0 -14
  127. package/dist/apis/anilist/types/DisabledListActivity.js +0 -11
  128. package/dist/apis/anilist/types/Format.js +0 -30
  129. package/dist/apis/anilist/types/FuzzyDate.js +0 -12
  130. package/dist/apis/anilist/types/MediaListOptions.js +0 -16
  131. package/dist/apis/anilist/types/NotificationOptions.js +0 -29
  132. package/dist/apis/anilist/types/RecommendationRating.js +0 -12
  133. package/dist/apis/anilist/types/Season.js +0 -13
  134. package/dist/apis/anilist/types/Sort.js +0 -265
  135. package/dist/apis/anilist/types/Source.js +0 -25
  136. package/dist/apis/anilist/types/Status.js +0 -26
  137. package/dist/apis/anilist/types/Type.js +0 -44
  138. package/dist/apis/anilist/types/UserStaffNameLanguage.js +0 -15
  139. package/dist/apis/anilist/types/UserTitleLanguage.js +0 -15
  140. package/dist/base/APIWrapper.js +0 -17
  141. package/dist/base/RequestHandler.js +0 -48
  142. package/dist/base/ValidateVariables.js +0 -125
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotificationOptionsMapping = void 0;
4
- /**
5
- * `NotificationOptionsMapping` is a constant that maps the `NotificationOptions` fields to their expected types.
6
- * The `type` field is mapped to an array of possible values, and the `enabled` field is mapped to 'boolean'.
7
- */
8
- exports.NotificationOptionsMapping = {
9
- type: [
10
- 'ACTIVITY_MESSAGE',
11
- 'ACTIVITY_REPLY',
12
- 'FOLLOWING',
13
- 'ACTIVITY_MENTION',
14
- 'THREAD_COMMENT_MENTION',
15
- 'THREAD_SUBSCRIBED',
16
- 'THREAD_COMMENT_REPLY',
17
- 'AIRING',
18
- 'ACTIVITY_LIKE',
19
- 'ACTIVITY_REPLY_LIKE',
20
- 'THREAD_LIKE',
21
- 'THREAD_COMMENT_LIKE',
22
- 'ACTIVITY_REPLY_SUBSCRIBED',
23
- 'RELATED_MEDIA_ADDITION',
24
- 'MEDIA_DATA_CHANGE',
25
- 'MEDIA_MERGE',
26
- 'MEDIA_DELETION'
27
- ],
28
- enabled: 'boolean'
29
- };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RecommendationRatingMappings = void 0;
4
- /**
5
- * `RecommendationRatingMappings` is a mapping of `RecommendationRating` enum values to their corresponding string values.
6
- * It can be one of the following: 'NO_RATING', 'RATE_UP', 'RATE_DOWN'.
7
- */
8
- exports.RecommendationRatingMappings = [
9
- 'NO_RATING',
10
- 'RATE_UP',
11
- 'RATE_DOWN'
12
- ];
@@ -1,13 +0,0 @@
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
- ];
@@ -1,265 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ThreadCommentSortMappings = exports.ThreadSortMappings = exports.StudioSortMappings = exports.StaffSortMappings = exports.SiteTrendSortMappings = exports.ReviewSortMappings = exports.RecommendationSortMappings = exports.CharacterSortMappings = exports.AiringSortMappings = exports.ActivitySortMappings = exports.UserStatisticSortMappings = exports.UserSortMappings = exports.MediaTrendSortMappings = exports.MediaListSortMappings = exports.MediaSortMappings = void 0;
4
- /**
5
- * `MediaSortMappings` is a mapping of `MediaSort` enum values to their corresponding string values.
6
- * It can be one of the following: 'ID', 'ID_DESC', 'TITLE_ROMAJI', 'TITLE_ROMAJI_DESC', 'TITLE_ENGLISH', 'TITLE_ENGLISH_DESC', 'TITLE_NATIVE', 'TITLE_NATIVE_DESC', 'TYPE', 'TYPE_DESC', 'FORMAT', 'FORMAT_DESC', 'START_DATE', 'START_DATE_DESC', 'END_DATE', 'END_DATE_DESC', 'SCORE', 'SCORE_DESC', 'POPULARITY', 'POPULARITY_DESC', 'TRENDING', 'TRENDING_DESC', 'EPISODES', 'EPISODES_DESC', 'DURATION', 'DURATION_DESC', 'STATUS', 'STATUS_DESC', 'CHAPTERS', 'CHAPTERS_DESC', 'VOLUMES', 'VOLUMES_DESC', 'UPDATED_AT', 'UPDATED_AT_DESC', 'SEARCH_MATCH', 'FAVOURITES', 'FAVOURITES_DESC'
7
- */
8
- exports.MediaSortMappings = [
9
- 'ID',
10
- 'ID_DESC',
11
- 'TITLE_ROMAJI',
12
- 'TITLE_ROMAJI_DESC',
13
- 'TITLE_ENGLISH',
14
- 'TITLE_ENGLISH_DESC',
15
- 'TITLE_NATIVE',
16
- 'TITLE_NATIVE_DESC',
17
- 'TYPE',
18
- 'TYPE_DESC',
19
- 'FORMAT',
20
- 'FORMAT_DESC',
21
- 'START_DATE',
22
- 'START_DATE_DESC',
23
- 'END_DATE',
24
- 'END_DATE_DESC',
25
- 'SCORE',
26
- 'SCORE_DESC',
27
- 'POPULARITY',
28
- 'POPULARITY_DESC',
29
- 'TRENDING',
30
- 'TRENDING_DESC',
31
- 'EPISODES',
32
- 'EPISODES_DESC',
33
- 'DURATION',
34
- 'DURATION_DESC',
35
- 'STATUS',
36
- 'STATUS_DESC',
37
- 'CHAPTERS',
38
- 'CHAPTERS_DESC',
39
- 'VOLUMES',
40
- 'VOLUMES_DESC',
41
- 'UPDATED_AT',
42
- 'UPDATED_AT_DESC',
43
- 'SEARCH_MATCH',
44
- 'FAVOURITES',
45
- 'FAVOURITES_DESC'
46
- ];
47
- /**
48
- * `MediaListSortMappings` is a mapping of `MediaListSort` enum values to their corresponding string values.
49
- * It can be one of the following: 'MEDIA_ID', 'MEDIA_ID_DESC', 'SCORE', 'SCORE_DESC', 'STATUS', 'STATUS_DESC', 'PROGRESS', 'PROGRESS_DESC', 'PROGRESS_VOLUMES', 'PROGRESS_VOLUMES_DESC', 'REPEAT', 'REPEAT_DESC', 'PRIORITY', 'PRIORITY_DESC', 'STARTED_ON', 'STARTED_ON_DESC', 'FINISHED_ON', 'FINISHED_ON_DESC', 'ADDED_TIME', 'ADDED_TIME_DESC', 'UPDATED_TIME', 'UPDATED_TIME_DESC', 'MEDIA_TITLE_ROMAJI', 'MEDIA_TITLE_ROMAJI_DESC', 'MEDIA_TITLE_ENGLISH', 'MEDIA_TITLE_ENGLISH_DESC', 'MEDIA_TITLE_NATIVE', 'MEDIA_TITLE_NATIVE_DESC', 'MEDIA_POPULARITY', 'MEDIA_POPULARITY_DESC'
50
- */
51
- exports.MediaListSortMappings = [
52
- 'MEDIA_ID',
53
- 'MEDIA_ID_DESC',
54
- 'SCORE',
55
- 'SCORE_DESC',
56
- 'STATUS',
57
- 'STATUS_DESC',
58
- 'PROGRESS',
59
- 'PROGRESS_DESC',
60
- 'PROGRESS_VOLUMES',
61
- 'PROGRESS_VOLUMES_DESC',
62
- 'REPEAT',
63
- 'REPEAT_DESC',
64
- 'PRIORITY',
65
- 'PRIORITY_DESC',
66
- 'STARTED_ON',
67
- 'STARTED_ON_DESC',
68
- 'FINISHED_ON',
69
- 'FINISHED_ON_DESC',
70
- 'ADDED_TIME',
71
- 'ADDED_TIME_DESC',
72
- 'UPDATED_TIME',
73
- 'UPDATED_TIME_DESC',
74
- 'MEDIA_TITLE_ROMAJI',
75
- 'MEDIA_TITLE_ROMAJI_DESC',
76
- 'MEDIA_TITLE_ENGLISH',
77
- 'MEDIA_TITLE_ENGLISH_DESC',
78
- 'MEDIA_TITLE_NATIVE',
79
- 'MEDIA_TITLE_NATIVE_DESC',
80
- 'MEDIA_POPULARITY',
81
- 'MEDIA_POPULARITY_DESC'
82
- ];
83
- /**
84
- * `MediaTrendSortMappings` is a mapping of `MediaTrendSort` enum values to their corresponding string values.
85
- * It can be one of the following: 'ID', 'ID_DESC', 'MEDIA_ID', 'MEDIA_ID_DESC', 'DATE', 'DATE_DESC', 'SCORE', 'SCORE_DESC', 'POPULARITY', 'POPULARITY_DESC', 'TRENDING', 'TRENDING_DESC', 'EPISODE', 'EPISODE_DESC'.
86
- */
87
- exports.MediaTrendSortMappings = [
88
- 'ID',
89
- 'ID_DESC',
90
- 'MEDIA_ID',
91
- 'MEDIA_ID_DESC',
92
- 'DATE',
93
- 'DATE_DESC',
94
- 'SCORE',
95
- 'SCORE_DESC',
96
- 'POPULARITY',
97
- 'POPULARITY_DESC',
98
- 'TRENDING',
99
- 'TRENDING_DESC',
100
- 'EPISODE',
101
- 'EPISODE_DESC'
102
- ];
103
- /**
104
- * `UserSortMappings` is a mapping of `UserSort` enum values to their corresponding string values.
105
- * It can be one of the following: 'ID', 'ID_DESC', 'USERNAME', 'USERNAME_DESC', 'WATCHED_TIME', 'WATCHED_TIME_DESC', 'CHAPTERS_READ', 'CHAPTERS_READ_DESC', 'SEARCH_MATCH'.
106
- */
107
- exports.UserSortMappings = [
108
- 'ID',
109
- 'ID_DESC',
110
- 'USERNAME',
111
- 'USERNAME_DESC',
112
- 'WATCHED_TIME',
113
- 'WATCHED_TIME_DESC',
114
- 'CHAPTERS_READ',
115
- 'CHAPTERS_READ_DESC',
116
- 'SEARCH_MATCH'
117
- ];
118
- /**
119
- * `UserStatisticSortMappings` is a mapping of `UserStatisticSort` enum values to their corresponding string values.
120
- * It can be one of the following: 'ID', 'ID_DESC', 'COUNT', 'COUNT_DESC', 'PROGRESS', 'PROGRESS_DESC', 'MEAN_SCORE', 'MEAN_SCORE_DESC'.
121
- */
122
- exports.UserStatisticSortMappings = [
123
- 'ID',
124
- 'ID_DESC',
125
- 'COUNT',
126
- 'COUNT_DESC',
127
- 'PROGRESS',
128
- 'PROGRESS_DESC',
129
- 'MEAN_SCORE',
130
- 'MEAN_SCORE_DESC'
131
- ];
132
- /**
133
- * `ActivitySortMappings` is a mapping of `ActivitySort` enum values to their corresponding string values.
134
- * It can be one of the following: 'ID', 'ID_DESC', 'PINNED'.
135
- */
136
- exports.ActivitySortMappings = [
137
- 'ID',
138
- 'ID_DESC',
139
- 'PINNED'
140
- ];
141
- /**
142
- * `AiringSortMappings` is a mapping of `AiringSort` enum values to their corresponding string values.
143
- * It can be one of the following: 'ID', 'ID_DESC', 'MEDIA_ID', 'MEDIA_ID_DESC', 'TIME', 'TIME_DESC', 'EPISODE', 'EPISODE_DESC'.
144
- */
145
- exports.AiringSortMappings = [
146
- 'ID',
147
- 'ID_DESC',
148
- 'MEDIA_ID',
149
- 'MEDIA_ID_DESC',
150
- 'TIME',
151
- 'TIME_DESC',
152
- 'EPISODE',
153
- 'EPISODE_DESC'
154
- ];
155
- /**
156
- * `CharacterSortMappings` is a mapping of `CharacterSort` enum values to their corresponding string values.
157
- * It can be one of the following: 'ID', 'ID_DESC', 'ROLE', 'ROLE_DESC', 'SEARCH_MATCH', 'FAVOURITES', 'FAVOURITES_DESC', 'RELEVANCE'.
158
- */
159
- exports.CharacterSortMappings = [
160
- 'ID',
161
- 'ID_DESC',
162
- 'ROLE',
163
- 'ROLE_DESC',
164
- 'SEARCH_MATCH',
165
- 'FAVOURITES',
166
- 'FAVOURITES_DESC',
167
- 'RELEVANCE'
168
- ];
169
- /**
170
- * `RecommendationSortMappings` is a mapping of `RecommendationSort` enum values to their corresponding string values.
171
- * It can be one of the following: 'ID', 'ID_DESC', 'RATING', 'RATING_DESC'.
172
- */
173
- exports.RecommendationSortMappings = [
174
- 'ID',
175
- 'ID_DESC',
176
- 'RATING',
177
- 'RATING_DESC'
178
- ];
179
- /**
180
- * `ReviewSortMappings` is a mapping of `ReviewSort` enum values to their corresponding string values.
181
- * It can be one of the following: 'ID', 'ID_DESC', 'MEDIA_ID', 'MEDIA_ID_DESC', 'SCORE', 'SCORE_DESC', 'RATING', 'RATING_DESC', 'CREATED_AT', 'CREATED_AT_DESC', 'UPDATED_AT', 'UPDATED_AT_DESC'.
182
- */
183
- exports.ReviewSortMappings = [
184
- 'ID',
185
- 'ID_DESC',
186
- 'MEDIA_ID',
187
- 'MEDIA_ID_DESC',
188
- 'SCORE',
189
- 'SCORE_DESC',
190
- 'RATING',
191
- 'RATING_DESC',
192
- 'CREATED_AT',
193
- 'CREATED_AT_DESC',
194
- 'UPDATED_AT',
195
- 'UPDATED_AT_DESC'
196
- ];
197
- /**
198
- * `SiteTrendSortMappings` is a mapping of `SiteTrendSort` enum values to their corresponding string values.
199
- * It can be one of the following: 'DATE', 'DATE_DESC', 'COUNT', 'COUNT_DESC', 'CHANGE', 'CHANGE_DESC'.
200
- */
201
- exports.SiteTrendSortMappings = [
202
- 'DATE',
203
- 'DATE_DESC',
204
- 'COUNT',
205
- 'COUNT_DESC',
206
- 'CHANGE',
207
- 'CHANGE_DESC'
208
- ];
209
- /**
210
- * `StaffSortMappings` is a mapping of `StaffSort` enum values to their corresponding string values.
211
- * It can be one of the following: 'ID', 'ID_DESC', 'ROLE', 'ROLE_DESC', 'SEARCH_MATCH', 'FAVOURITES', 'FAVOURITES_DESC', 'RELEVANCE'.
212
- */
213
- exports.StaffSortMappings = [
214
- 'ID',
215
- 'ID_DESC',
216
- 'ROLE',
217
- 'ROLE_DESC',
218
- 'SEARCH_MATCH',
219
- 'FAVOURITES',
220
- 'FAVOURITES_DESC',
221
- 'RELEVANCE'
222
- ];
223
- /**
224
- * `StudioSortMappings` is a mapping of `StudioSort` enum values to their corresponding string values.
225
- * It can be one of the following: 'ID', 'ID_DESC', 'NAME', 'NAME_DESC', 'SEARCH_MATCH', 'FAVOURITES', 'FAVOURITES_DESC'.
226
- */
227
- exports.StudioSortMappings = [
228
- 'ID',
229
- 'ID_DESC',
230
- 'NAME',
231
- 'NAME_DESC',
232
- 'SEARCH_MATCH',
233
- 'FAVOURITES',
234
- 'FAVOURITES_DESC'
235
- ];
236
- /**
237
- * `ThreadSortMappings` is a mapping of `ThreadSort` enum values to their corresponding string values.
238
- * It can be one of the following: 'ID', 'ID_DESC', 'TITLE', 'TITLE_DESC', 'CREATED_AT', 'CREATED_AT_DESC', 'UPDATED_AT', 'UPDATED_AT_DESC', 'REPLIED_AT', 'REPLIED_AT_DESC', 'REPLY_COUNT', 'REPLY_COUNT_DESC', 'VIEW_COUNT', 'VIEW_COUNT_DESC', 'IS_STICKY', 'SEARCH_MATCH'.
239
- */
240
- exports.ThreadSortMappings = [
241
- 'ID',
242
- 'ID_DESC',
243
- 'TITLE',
244
- 'TITLE_DESC',
245
- 'CREATED_AT',
246
- 'CREATED_AT_DESC',
247
- 'UPDATED_AT',
248
- 'UPDATED_AT_DESC',
249
- 'REPLIED_AT',
250
- 'REPLIED_AT_DESC',
251
- 'REPLY_COUNT',
252
- 'REPLY_COUNT_DESC',
253
- 'VIEW_COUNT',
254
- 'VIEW_COUNT_DESC',
255
- 'IS_STICKY',
256
- 'SEARCH_MATCH'
257
- ];
258
- /**
259
- * `ThreadCommentSortMappings` is a mapping of `ThreadCommentSort` enum values to their corresponding string values.
260
- * It can be one of the following: 'ID', 'ID_DESC'.
261
- */
262
- exports.ThreadCommentSortMappings = [
263
- 'ID',
264
- 'ID_DESC'
265
- ];
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MediaSourceMappings = void 0;
4
- /**
5
- * `MediaSourceMappings` is a mapping of `MediaSource` enum values to their corresponding string values.
6
- * It can be one of the following: 'ORIGINAL', 'MANGA', 'LIGHT_NOVEL', 'VISUAL_NOVEL', 'VIDEO_GAME', 'OTHER', 'NOVEL', 'DOUJINSHI', 'ANIME', 'WEB_NOVEL', 'LIVE_ACTION', 'GAME', 'BOOK', 'MUSIC', 'MULTIMEDIA_PROJECT', 'PICTURE_BOOK'.
7
- */
8
- exports.MediaSourceMappings = [
9
- 'ORIGINAL',
10
- 'MANGA',
11
- 'LIGHT_NOVEL',
12
- 'VISUAL_NOVEL',
13
- 'VIDEO_GAME',
14
- 'OTHER',
15
- 'NOVEL',
16
- 'DOUJINSHI',
17
- 'ANIME',
18
- 'WEB_NOVEL',
19
- 'LIVE_ACTION',
20
- 'GAME',
21
- 'BOOK',
22
- 'MUSIC',
23
- 'MULTIMEDIA_PROJECT',
24
- 'PICTURE_BOOK'
25
- ];
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MediaListStatusMappings = exports.MediaStatusMappings = void 0;
4
- /**
5
- * `MediaStatusMappings` is a mapping of `MediaStatus` enum values to their corresponding string values.
6
- * It can be one of the following: 'FINISHED', 'RELEASING', 'NOT_YET_RELEASED', 'CANCELLED', 'HIATUS'.
7
- */
8
- exports.MediaStatusMappings = [
9
- 'FINISHED',
10
- 'RELEASING',
11
- 'NOT_YET_RELEASED',
12
- 'CANCELLED',
13
- 'HIATUS'
14
- ];
15
- /**
16
- * `MediaListStatusMappings` is a mapping of `MediaListStatus` enum values to their corresponding string values.
17
- * It can be one of the following: 'CURRENT', 'PLANNING', 'COMPLETED', 'DROPPED', 'PAUSED', 'REPEATING'.
18
- */
19
- exports.MediaListStatusMappings = [
20
- 'CURRENT',
21
- 'PLANNING',
22
- 'COMPLETED',
23
- 'DROPPED',
24
- 'PAUSED',
25
- 'REPEATING'
26
- ];
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LikeableTypeMappings = exports.NotificationTypeMappings = exports.MediaTypeMappings = void 0;
4
- /**
5
- * `MediaTypeMappings` is a mapping of `MediaType` enum values to their corresponding string values.
6
- * It can be one of the following: 'ANIME', 'MANGA'.
7
- */
8
- exports.MediaTypeMappings = [
9
- 'ANIME',
10
- 'MANGA'
11
- ];
12
- /**
13
- * `NotificationTypeMappings` is a mapping of `NotificationType` enum values to their corresponding string values.
14
- * It can be one of the following: 'ACTIVITY_MESSAGE', 'ACTIVITY_REPLY', 'FOLLOWING', 'ACTIVITY_MENTION', 'THREAD_COMMENT_MENTION', 'THREAD_SUBSCRIBED', 'THREAD_COMMENT_REPLY', 'AIRING', 'ACTIVITY_LIKE', 'ACTIVITY_REPLY_LIKE', 'THREAD_LIKE', 'THREAD_COMMENT_LIKE', 'ACTIVITY_REPLY_SUBSCRIBED', 'RELATED_MEDIA_ADDITION', 'MEDIA_DATA_CHANGE', 'MEDIA_MERGE', 'MEDIA_DELETION'.
15
- */
16
- exports.NotificationTypeMappings = [
17
- 'ACTIVITY_MESSAGE',
18
- 'ACTIVITY_REPLY',
19
- 'FOLLOWING',
20
- 'ACTIVITY_MENTION',
21
- 'THREAD_COMMENT_MENTION',
22
- 'THREAD_SUBSCRIBED',
23
- 'THREAD_COMMENT_REPLY',
24
- 'AIRING',
25
- 'ACTIVITY_LIKE',
26
- 'ACTIVITY_REPLY_LIKE',
27
- 'THREAD_LIKE',
28
- 'THREAD_COMMENT_LIKE',
29
- 'ACTIVITY_REPLY_SUBSCRIBED',
30
- 'RELATED_MEDIA_ADDITION',
31
- 'MEDIA_DATA_CHANGE',
32
- 'MEDIA_MERGE',
33
- 'MEDIA_DELETION'
34
- ];
35
- /**
36
- * `LikeableTypeMappings` is a mapping of `LikeableType` enum values to their corresponding string values.
37
- * It can be one of the following: 'THREAD', 'THREAD_COMMENT', 'ACTIVITY', 'ACTIVITY_REPLY'.
38
- */
39
- exports.LikeableTypeMappings = [
40
- 'THREAD',
41
- 'THREAD_COMMENT',
42
- 'ACTIVITY',
43
- 'ACTIVITY_REPLY'
44
- ];
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserStaffNameLanguageMapping = void 0;
4
- /**
5
- * `UserStaffNameLanguageMapping` is a mapping of `UserStaffNameLanguage` enum values to their corresponding string values.
6
- * It can be one of the following: 'ROMAJI', 'ENGLISH', 'NATIVE', 'ROMAJI_STYLISED', 'ENGLISH_STYLISED', 'NATIVE_STYLISED'.
7
- */
8
- exports.UserStaffNameLanguageMapping = [
9
- 'ROMAJI',
10
- 'ENGLISH',
11
- 'NATIVE',
12
- 'ROMAJI_STYLISED',
13
- 'ENGLISH_STYLISED',
14
- 'NATIVE_STYLISED'
15
- ];
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserTitleLanguageMapping = void 0;
4
- /**
5
- * `UserTitleLanguageMapping` is an object that maps each `UserTitleLanguage` to its corresponding string value.
6
- * It can be one of the following: 'ROMAJI', 'ENGLISH', 'NATIVE', 'ROMAJI_STYLISED', 'ENGLISH_STYLISED', 'NATIVE_STYLISED'.
7
- */
8
- exports.UserTitleLanguageMapping = [
9
- 'ROMAJI',
10
- 'ENGLISH',
11
- 'NATIVE',
12
- 'ROMAJI_STYLISED',
13
- 'ENGLISH_STYLISED',
14
- 'NATIVE_STYLISED'
15
- ];
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.APIWrapper = void 0;
4
- /**
5
- * `APIWrapper` is a base class for API wrappers.
6
- * It provides a basic structure that can be extended by specific API wrappers.
7
- */
8
- class APIWrapper {
9
- /**
10
- * Constructs a new `APIWrapper` instance.
11
- * @param baseURL - The base URL for the API.
12
- */
13
- constructor(baseURL) {
14
- this.baseURL = baseURL;
15
- }
16
- }
17
- exports.APIWrapper = APIWrapper;
@@ -1,48 +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
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.sendRequest = void 0;
16
- const axios_1 = __importDefault(require("axios"));
17
- /**
18
- * Sends a request to the specified URL.
19
- * @param url - The URL to send the request to.
20
- * @param method - The HTTP method to use ('GET' or 'POST').
21
- * @param data - The data to send with the request.
22
- * @param token - The authentication token to include in the request headers.
23
- * @returns The data from the response.
24
- * @throws An error if the request fails.
25
- */
26
- const sendRequest = (url, method, data, token) => __awaiter(void 0, void 0, void 0, function* () {
27
- const headers = {
28
- 'Content-Type': 'application/json',
29
- Accept: 'application/json'
30
- };
31
- if (token !== null && token !== undefined && token !== '') {
32
- headers.Authorization = `Bearer ${token}`;
33
- }
34
- /* eslint-disable no-useless-catch */
35
- try {
36
- const response = yield (0, axios_1.default)({
37
- url,
38
- method,
39
- data,
40
- headers
41
- });
42
- return response.data;
43
- }
44
- catch (error) {
45
- throw error;
46
- }
47
- });
48
- exports.sendRequest = sendRequest;
@@ -1,125 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateVariables = validateVariables;
4
- /**
5
- * Validates the provided variables against the expected types.
6
- *
7
- * @param variables - The variables to validate. This is an object where each key is the name of a variable and the value is the value of the variable.
8
- * @param variableTypeMappings - An object that maps variable names to their expected types. The expected type can be a string representing a primitive type, an array of possible values, or an object mapping property names to their expected types.
9
- *
10
- * @throws Will throw an error if any of the variables do not match their expected types. The error message will include the names of the invalid variables and their expected types.
11
- */
12
- function validateVariables(variables, variableTypeMappings) {
13
- if (Object.keys(variables).length === 0) {
14
- throw new Error('No variables were provided');
15
- }
16
- const errors = [];
17
- for (const [variable, value] of Object.entries(variables)) {
18
- const expectedType = variableTypeMappings[variable];
19
- if (expectedType) {
20
- if (Array.isArray(expectedType)) {
21
- // If the expected type is an array, check if the value or its elements are included in the array
22
- if (Array.isArray(value)) {
23
- value.forEach((item, index) => {
24
- if (!expectedType.includes(item)) {
25
- errors.push(`Invalid ${variable}[${index}]: ${item}. Expected one of: ${expectedType.join(', ')}`);
26
- }
27
- });
28
- }
29
- else if (!expectedType.includes(value)) {
30
- errors.push(`Invalid ${variable}: ${value}. Expected one of: ${expectedType.join(', ')}`);
31
- }
32
- }
33
- else if (typeof expectedType === 'string' && expectedType.endsWith('[]')) {
34
- // If the expected type is an array type, check if the actual value is an array and if its elements are of the correct type
35
- const elementType = expectedType.slice(0, -2); // Remove the '[]' from the end
36
- if (!Array.isArray(value) || !value.every((element) => typeof element === elementType)) {
37
- errors.push(`Invalid ${variable}: ${value}. Expected type: ${expectedType}`);
38
- }
39
- }
40
- else if (typeof expectedType === 'object') {
41
- // If the expected type is an object, validate its properties
42
- if (Array.isArray(value)) {
43
- // If the value is an array, validate each object in the array
44
- value.forEach((item, index) => {
45
- for (const [prop, propValue] of Object.entries(item)) {
46
- const expectedPropType = expectedType[prop];
47
- if (expectedPropType) {
48
- if (expectedPropType === 'boolean' && typeof propValue === 'boolean') {
49
- // If the expected type is 'boolean' and the value is a boolean, the validation passes
50
- }
51
- else if (!expectedPropType.includes(propValue)) {
52
- let expectedPropTypeString;
53
- if (Array.isArray(expectedPropType)) {
54
- expectedPropTypeString = expectedPropType.join(', ');
55
- }
56
- else {
57
- expectedPropTypeString = expectedPropType.toString();
58
- }
59
- errors.push(`Invalid ${variable}[${index}].${prop}: ${propValue}. Expected one of: ${expectedPropTypeString}`);
60
- }
61
- }
62
- }
63
- });
64
- }
65
- else {
66
- // If the value is not an array, validate its properties
67
- for (const [prop, propValue] of Object.entries(value)) {
68
- const expectedPropType = expectedType[prop];
69
- if (expectedPropType) {
70
- if (Array.isArray(propValue) && propValue.length === 1) {
71
- // If the expected type is a string and the value is an array with a single string, treat it as a single string
72
- if (typeof propValue[0] === 'string' && expectedPropType.includes(propValue[0])) {
73
- // If the expected type is a string and the value is a string, check if the string is in the array
74
- }
75
- else if (typeof propValue[0] !== expectedPropType) {
76
- errors.push(`Invalid ${variable}.${prop}: ${propValue[0]}. Expected type: ${expectedPropType}`);
77
- }
78
- }
79
- else if (Array.isArray(propValue)) {
80
- // If the expected type is an array and the value is an array, check if all elements in the array are of the expected type
81
- if (!propValue.every(item => expectedPropType.includes(item))) {
82
- let expectedPropTypeString;
83
- if (Array.isArray(expectedPropType)) {
84
- expectedPropTypeString = expectedPropType.join(', ');
85
- }
86
- else {
87
- expectedPropTypeString = expectedPropType;
88
- }
89
- errors.push(`Invalid ${variable}.${prop}: ${propValue}. Expected type: ${expectedPropTypeString}`);
90
- }
91
- }
92
- else if (typeof propValue === 'string' && expectedPropType.includes(propValue)) {
93
- // If the expected type is an array and the value is a string, check if the string is in the array
94
- }
95
- else if (typeof propValue !== expectedPropType) {
96
- let expectedPropTypeString;
97
- if (Array.isArray(expectedPropType)) {
98
- expectedPropTypeString = expectedPropType.join(', ');
99
- }
100
- else {
101
- expectedPropTypeString = expectedPropType;
102
- }
103
- errors.push(`Invalid ${variable}.${prop}: ${propValue}. Expected type: ${expectedPropTypeString}`);
104
- }
105
- }
106
- }
107
- }
108
- }
109
- else if (Array.isArray(value)) {
110
- // If the value is an array, validate each item in the array
111
- value.forEach((item, index) => {
112
- if (typeof item !== expectedType) {
113
- errors.push(`Invalid ${variable}[${index}]: ${item}. Expected type: ${expectedType}`);
114
- }
115
- });
116
- }
117
- else if (typeof value !== expectedType) {
118
- errors.push(`Invalid ${variable}: ${value}. Expected type: ${expectedType}`);
119
- }
120
- }
121
- }
122
- if (errors.length > 0) {
123
- throw new Error(errors.join('\n'));
124
- }
125
- }