- const { UserProfileQuery, UserStatsQuery, UserUpdateQuery } = require("./consts");
+ const {
+ UserProfileQuery,
+ UserStatsQuery,
+ UserUpdateQuery,
+ ListActivityQuery,
+ TextActivityQuery,
+ MessageActivityQuery
+} = require("./consts");
/**
* Access AniList's user data.
@@ -258,10 +263,9 @@ user.js
`query ($page: Int, $perPage: Int, $user: Int) {
Page (page: $page, perPage: $perPage) { pageInfo { total currentPage lastPage hasNextPage perPage }
activities(userId: $user, sort:ID_DESC) {
- ... on ListActivity { id status type progress media { id title { romaji english native userPreferred } type }
- createdAt likeCount replies { id text likeCount } }
- ... on TextActivity { id userId type text createdAt likeCount replies { id text likeCount } }
- ... on MessageActivity { id recipientId type message createdAt likeCount replies { id text likeCount } }
+ ... on ListActivity { ${ListActivityQuery} }
+ ... on TextActivity { ${TextActivityQuery} }
+ ... on MessageActivity { ${MessageActivityQuery} }
} } }`,
{ user: user, page: 1, perPage: 25 }
);
@@ -288,12 +292,12 @@ user.js
*
* @since 1.10.0
*/
- update(options) {
+ async update(options) {
if (!options || Object.keys(options).length === 0) {
throw new Error("Options were not provided for updating user!");
}
- const data = this.util.send(UserUpdateQuery, options);
+ const data = await this.util.send(UserUpdateQuery, options);
return data.updateUser;
}
}
@@ -307,7 +311,7 @@ user.js
diff --git a/docs/utilities.js.html b/docs/utilities.js.html
index ba8e0dc..c0a6c24 100644
--- a/docs/utilities.js.html
+++ b/docs/utilities.js.html
@@ -283,7 +283,7 @@ utilities.js
diff --git a/package-lock.json b/package-lock.json
index 0e4474a..f008ed7 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "anilist-node",
- "version": "1.11.1",
+ "version": "1.11.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "anilist-node",
- "version": "1.11.1",
+ "version": "1.11.2",
"license": "MIT",
"dependencies": {
"abort-controller": "^3.0.0",
@@ -14,13 +14,13 @@
},
"devDependencies": {
"docdash": "^1.2.0",
- "eslint": "^8.9.0",
+ "eslint": "^8.11.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.4",
"jsdoc": "^3.6.10",
- "lint-staged": "^12.3.4",
- "prettier": "^2.5.1",
- "typescript": "^4.5.5"
+ "lint-staged": "^12.3.6",
+ "prettier": "^2.6.0",
+ "typescript": "^4.6.2"
}
},
"node_modules/@babel/parser": {
@@ -36,16 +36,16 @@
}
},
"node_modules/@eslint/eslintrc": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.1.0.tgz",
- "integrity": "sha512-C1DfL7XX4nPqGd6jcP01W9pVM1HYCuUkFk1432D7F0v3JSlUIeOYn9oCoi3eoLZ+iwBSb29BMFxxny0YrrEZqg==",
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz",
+ "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==",
"dev": true,
"dependencies": {
"ajv": "^6.12.4",
"debug": "^4.3.2",
"espree": "^9.3.1",
"globals": "^13.9.0",
- "ignore": "^4.0.6",
+ "ignore": "^5.2.0",
"import-fresh": "^3.2.1",
"js-yaml": "^4.1.0",
"minimatch": "^3.0.4",
@@ -55,15 +55,6 @@
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
- "node_modules/@eslint/eslintrc/node_modules/ignore": {
- "version": "4.0.6",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
- "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
- "dev": true,
- "engines": {
- "node": ">= 4"
- }
- },
"node_modules/@humanwhocodes/config-array": {
"version": "0.9.3",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz",
@@ -457,12 +448,12 @@
}
},
"node_modules/eslint": {
- "version": "8.9.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.9.0.tgz",
- "integrity": "sha512-PB09IGwv4F4b0/atrbcMFboF/giawbBLVC7fyDamk5Wtey4Jh2K+rYaBhCAbUyEI4QzB1ly09Uglc9iCtFaG2Q==",
+ "version": "8.11.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.11.0.tgz",
+ "integrity": "sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA==",
"dev": true,
"dependencies": {
- "@eslint/eslintrc": "^1.1.0",
+ "@eslint/eslintrc": "^1.2.1",
"@humanwhocodes/config-array": "^0.9.2",
"ajv": "^6.10.0",
"chalk": "^4.0.0",
@@ -801,9 +792,9 @@
}
},
"node_modules/globals": {
- "version": "13.12.1",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz",
- "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==",
+ "version": "13.13.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz",
+ "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==",
"dev": true,
"dependencies": {
"type-fest": "^0.20.2"
@@ -1076,9 +1067,9 @@
}
},
"node_modules/lint-staged": {
- "version": "12.3.4",
- "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-12.3.4.tgz",
- "integrity": "sha512-yv/iK4WwZ7/v0GtVkNb3R82pdL9M+ScpIbJLJNyCXkJ1FGaXvRCOg/SeL59SZtPpqZhE7BD6kPKFLIDUhDx2/w==",
+ "version": "12.3.6",
+ "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-12.3.6.tgz",
+ "integrity": "sha512-tVNyl/HsAnplKh4oaoRNzyZLm0PE/6VaBUXvd/gA9zhYCC/+ivZwiwpoT6jOxcLzuIOjP19wW+mfOi7/Bw4c1A==",
"dev": true,
"dependencies": {
"cli-truncate": "^3.1.0",
@@ -1091,6 +1082,7 @@
"micromatch": "^4.0.4",
"normalize-path": "^3.0.0",
"object-inspect": "^1.12.0",
+ "pidtree": "^0.5.0",
"string-argv": "^0.3.1",
"supports-color": "^9.2.1",
"yaml": "^1.10.2"
@@ -1548,6 +1540,18 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
+ "node_modules/pidtree": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.5.0.tgz",
+ "integrity": "sha512-9nxspIM7OpZuhBxPg73Zvyq7j1QMPMPsGKTqRc2XOaFQauDvoNz9fM1Wdkjmeo7l9GXOZiRs97sPkuayl39wjA==",
+ "dev": true,
+ "bin": {
+ "pidtree": "bin/pidtree.js"
+ },
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
"node_modules/prelude-ls": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
@@ -1558,15 +1562,18 @@
}
},
"node_modules/prettier": {
- "version": "2.5.1",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz",
- "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==",
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz",
+ "integrity": "sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/prettier-linter-helpers": {
@@ -1882,9 +1889,9 @@
}
},
"node_modules/typescript": {
- "version": "4.5.5",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz",
- "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==",
+ "version": "4.6.2",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz",
+ "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@@ -2035,28 +2042,20 @@
"dev": true
},
"@eslint/eslintrc": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.1.0.tgz",
- "integrity": "sha512-C1DfL7XX4nPqGd6jcP01W9pVM1HYCuUkFk1432D7F0v3JSlUIeOYn9oCoi3eoLZ+iwBSb29BMFxxny0YrrEZqg==",
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz",
+ "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==",
"dev": true,
"requires": {
"ajv": "^6.12.4",
"debug": "^4.3.2",
"espree": "^9.3.1",
"globals": "^13.9.0",
- "ignore": "^4.0.6",
+ "ignore": "^5.2.0",
"import-fresh": "^3.2.1",
"js-yaml": "^4.1.0",
"minimatch": "^3.0.4",
"strip-json-comments": "^3.1.1"
- },
- "dependencies": {
- "ignore": {
- "version": "4.0.6",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
- "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
- "dev": true
- }
}
},
"@humanwhocodes/config-array": {
@@ -2359,12 +2358,12 @@
"dev": true
},
"eslint": {
- "version": "8.9.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.9.0.tgz",
- "integrity": "sha512-PB09IGwv4F4b0/atrbcMFboF/giawbBLVC7fyDamk5Wtey4Jh2K+rYaBhCAbUyEI4QzB1ly09Uglc9iCtFaG2Q==",
+ "version": "8.11.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.11.0.tgz",
+ "integrity": "sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA==",
"dev": true,
"requires": {
- "@eslint/eslintrc": "^1.1.0",
+ "@eslint/eslintrc": "^1.2.1",
"@humanwhocodes/config-array": "^0.9.2",
"ajv": "^6.10.0",
"chalk": "^4.0.0",
@@ -2614,9 +2613,9 @@
}
},
"globals": {
- "version": "13.12.1",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz",
- "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==",
+ "version": "13.13.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz",
+ "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==",
"dev": true,
"requires": {
"type-fest": "^0.20.2"
@@ -2816,9 +2815,9 @@
}
},
"lint-staged": {
- "version": "12.3.4",
- "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-12.3.4.tgz",
- "integrity": "sha512-yv/iK4WwZ7/v0GtVkNb3R82pdL9M+ScpIbJLJNyCXkJ1FGaXvRCOg/SeL59SZtPpqZhE7BD6kPKFLIDUhDx2/w==",
+ "version": "12.3.6",
+ "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-12.3.6.tgz",
+ "integrity": "sha512-tVNyl/HsAnplKh4oaoRNzyZLm0PE/6VaBUXvd/gA9zhYCC/+ivZwiwpoT6jOxcLzuIOjP19wW+mfOi7/Bw4c1A==",
"dev": true,
"requires": {
"cli-truncate": "^3.1.0",
@@ -2831,6 +2830,7 @@
"micromatch": "^4.0.4",
"normalize-path": "^3.0.0",
"object-inspect": "^1.12.0",
+ "pidtree": "^0.5.0",
"string-argv": "^0.3.1",
"supports-color": "^9.2.1",
"yaml": "^1.10.2"
@@ -3155,6 +3155,12 @@
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
"dev": true
},
+ "pidtree": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.5.0.tgz",
+ "integrity": "sha512-9nxspIM7OpZuhBxPg73Zvyq7j1QMPMPsGKTqRc2XOaFQauDvoNz9fM1Wdkjmeo7l9GXOZiRs97sPkuayl39wjA==",
+ "dev": true
+ },
"prelude-ls": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
@@ -3162,9 +3168,9 @@
"dev": true
},
"prettier": {
- "version": "2.5.1",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz",
- "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==",
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz",
+ "integrity": "sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==",
"dev": true
},
"prettier-linter-helpers": {
@@ -3394,9 +3400,9 @@
"dev": true
},
"typescript": {
- "version": "4.5.5",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz",
- "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==",
+ "version": "4.6.2",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz",
+ "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==",
"dev": true
},
"uc.micro": {
diff --git a/package.json b/package.json
index 1f680f6..6d51d82 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "anilist-node",
- "version": "1.11.1",
+ "version": "1.11.2",
"description": "A lightweight Node.js wrapper for the AniList API",
"main": "./lib/index.js",
"types": "./lib/types/index.d.ts",
@@ -49,12 +49,12 @@
],
"devDependencies": {
"docdash": "^1.2.0",
- "eslint": "^8.9.0",
+ "eslint": "^8.11.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.4",
"jsdoc": "^3.6.10",
- "lint-staged": "^12.3.4",
- "prettier": "^2.5.1",
- "typescript": "^4.5.5"
+ "lint-staged": "^12.3.6",
+ "prettier": "^2.6.0",
+ "typescript": "^4.6.2"
}
}