{"_id":"42-api.js","_rev":"2-5cda15ac075e282da336037036f5f0cf","name":"42-api.js","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"42-api.js","version":"1.0.0","description":"An small npm module to fetch the 42 api","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["42","js","javascript"],"author":{"name":"X3ne"},"repository":{"type":"git","url":"git+https://github.com/X3ne/42.js.git"},"license":"MIT","dependencies":{"node-persist":"^3.1.0","superagent":"^7.0.1"},"devDependencies":{"dotenv":"^11.0.0"},"engines":{"node":">=6.4.0 <13 || >=14"},"gitHead":"be118f30416594c2fde7e789a23728c23da0de9b","bugs":{"url":"https://github.com/X3ne/42.js/issues"},"homepage":"https://github.com/X3ne/42.js#readme","_id":"42-api.js@1.0.0","_nodeVersion":"16.11.1","_npmVersion":"8.0.0","dist":{"integrity":"sha512-v1CViXEOMGqXePRzEkkkgkvDutMc0TcRkT6oz2NdHSIPFaIGNA9zkzzajygkzlCcxvQzKPi73vJJWDD2PCEv/g==","shasum":"18fe96bd19113317430cdd416be27642f60b9fb4","tarball":"https://registry.npmjs.org/42-api.js/-/42-api.js-1.0.0.tgz","fileCount":9,"unpackedSize":16264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4buTCRA9TVsSAnZWagAA8ToP/jYfA9Gm24wjUj0Kk+m7\njUimhz+p++J4OY5vUhtvXg2L/euGac1qeBtlygX7cBU00d8zzKm/QC4wdfe1\nLjxS4colIyttc42z9NF1IHjoGDWyJyoEK0KwnxanASAnKjBVlxuazY/Q1jsG\nFDLGP9ok+kLLpapyTNvRaUGaYXB+mdzxoKQMM/GBukh9WDoFPtbp4tShGB6i\n9K5ky5yZsno9sm56XbepiekfDtualMyTntdc96h4BB7ODCbLIO+3SgEhCfFc\nKWWqa2tUZqV+IstptLdNhOuQD2GCsjQz4klDwk+xalfSBxVh7L1vxdk9EV7P\nDTf8k+q04Y91CtwUGL5d7R4ASx7eDNcwVYh7BR0FEro5az3SPG9ux0d+6tHG\nVtiGb5pVeelqtac/tEsyLLLb70HVWNuENR/jLYPo2xjJlOXXITEP0slS7gcZ\ntSzp4/KtYorSCl+jrTNrpCBYOFiwgkf7r4rNeDZg5Zjljh8N645eVuPFP7bT\nyKUlUdpfGoU0K0YA4yWPgBKqHW+PyH0VpRq2oVjdN9X8LG6CE0vg3JEcZtD0\n3ag6S1jwCDjb0aZSuNHcnxbj0wS5o0ylArj+rhU2swhe8bgpdpMY57yd3Jiv\nhvJ17sPVQV3iwU4y5bX4xA/J8xSgB3qbncmYpdD1OTehAkIw/0yL77UHN2Rn\nj4Y7\r\n=BuRN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEcUHzmhVqmH/6Ld5S5/8DI7y73V/fF3jPvO2X94CCjwAiAFjF9liiQmN9Ote4C3cLDCFC1w1Wu6Htkn588NGwCezQ=="}]},"_npmUser":{"name":"narcisserael","email":"X3neYTB@gmail.com"},"directories":{},"maintainers":[{"name":"narcisserael","email":"X3neYTB@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/42-api.js_1.0.0_1642183571240_0.5676467106217664"},"_hasShrinkwrap":false},"1.0.1":{"name":"42-api.js","version":"1.0.1","description":"An small npm module to fetch the 42 api","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["42","js","fetch-api","42born2code","42school"],"author":{"name":"X3ne"},"repository":{"type":"git","url":"git+https://github.com/X3ne/42.js.git"},"license":"MIT","dependencies":{"superagent":"7.0.2"},"devDependencies":{"dotenv":"^11.0.0"},"engines":{"node":">=6.4.0 <13 || >=14"},"gitHead":"ff59ed5d8898a7f604bc246cd375120c3d064158","bugs":{"url":"https://github.com/X3ne/42.js/issues"},"homepage":"https://github.com/X3ne/42.js#readme","_id":"42-api.js@1.0.1","_nodeVersion":"16.11.1","_npmVersion":"8.0.0","dist":{"integrity":"sha512-tp6d7XkbvVAVQFzZZuGTaYB4jjEWFaOw3RbkZm+axXuE4RKYulUI6G6TbkF3qoeC+unlweNHyRSwSteNMzUD7Q==","shasum":"b7ed68eae620a94a54dd2dcef8102255f5299f79","tarball":"https://registry.npmjs.org/42-api.js/-/42-api.js-1.0.1.tgz","fileCount":8,"unpackedSize":16185,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6IBlCRA9TVsSAnZWagAABwQP/0hV0gohlPFo80UO6NBh\nGT6u+JsG+KEQR/C24s2T8voP4HDm4bj0KT51MW/k7ioOSEZxGO9c/6nMIyRy\nvcyKDZt+ULFYcVxFun4DfkD5gCShv4hrWTsu7pK3PVzFaEcsJQTBLA6IJGZC\nUKXpEJpRnPLylVbIJF7t+I8jLV3qJaHPp+tNvop6XgENnsDNFtUxLzFD1g62\nyHWLn+vtMhnpdbAr+OwwW5ecEh/j74PHVOmxXWIUCvgSPhkOVkSm4ky9HfGI\nyFOMFqicekcwACdea5lIQd4EnyG5myzCC6QhPdB+g2fFxsSskPICrX+pV9fF\nfLY92LVWIuMRURijkiJEh18Y7eRbHfJxmdZxn2i116ETq8ZDDDA8A3m4kdEp\nEgRwshosOPc7megS5w44W5raIHFFP0CJohtD9SQTEbmB79t+pyYgOIC1cPpw\njcd+xtAnOuC5ftOVy56RSoqt3uLuYYarcWbsvqavMN/MzEfrZmu8LR9P/2gD\nCLu9/s8nMm7NWnqQcd/JQrmCz5feDsILLQxtEteIumCPDubxrofwwjH7G6hU\nSJysnuDO6nz9oBuYFjDbbmn2iHhHiN+ec0wK58UWQjBuPrdScm70VeB52TOx\nDydmmTBp6oD/eu0gLo1Rtze8HWVo9FX57vxdKd1qDk6bXBhEonEnViKmH1GW\n7KYa\r\n=BiDN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID2w0HcbAJvhO/hkPB6XsD5c8+DdtCvVqB2BWfvg5lSSAiAMfw1Wmu70HmwXqYEUQlajpIOypyH3gvmzUDNrrHnsZA=="}]},"_npmUser":{"name":"narcisserael","email":"X3neYTB@gmail.com"},"directories":{},"maintainers":[{"name":"narcisserael","email":"X3neYTB@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/42-api.js_1.0.1_1642627172854_0.4773559184219187"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-14T18:06:11.240Z","1.0.0":"2022-01-14T18:06:11.496Z","modified":"2022-04-04T10:22:12.921Z","1.0.1":"2022-01-19T21:19:33.064Z"},"maintainers":[{"name":"narcisserael","email":"X3neYTB@gmail.com"}],"description":"An small npm module to fetch the 42 api","homepage":"https://github.com/X3ne/42.js#readme","keywords":["42","js","fetch-api","42born2code","42school"],"repository":{"type":"git","url":"git+https://github.com/X3ne/42.js.git"},"author":{"name":"X3ne"},"bugs":{"url":"https://github.com/X3ne/42.js/issues"},"license":"MIT","readme":"# 42.js\r\n\r\n[![made-with-javascript](https://img.shields.io/badge/Made%20with-JavaScript-1f425f.svg)](https://www.javascript.com)\r\n\r\n## 🚧Work in progress🚧\r\n\r\n> An small npm module to fetch the 42 api\r\n\r\n\r\n## Table of Contents\r\n\r\n<!-- * [Doc](#doc) -->\r\n* [Install](#install)\r\n* [Usage](#usage)\r\n* [License](#license)\r\n\r\n## Install\r\n```sh\r\nnpm install 42-api.js\r\n```\r\n```sh\r\npnpm install 42-api.js\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\nconst Api42 = require('42-api.js');\r\n\r\nconst client = new Api42({ clientId: client_id, clientSecret: client_secret });\r\n\r\nasync function GetData() {\r\n    const token = await client.GetToken();\r\n    console.log(token);\r\n\r\n    const newToken = await client.GenerateToken();\r\n    console.log(newToken);\r\n\r\n    const validity = await client.RefreshToken();\r\n    console.log(validity);\r\n\r\n    const users = await client.GetUsers({\"filter[login]\": 'login'});\r\n    console.log(users);\r\n\r\n    const userCursus = await client.GetUserCursus('login');\r\n    console.log(userCursus);\r\n\r\n    const userLog = await client.GetUserLocationStats('login')\r\n    console.log(userLog);\r\n\r\n    const coalitions = await client.GetCoalitions();\r\n    console.log(coalitions);\r\n}\r\nGetData();\r\n```\r\n### Or\r\n```js\r\nconst Api42 = require('42-api.js');\r\n\r\nconst client = new Api42({ clientId: client_id, clientSecret: client_secret });\r\n\r\nclient.GetToken().then((data) => {\r\n    console.log(data);\r\n});\r\n\r\nclient.GenerateToken().then((data) => {\r\n    console.log(data);\r\n});\r\n\r\nclient.RefreshToken().then((data) => {\r\n    console.log(data);\r\n});\r\n\r\nclient.GetUsers({\"filter[login]\": 'login'}).then((data) => {\r\n    console.log(data);\r\n});\r\n\r\nclient.GetUserCursus('login').then((data) => {\r\n    console.log(data);\r\n});\r\n\r\nclient.GetUserLocationStats('login').then((data) => {\r\n    console.log(data);\r\n});\r\n\r\nclient.GetCoalitions().then((data) => {\r\n    console.log(data);\r\n});\r\n```\r\n\r\n## License\r\n\r\n[MIT](LICENSE) © X3ne\r\n","readmeFilename":"README.md"}