anilink-api-wrapper 1.21.0 → 1.23.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 (32) hide show
  1. package/README.md +2 -0
  2. package/dist/AniLink.js +10 -1
  3. package/dist/apis/anilist/mutation/DeleteActivity.js +1 -1
  4. package/dist/apis/anilist/mutation/DeleteCustomList.js +1 -1
  5. package/dist/apis/anilist/mutation/SaveActivityReply.js +66 -0
  6. package/dist/apis/anilist/mutation/ToggleActivityPin.js +64 -0
  7. package/dist/apis/anilist/mutation/ToggleActivitySubscription.js +64 -0
  8. package/package.json +4 -3
  9. package/Examples/ANILIST_API_EXAMPLES.md +0 -253
  10. package/dist/apis/anilist/interfaces/Stats.js +0 -2
  11. package/dist/apis/anilist/interfaces/responses/AiringSchedule.js +0 -14
  12. package/dist/apis/anilist/interfaces/responses/AniChartUser.js +0 -2
  13. package/dist/apis/anilist/interfaces/responses/Character.js +0 -30
  14. package/dist/apis/anilist/interfaces/responses/ExternalLinkSourceCollection.js +0 -2
  15. package/dist/apis/anilist/interfaces/responses/Media.js +0 -210
  16. package/dist/apis/anilist/interfaces/responses/MediaList.js +0 -32
  17. package/dist/apis/anilist/interfaces/responses/MediaListCollectionResponse.js +0 -41
  18. package/dist/apis/anilist/interfaces/responses/MediaTag.js +0 -2
  19. package/dist/apis/anilist/interfaces/responses/MediaTagCollection.js +0 -2
  20. package/dist/apis/anilist/interfaces/responses/MediaTrend.js +0 -17
  21. package/dist/apis/anilist/interfaces/responses/Notification.js +0 -164
  22. package/dist/apis/anilist/interfaces/responses/Recommendation.js +0 -19
  23. package/dist/apis/anilist/interfaces/responses/Review.js +0 -26
  24. package/dist/apis/anilist/interfaces/responses/SiteStatistics.js +0 -27
  25. package/dist/apis/anilist/interfaces/responses/Staff.js +0 -55
  26. package/dist/apis/anilist/interfaces/responses/Studio.js +0 -56
  27. package/dist/apis/anilist/interfaces/responses/Thread.js +0 -40
  28. package/dist/apis/anilist/interfaces/responses/ThreadComment.js +0 -27
  29. package/dist/apis/anilist/interfaces/responses/User.js +0 -362
  30. package/dist/apis/anilist/query/Like.js +0 -69
  31. package/dist/apis/anilist/types/MediaListStatus.js +0 -15
  32. package/dist/apis/anilist/types/ScoreFormat.js +0 -14
package/README.md CHANGED
@@ -120,6 +120,8 @@ List of methods in `anilist.mutation`:
120
120
  - saveTextActivity
121
121
  - saveMessageActivity
122
122
  - deleteActivity
123
+ - toggleActivityPin
124
+ - toggleActivitySubscription
123
125
 
124
126
  ### Error Handling
125
127
 
package/dist/AniLink.js CHANGED
@@ -53,6 +53,9 @@ const SaveTextActivity_1 = require("./apis/anilist/mutation/SaveTextActivity");
53
53
  const SaveMessageActivity_1 = require("./apis/anilist/mutation/SaveMessageActivity");
54
54
  const SaveListActivity_1 = require("./apis/anilist/mutation/SaveListActivity");
55
55
  const DeleteActivity_1 = require("./apis/anilist/mutation/DeleteActivity");
