├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── src ├── constants.ts ├── graphql-helper.ts ├── http-helper.ts ├── index.ts ├── leetcode.ts ├── models │ ├── IByTag.ts │ ├── IConfig.ts │ ├── IDifficulty.ts │ ├── IFilters.ts │ ├── IListProbems.ts │ ├── IProblem.ts │ ├── IPublicList.ts │ ├── ISortAndFilterParams.ts │ ├── ISubmission.ts │ ├── ISubmissionList.ts │ └── ITopicTag.ts ├── my-lists.ts ├── problem-list.ts ├── problem.ts ├── submission-list.ts ├── tag-info.ts └── typings │ └── index.d.ts ├── tsconfig.json └── typedoc.json /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /lib 3 | /example 4 | /docs -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Table of Contents 2 | 3 | - [Table of Contents](#table-of-contents) 4 | - [Introduction](#introduction) 5 | - [Getting Started](#getting-started) 6 | - [Example Usage](#example-usage) 7 | - [Available methods](#available-methods) 8 | - [Docs](#docs) 9 | - [Todo](#todo) 10 | - [Features](#features) 11 | - [Technical/Other Improvements](#technicalother-improvements) 12 | 13 | ## Introduction 14 | 15 | This is a [npm library](https://www.npmjs.com/package/@codingsnack/leetcode-api) through which one can interface with leetcode api. 16 | 17 | ## Getting Started 18 | 19 | Install the api into your node project through npm or yarn. 20 | 21 | - npm: `npm i @codingsnack/leetcode-api` 22 | - yarn: `yarn add @codingsnack/leetcode-api` 23 | 24 | ## Example Usage 25 | 26 | To use this api, you need to login to your [leetcode.com](https://leetcode.com/) account and then copy the two cookies mentioned below and pass it to Leetcode constructor. You can get these cookies using chrome devtools or [EditThisCookie](https://www.editthiscookie.com/) chrome extension. 27 | 28 | - csrfToken 29 | - LEETCODE_SESSION 30 | 31 | ```js 32 | const { Leetcode } = require('@codingsnack/leetcode-api'); 33 | 34 | const main = async () => { 35 | // csrfToken after you've logged in 36 | const csrfToken = ''; 37 | // LEETCODE_SESSION after you've logged in 38 | const session = ''; 39 | 40 | const lc = new Leetcode({ csrfToken, session }); 41 | 42 | const problem = await lc.getProblem('two-sum'); 43 | console.log(problem); 44 | 45 | }; 46 | 47 | main(); 48 | 49 | ``` 50 | 51 | ## Available methods 52 | 53 | Currently availably methods are 54 | 55 | - `getProblem(slug)`: Get information about single problem based on its title(also referred to as slug) 56 | - `getMyLists()`: Get all the lists that you have created or have favorited. 57 | - `getProblems(params)`: Get all the problems based on passed params. Supports pagination, filter by category, listId, difficulty, status, premiumOnly, tags, companies, searchKeyWords. You can also orderBy FRONTEND_ID, AC_RATE(acceptance rate), DIFFICULTY, FREQUENCY. Sort order can be ascending or descending. This is same as going to . 58 | - `getSubmission(slug)`: Get all submissions for given problem. 59 | - `getRandomQuestion()`: Get a random question. 60 | - `getPublicList(listId)`: Get a public list based on its listId. 61 | - `getProblemsByTag(tag)`: Get problems by tag(like array). This is same as going to . 62 | - `getProblemsByCompany(company)`: Get problems by company(like apple). This is same as going to . 63 | - `getSimilarProblems(slug, depth = 1)`: Get similar problems based on slug. Depth param is optional and default value is 1. If depth is say `2` and slug is `two-sum`, then this will fetch similar questions to `two-sum` and then similar questions to all the similar questions of `two-sum`. Note that this will return a problem instance and this will have a field called similarProblems which is an array and the consumer can recurse through this. Also note that this method is still in beta. 64 | 65 | ## Docs 66 | 67 | For docs refer this [link](https://codingsnack.github.io/leetcode-api/). 68 | 69 | ## Todo 70 | 71 | ### Features 72 | 73 | - Post submission and get the result back 74 | - Fetch any user profile(including contribution graph) 75 | - Fetch loggedIn user's session details(as in progress mainted by leetcode). 76 | - Fetch discuss sections for a problem 77 | - Optimize similarProblems method 78 | - Build adjaceny list of problems based on tag, company etc so its easier to visualize the connections between similar problems. 79 | 80 | ### Technical/Other Improvements 81 | 82 | - Add better docs, wiki and examples. 83 | - Add Contributing Page. 84 | - Add github actions to check the build process and automatically generate docs and deploy them. 85 | - Update master branch to main branch. 86 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@codingsnack/leetcode-api", 3 | "version": "0.0.5", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "@codingsnack/leetcode-api", 9 | "version": "0.0.5", 10 | "license": "ISC", 11 | "dependencies": { 12 | "delay": "^5.0.0", 13 | "graphql-request": "^3.7.0", 14 | "node-fetch": "^2.6.1" 15 | }, 16 | "devDependencies": { 17 | "@types/node-fetch": "^3.0.3", 18 | "gh-pages": "^3.2.3", 19 | "rimraf": "^3.0.2", 20 | "typedoc": "^0.22.10", 21 | "typescript": "^4.5.4" 22 | } 23 | }, 24 | "node_modules/@types/node-fetch": { 25 | "version": "3.0.3", 26 | "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-3.0.3.tgz", 27 | "integrity": "sha512-HhggYPH5N+AQe/OmN6fmhKmRRt2XuNJow+R3pQwJxOOF9GuwM7O2mheyGeIrs5MOIeNjDEdgdoyHBOrFeJBR3g==", 28 | "deprecated": "This is a stub types definition. node-fetch provides its own type definitions, so you do not need this installed.", 29 | "dev": true, 30 | "dependencies": { 31 | "node-fetch": "*" 32 | } 33 | }, 34 | "node_modules/array-union": { 35 | "version": "1.0.2", 36 | "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", 37 | "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", 38 | "dev": true, 39 | "dependencies": { 40 | "array-uniq": "^1.0.1" 41 | }, 42 | "engines": { 43 | "node": ">=0.10.0" 44 | } 45 | }, 46 | "node_modules/array-uniq": { 47 | "version": "1.0.3", 48 | "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", 49 | "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", 50 | "dev": true, 51 | "engines": { 52 | "node": ">=0.10.0" 53 | } 54 | }, 55 | "node_modules/async": { 56 | "version": "2.6.3", 57 | "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", 58 | "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", 59 | "dev": true, 60 | "dependencies": { 61 | "lodash": "^4.17.14" 62 | } 63 | }, 64 | "node_modules/asynckit": { 65 | "version": "0.4.0", 66 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 67 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 68 | }, 69 | "node_modules/balanced-match": { 70 | "version": "1.0.2", 71 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 72 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 73 | "dev": true 74 | }, 75 | "node_modules/brace-expansion": { 76 | "version": "1.1.11", 77 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 78 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 79 | "dev": true, 80 | "dependencies": { 81 | "balanced-match": "^1.0.0", 82 | "concat-map": "0.0.1" 83 | } 84 | }, 85 | "node_modules/combined-stream": { 86 | "version": "1.0.8", 87 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 88 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 89 | "dependencies": { 90 | "delayed-stream": "~1.0.0" 91 | }, 92 | "engines": { 93 | "node": ">= 0.8" 94 | } 95 | }, 96 | "node_modules/commander": { 97 | "version": "2.20.3", 98 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", 99 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", 100 | "dev": true 101 | }, 102 | "node_modules/commondir": { 103 | "version": "1.0.1", 104 | "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", 105 | "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", 106 | "dev": true 107 | }, 108 | "node_modules/concat-map": { 109 | "version": "0.0.1", 110 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 111 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 112 | "dev": true 113 | }, 114 | "node_modules/cross-fetch": { 115 | "version": "3.1.4", 116 | "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", 117 | "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", 118 | "dependencies": { 119 | "node-fetch": "2.6.1" 120 | } 121 | }, 122 | "node_modules/delay": { 123 | "version": "5.0.0", 124 | "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", 125 | "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", 126 | "engines": { 127 | "node": ">=10" 128 | }, 129 | "funding": { 130 | "url": "https://github.com/sponsors/sindresorhus" 131 | } 132 | }, 133 | "node_modules/delayed-stream": { 134 | "version": "1.0.0", 135 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 136 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", 137 | "engines": { 138 | "node": ">=0.4.0" 139 | } 140 | }, 141 | "node_modules/email-addresses": { 142 | "version": "3.1.0", 143 | "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz", 144 | "integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==", 145 | "dev": true 146 | }, 147 | "node_modules/escape-string-regexp": { 148 | "version": "1.0.5", 149 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 150 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 151 | "dev": true, 152 | "engines": { 153 | "node": ">=0.8.0" 154 | } 155 | }, 156 | "node_modules/extract-files": { 157 | "version": "9.0.0", 158 | "resolved": "https://registry.npmjs.org/extract-files/-/extract-files-9.0.0.tgz", 159 | "integrity": "sha512-CvdFfHkC95B4bBBk36hcEmvdR2awOdhhVUYH6S/zrVj3477zven/fJMYg7121h4T1xHZC+tetUpubpAhxwI7hQ==", 160 | "engines": { 161 | "node": "^10.17.0 || ^12.0.0 || >= 13.7.0" 162 | }, 163 | "funding": { 164 | "url": "https://github.com/sponsors/jaydenseric" 165 | } 166 | }, 167 | "node_modules/filename-reserved-regex": { 168 | "version": "2.0.0", 169 | "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz", 170 | "integrity": "sha1-q/c9+rc10EVECr/qLZHzieu/oik=", 171 | "dev": true, 172 | "engines": { 173 | "node": ">=4" 174 | } 175 | }, 176 | "node_modules/filenamify": { 177 | "version": "4.3.0", 178 | "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-4.3.0.tgz", 179 | "integrity": "sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==", 180 | "dev": true, 181 | "dependencies": { 182 | "filename-reserved-regex": "^2.0.0", 183 | "strip-outer": "^1.0.1", 184 | "trim-repeated": "^1.0.0" 185 | }, 186 | "engines": { 187 | "node": ">=8" 188 | }, 189 | "funding": { 190 | "url": "https://github.com/sponsors/sindresorhus" 191 | } 192 | }, 193 | "node_modules/find-cache-dir": { 194 | "version": "3.3.2", 195 | "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", 196 | "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", 197 | "dev": true, 198 | "dependencies": { 199 | "commondir": "^1.0.1", 200 | "make-dir": "^3.0.2", 201 | "pkg-dir": "^4.1.0" 202 | }, 203 | "engines": { 204 | "node": ">=8" 205 | }, 206 | "funding": { 207 | "url": "https://github.com/avajs/find-cache-dir?sponsor=1" 208 | } 209 | }, 210 | "node_modules/find-up": { 211 | "version": "4.1.0", 212 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", 213 | "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", 214 | "dev": true, 215 | "dependencies": { 216 | "locate-path": "^5.0.0", 217 | "path-exists": "^4.0.0" 218 | }, 219 | "engines": { 220 | "node": ">=8" 221 | } 222 | }, 223 | "node_modules/form-data": { 224 | "version": "3.0.1", 225 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", 226 | "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", 227 | "dependencies": { 228 | "asynckit": "^0.4.0", 229 | "combined-stream": "^1.0.8", 230 | "mime-types": "^2.1.12" 231 | }, 232 | "engines": { 233 | "node": ">= 6" 234 | } 235 | }, 236 | "node_modules/fs-extra": { 237 | "version": "8.1.0", 238 | "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", 239 | "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", 240 | "dev": true, 241 | "dependencies": { 242 | "graceful-fs": "^4.2.0", 243 | "jsonfile": "^4.0.0", 244 | "universalify": "^0.1.0" 245 | }, 246 | "engines": { 247 | "node": ">=6 <7 || >=8" 248 | } 249 | }, 250 | "node_modules/fs.realpath": { 251 | "version": "1.0.0", 252 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 253 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 254 | "dev": true 255 | }, 256 | "node_modules/gh-pages": { 257 | "version": "3.2.3", 258 | "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-3.2.3.tgz", 259 | "integrity": "sha512-jA1PbapQ1jqzacECfjUaO9gV8uBgU6XNMV0oXLtfCX3haGLe5Atq8BxlrADhbD6/UdG9j6tZLWAkAybndOXTJg==", 260 | "dev": true, 261 | "dependencies": { 262 | "async": "^2.6.1", 263 | "commander": "^2.18.0", 264 | "email-addresses": "^3.0.1", 265 | "filenamify": "^4.3.0", 266 | "find-cache-dir": "^3.3.1", 267 | "fs-extra": "^8.1.0", 268 | "globby": "^6.1.0" 269 | }, 270 | "bin": { 271 | "gh-pages": "bin/gh-pages.js", 272 | "gh-pages-clean": "bin/gh-pages-clean.js" 273 | }, 274 | "engines": { 275 | "node": ">=10" 276 | } 277 | }, 278 | "node_modules/glob": { 279 | "version": "7.2.0", 280 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", 281 | "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", 282 | "dev": true, 283 | "dependencies": { 284 | "fs.realpath": "^1.0.0", 285 | "inflight": "^1.0.4", 286 | "inherits": "2", 287 | "minimatch": "^3.0.4", 288 | "once": "^1.3.0", 289 | "path-is-absolute": "^1.0.0" 290 | }, 291 | "engines": { 292 | "node": "*" 293 | }, 294 | "funding": { 295 | "url": "https://github.com/sponsors/isaacs" 296 | } 297 | }, 298 | "node_modules/globby": { 299 | "version": "6.1.0", 300 | "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", 301 | "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", 302 | "dev": true, 303 | "dependencies": { 304 | "array-union": "^1.0.1", 305 | "glob": "^7.0.3", 306 | "object-assign": "^4.0.1", 307 | "pify": "^2.0.0", 308 | "pinkie-promise": "^2.0.0" 309 | }, 310 | "engines": { 311 | "node": ">=0.10.0" 312 | } 313 | }, 314 | "node_modules/graceful-fs": { 315 | "version": "4.2.8", 316 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", 317 | "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", 318 | "dev": true 319 | }, 320 | "node_modules/graphql": { 321 | "version": "16.1.0", 322 | "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.1.0.tgz", 323 | "integrity": "sha512-+PIjmhqGHMIxtnlEirRXDHIzs0cAHAozKG5M2w2N4TnS8VzCxO3bbv1AW9UTeycBfl2QsPduxcVrBvANFKQhiw==", 324 | "peer": true, 325 | "engines": { 326 | "node": "^12.22.0 || ^14.16.0 || >=16.0.0" 327 | } 328 | }, 329 | "node_modules/graphql-request": { 330 | "version": "3.7.0", 331 | "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-3.7.0.tgz", 332 | "integrity": "sha512-dw5PxHCgBneN2DDNqpWu8QkbbJ07oOziy8z+bK/TAXufsOLaETuVO4GkXrbs0WjhdKhBMN3BkpN/RIvUHkmNUQ==", 333 | "dependencies": { 334 | "cross-fetch": "^3.0.6", 335 | "extract-files": "^9.0.0", 336 | "form-data": "^3.0.0" 337 | }, 338 | "peerDependencies": { 339 | "graphql": "14 - 16" 340 | } 341 | }, 342 | "node_modules/inflight": { 343 | "version": "1.0.6", 344 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 345 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 346 | "dev": true, 347 | "dependencies": { 348 | "once": "^1.3.0", 349 | "wrappy": "1" 350 | } 351 | }, 352 | "node_modules/inherits": { 353 | "version": "2.0.4", 354 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 355 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 356 | "dev": true 357 | }, 358 | "node_modules/jsonc-parser": { 359 | "version": "3.0.0", 360 | "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", 361 | "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", 362 | "dev": true 363 | }, 364 | "node_modules/jsonfile": { 365 | "version": "4.0.0", 366 | "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", 367 | "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", 368 | "dev": true, 369 | "optionalDependencies": { 370 | "graceful-fs": "^4.1.6" 371 | } 372 | }, 373 | "node_modules/locate-path": { 374 | "version": "5.0.0", 375 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", 376 | "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", 377 | "dev": true, 378 | "dependencies": { 379 | "p-locate": "^4.1.0" 380 | }, 381 | "engines": { 382 | "node": ">=8" 383 | } 384 | }, 385 | "node_modules/lodash": { 386 | "version": "4.17.21", 387 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 388 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", 389 | "dev": true 390 | }, 391 | "node_modules/lunr": { 392 | "version": "2.3.9", 393 | "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", 394 | "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", 395 | "dev": true 396 | }, 397 | "node_modules/make-dir": { 398 | "version": "3.1.0", 399 | "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", 400 | "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", 401 | "dev": true, 402 | "dependencies": { 403 | "semver": "^6.0.0" 404 | }, 405 | "engines": { 406 | "node": ">=8" 407 | }, 408 | "funding": { 409 | "url": "https://github.com/sponsors/sindresorhus" 410 | } 411 | }, 412 | "node_modules/marked": { 413 | "version": "3.0.8", 414 | "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.8.tgz", 415 | "integrity": "sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==", 416 | "dev": true, 417 | "bin": { 418 | "marked": "bin/marked" 419 | }, 420 | "engines": { 421 | "node": ">= 12" 422 | } 423 | }, 424 | "node_modules/mime-db": { 425 | "version": "1.51.0", 426 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", 427 | "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", 428 | "engines": { 429 | "node": ">= 0.6" 430 | } 431 | }, 432 | "node_modules/mime-types": { 433 | "version": "2.1.34", 434 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", 435 | "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", 436 | "dependencies": { 437 | "mime-db": "1.51.0" 438 | }, 439 | "engines": { 440 | "node": ">= 0.6" 441 | } 442 | }, 443 | "node_modules/minimatch": { 444 | "version": "3.0.4", 445 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 446 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 447 | "dev": true, 448 | "dependencies": { 449 | "brace-expansion": "^1.1.7" 450 | }, 451 | "engines": { 452 | "node": "*" 453 | } 454 | }, 455 | "node_modules/node-fetch": { 456 | "version": "2.6.1", 457 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", 458 | "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", 459 | "engines": { 460 | "node": "4.x || >=6.0.0" 461 | } 462 | }, 463 | "node_modules/object-assign": { 464 | "version": "4.1.1", 465 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 466 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", 467 | "dev": true, 468 | "engines": { 469 | "node": ">=0.10.0" 470 | } 471 | }, 472 | "node_modules/once": { 473 | "version": "1.4.0", 474 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 475 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 476 | "dev": true, 477 | "dependencies": { 478 | "wrappy": "1" 479 | } 480 | }, 481 | "node_modules/p-limit": { 482 | "version": "2.3.0", 483 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", 484 | "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", 485 | "dev": true, 486 | "dependencies": { 487 | "p-try": "^2.0.0" 488 | }, 489 | "engines": { 490 | "node": ">=6" 491 | }, 492 | "funding": { 493 | "url": "https://github.com/sponsors/sindresorhus" 494 | } 495 | }, 496 | "node_modules/p-locate": { 497 | "version": "4.1.0", 498 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", 499 | "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", 500 | "dev": true, 501 | "dependencies": { 502 | "p-limit": "^2.2.0" 503 | }, 504 | "engines": { 505 | "node": ">=8" 506 | } 507 | }, 508 | "node_modules/p-try": { 509 | "version": "2.2.0", 510 | "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", 511 | "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", 512 | "dev": true, 513 | "engines": { 514 | "node": ">=6" 515 | } 516 | }, 517 | "node_modules/path-exists": { 518 | "version": "4.0.0", 519 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 520 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", 521 | "dev": true, 522 | "engines": { 523 | "node": ">=8" 524 | } 525 | }, 526 | "node_modules/path-is-absolute": { 527 | "version": "1.0.1", 528 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 529 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 530 | "dev": true, 531 | "engines": { 532 | "node": ">=0.10.0" 533 | } 534 | }, 535 | "node_modules/pify": { 536 | "version": "2.3.0", 537 | "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", 538 | "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", 539 | "dev": true, 540 | "engines": { 541 | "node": ">=0.10.0" 542 | } 543 | }, 544 | "node_modules/pinkie": { 545 | "version": "2.0.4", 546 | "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", 547 | "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", 548 | "dev": true, 549 | "engines": { 550 | "node": ">=0.10.0" 551 | } 552 | }, 553 | "node_modules/pinkie-promise": { 554 | "version": "2.0.1", 555 | "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", 556 | "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", 557 | "dev": true, 558 | "dependencies": { 559 | "pinkie": "^2.0.0" 560 | }, 561 | "engines": { 562 | "node": ">=0.10.0" 563 | } 564 | }, 565 | "node_modules/pkg-dir": { 566 | "version": "4.2.0", 567 | "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", 568 | "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", 569 | "dev": true, 570 | "dependencies": { 571 | "find-up": "^4.0.0" 572 | }, 573 | "engines": { 574 | "node": ">=8" 575 | } 576 | }, 577 | "node_modules/rimraf": { 578 | "version": "3.0.2", 579 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", 580 | "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 581 | "dev": true, 582 | "dependencies": { 583 | "glob": "^7.1.3" 584 | }, 585 | "bin": { 586 | "rimraf": "bin.js" 587 | }, 588 | "funding": { 589 | "url": "https://github.com/sponsors/isaacs" 590 | } 591 | }, 592 | "node_modules/semver": { 593 | "version": "6.3.0", 594 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 595 | "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 596 | "dev": true, 597 | "bin": { 598 | "semver": "bin/semver.js" 599 | } 600 | }, 601 | "node_modules/shiki": { 602 | "version": "0.9.15", 603 | "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.15.tgz", 604 | "integrity": "sha512-/Y0z9IzhJ8nD9nbceORCqu6NgT9X6I8Fk8c3SICHI5NbZRLdZYFaB233gwct9sU0vvSypyaL/qaKvzyQGJBZSw==", 605 | "dev": true, 606 | "dependencies": { 607 | "jsonc-parser": "^3.0.0", 608 | "vscode-oniguruma": "^1.6.1", 609 | "vscode-textmate": "5.2.0" 610 | } 611 | }, 612 | "node_modules/strip-outer": { 613 | "version": "1.0.1", 614 | "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz", 615 | "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==", 616 | "dev": true, 617 | "dependencies": { 618 | "escape-string-regexp": "^1.0.2" 619 | }, 620 | "engines": { 621 | "node": ">=0.10.0" 622 | } 623 | }, 624 | "node_modules/trim-repeated": { 625 | "version": "1.0.0", 626 | "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", 627 | "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=", 628 | "dev": true, 629 | "dependencies": { 630 | "escape-string-regexp": "^1.0.2" 631 | }, 632 | "engines": { 633 | "node": ">=0.10.0" 634 | } 635 | }, 636 | "node_modules/typedoc": { 637 | "version": "0.22.10", 638 | "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.10.tgz", 639 | "integrity": "sha512-hQYZ4WtoMZ61wDC6w10kxA42+jclWngdmztNZsDvIz7BMJg7F2xnT+uYsUa7OluyKossdFj9E9Ye4QOZKTy8SA==", 640 | "dev": true, 641 | "dependencies": { 642 | "glob": "^7.2.0", 643 | "lunr": "^2.3.9", 644 | "marked": "^3.0.8", 645 | "minimatch": "^3.0.4", 646 | "shiki": "^0.9.12" 647 | }, 648 | "bin": { 649 | "typedoc": "bin/typedoc" 650 | }, 651 | "engines": { 652 | "node": ">= 12.10.0" 653 | }, 654 | "peerDependencies": { 655 | "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x" 656 | } 657 | }, 658 | "node_modules/typescript": { 659 | "version": "4.5.4", 660 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", 661 | "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", 662 | "dev": true, 663 | "bin": { 664 | "tsc": "bin/tsc", 665 | "tsserver": "bin/tsserver" 666 | }, 667 | "engines": { 668 | "node": ">=4.2.0" 669 | } 670 | }, 671 | "node_modules/universalify": { 672 | "version": "0.1.2", 673 | "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", 674 | "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", 675 | "dev": true, 676 | "engines": { 677 | "node": ">= 4.0.0" 678 | } 679 | }, 680 | "node_modules/vscode-oniguruma": { 681 | "version": "1.6.1", 682 | "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.1.tgz", 683 | "integrity": "sha512-vc4WhSIaVpgJ0jJIejjYxPvURJavX6QG41vu0mGhqywMkQqulezEqEQ3cO3gc8GvcOpX6ycmKGqRoROEMBNXTQ==", 684 | "dev": true 685 | }, 686 | "node_modules/vscode-textmate": { 687 | "version": "5.2.0", 688 | "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", 689 | "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", 690 | "dev": true 691 | }, 692 | "node_modules/wrappy": { 693 | "version": "1.0.2", 694 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 695 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 696 | "dev": true 697 | } 698 | }, 699 | "dependencies": { 700 | "@types/node-fetch": { 701 | "version": "3.0.3", 702 | "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-3.0.3.tgz", 703 | "integrity": "sha512-HhggYPH5N+AQe/OmN6fmhKmRRt2XuNJow+R3pQwJxOOF9GuwM7O2mheyGeIrs5MOIeNjDEdgdoyHBOrFeJBR3g==", 704 | "dev": true, 705 | "requires": { 706 | "node-fetch": "*" 707 | } 708 | }, 709 | "array-union": { 710 | "version": "1.0.2", 711 | "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", 712 | "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", 713 | "dev": true, 714 | "requires": { 715 | "array-uniq": "^1.0.1" 716 | } 717 | }, 718 | "array-uniq": { 719 | "version": "1.0.3", 720 | "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", 721 | "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", 722 | "dev": true 723 | }, 724 | "async": { 725 | "version": "2.6.3", 726 | "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", 727 | "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", 728 | "dev": true, 729 | "requires": { 730 | "lodash": "^4.17.14" 731 | } 732 | }, 733 | "asynckit": { 734 | "version": "0.4.0", 735 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 736 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 737 | }, 738 | "balanced-match": { 739 | "version": "1.0.2", 740 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 741 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 742 | "dev": true 743 | }, 744 | "brace-expansion": { 745 | "version": "1.1.11", 746 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 747 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 748 | "dev": true, 749 | "requires": { 750 | "balanced-match": "^1.0.0", 751 | "concat-map": "0.0.1" 752 | } 753 | }, 754 | "combined-stream": { 755 | "version": "1.0.8", 756 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 757 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 758 | "requires": { 759 | "delayed-stream": "~1.0.0" 760 | } 761 | }, 762 | "commander": { 763 | "version": "2.20.3", 764 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", 765 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", 766 | "dev": true 767 | }, 768 | "commondir": { 769 | "version": "1.0.1", 770 | "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", 771 | "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", 772 | "dev": true 773 | }, 774 | "concat-map": { 775 | "version": "0.0.1", 776 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 777 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 778 | "dev": true 779 | }, 780 | "cross-fetch": { 781 | "version": "3.1.4", 782 | "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", 783 | "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", 784 | "requires": { 785 | "node-fetch": "2.6.1" 786 | } 787 | }, 788 | "delay": { 789 | "version": "5.0.0", 790 | "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", 791 | "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==" 792 | }, 793 | "delayed-stream": { 794 | "version": "1.0.0", 795 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 796 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 797 | }, 798 | "email-addresses": { 799 | "version": "3.1.0", 800 | "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz", 801 | "integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==", 802 | "dev": true 803 | }, 804 | "escape-string-regexp": { 805 | "version": "1.0.5", 806 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 807 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 808 | "dev": true 809 | }, 810 | "extract-files": { 811 | "version": "9.0.0", 812 | "resolved": "https://registry.npmjs.org/extract-files/-/extract-files-9.0.0.tgz", 813 | "integrity": "sha512-CvdFfHkC95B4bBBk36hcEmvdR2awOdhhVUYH6S/zrVj3477zven/fJMYg7121h4T1xHZC+tetUpubpAhxwI7hQ==" 814 | }, 815 | "filename-reserved-regex": { 816 | "version": "2.0.0", 817 | "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz", 818 | "integrity": "sha1-q/c9+rc10EVECr/qLZHzieu/oik=", 819 | "dev": true 820 | }, 821 | "filenamify": { 822 | "version": "4.3.0", 823 | "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-4.3.0.tgz", 824 | "integrity": "sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==", 825 | "dev": true, 826 | "requires": { 827 | "filename-reserved-regex": "^2.0.0", 828 | "strip-outer": "^1.0.1", 829 | "trim-repeated": "^1.0.0" 830 | } 831 | }, 832 | "find-cache-dir": { 833 | "version": "3.3.2", 834 | "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", 835 | "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", 836 | "dev": true, 837 | "requires": { 838 | "commondir": "^1.0.1", 839 | "make-dir": "^3.0.2", 840 | "pkg-dir": "^4.1.0" 841 | } 842 | }, 843 | "find-up": { 844 | "version": "4.1.0", 845 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", 846 | "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", 847 | "dev": true, 848 | "requires": { 849 | "locate-path": "^5.0.0", 850 | "path-exists": "^4.0.0" 851 | } 852 | }, 853 | "form-data": { 854 | "version": "3.0.1", 855 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", 856 | "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", 857 | "requires": { 858 | "asynckit": "^0.4.0", 859 | "combined-stream": "^1.0.8", 860 | "mime-types": "^2.1.12" 861 | } 862 | }, 863 | "fs-extra": { 864 | "version": "8.1.0", 865 | "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", 866 | "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", 867 | "dev": true, 868 | "requires": { 869 | "graceful-fs": "^4.2.0", 870 | "jsonfile": "^4.0.0", 871 | "universalify": "^0.1.0" 872 | } 873 | }, 874 | "fs.realpath": { 875 | "version": "1.0.0", 876 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 877 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 878 | "dev": true 879 | }, 880 | "gh-pages": { 881 | "version": "3.2.3", 882 | "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-3.2.3.tgz", 883 | "integrity": "sha512-jA1PbapQ1jqzacECfjUaO9gV8uBgU6XNMV0oXLtfCX3haGLe5Atq8BxlrADhbD6/UdG9j6tZLWAkAybndOXTJg==", 884 | "dev": true, 885 | "requires": { 886 | "async": "^2.6.1", 887 | "commander": "^2.18.0", 888 | "email-addresses": "^3.0.1", 889 | "filenamify": "^4.3.0", 890 | "find-cache-dir": "^3.3.1", 891 | "fs-extra": "^8.1.0", 892 | "globby": "^6.1.0" 893 | } 894 | }, 895 | "glob": { 896 | "version": "7.2.0", 897 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", 898 | "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", 899 | "dev": true, 900 | "requires": { 901 | "fs.realpath": "^1.0.0", 902 | "inflight": "^1.0.4", 903 | "inherits": "2", 904 | "minimatch": "^3.0.4", 905 | "once": "^1.3.0", 906 | "path-is-absolute": "^1.0.0" 907 | } 908 | }, 909 | "globby": { 910 | "version": "6.1.0", 911 | "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", 912 | "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", 913 | "dev": true, 914 | "requires": { 915 | "array-union": "^1.0.1", 916 | "glob": "^7.0.3", 917 | "object-assign": "^4.0.1", 918 | "pify": "^2.0.0", 919 | "pinkie-promise": "^2.0.0" 920 | } 921 | }, 922 | "graceful-fs": { 923 | "version": "4.2.8", 924 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", 925 | "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", 926 | "dev": true 927 | }, 928 | "graphql": { 929 | "version": "16.1.0", 930 | "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.1.0.tgz", 931 | "integrity": "sha512-+PIjmhqGHMIxtnlEirRXDHIzs0cAHAozKG5M2w2N4TnS8VzCxO3bbv1AW9UTeycBfl2QsPduxcVrBvANFKQhiw==", 932 | "peer": true 933 | }, 934 | "graphql-request": { 935 | "version": "3.7.0", 936 | "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-3.7.0.tgz", 937 | "integrity": "sha512-dw5PxHCgBneN2DDNqpWu8QkbbJ07oOziy8z+bK/TAXufsOLaETuVO4GkXrbs0WjhdKhBMN3BkpN/RIvUHkmNUQ==", 938 | "requires": { 939 | "cross-fetch": "^3.0.6", 940 | "extract-files": "^9.0.0", 941 | "form-data": "^3.0.0" 942 | } 943 | }, 944 | "inflight": { 945 | "version": "1.0.6", 946 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 947 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 948 | "dev": true, 949 | "requires": { 950 | "once": "^1.3.0", 951 | "wrappy": "1" 952 | } 953 | }, 954 | "inherits": { 955 | "version": "2.0.4", 956 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 957 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 958 | "dev": true 959 | }, 960 | "jsonc-parser": { 961 | "version": "3.0.0", 962 | "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", 963 | "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", 964 | "dev": true 965 | }, 966 | "jsonfile": { 967 | "version": "4.0.0", 968 | "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", 969 | "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", 970 | "dev": true, 971 | "requires": { 972 | "graceful-fs": "^4.1.6" 973 | } 974 | }, 975 | "locate-path": { 976 | "version": "5.0.0", 977 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", 978 | "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", 979 | "dev": true, 980 | "requires": { 981 | "p-locate": "^4.1.0" 982 | } 983 | }, 984 | "lodash": { 985 | "version": "4.17.21", 986 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 987 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", 988 | "dev": true 989 | }, 990 | "lunr": { 991 | "version": "2.3.9", 992 | "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", 993 | "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", 994 | "dev": true 995 | }, 996 | "make-dir": { 997 | "version": "3.1.0", 998 | "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", 999 | "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", 1000 | "dev": true, 1001 | "requires": { 1002 | "semver": "^6.0.0" 1003 | } 1004 | }, 1005 | "marked": { 1006 | "version": "3.0.8", 1007 | "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.8.tgz", 1008 | "integrity": "sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==", 1009 | "dev": true 1010 | }, 1011 | "mime-db": { 1012 | "version": "1.51.0", 1013 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", 1014 | "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==" 1015 | }, 1016 | "mime-types": { 1017 | "version": "2.1.34", 1018 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", 1019 | "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", 1020 | "requires": { 1021 | "mime-db": "1.51.0" 1022 | } 1023 | }, 1024 | "minimatch": { 1025 | "version": "3.0.4", 1026 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 1027 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 1028 | "dev": true, 1029 | "requires": { 1030 | "brace-expansion": "^1.1.7" 1031 | } 1032 | }, 1033 | "node-fetch": { 1034 | "version": "2.6.1", 1035 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", 1036 | "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" 1037 | }, 1038 | "object-assign": { 1039 | "version": "4.1.1", 1040 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 1041 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", 1042 | "dev": true 1043 | }, 1044 | "once": { 1045 | "version": "1.4.0", 1046 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1047 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 1048 | "dev": true, 1049 | "requires": { 1050 | "wrappy": "1" 1051 | } 1052 | }, 1053 | "p-limit": { 1054 | "version": "2.3.0", 1055 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", 1056 | "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", 1057 | "dev": true, 1058 | "requires": { 1059 | "p-try": "^2.0.0" 1060 | } 1061 | }, 1062 | "p-locate": { 1063 | "version": "4.1.0", 1064 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", 1065 | "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", 1066 | "dev": true, 1067 | "requires": { 1068 | "p-limit": "^2.2.0" 1069 | } 1070 | }, 1071 | "p-try": { 1072 | "version": "2.2.0", 1073 | "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", 1074 | "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", 1075 | "dev": true 1076 | }, 1077 | "path-exists": { 1078 | "version": "4.0.0", 1079 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 1080 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", 1081 | "dev": true 1082 | }, 1083 | "path-is-absolute": { 1084 | "version": "1.0.1", 1085 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1086 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 1087 | "dev": true 1088 | }, 1089 | "pify": { 1090 | "version": "2.3.0", 1091 | "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", 1092 | "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", 1093 | "dev": true 1094 | }, 1095 | "pinkie": { 1096 | "version": "2.0.4", 1097 | "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", 1098 | "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", 1099 | "dev": true 1100 | }, 1101 | "pinkie-promise": { 1102 | "version": "2.0.1", 1103 | "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", 1104 | "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", 1105 | "dev": true, 1106 | "requires": { 1107 | "pinkie": "^2.0.0" 1108 | } 1109 | }, 1110 | "pkg-dir": { 1111 | "version": "4.2.0", 1112 | "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", 1113 | "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", 1114 | "dev": true, 1115 | "requires": { 1116 | "find-up": "^4.0.0" 1117 | } 1118 | }, 1119 | "rimraf": { 1120 | "version": "3.0.2", 1121 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", 1122 | "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 1123 | "dev": true, 1124 | "requires": { 1125 | "glob": "^7.1.3" 1126 | } 1127 | }, 1128 | "semver": { 1129 | "version": "6.3.0", 1130 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 1131 | "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 1132 | "dev": true 1133 | }, 1134 | "shiki": { 1135 | "version": "0.9.15", 1136 | "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.15.tgz", 1137 | "integrity": "sha512-/Y0z9IzhJ8nD9nbceORCqu6NgT9X6I8Fk8c3SICHI5NbZRLdZYFaB233gwct9sU0vvSypyaL/qaKvzyQGJBZSw==", 1138 | "dev": true, 1139 | "requires": { 1140 | "jsonc-parser": "^3.0.0", 1141 | "vscode-oniguruma": "^1.6.1", 1142 | "vscode-textmate": "5.2.0" 1143 | } 1144 | }, 1145 | "strip-outer": { 1146 | "version": "1.0.1", 1147 | "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz", 1148 | "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==", 1149 | "dev": true, 1150 | "requires": { 1151 | "escape-string-regexp": "^1.0.2" 1152 | } 1153 | }, 1154 | "trim-repeated": { 1155 | "version": "1.0.0", 1156 | "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", 1157 | "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=", 1158 | "dev": true, 1159 | "requires": { 1160 | "escape-string-regexp": "^1.0.2" 1161 | } 1162 | }, 1163 | "typedoc": { 1164 | "version": "0.22.10", 1165 | "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.10.tgz", 1166 | "integrity": "sha512-hQYZ4WtoMZ61wDC6w10kxA42+jclWngdmztNZsDvIz7BMJg7F2xnT+uYsUa7OluyKossdFj9E9Ye4QOZKTy8SA==", 1167 | "dev": true, 1168 | "requires": { 1169 | "glob": "^7.2.0", 1170 | "lunr": "^2.3.9", 1171 | "marked": "^3.0.8", 1172 | "minimatch": "^3.0.4", 1173 | "shiki": "^0.9.12" 1174 | } 1175 | }, 1176 | "typescript": { 1177 | "version": "4.5.4", 1178 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", 1179 | "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", 1180 | "dev": true 1181 | }, 1182 | "universalify": { 1183 | "version": "0.1.2", 1184 | "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", 1185 | "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", 1186 | "dev": true 1187 | }, 1188 | "vscode-oniguruma": { 1189 | "version": "1.6.1", 1190 | "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.1.tgz", 1191 | "integrity": "sha512-vc4WhSIaVpgJ0jJIejjYxPvURJavX6QG41vu0mGhqywMkQqulezEqEQ3cO3gc8GvcOpX6ycmKGqRoROEMBNXTQ==", 1192 | "dev": true 1193 | }, 1194 | "vscode-textmate": { 1195 | "version": "5.2.0", 1196 | "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", 1197 | "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", 1198 | "dev": true 1199 | }, 1200 | "wrappy": { 1201 | "version": "1.0.2", 1202 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1203 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 1204 | "dev": true 1205 | } 1206 | } 1207 | } 1208 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@codingsnack/leetcode-api", 3 | "version": "0.0.5", 4 | "description": "leetcode api", 5 | "main": "lib/index.js", 6 | "files": [ 7 | "lib/**/*" 8 | ], 9 | "scripts": { 10 | "tsc": "tsc", 11 | "develop": "tsc && yalc publish", 12 | "build-docs": "rimraf docs && typedoc --options typedoc.json", 13 | "deploy": "npm run build-docs && gh-pages -d docs" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/codingsnack/leetcode-api.git" 18 | }, 19 | "keywords": [], 20 | "author": "codingsnack", 21 | "license": "ISC", 22 | "bugs": { 23 | "url": "https://github.com/codingsnack/leetcode-api/issues" 24 | }, 25 | "homepage": "https://github.com/codingsnack/leetcode-api#readme", 26 | "devDependencies": { 27 | "@types/node-fetch": "^3.0.3", 28 | "gh-pages": "^3.2.3", 29 | "rimraf": "^3.0.2", 30 | "typedoc": "^0.22.10", 31 | "typescript": "^4.5.4" 32 | }, 33 | "dependencies": { 34 | "delay": "^5.0.0", 35 | "graphql-request": "^3.7.0", 36 | "node-fetch": "^2.6.1" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/constants.ts: -------------------------------------------------------------------------------- 1 | export class Constants { 2 | public static readonly ENDPOINT = 'https://leetcode.com'; 3 | public static readonly API_URL = `${Constants.ENDPOINT}/graphql`; 4 | public static readonly X_CSRFTOKEN_HEADER_KEY = 'x-csrftoken'; 5 | } 6 | -------------------------------------------------------------------------------- /src/graphql-helper.ts: -------------------------------------------------------------------------------- 1 | import { gql, GraphQLClient } from 'graphql-request'; 2 | import { Constants } from './constants'; 3 | import { ISortAndFilterParams } from './models/ISortAndFilterParams'; 4 | 5 | export class GraphQLHelper { 6 | private static readonly QUESTION_FIELDS = ` 7 | questionId 8 | questionFrontendId 9 | title 10 | titleSlug 11 | content 12 | isPaidOnly 13 | difficulty 14 | likes 15 | dislikes 16 | isLiked 17 | similarQuestions 18 | exampleTestcases 19 | companyTagStats 20 | stats 21 | hints 22 | sampleTestCase 23 | acRate 24 | difficulty 25 | freqBar 26 | isFavor 27 | status 28 | topicTags { 29 | name 30 | id 31 | slug 32 | } 33 | hasSolution 34 | hasVideoSolution 35 | `; 36 | private static readonly TAG_QUESTION_FIELDS = ` 37 | status 38 | questionId 39 | freqBar 40 | questionFrontendId 41 | title 42 | titleSlug 43 | stats 44 | difficulty 45 | isPaidOnly 46 | topicTags { 47 | name 48 | slug 49 | } 50 | companyTags { 51 | name 52 | slug 53 | } 54 | `; 55 | private graphQLClient: GraphQLClient; 56 | 57 | constructor(csrfToken: string, session: string) { 58 | this.graphQLClient = this.initGraphQLClient(csrfToken, session); 59 | } 60 | 61 | initGraphQLClient(csrfToken: string, session: string): GraphQLClient { 62 | return new GraphQLClient(Constants.API_URL, { 63 | headers: { 64 | referer: Constants.ENDPOINT, 65 | [Constants.X_CSRFTOKEN_HEADER_KEY]: csrfToken, 66 | Cookie: this.generateCookie(csrfToken, session), 67 | }, 68 | }); 69 | } 70 | 71 | generateCookie(csrfToken: string, session: string): string { 72 | return `csrftoken=${csrfToken};LEETCODE_SESSION=${session}`; 73 | } 74 | 75 | async getProblem(titleSlug: string) { 76 | const variables = { titleSlug }; 77 | const query = gql` 78 | query questionData($titleSlug: String!) { 79 | question(titleSlug: $titleSlug) { 80 | ${GraphQLHelper.QUESTION_FIELDS} 81 | } 82 | } 83 | `; 84 | return await this.graphQLClient.request(query, JSON.stringify(variables)); 85 | } 86 | 87 | async getMyLists() { 88 | const query = gql` 89 | query favoritesList { 90 | favoritesLists { 91 | allFavorites { 92 | idHash 93 | name 94 | description 95 | viewCount 96 | creator 97 | isWatched 98 | isPublicFavorite 99 | questions { 100 | questionId 101 | status 102 | title 103 | titleSlug 104 | } 105 | } 106 | watchedFavorites { 107 | idHash 108 | name 109 | description 110 | viewCount 111 | creator 112 | isWatched 113 | isPublicFavorite 114 | questions { 115 | questionId 116 | status 117 | title 118 | titleSlug 119 | } 120 | } 121 | } 122 | } 123 | `; 124 | return await this.graphQLClient.request(query); 125 | } 126 | 127 | async getProblems(params?: ISortAndFilterParams) { 128 | const { categorySlug = '', skip = 0, limit = 100, filters = {} } = params || {}; 129 | const variables = { categorySlug, skip, limit, filters }; 130 | 131 | const query = gql` 132 | query problemsetQuestionList($categorySlug: String, $limit: Int, $skip: Int, $filters: QuestionListFilterInput) { 133 | problemsetQuestionList: questionList(categorySlug: $categorySlug, limit: $limit, skip: $skip, filters: $filters) { 134 | total: totalNum 135 | questions: data { 136 | ${GraphQLHelper.QUESTION_FIELDS} 137 | } 138 | } 139 | } 140 | `; 141 | return await this.graphQLClient.request(query, JSON.stringify(variables)); 142 | } 143 | 144 | async getSubmissions(questionSlug: string) { 145 | const variables = { offset: 0, limit: 100, lastKey: null, questionSlug }; 146 | const query = gql` 147 | query Submissions($offset: Int!, $limit: Int!, $lastKey: String, $questionSlug: String!) { 148 | submissionList(offset: $offset, limit: $limit, lastKey: $lastKey, questionSlug: $questionSlug) { 149 | lastKey 150 | hasNext 151 | submissions { 152 | id 153 | statusDisplay 154 | lang 155 | runtime 156 | timestamp 157 | url 158 | isPending 159 | memory 160 | } 161 | } 162 | } 163 | `; 164 | return await this.graphQLClient.request(query, JSON.stringify(variables)); 165 | } 166 | 167 | async getRandomQuestion() { 168 | const variables = { categorySlug: '', filters: {} }; 169 | const query = gql` 170 | query randomQuestion($categorySlug: String, $filters: QuestionListFilterInput) { 171 | randomQuestion(categorySlug: $categorySlug, filters: $filters) { 172 | titleSlug 173 | } 174 | } 175 | `; 176 | return await this.graphQLClient.request(query, JSON.stringify(variables)); 177 | } 178 | 179 | async getProblemsByTag(tag: string) { 180 | const variables = { slug: tag }; 181 | 182 | const query = gql` 183 | query getTopicTag($slug: String!) { 184 | topicTag(slug: $slug) { 185 | name 186 | slug 187 | questions { 188 | ${GraphQLHelper.TAG_QUESTION_FIELDS} 189 | } 190 | frequencies 191 | } 192 | } 193 | `; 194 | return await this.graphQLClient.request(query, JSON.stringify(variables)); 195 | } 196 | async getProblemsByCompany(company: string) { 197 | const variables = { slug: company }; 198 | 199 | const query = gql` 200 | query getCompanyTag($slug: String!) { 201 | companyTag(slug: $slug) { 202 | name 203 | questions { 204 | ${GraphQLHelper.TAG_QUESTION_FIELDS} 205 | } 206 | frequencies 207 | } 208 | } 209 | `; 210 | return await this.graphQLClient.request(query, JSON.stringify(variables)); 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /src/http-helper.ts: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | import { Constants } from './constants'; 3 | 4 | export class HttpHelper { 5 | async getPublicList(listId: string) { 6 | const res = await fetch(`${Constants.ENDPOINT}/list/api/get_list/${listId}/`); 7 | return await res.json(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import Leetcode from './leetcode'; 2 | 3 | export { Leetcode }; 4 | -------------------------------------------------------------------------------- /src/leetcode.ts: -------------------------------------------------------------------------------- 1 | import { TagInfo } from './tag-info'; 2 | import { ISortAndFilterParams } from './models/ISortAndFilterParams'; 3 | import { MyLists } from './my-lists'; 4 | import { GraphQLHelper } from './graphql-helper'; 5 | import { Problem } from './problem'; 6 | import { ProblemList } from './problem-list'; 7 | import { IConfig } from './models/IConfig'; 8 | import { SubmissionList } from './submission-list'; 9 | import { HttpHelper } from './http-helper'; 10 | 11 | export default class Leetcode { 12 | private graphQLHelper: GraphQLHelper; 13 | private httpHelper: HttpHelper; 14 | 15 | constructor(config: IConfig) { 16 | const { csrfToken, session } = config; 17 | this.graphQLHelper = new GraphQLHelper(csrfToken, session); 18 | this.httpHelper = new HttpHelper(); 19 | } 20 | 21 | async getProblem(titleSlug: string): Promise { 22 | const data = await this.graphQLHelper.getProblem(titleSlug); 23 | const { question } = data; 24 | return new Problem(question); 25 | } 26 | 27 | async getMyLists(): Promise { 28 | const data = await this.graphQLHelper.getMyLists(); 29 | const { favoritesLists } = data; 30 | const { allFavorites, watchedFavorites } = favoritesLists; 31 | return new MyLists(allFavorites, watchedFavorites); 32 | } 33 | 34 | async getProblems(params?: ISortAndFilterParams): Promise { 35 | const data = await this.graphQLHelper.getProblems(params); 36 | const { problemsetQuestionList } = data; 37 | const { total, questions } = problemsetQuestionList; 38 | return new ProblemList(total, questions); 39 | } 40 | async getSubmissions(titleSlug: string): Promise { 41 | const data = await this.graphQLHelper.getSubmissions(titleSlug); 42 | const { submissionList } = data; 43 | const { lastKey, hasNext, submissions } = submissionList; 44 | return new SubmissionList(lastKey, hasNext, submissions); 45 | } 46 | 47 | async getRandomQuestion(): Promise { 48 | const data = await this.graphQLHelper.getRandomQuestion(); 49 | const { randomQuestion } = data; 50 | const { titleSlug } = randomQuestion; 51 | return await this.getProblem(titleSlug); 52 | } 53 | 54 | async getPublicList(listId: string): Promise { 55 | return await this.httpHelper.getPublicList(listId); 56 | } 57 | 58 | async getProblemsByTag(tag: string): Promise { 59 | const data = await this.graphQLHelper.getProblemsByTag(tag); 60 | const { topicTag } = data; 61 | const { name, slug, questions, frequencies } = topicTag; 62 | return new TagInfo(name, slug, questions, frequencies); 63 | } 64 | 65 | async getProblemsByCompany(company: string): Promise { 66 | const data = await this.graphQLHelper.getProblemsByCompany(company); 67 | const { companyTag } = data; 68 | const { name, slug, questions, frequencies } = companyTag; 69 | return new TagInfo(name, slug, questions, frequencies); 70 | } 71 | 72 | async getSimilarProblems(titleSlug: string, depth = 1): Promise { 73 | const problem = await this.getProblem(titleSlug); 74 | const visited: Set = new Set(); 75 | const q: Problem[] = []; 76 | q.push(problem); 77 | while (q.length > 0 && depth > 0) { 78 | const length = q.length; 79 | for (let i = 0; i < length; i++) { 80 | const currentProblem: Problem = q.shift()!; 81 | if (visited.has(currentProblem.titleSlug)) continue; 82 | visited.add(currentProblem.titleSlug); 83 | await this.fillSimilarProblems(currentProblem); 84 | q.push(...currentProblem.similarProblems); 85 | } 86 | depth--; 87 | } 88 | return problem; 89 | } 90 | 91 | private async fillSimilarProblems(problem: Problem) { 92 | const similarProblemsParsed: Object[] = this.parseSimilarQuestions(problem); 93 | 94 | for (let i = 0; i < similarProblemsParsed.length; i++) { 95 | const item: any = similarProblemsParsed[i]; 96 | const { titleSlug } = item; 97 | const currentProblem = await this.getProblem(titleSlug); 98 | problem.similarProblems.push(currentProblem); 99 | } 100 | } 101 | 102 | private parseSimilarQuestions(problem: Problem) { 103 | const { similarQuestions } = problem; 104 | return similarQuestions ? JSON.parse(problem.similarQuestions) : []; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/models/IByTag.ts: -------------------------------------------------------------------------------- 1 | import { IDifficulty } from './IDifficulty'; 2 | import { ITopicTag } from './ITopicTag'; 3 | 4 | export interface IByTag { 5 | name: string; 6 | slug: string; 7 | questions: TopicTagQuestion[]; 8 | frequencies: string; 9 | } 10 | 11 | export interface TopicTagQuestion { 12 | status: string; 13 | questionId: string; 14 | questionFrontendId: string; 15 | title: string; 16 | titleSlug: string; 17 | stats: string; 18 | difficulty: IDifficulty; 19 | isPaidOnly: boolean; 20 | topicTags: ITopicTag[]; 21 | companyTags: ITopicTag[]; 22 | frequency: number; 23 | freqBar: number; 24 | } 25 | -------------------------------------------------------------------------------- /src/models/IConfig.ts: -------------------------------------------------------------------------------- 1 | export interface IConfig { 2 | csrfToken: string; 3 | session: string; 4 | } 5 | -------------------------------------------------------------------------------- /src/models/IDifficulty.ts: -------------------------------------------------------------------------------- 1 | export enum IDifficulty { 2 | Easy = 'Easy', 3 | Hard = 'Hard', 4 | Medium = 'Medium', 5 | } 6 | -------------------------------------------------------------------------------- /src/models/IFilters.ts: -------------------------------------------------------------------------------- 1 | import { IDifficulty } from './IDifficulty'; 2 | 3 | export interface IFilters { 4 | listId?: string; 5 | difficulty?: IDifficulty; 6 | status?: string; 7 | premiumOnly?: boolean; 8 | tags?: string[]; 9 | companies?: string[]; 10 | searchKeyWords?: string; 11 | orderBy?: 'FRONTEND_ID' | 'AC_RATE' | 'DIFFICULTY' | 'FREQUENCY'; 12 | sortOrder?: 'DESCENDING' | 'ASCENDING'; 13 | } 14 | -------------------------------------------------------------------------------- /src/models/IListProbems.ts: -------------------------------------------------------------------------------- 1 | import { IProblem } from './IProblem'; 2 | 3 | export interface IListProbems { 4 | total: number; 5 | questions: IProblem[]; 6 | } 7 | -------------------------------------------------------------------------------- /src/models/IProblem.ts: -------------------------------------------------------------------------------- 1 | import { IDifficulty } from './IDifficulty'; 2 | import { ITopicTag } from './ITopicTag'; 3 | 4 | export interface IProblem { 5 | questionId: string; 6 | questionFrontendId: string; 7 | title: string; 8 | titleSlug: string; 9 | content: string; 10 | isPaidOnly: boolean; 11 | difficulty: IDifficulty; 12 | likes: number; 13 | dislikes: number; 14 | isLiked: null; 15 | similarQuestions: string; 16 | exampleTestcases: string; 17 | companyTagStats: string; 18 | stats: string; 19 | hints: string[]; 20 | sampleTestCase: string; 21 | 22 | acRate: number; 23 | freqBar: number; 24 | isFavor: boolean; 25 | status: string; 26 | topicTags: ITopicTag[]; 27 | hasSolution: boolean; 28 | hasVideoSolution: boolean; 29 | } 30 | -------------------------------------------------------------------------------- /src/models/IPublicList.ts: -------------------------------------------------------------------------------- 1 | namespace PublicList { 2 | export interface IPublicList { 3 | id_hash: string; 4 | name: string; 5 | description: string; 6 | questions: Question[]; 7 | is_public_favorite: boolean; 8 | view_count: number; 9 | creator: string; 10 | current_user: string; 11 | is_watched: boolean; 12 | } 13 | 14 | export interface Question { 15 | id: number; 16 | title: string; 17 | title_slug: string; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/models/ISortAndFilterParams.ts: -------------------------------------------------------------------------------- 1 | import { IFilters } from './IFilters'; 2 | 3 | export interface ISortAndFilterParams { 4 | categorySlug: '' | 'algorithms' | 'database' | 'shell' | 'concurrency'; 5 | skip: number; 6 | limit: number; 7 | filters: IFilters; 8 | } 9 | -------------------------------------------------------------------------------- /src/models/ISubmission.ts: -------------------------------------------------------------------------------- 1 | export interface ISubmission { 2 | id: string; 3 | statusDisplay: string; 4 | lang: string; 5 | runtime: string; 6 | timestamp: string; 7 | url: string; 8 | isPending: string; 9 | memory: string; 10 | absoluteUrl: string; 11 | } 12 | -------------------------------------------------------------------------------- /src/models/ISubmissionList.ts: -------------------------------------------------------------------------------- 1 | import { ISubmission } from './ISubmission'; 2 | 3 | export interface ISubmissionList { 4 | lastKey: any; 5 | hasNext: boolean; 6 | submissions: ISubmission[]; 7 | } 8 | -------------------------------------------------------------------------------- /src/models/ITopicTag.ts: -------------------------------------------------------------------------------- 1 | export interface ITopicTag { 2 | name: string; 3 | id: string; 4 | slug: string; 5 | } 6 | -------------------------------------------------------------------------------- /src/my-lists.ts: -------------------------------------------------------------------------------- 1 | export interface IMyLists { 2 | allFavorites: Favorite[]; 3 | watchedFavorites: Favorite[]; 4 | } 5 | 6 | export interface Favorite { 7 | idHash: string; 8 | name: string; 9 | description: string; 10 | viewCount: number; 11 | creator: string; 12 | isWatched: boolean; 13 | isPublicFavorite: boolean; 14 | questions: Question[]; 15 | } 16 | 17 | export interface Question { 18 | questionId: string; 19 | status: string; 20 | title: string; 21 | titleSlug: string; 22 | } 23 | 24 | export class MyLists implements IMyLists { 25 | allFavorites: Favorite[]; 26 | watchedFavorites: Favorite[]; 27 | 28 | constructor(allFavorites: Favorite[], watchedFavorites: Favorite[]) { 29 | this.allFavorites = allFavorites; 30 | this.watchedFavorites = watchedFavorites; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/problem-list.ts: -------------------------------------------------------------------------------- 1 | import { IListProbems } from './models/IListProbems'; 2 | import { IProblem } from './models/IProblem'; 3 | 4 | export class ProblemList implements IListProbems { 5 | total: number; 6 | questions: IProblem[]; 7 | 8 | constructor(total: number, questions: IProblem[]) { 9 | this.total = total; 10 | this.questions = questions; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/problem.ts: -------------------------------------------------------------------------------- 1 | import { IProblem } from './models/IProblem'; 2 | import { Constants } from './constants'; 3 | import { IDifficulty } from './models/IDifficulty'; 4 | import { ITopicTag } from './models/ITopicTag'; 5 | 6 | export class Problem implements IProblem { 7 | questionId: string; 8 | questionFrontendId: string; 9 | title: string; 10 | titleSlug: string; 11 | content: string; 12 | isPaidOnly: boolean; 13 | likes: number; 14 | dislikes: number; 15 | isLiked: null; 16 | similarQuestions: string; 17 | exampleTestcases: string; 18 | companyTagStats: string; 19 | stats: string; 20 | hints: string[]; 21 | sampleTestCase: string; 22 | acRate: number; 23 | difficulty: IDifficulty; 24 | freqBar: number; 25 | isFavor: boolean; 26 | status: string; 27 | topicTags: ITopicTag[]; 28 | hasSolution: boolean; 29 | hasVideoSolution: boolean; 30 | url: string; 31 | 32 | similarProblems: Problem[] = []; 33 | 34 | constructor(question: IProblem) { 35 | const { 36 | questionId, 37 | questionFrontendId, 38 | title, 39 | titleSlug, 40 | content, 41 | isPaidOnly, 42 | likes, 43 | dislikes, 44 | isLiked, 45 | similarQuestions, 46 | exampleTestcases, 47 | companyTagStats, 48 | stats, 49 | hints, 50 | sampleTestCase, 51 | acRate, 52 | difficulty, 53 | freqBar, 54 | isFavor, 55 | status, 56 | topicTags, 57 | hasSolution, 58 | hasVideoSolution, 59 | } = question; 60 | 61 | this.questionId = questionId; 62 | this.questionFrontendId = questionFrontendId; 63 | this.title = title; 64 | this.titleSlug = titleSlug; 65 | this.content = content; 66 | this.isPaidOnly = isPaidOnly; 67 | this.likes = likes; 68 | this.dislikes = dislikes; 69 | this.isLiked = isLiked; 70 | this.similarQuestions = similarQuestions; 71 | this.exampleTestcases = exampleTestcases; 72 | this.companyTagStats = companyTagStats; 73 | this.stats = stats; 74 | this.hints = hints; 75 | this.sampleTestCase = sampleTestCase; 76 | this.acRate = acRate; 77 | this.difficulty = difficulty; 78 | this.freqBar = freqBar; 79 | this.isFavor = isFavor; 80 | this.status = status; 81 | this.topicTags = topicTags; 82 | this.hasSolution = hasSolution; 83 | this.hasVideoSolution = hasVideoSolution; 84 | this.url = `${Constants.ENDPOINT}/problems/${titleSlug}`; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/submission-list.ts: -------------------------------------------------------------------------------- 1 | import { Constants } from './constants'; 2 | import { ISubmission } from './models/ISubmission'; 3 | import { ISubmissionList } from './models/ISubmissionList'; 4 | 5 | export class SubmissionList implements ISubmissionList { 6 | lastKey: any; 7 | hasNext: boolean; 8 | submissions: ISubmission[]; 9 | 10 | constructor(lastKey: any, hasNext: boolean, submissions: ISubmission[]) { 11 | this.lastKey = lastKey; 12 | this.hasNext = hasNext; 13 | this.submissions = submissions; 14 | if (submissions) { 15 | this.submissions.forEach((submission) => { 16 | submission.absoluteUrl = `${Constants.ENDPOINT}${submission.url}`; 17 | }); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/tag-info.ts: -------------------------------------------------------------------------------- 1 | import { IByTag, TopicTagQuestion } from './models/IByTag'; 2 | 3 | export class TagInfo implements IByTag { 4 | name: string; 5 | slug: string; 6 | questions: TopicTagQuestion[]; 7 | frequencies: string; 8 | 9 | constructor(name: string, slug: string, questions: TopicTagQuestion[], frequencies: string) { 10 | this.name = name; 11 | this.slug = slug; 12 | this.questions = questions; 13 | this.frequencies = frequencies; 14 | 15 | this.initFrequency(frequencies, questions); 16 | } 17 | 18 | private initFrequency(frequencies: string, questions: TopicTagQuestion[]) { 19 | try { 20 | const freqs = JSON.parse(frequencies); 21 | for (let questionId in freqs) { 22 | if (questions) { 23 | questions.forEach((question) => { 24 | if (question.questionId === questionId) { 25 | question.frequency = freqs[questionId]; 26 | } 27 | }); 28 | } 29 | } 30 | } catch (e) { 31 | console.error(e); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/typings/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'node-fetch'; 2 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ 22 | // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | 26 | /* Modules */ 27 | "module": "commonjs" /* Specify what module code is generated. */, 28 | "rootDir": "./src" /* Specify the root folder within your source files. */, 29 | // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ 30 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 31 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 32 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 33 | // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ 34 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 35 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 36 | // "resolveJsonModule": true, /* Enable importing .json files */ 37 | // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ 38 | 39 | /* JavaScript Support */ 40 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ 41 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 42 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ 43 | 44 | /* Emit */ 45 | "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, 46 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 47 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 48 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 49 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ 50 | "outDir": "./lib" /* Specify an output folder for all emitted files. */, 51 | // "removeComments": true, /* Disable emitting comments. */ 52 | // "noEmit": true, /* Disable emitting files from a compilation. */ 53 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 54 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ 55 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 56 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 57 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 58 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 59 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 60 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 61 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 62 | // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ 63 | // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ 64 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 65 | // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ 66 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 67 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 68 | 69 | /* Interop Constraints */ 70 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 71 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 72 | "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */, 73 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 74 | "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, 75 | 76 | /* Type Checking */ 77 | "strict": true /* Enable all strict type-checking options. */, 78 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ 79 | // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ 80 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 81 | // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ 82 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 83 | // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ 84 | // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ 85 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 86 | // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ 87 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ 88 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 89 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 90 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 91 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 92 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 93 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ 94 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 95 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 96 | 97 | /* Completeness */ 98 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 99 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 100 | }, 101 | "include": ["src/**/*"] 102 | } 103 | -------------------------------------------------------------------------------- /typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPointStrategy": "expand", 3 | "entryPoints": ["./src"], 4 | "hideGenerator": true, 5 | "name": "Leetcode-API", 6 | "cleanOutputDir": true 7 | } 8 | --------------------------------------------------------------------------------