{"_id":"@amankapur007/trakt.tv","_rev":"2-14aa19167a189d5e79d87eb96724c343","name":"@amankapur007/trakt.tv","dist-tags":{"latest":"1.0.0"},"versions":{"7.2.0":{"_from":"trakt.tv","_inBundle":false,"_integrity":"sha512-ALuLfpkjrxwQFnZ4X6aRSsMn91gDMXZHCzO+ogOZ2iUmTkDxXTNeyUZyLzpx3EW8dzHU427sI8xFZyARJDpEkw==","_location":"/trakt.tv","_phantomChildren":{"@sindresorhus/is":"0.14.0","@szmarczak/http-timer":"1.1.2","cacheable-request":"6.1.0","decompress-response":"3.3.0","duplexer3":"0.1.4","lowercase-keys":"1.0.1","mimic-response":"1.0.1","p-cancelable":"1.1.0","pump":"3.0.0","to-readable-stream":"1.0.0"},"_requested":{"type":"tag","registry":true,"raw":"trakt.tv","name":"trakt.tv","escapedName":"trakt.tv","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/trakt.tv/-/trakt.tv-7.2.0.tgz","_shasum":"69a85aa5bfb7f26075f8608c1c6aed52e38c302b","_spec":"trakt.tv","_where":"C:\\Users\\Aman\\imdb","author":{"name":"Jean van Kasteel"},"bugs":{"url":"https://github.com/vankasteelj/trakt.tv/issues"},"bundleDependencies":false,"dependencies":{"got":"^9.6.0","sanitizer":"^0.1.3"},"deprecated":false,"description":"Interact with Trakt.tv API in NodeJS","homepage":"https://github.com/vankasteelj/trakt.tv#readme","keywords":["trakt","api","wrapper","node"],"license":"MIT","main":"trakt.js","name":"@amankapur007/trakt.tv","repository":{"type":"git","url":"git+https://github.com/vankasteelj/trakt.tv.git"},"scripts":{"docs":"node docs/methods-generator"},"version":"7.2.0","directories":{"doc":"docs"},"_id":"@amankapur007/trakt.tv@7.2.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-dErdAMyUYXOGgQdehMkRLQh3Px8VAAeaPbDBf61X49gWtESme0GdWKA+GHGCjs/ngv8KF7kWVfNCt+e/P2Vsmg==","shasum":"18c2e0ddc3d7d4290554d0447286562596d2666d","tarball":"https://registry.npmjs.org/@amankapur007/trakt.tv/-/trakt.tv-7.2.0.tgz","fileCount":8,"unpackedSize":84425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDzqgCRA9TVsSAnZWagAAJQ4P/jUMg9vDqEpvK96kblgq\n/aUyXSkwn8y4Z9eX2JDNQ3SxZkqCPQmQn8jxBUOxmUP/MMBU/+S0xyuzzXC6\nhHYMOCgtBH8IlbGL+G6ifpJCE+blKKOuEIsZqbrvT/FIDkxGE1b4bNhLq9NL\nw/FCjlak13CFDicb2HWR1TiTvfcrh5jVAvNK9YpkclPA/7XZJYzAB5orVCif\n7PJCG5f4kpwHcOASdLKzMi07sEWWMNoMpi5Bj/aIAVmM7baO89q6oj6oAEUW\nppF087in7dtZpT7XK3NeAxDUK3CsLfvCRY+8BhcyX0dhOxdkgl3j8ToPEoHr\n2Uo/WYU8YI4f7ZWHc11+UxXQrW6UPHVF7Tb946XRCDuKlST0nkpXLb3Rhs+0\ntP144T5NoTZXLwRwkny37ByBfe4tJVMxZosbTWPvGn+M/x2FSAQWxHlppYug\nGNUaJnxAT7HNnQE2knHQGfeBZimF1kmUAg/74ZFtIJF3Gnfu8xakyeXepk5z\nQpU2neqLDiia6zcIoypCc/OErrU7ThdkSLlioxmEMEZIQmX9/YOxv0Dsinv8\n9/LWZwezYWZDxkVuAgJU2gB/MJyBlE1XvbEyWc1/OXKLVYuT/iJszDaU4O0M\nmr/ABochAGdKsuCWqZ8u+ZsfHLzTTfIl9su7uRU8KFc1h2+VOJz/rFXS/Z2g\nzT83\r\n=xdQc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH27d66m3rzb34/siAIFoqJHQXiBPGotKjDPscCogW9SAiEA4eZ6RlwxyVFDizCdy5LYUDH+e08Z1EobDdF6sK8J9f0="}]},"maintainers":[{"name":"amankapur007","email":"akapur07@gmail.com"}],"_npmUser":{"name":"amankapur007","email":"akapur07@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trakt.tv_7.2.0_1578056352258_0.44161073907885773"},"_hasShrinkwrap":false},"1.0.0":{"name":"@amankapur007/trakt.tv","version":"1.0.0","description":"**Trakt.tv API wrapper for Node.js, featuring:**","main":"trakt.js","directories":{"doc":"docs"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/amankapur007/trakt-tv-v2.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/amankapur007/trakt-tv-v2/issues"},"homepage":"https://github.com/amankapur007/trakt-tv-v2#readme","dependencies":{"got":"^9.6.0","sanitizer":"^0.1.3"},"_id":"@amankapur007/trakt.tv@1.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-JBskrE1L4klLz4CL/1rj/1jxTsc8FPloUXBM9othKAy+lNyOymq1kKcCeMWnKSmX6hBlXaWUOB0oAdmRCjyT0g==","shasum":"e7b25cc5900252b88f0b739ab02956227be4321f","tarball":"https://registry.npmjs.org/@amankapur007/trakt.tv/-/trakt.tv-1.0.0.tgz","fileCount":8,"unpackedSize":83347,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDzyOCRA9TVsSAnZWagAAgLQP/0glbNpLHGxJ9g58t1LL\ng1PwwIng8vLbRqzSNA+xh4yZPSDez0MtuYcQ46Sf8Pn6rZcIsRqekgdZ86YD\n5uZnsYHhzVaetA47F0i3PU3boDEEgYelQFoVtAropm//iHE3a7C4S6Erp3pm\nw8RkZ8Gqb4W2V2PxWg6Sxom75HY4Z0Ay+tQcSNu1EMFbZlwBq7Dbl4OwBSIP\nIropCcaUILgcZdLt2HneDIaFv+4YkElSjIGp6yQoGa/Qkm9DDOnBB5ykjKap\nQZbLjrg44IPINlU5dxDs3iAuRloTPQpTHiaIaH5D9Iyuu1dD/53ot69RcCVB\nyWvi9ZFGqkIlrXxHAhqW0SiYENSnfak/qqcsgXbwKpYZCm/QgJaMgDEX15WF\nRA8FRV54GnDpJCDvJxC/CpoU8on8V0pV236VNBO8sGeINcRyxLSjgTJYB3Mu\njY2Up9N+VHWCFIVGQi3lE28ykW8pl6sBN/Mqhj+jKA8E9gBu+xMiarb84293\np8TaStImCHfXODwTT5PE9V3q2FYPWpvH1HUFbIr/bfCbaZe8QuZ/iALnVwi3\n+WfkiL+zI/Zqwae68HcEoQujIMXzZsi0a4GLP1RhubeX2sg0+5rMftzumGa7\nblh+tLi456Sb59WXOJAOcAotDuvpZmRRiZv0e+qkpWElvAZUMVcST4tckZiJ\nAWJC\r\n=VXHK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAIyoka2ig84idjDYBLDw6u6gh7T14TKcm32YjiBthhdAiEAjXymQtGmz3d+64m/BaSIL6pAzZrlw6AesS0XzbjV4Ps="}]},"maintainers":[{"name":"amankapur007","email":"akapur07@gmail.com"}],"_npmUser":{"name":"amankapur007","email":"akapur07@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trakt.tv_1.0.0_1578056845601_0.10897692532406711"},"_hasShrinkwrap":false}},"time":{"created":"2020-01-03T12:59:12.230Z","7.2.0":"2020-01-03T12:59:12.359Z","modified":"2022-04-04T13:43:28.426Z","1.0.0":"2020-01-03T13:07:25.752Z"},"maintainers":[{"name":"amankapur007","email":"akapur07@gmail.com"}],"description":"**Trakt.tv API wrapper for Node.js, featuring:**","homepage":"https://github.com/amankapur007/trakt-tv-v2#readme","repository":{"type":"git","url":"git+https://github.com/amankapur007/trakt-tv-v2.git"},"bugs":{"url":"https://github.com/amankapur007/trakt-tv-v2/issues"},"license":"ISC","readme":"# trakt.tv\r\n**Trakt.tv API wrapper for Node.js, featuring:**\r\n\r\n- [All Trakt.tv API v2 methods](docs/available_methods.md)\r\n- Promises\r\n- Forget JSON: use Objects, Arrays and Strings directly\r\n- Enhanced protection against: CSRF (session riding) and XSS (content spoofing) attacks, using Crypto and Sanitizer\r\n- [Plugin extension](docs/plugins.md)\r\n\r\n*For more information about the trakt.tv API, read http://docs.trakt.apiary.io/*\r\n\r\n## Example usage\r\n\r\n#### Setup\r\n\r\n    npm install trakt.tv\r\n\r\n#### Initialize\r\n```js\r\nconst Trakt = require('trakt.tv');\r\n\r\nlet options = {\r\n  client_id: <the_client_id>,\r\n  client_secret: <the_client_secret>,\r\n  redirect_uri: null,   // defaults to 'urn:ietf:wg:oauth:2.0:oob'\r\n  api_url: null,        // defaults to 'https://api.trakt.tv'\r\n  useragent: null,      // defaults to 'trakt.tv/<version>'\r\n  pagination: true      // defaults to false, global pagination (see below)\r\n};\r\nconst trakt = new Trakt(options);\r\n```\r\nAdd `debug: true` to the `options` object to get debug logs of the requests executed in your console.\r\n\r\n#### OAUTH\r\n\r\n1. Generate Auth URL\r\n```js\r\nconst traktAuthUrl = trakt.get_url();\r\n```\r\n\r\n2. Authentication is done at that URL, it redirects to the provided uri with a code and a state\r\n\r\n3. Verify code (and optionally state for better security) from returned auth, and get a token in exchange\r\n```js\r\ntrakt.exchange_code('code', 'csrf token (state)').then(result => {\r\n    // contains tokens & session information\r\n    // API can now be used with authorized requests\r\n});\r\n```\r\n\r\n#### Alternate OAUTH \"device\" method\r\n```js\r\ntrakt.get_codes().then(poll => {\r\n    // poll.verification_url: url to visit in a browser\r\n    // poll.user_code: the code the user needs to enter on trakt\r\n\r\n    // verify if app was authorized\r\n    return trakt.poll_access(poll);\r\n}).catch(error => {\r\n    // error.message == 'Expired' will be thrown if timeout is reached\r\n});\r\n```\r\n\r\n#### Refresh token\r\n```js\r\ntrakt.refresh_token().then(results => {\r\n    // results are auto-injected in the main module cache\r\n});\r\n```\r\n\r\n#### Storing token over sessions\r\n```js\r\n// get token, store it safely.\r\nconst token = trakt.export_token();\r\n\r\n// injects back stored token on new session.\r\ntrakt.import_token(token).then(newTokens => {\r\n    // Contains token, refreshed if needed (store it back)\r\n});\r\n```\r\n\r\n#### Revoke token\r\n```js\r\ntrakt.revoke_token();\r\n```\r\n\r\n#### Actual API requests\r\nSee methods in [methods.json](methods.json) or [the docs](docs/available_methods.md).\r\n\r\n```js\r\ntrakt.calendars.all.shows({\r\n    start_date: '2015-11-13',\r\n    days: '7',\r\n    extended: 'full'\r\n}).then(shows => {\r\n    // Contains Object{} response from API (show data)\r\n});\r\n```\r\n\r\n```js\r\ntrakt.search.text({\r\n    query: 'tron',\r\n    type: 'movie,person'\r\n}).then(response => {\r\n    // Contains Array[] response from API (search data)\r\n});\r\n```\r\n\r\n```js\r\ntrakt.search.id({\r\n    id_type: 'imdb',\r\n    id: 'tt0084827'\r\n}).then(response => {\r\n    // Contains Array[] response from API (imdb data)\r\n});\r\n```\r\n\r\n#### Using pagination\r\nYou can extend your calls with `pagination: true` to get the extra pagination info from headers.\r\n\r\n```js\r\ntrakt.movies.popular({\r\n    pagination: true\r\n}).then(movies => {\r\n    /**\r\n    movies = Object {\r\n        data: [<actual data from API>],\r\n        pagination: {\r\n            item-count: \"80349\",\r\n            limit: \"10\",\r\n            page: \"1\",\r\n            page-count: \"8035\"\r\n        }\r\n    }\r\n    **/\r\n});\r\n```\r\n\r\nNote: _this will contain `data` and `pagination` for all calls, even if no pagination is available (`result.pagination` will be `false`). it's typically for advanced use only_\r\n\r\n#### Load plugins\r\nWhen calling `new Trakt()`, include desired plugins in an object (must be installed from npm):\r\n\r\n```js\r\nconst trakt = new Trakt({\r\n    client_id: <the_client_id>,\r\n    client_secret: <the_client_secret>,\r\n    plugins: {  // load plugins\r\n        images: require('trakt.tv-images')\r\n    }\r\n    options: {  // pass options to plugins\r\n        images: {\r\n            smallerImages: true\r\n        }\r\n    }\r\n});\r\n```\r\n\r\nThe plugin can be accessed with the key you specify. For example `trakt.images.get()`.\r\n\r\n#### Write plugins\r\nSee the [documentation](docs/writing_plugins.md).\r\n\r\n#### Notes\r\n- You can use 'me' as username if the user is authenticated.\r\n- Timestamps (such as token _expires_ property) are Epoch in milliseconds.\r\n\r\n## LICENSE\r\n\r\nThe MIT License (MIT) - author: Jean van Kasteel <vankasteelj@gmail.com>\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in\r\nall copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\nTHE SOFTWARE.\r\n","readmeFilename":"README.md"}