56
+ const ToggleActivitySubscription_1 = require("./apis/anilist/mutation/ToggleActivitySubscription");
57
+ const ToggleActivityPin_1 = require("./apis/anilist/mutation/ToggleActivityPin");
58
+ const SaveActivityReply_1 = require("./apis/anilist/mutation/SaveActivityReply");
56
59
  /**
57
60
  * `AniLink` is a class for interacting with the APIs.
58
61
  * It provides methods for querying and mutating data.
@@ -122,6 +125,9 @@ class AniLink {
122
125
  const saveMessageActivityMutationInstance = new SaveMessageActivity_1.SaveMessageActivityMutation(authToken);
123
126
  const saveListActivityMutationInstance = new SaveListActivity_1.SaveListActivityMutation(authToken);
124
127
  const deleteActivityMutationInstance = new DeleteActivity_1.DeleteActivityMutation(authToken);
128
+ const toggleActivityPinMutationInstance = new ToggleActivityPin_1.ToggleActivityPinMutation(authToken);
129
+ const toggleActivitySubscriptionMutationInstance = new ToggleActivitySubscription_1.ToggleActivitySubscriptionMutation(authToken);
130
+ const saveActivityReplyMutationInstance = new SaveActivityReply_1.SaveActivityReplyMutation(authToken);
125
131
  this.anilist = {
126
132
  query: {
127
133
  user: userQueryInstance.user.bind(userQueryInstance),
@@ -179,7 +185,10 @@ class AniLink {
179
185
  saveTextActivity: saveTextActivityMutationInstance.saveTextActivity.bind(saveTextActivityMutationInstance),
180
186
  saveMessageActivity: saveMessageActivityMutationInstance.saveMessageActivity.bind(saveMessageActivityMutationInstance),
181
187
  saveListActivity: saveListActivityMutationInstance.saveListActivity.bind(saveListActivityMutationInstance),
182
- deleteActivity: deleteActivityMutationInstance.deleteActivity.bind(deleteActivityMutationInstance)
188
+ deleteActivity: deleteActivityMutationInstance.deleteActivity.bind(deleteActivityMutationInstance),
189
+ toggleActivityPin: toggleActivityPinMutationInstance.toggleActivityPin.bind(toggleActivityPinMutationInstance),
190
+ toggleActivitySubscription: toggleActivitySubscriptionMutationInstance.toggleActivitySubscription.bind(toggleActivitySubscriptionMutationInstance),
191
+ saveActivityReply: saveActivityReplyMutationInstance.saveActivityReply.bind(saveActivityReplyMutationInstance)
183
192
  }
184
193
  };
185
194
  }
@@ -28,7 +28,7 @@ class DeleteActivityMutation extends APIWrapper_1.APIWrapper {
28
28
  this.authToken = authToken;
29
29
  }
30
30
  /**
31
- * `deleteMediaListEntry` is a method that sends a mutation request to delete a activity.
31
+ * `deleteActivity` is a method that sends a mutation request to delete a activity.
32
32
  *
33
33
  * @param variables - An object of type `DeleteActivityVariables` representing the variables for the mutation.
34
34
  * @returns A Promise that resolves to the response from the mutation request.
@@ -29,7 +29,7 @@ class DeleteCustomListMutation extends APIWrapper_1.APIWrapper {
29
29
  this.authToken = authToken;
30
30
  }
31
31
  /**
32
- * `deleteMediaListEntry` is a method that sends a mutation request to delete a custom list.
32
+ * `deleteCustomList` is a method that sends a mutation request to delete a custom list.
33
33
  *
34
34
  * @param variables - An object of type `DeleteCustomListVariables` representing the variables for the mutation.
35
35
  * @returns A Promise that resolves to the response from the mutation request.
@@ -0,0 +1,66 @@
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.SaveActivityReplyMutation = 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 ActivityReply_1 = require("../interfaces/ActivityReply");
17
+ /**
18
+ * `SaveActivityReplyMutation` is a class representing a mutation to save an activity reply.
19
+ * It includes a method to save an activity reply
20
+ */
21
+ class SaveActivityReplyMutation extends APIWrapper_1.APIWrapper {
22
+ /**
23
+ * Constructs a new `SaveActivityReplyMutation` 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
+ * `SaveActivityReply` is a method that sends a mutation request to save an activity reply.
33
+ *
34
+ * @param variables - An object of type `SaveActivityReplyVariables` representing the variables for the mutation.
35
+ * @returns A Promise that resolves to the response from the mutation request.
36
+ * @throws Will throw an error if the mutation request fails or if the provided variables do not pass the validation checks.
37
+ * */
38
+ saveActivityReply(variables) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (!this.authToken) {
41
+ throw new Error('SaveActivityReplyMutation requires an authentication token. Create a new instance of AniLink and pass the token as an argument.');
42
+ }
43
+ if (!variables.id && !variables.text) {
44
+ throw new Error('id or text variable is required');
45
+ }
46
+ const variableTypeMappings = {
47
+ id: 'number',
48
+ activityId: 'number',
49
+ text: 'string',
50
+ asMod: 'boolean',
51
+ asHtml: 'boolean'
52
+ };
53
+ (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
54
+ const mutation = `
55
+ mutation ($id: Int, $activityId: Int, $text: String, $asMod: Boolean, $asHtml: Boolean) {
56
+ SaveActivityReply (id: $id, activityId: $activityId, text: $text, asMod: $asMod) {
57
+ ${ActivityReply_1.ActivityReplySchema}
58
+ }
59
+ }
60
+ `;
61
+ const data = { query: mutation, variables };
62
+ return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
63
+ });
64
+ }
65
+ }
66
+ exports.SaveActivityReplyMutation = SaveActivityReplyMutation;
@@ -0,0 +1,64 @@
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.ToggleActivityPinMutation = 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 Activity_1 = require("../interfaces/Activity");
17
+ /**
18
+ * `ToggleActivityPinMutation` is a class representing a mutation to pin an activity.
19
+ * It includes a method to pin an activity
20
+ */
21
+ class ToggleActivityPinMutation extends APIWrapper_1.APIWrapper {
22
+ /**
23
+ * Constructs a new `ToggleActivityPinMutation` 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
+ * `toggleActivityPin` is a method that sends a mutation request to pin an activity.
33
+ *
34
+ * @param variables - An object of type `ToggleActivityPinVariables` representing the variables for the mutation.
35
+ * @returns A Promise that resolves to the response from the mutation request.
36
+ * @throws Will throw an error if the mutation request fails or if the provided variables do not pass the validation checks.
37
+ * */
38
+ toggleActivityPin(variables) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (!this.authToken) {
41
+ throw new Error('ToggleActivityPinMutation requires an authentication token. Create a new instance of AniLink and pass the token as an argument.');
42
+ }
43
+ if (!variables.id || !variables.pinned) {
44
+ throw new Error('id & pinned variables are required');
45
+ }
46
+ const variableTypeMappings = {
47
+ id: 'number',
48
+ pinned: 'boolean',
49
+ asHtml: 'boolean'
50
+ };
51
+ (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
52
+ const mutation = `
53
+ mutation ($id: Int, $pinned: Boolean, $asHtml: Boolean) {
54
+ ToggleActivityPin(id: $id, pinned: $pinned) {
55
+ ${Activity_1.ActivityWithRepliesSchema}
56
+ }
57
+ }
58
+ `;
59
+ const data = { query: mutation, variables };
60
+ return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
61
+ });
62
+ }
63
+ }
64
+ exports.ToggleActivityPinMutation = ToggleActivityPinMutation;
@@ -0,0 +1,64 @@
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.ToggleActivitySubscriptionMutation = 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 Activity_1 = require("../interfaces/Activity");
17
+ /**
18
+ * `ToggleActivitySubscriptionMutation` is a class representing a mutation to subscribe to an activity.
19
+ * It includes a method to subscribe to an activity
20
+ */
21
+ class ToggleActivitySubscriptionMutation extends APIWrapper_1.APIWrapper {
22
+ /**
23
+ * Constructs a new `ToggleActivitySubscriptionMutation` 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
+ * `toggleActivitySubscription` is a method that sends a mutation request to subscribe to an activity.
33
+ *
34
+ * @param variables - An object of type `ToggleActivitySubscriptionVariables` representing the variables for the mutation.
35
+ * @returns A Promise that resolves to the response from the mutation request.
36
+ * @throws Will throw an error if the mutation request fails or if the provided variables do not pass the validation checks.
37
+ * */
38
+ toggleActivitySubscription(variables) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (!this.authToken) {
41
+ throw new Error('ToggleActivitySubscriptionMutation requires an authentication token. Create a new instance of AniLink and pass the token as an argument.');
42
+ }
43
+ if (!variables.activityId || !variables.subscribe) {
44
+ throw new Error('activityId & subscribe variables are required');
45
+ }
46
+ const variableTypeMappings = {
47
+ activityId: 'number',
48
+ subscribe: 'boolean',
49
+ asHtml: 'boolean'
50
+ };
51
+ (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
52
+ const mutation = `
53
+ mutation ($activityId: Int, $subscribe: Boolean, $asHtml: Boolean) {
54
+ ToggleActivitySubscription(activityId: $activityId, subscribe: $subscribe) {
55
+ ${Activity_1.ActivityWithRepliesSchema}
56
+ }
57
+ }
58
+ `;
59
+ const data = { query: mutation, variables };
60
+ return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
61
+ });
62
+ }
63
+ }
64
+ exports.ToggleActivitySubscriptionMutation = ToggleActivitySubscriptionMutation;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "anilink-api-wrapper",
3
- "version": "1.21.0",
3
+ "version": "1.23.0",
4
4
  "description": "API wrapper for AniManga sites such as Anilist, MyAnimeList, Kitsu.",
5
5
  "main": "dist/AniLink.js",
6
6
  "scripts": {
7
7
  "test": "jest",
8
- "build": "tsc",
9
- "generate-docs": "typedoc --entryPoints ./src --entryPointStrategy expand --out docs --plugin typedoc-theme-hierarchy --theme hierarchy",
8
+ "build": "rimraf dist && tsc",
9
+ "generate-docs": "typedoc --entryPoints ./src --entryPointStrategy expand --out docs --plugin typedoc-theme-hierarchy --theme hierarchy && node add-ga.js",
10
10
  "prepublishOnly": "npm run build"
11
11
  },
12
12
  "keywords": [
@@ -33,6 +33,7 @@
33
33
  "eslint-plugin-n": "^15.7.0",
34
34
  "eslint-plugin-promise": "^6.1.1",
35
35
  "jest": "^29.7.0",
36
+ "rimraf": "^5.0.5",
36
37
  "standard": "^17.1.0",
37
38
  "ts-jest": "^29.1.2",
38
39
  "typedoc": "^0.25.13",
@@ -1,253 +0,0 @@
1
- ## Examples
2
-
3
- Here are examples of how to use AniLink to interact with the AniList API:
4
-
5
- ### Querying user data
6
-
7
- ```typescript
8
- // Querying user data
9
- aniLink.anilist.query.user({id: 542244, isHTML: true});
10
-
11
- // Querying media data
12
- aniLink.anilist.query.media({id: 1, type: 'ANIME'});
13
-
14
- // Querying media trend data
15
- aniLink.anilist.query.mediaTrend({mediaId: 1, type: 'ANIME'});
16
-
17
- // Querying airing schedule data
18
- aniLink.anilist.query.airingSchedule({mediaId: 130590});
19
-
20
- // Querying character data
21
- aniLink.anilist.query.character({
22
- id: 1,
23
- asHtml: true,
24
- mediaSort: ['POPULARITY_DESC'],
25
- mediaType: 'ANIME',
26
- mediaOnList: true,
27
- mediaPage: 1,
28
- mediaPerPage: 10
29
- });
30
-
31
- // Querying staff data
32
- aniLink.anilist.query.staff({
33
- id: 132186,
34
- asHtml: true,
35
- staffMediaSort: ['POPULARITY_DESC'],
36
- staffMediaType: 'ANIME',
37
- staffMediaOnList: true,
38
- staffMediaPage: 1,
39
- staffMediaPerPage: 10,
40
- charactersSort: ['ID'],
41
- charactersPage: 1,
42
- charactersPerPage: 10,
43
- characterMediaSort: ['POPULARITY_DESC'],
44
- characterMediaOnList: true,
45
- characterMediaPage: 1,
46
- characterMediaPerPage: 10
47
- });
48
-
49
- // Querying media list data
50
- aniLink.anilist.query.mediaList({userId: 542244});
51
-
52
- // Querying media list collection data
53
- aniLink.anilist.query.mediaListCollection({
54
- userId: 542244,
55
- type: 'ANIME',
56
- status: 'COMPLETED',
57
- chunk: 1,
58
- perChunk: 10000
59
- });
60
-
61
- // Querying genre collection data
62
- aniLink.anilist.query.genreCollection();
63
-
64
- // Querying media tag collection data
65
- aniLink.anilist.query.mediaTagCollection();
66
-
67
- // Querying viewer data
68
- aniLink.anilist.query.viewer({isHTML: true});
69
-
70
- // Querying notification data
71
- aniLink.anilist.query.notification({asHtml: true});
72
-
73
- // Querying studio data
74
- aniLink.anilist.query.studio({id: 561, asHtml: true});
75
-
76
- // Querying review data
77
- aniLink.anilist.query.review({id: 8008, asHtml: true});
78
-
79
- // Querying activity data
80
- aniLink.anilist.query.activity({id: 723235883, asHtml: true});
81
-
82
- // Querying activity reply data
83
- aniLink.anilist.query.activityReply({id: 12191046, asHtml: true});
84
-
85
- // Querying following data
86
- aniLink.anilist.query.following({userId: 542244, asHtml: true});
87
-
88
- // Querying follower data
89
- aniLink.anilist.query.follower({userId: 542244, asHtml: true});
90
-
91
- // Querying thread data
92
- aniLink.anilist.query.thread({id: 71881, asHtml: true});
93
-
94
- // Querying thread comment data
95
- aniLink.anilist.query.threadComment({id: 2555166, asHtml: true});
96
-
97
- // Querying recommendation data
98
- aniLink.anilist.query.recommendation({mediaId: 156822, asHtml: true});
99
-
100
- // Querying markdown data
101
- aniLink.anilist.query.markdown({markdown: 'Hello'});
102
-
103
- // Querying AniChartUser data
104
- aniLink.anilist.query.aniChartUser();
105
-
106
- // Querying site statistics data
107
- aniLink.anilist.query.siteStatistics();
108
-
109
- // Querying external link source collection data
110
- aniLink.anilist.query.externalLinkSourceCollection();
111
-
112
- // Querying users page data
113
- aniLink.anilist.query.page.users({id: 542244, isHTML: true});
114
-
115
- // Querying media page data
116
- aniLink.anilist.query.page.medias({id: 1, type: 'ANIME'});
117
-
118
- // Querying character page data
119
- aniLink.anilist.query.page.characters({id: 1, asHtml: true});
120
-
121
- // Querying staff page data
122
- aniLink.anilist.query.page.staffs({id: 132186, asHtml: true});
123
-
124
- // Querying studio page data
125
- aniLink.anilist.query.page.studios({id: 561, asHtml: true});
126
-
127
- // Querying media list page data
128
- aniLink.anilist.query.page.mediaLists({userId: 542244});
129
-
130
- // Querying airing schedule page data
131
- aniLink.anilist.query.page.airingSchedules({mediaId: 130590});
132
-
133
- // Querying media trend page data
134
- aniLink.anilist.query.page.mediaTrends({mediaId: 1, type: 'ANIME'});
135
-
136
- // Querying notification page data
137
- aniLink.anilist.query.page.notifications({asHtml: true});
138
-
139
- // Querying follower page data
140
- aniLink.anilist.query.page.followers({userId: 542244, asHtml: true});
141
-
142
- // Querying following page data
143
- aniLink.anilist.query.page.following({userId: 542244, asHtml: true});
144
-
145
- // Querying activity page data
146
- aniLink.anilist.query.page.activities({id: 723235883, asHtml: true});
147
-
148
- // Querying activity reply page data
149
- aniLink.anilist.query.page.activityReplies({id: 12191046, asHtml: true
150
- });
151
-
152
- // Querying thread page data
153
- aniLink.anilist.query.page.threads({id: 71881, asHtml: true});
154
-
155
- // Querying thread comment page data
156
- aniLink.anilist.query.page.threadComments({threadId: 71881, asHtml: true
157
- });
158
-
159
- // Querying review page data
160
- aniLink.anilist.query.page.reviews({id: 8008, asHtml: true});
161
-
162
- // Querying recommendation page data
163
- aniLink.anilist.query.page.recommendations({mediaId: 156822, asHtml: true
164
- });
165
-
166
- // Querying likes page data
167
- aniLink.anilist.query.page.likes({likeableId: 723422275, type: 'ACTIVITY', asHtml: true
168
- });
169
- ```
170
-
171
- ### Mutating user data
172
-
173
- ```typescript
174
- // Updating a user
175
- aniLink.anilist.mutation.updateUser({
176
- about: 'New about text',
177
- titleLanguage: 'ENGLISH',
178
- displayAdultContent: true,
179
- airingNotifications: true,
180
- scoreFormat: 'POINT_10',
181
- rowOrder: 'title',
182
- profileColor: 'blue',
183
- donatorBadge: 'Supporter',
184
- notificationOptions: [{type: 'AIRING', enabled: true}],
185
- timezone: '-06:00',
186
- activityMergeTime: 30,
187
- animeListOptions: {sectionOrder: ['title'], customLists: ['test'], advancedScoring: [], advancedScoringEnabled: false},
188
- mangaListOptions: {sectionOrder: ['title'], customLists: ['test'], advancedScoring: [], advancedScoringEnabled: false},
189
- staffNameLanguage: 'ROMAJI',
190
- restrictMessagesToFollowing: false,
191
- disabledListActivity: [{type: 'CURRENT', disabled: false}]
192
- });
193
-
194
- // Saving media list entries
195
- aniLink.anilist.mutation.saveMediaListEntry({
196
- mediaId: 143271,
197
- status: 'CURRENT',
198
- score: 8.5,
199
- progress: 3,
200
- });
201
-
202
- // Updating media list entries
203
- aniLink.anilist.mutation.updateMediaListEntries({
204
- status: 'CURRENT',
205
- score: 8.5,
206
- progress: 3,
207
- ids: [143271, 156822, 170890],
208
- });
209
-
210
- // Deleting media list entry
211
- const entryId = (
212
- await handleRateLimit(() => aniLink.anilist.query.mediaList(
213
- {
214
- userId: 6503722,
215
- mediaId: 143271
216
- }
217
- )
218
- )
219
- ).data.MediaList.id;
220
- aniLink.anilist.mutation.deleteMediaListEntry({id: entryId});
221
-
222
- // Deleting custom list
223
- aniLink.anilist.mutation.deleteCustomLists({customList: 'test'});
224
-
225
- // Create text activity
226
- aniLink.anilist.mutation.saveTextActivity({text: 'test'})
227
-
228
- // Update text activity
229
- aniLink.anilist.mutation.saveTextActivity({id: 725254160, text: 'Updated Text'})
230
-
231
- // Create message activity
232
- aniLink.anilist.mutation.saveMessageActivity({recipientId: 542244, message: 'test'})
233
-
234
- // Update message activity
235
- aniLink.anilist.mutation.saveMessageActivity({id: 725254160, message: 'Updated Message'})
236
-
237
- // Update list activity
238
- // Mod only
239
- aniLink.anilist.mutation.saveListActivity({id: 725254160})
240
-
241
- // Delete Activity
242
- const activityId = (
243
- await handleRateLimit(() => aniLink.anilist.query.activity(
244
- {
245
- userId: 542244,
246
- messengerId: 6503722,
247
- type: 'MESSAGE'
248
- }
249
- )
250
- )
251
- ).data.Activity.id
252
- const response = await handleRateLimit(() => aniLink.anilist.mutation.deleteActivity({id: activityId}))
253
- ```
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {value: true});
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AiringScheduleSchema = void 0;
4
- const Media_1 = require("./Media");
5
- exports.AiringScheduleSchema = `
6
- id
7
- airingAt
8
- timeUntilAiring
9
- episode
10
- mediaId
11
- media {
12
- ${Media_1.MediaSchema}
13
- }
14
- `;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CharacterSchema = void 0;
4
- const FuzzyDate_1 = require("../FuzzyDate");
5
- const Name_1 = require("../Name");
6
- const Image_1 = require("../Image");
7
- const Title_1 = require("../Title");
8
- exports.CharacterSchema = `
9
- id
10
- ${Name_1.NameSchema}
11
- ${Image_1.ImageSchema}
12
- description(asHtml: $asHtml)
13
- gender
14
- dateOfBirth {
15
- ${FuzzyDate_1.FuzzyDateSchema}
16
- }
17
- age
18
- bloodType
19
- isFavourite
20
- isFavouriteBlocked
21
- siteUrl
22
- media(sort: $mediaSort, onList: $mediaOnList, page: $mediaPage, perPage: $mediaPerPage) {
23
- nodes {
24
- id
25
- ${Title_1.TitleSchema}
26
- }
27
- }
28
- favourites
29
- modNotes
30
- `;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });