{"_id":"@ahmadyusri/adonis-request-throttler","_rev":"8-944568a619bc00a9d287af00d9d72717","time":{"created":"2022-10-06T21:54:56.841Z","2.0.4":"2022-10-06T21:39:38.974Z","modified":"2023-02-28T20:22:58.337Z","2.0.5":"2022-10-06T21:46:10.261Z","2.0.6":"2022-10-06T21:54:57.043Z","2.0.7":"2023-02-28T20:08:51.580Z","2.0.8":"2023-02-28T20:22:58.246Z"},"name":"@ahmadyusri/adonis-request-throttler","dist-tags":{"latest":"2.0.8"},"versions":{"2.0.6":{"name":"@ahmadyusri/adonis-request-throttler","version":"2.0.6","description":"Request throttler provider for AdonisJS 5","scripts":{"mrm":"mrm --preset=@adonisjs/mrm-preset","dev":"tsc --watch","clean":"del build","compile":"npm run lint && npm run clean && tsc && npm run copy:files","copy:files":"cpx 'templates/**' 'build/templates'","build":"npm run compile","test":"jest test --runInBand --testTimeout 30000","prepublishOnly":"npm run build","lint":"eslint . --ext=.ts --fix","format":"prettier --write .","commit":"git-cz","release":"np","version":"npm run build","prepare":"npm run build","run-prettier":"prettier --write .","sync-labels":"github-label-sync --labels ./node_modules/@adonisjs/mrm-preset/gh-labels.json reg2005/adonis5-cache"},"repository":{"type":"git","url":"git+https://github.com/ahmadyusri/adonis-request-throttler.git"},"keywords":["Adonis","5","@ahmadyusri/adonis-request-throttler"],"author":{"name":"Vladyslav Parashchenko"},"contributors":[{"name":"Vladyslav Parashchenko","email":"vladyslavparashchenko37@gmail.com"},{"name":"Ryumin Evgeniy","email":"cmp08@ya.ru"}],"license":"MIT","bugs":{"url":"https://github.com/ahmadyusri/adonis-request-throttler.git/issues"},"homepage":"https://github.com/ahmadyusri/adonis-request-throttler.git#readme","types":"build/adonis-typings/index.d.ts","typings":"build/adonis-typings/index.d.ts","devDependencies":{"@adonisjs/ioc-transformer":"^2.2.1","@adonisjs/mrm-preset":"^2.4.0","@types/jest":"^26.0.23","@types/ms":"^0.7.31","@types/node":"^14.17.1","@types/ramda":"^0.27.19","adonis-provider-tester":"git+https://github.com/VladyslavParashchenko/adonis-provider-tester.git#main","commitizen":"^4.1.2","cpx":"^1.5.0","cz-conventional-changelog":"^3.2.0","debug":"^4.1.1","del-cli":"^3.0.1","doctoc":"^1.4.0","eslint":"^7.27.0","eslint-config-prettier":"^8.3.0","eslint-plugin-adonis":"^1.3.1","eslint-plugin-prettier":"^3.4.0","get-port":"^5.1.1","github-label-sync":"^2.0.0","husky":"^4.2.5","jest":"^27.0.1","mrm":"^2.6.2","np":"^6.3.2","npm-audit-html":"^1.4.1","pino-pretty":"^4.1.0","prettier":"^2.0.5","reflect-metadata":"^0.1.13","source-map-support":"^0.5.19","supertest":"^5.0.0","ts-jest":"^27.0.1","ts-mockito":"^2.6.1","ts-node":"^10.0.0","typescript":"^4.3.2"},"husky":{"hooks":{"pre-commit":"npm audit --production --json | ./node_modules/.bin/npm-audit-html && git add npm-audit.html && doctoc README.md --title='## Table of contents' && git add README.md","commit-msg":"node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js"}},"nyc":{"exclude":["test"],"extension":[".ts"]},"main":"build/index.js","adonisjs":{"types":"@ahmadyusri/adonis-request-throttler","providers":["@ahmadyusri/adonis-request-throttler"],"templates":{"config":[{"src":"config.txt","dest":"request-throttler"}]}},"config":{"commitizen":{"path":"cz-conventional-changelog"}},"np":{"contents":".","anyBranch":false},"dependencies":{"@adonisjs/events":"^7.0.1","@adonisjs/redis":"^7.0.4","adonis5-cache":"^1.3.1","dayjs":"^1.10.5","ms":"^2.1.3"},"gitHead":"5725e518bd0b7a1f6ac649fc4c19b1936abdbff6","_id":"@ahmadyusri/adonis-request-throttler@2.0.6","_nodeVersion":"18.9.1","_npmVersion":"8.19.1","dist":{"integrity":"sha512-bmrC6EN1OBXPZGU/46A6R8oZyTsFkQ1d/ivIwog1vPr64TUBYdf/O2uPNVCpK17gadKYNGRUSNKyNCwhPv3WKg==","shasum":"5813eeb6c55c902d10a6b811323cf9e0c07cd7fc","tarball":"https://registry.npmjs.org/@ahmadyusri/adonis-request-throttler/-/adonis-request-throttler-2.0.6.tgz","fileCount":20,"unpackedSize":28131,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfhYlamxbhFGhImHf0G/Og+sPQnFROOJSo3/JGpLG0qAiB8cQbYwmpfWzCJg/2spJUgoi35tDN5oBFyDcZDbpLn4Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjP06xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpfrQ/9FwzkyHQkAIQzxfxQCNwDy+j+Jk+/wRUNlTKA20DWBfAZok7S\r\nBpufZ7f6E4/rQmAeWQZcEP3G1l8zseLz1t6wH65ZAYvwfiRxqkBJ9JUMmQzZ\r\nMvE/5uNbjDcVEZg4aH0iVTaH+rOUTe+RHPOrsH+kawYKIdjPgCIVjopX/fkB\r\njdjyuAW/xdTFVrR4HSykqSNfrJqJgLtADjlhBG8fD82lil7nCFzNlbY6J87f\r\nTsEY1kZroy5k2QKL3P3VNRJnmb6Hzs2DrXlVrXhuBr/OZomyGCyDZBEwNzvI\r\nBSLZfFsT8RGL4MZqrqn0xFtsEDCBkC1g2XfWuCmGI0/k8JftCkjhaFcA0y1S\r\nmXOFBu9jZkieG57dG6QB322XaENXZ44XpT+Coevm8vUd902jaQRJknRn6ZKa\r\nrvA0QWy42cKaERz88W0Cc570/5PRroD2WZ++li3lR8yGWwSGd2aIX5LA+N6A\r\ncu5T/P+cjC6YUkGZ8HNOvwSctNfizorc/uKFdiJFGD5xpSTIcw21HPm/o3qb\r\nkeW2MY/y3eBlg+zwq+3tJThQA9INdbTmFc1mhgqr9tzyyhUlkIT2xiQ/Pq1f\r\nv4DuXo5FAX618Lx0ZJ/eRbI4JrJkr3Uf949E6z/Pvf+3bEBF1v0wztPXigFe\r\n0zb8WcFh9q3QZX28YNcZVcUT+zEYZtE2tHw=\r\n=QiUv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ahmadyusri","email":"yusriahmad2@gmail.com"},"directories":{},"maintainers":[{"name":"ahmadyusri","email":"yusriahmad2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/adonis-request-throttler_2.0.6_1665093296888_0.5917143235221725"},"_hasShrinkwrap":false},"2.0.7":{"name":"@ahmadyusri/adonis-request-throttler","version":"2.0.7","description":"Request throttler provider for AdonisJS 5","scripts":{"mrm":"mrm --preset=@adonisjs/mrm-preset","dev":"tsc --watch","clean":"del build","compile":"npm run lint && npm run clean && tsc && npm run copy:files","copy:files":"cpx 'templates/**' 'build/templates'","build":"npm run compile","test":"jest test --runInBand --testTimeout 30000","prepublishOnly":"npm run build","lint":"eslint . --ext=.ts --fix","format":"prettier --write .","commit":"git-cz","release":"np","version":"npm run build","prepare":"npm run build","run-prettier":"prettier --write .","sync-labels":"github-label-sync --labels ./node_modules/@adonisjs/mrm-preset/gh-labels.json ahmadyusri/adonis-request-throttler"},"repository":{"type":"git","url":"git+https://github.com/ahmadyusri/adonis-request-throttler.git"},"keywords":["Adonis","5","@ahmadyusri/adonis-request-throttler"],"author":{"name":"Vladyslav Parashchenko"},"contributors":[{"name":"Vladyslav Parashchenko","email":"vladyslavparashchenko37@gmail.com"},{"name":"Ryumin Evgeniy","email":"cmp08@ya.ru"}],"license":"MIT","bugs":{"url":"https://github.com/ahmadyusri/adonis-request-throttler.git/issues"},"homepage":"https://github.com/ahmadyusri/adonis-request-throttler.git#readme","types":"build/adonis-typings/index.d.ts","typings":"build/adonis-typings/index.d.ts","devDependencies":{"@adonisjs/ioc-transformer":"^2.2.1","@adonisjs/mrm-preset":"^2.4.0","@types/jest":"^26.0.23","@types/ms":"^0.7.31","@types/node":"^14.17.1","@types/ramda":"^0.27.19","adonis-preset-ts":"^2.1.0","adonis-provider-tester":"^2.1.0","commitizen":"^4.1.2","cpx":"^1.5.0","cz-conventional-changelog":"^3.2.0","debug":"^4.1.1","del-cli":"^3.0.1","doctoc":"^1.4.0","esbuild":"^0.17.10","eslint":"^7.27.0","eslint-config-prettier":"^8.3.0","eslint-plugin-adonis":"^1.3.1","eslint-plugin-prettier":"^3.4.0","get-port":"^5.1.1","github-label-sync":"^2.0.0","husky":"^4.2.5","jest":"^27.0.1","mrm":"^2.6.2","np":"^6.3.2","npm-audit-html":"^1.4.1","pino-pretty":"^4.1.0","prettier":"^2.0.5","reflect-metadata":"^0.1.13","source-map-support":"^0.5.19","supertest":"^5.0.0","ts-jest":"^27.0.1","ts-mockito":"^2.6.1","ts-node":"^10.0.0","typescript":"^4.3.2"},"husky":{"hooks":{"pre-commit":"npm audit --production --json | ./node_modules/.bin/npm-audit-html && git add npm-audit.html && doctoc README.md --title='## Table of contents' && git add README.md","commit-msg":"node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js"}},"nyc":{"exclude":["test"],"extension":[".ts"]},"main":"build/index.js","adonisjs":{"types":"@ahmadyusri/adonis-request-throttler","providers":["@ahmadyusri/adonis-request-throttler"],"templates":{"config":[{"src":"config.txt","dest":"request-throttler"}]}},"config":{"commitizen":{"path":"cz-conventional-changelog"}},"np":{"contents":".","anyBranch":false},"dependencies":{"@adonisjs/events":"^7.0.1","@adonisjs/redis":"^7.0.4","adonis5-cache":"^1.3.1","dayjs":"^1.10.5","ms":"^2.1.3"},"gitHead":"b8c27d77726baa515fdf3bb1ffb6fd5ebee578eb","_id":"@ahmadyusri/adonis-request-throttler@2.0.7","_nodeVersion":"16.10.0","_npmVersion":"7.24.0","dist":{"integrity":"sha512-GIzR1V9X6+5miVx+Uk7KwjeZpYCZ7/6nWZadOs0A8mvRBpA7WLJclzi0qKGvsmiB9/xZORTGPb2yDiHb2xl2FA==","shasum":"7d93f01e5e00c5d2c092fec79be02175e0a069ee","tarball":"https://registry.npmjs.org/@ahmadyusri/adonis-request-throttler/-/adonis-request-throttler-2.0.7.tgz","fileCount":20,"unpackedSize":28547,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUNuUVfBSFH5a98yDWsxqmppwlzKoOTVu3Ocz0oLbHtAIhAIeXyapHbsIuBm6S0pzxA+Cu0dPFZlXao1xMq1BFv/55"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/l9TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQ8xAAh2E1GMCggusTHYDcppkP6DjgLZrpU4li7ueOzvt+joRoivAn\r\ngiGDAqAZfC6T2wFQKMYIw0mLmTaYQaoucH+YBchzYCdiT6GtfKH4S7l5npj+\r\nF8fmI3aJwNup571C4rfFsjVvVYIeOk8Vl1inacAI34OOwLu+7K6j2/myJuw5\r\ngYuma1xTOf/zGU/AfvDWoEZWx+E1VTtZT8jki6ZBEBt4UngF16DVMmrUiYZW\r\nJIbio1/v2dFTrRU0B8QX5762v6GLqwXq9YyFN+PefcAfONuYtqd5Ws71tY9S\r\nkyELTXpa/Qo3t9BAvK+xXdSnp8legC+mEi1UKmJoOgIpiueym7f8RLWzv7tk\r\n7VeLmOR+2z+YQv96IngjBjZabyZA3KZmCnvFETXLXFtNc9B/569rnR1W5J1b\r\n5wq6HNw9DX6a4TJFk1COyLQHHCVTSSLeQ4Z+rx57ms79s37XrUw5pk37hUvg\r\nEMQolgwR7IB8KuY0obxB3csebuGWpO8+4upcNqLrkrpnow68aNOdPM/rqMYo\r\nUJpJJevaoql9Fgu29PugbNGmkN8oK2HYFY7+8hKIyNg8/XNk7kXFAAGI+ayx\r\n0Xcuseb+twmsvW3xwSIEssidGSLoAPYXHR8rdlu9A0nFNJGC75HVzO3GtQcT\r\nHDa1und8p42rPovxvaUUo3PD6+Mu2Qp1Dbc=\r\n=ksQi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ahmadyusri","email":"yusriahmad2@gmail.com"},"directories":{},"maintainers":[{"name":"ahmadyusri","email":"yusriahmad2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/adonis-request-throttler_2.0.7_1677614931407_0.39268154753722606"},"_hasShrinkwrap":false},"2.0.8":{"name":"@ahmadyusri/adonis-request-throttler","version":"2.0.8","description":"Request throttler provider for AdonisJS 5","scripts":{"mrm":"mrm --preset=@adonisjs/mrm-preset","dev":"tsc --watch","clean":"del build","compile":"npm run lint && npm run clean && tsc && npm run copy:files","copy:files":"cpx 'templates/**' 'build/templates'","build":"npm run compile","test":"jest test --runInBand --testTimeout 30000","prepublishOnly":"npm run build","lint":"eslint . --ext=.ts --fix","format":"prettier --write .","commit":"git-cz","release":"np","version":"npm run build","prepare":"npm run build","run-prettier":"prettier --write .","sync-labels":"github-label-sync --labels ./node_modules/@adonisjs/mrm-preset/gh-labels.json ahmadyusri/adonis-request-throttler"},"repository":{"type":"git","url":"git+https://github.com/ahmadyusri/adonis-request-throttler.git"},"keywords":["Adonis","5","@ahmadyusri/adonis-request-throttler"],"author":{"name":"Vladyslav Parashchenko"},"contributors":[{"name":"Vladyslav Parashchenko","email":"vladyslavparashchenko37@gmail.com"},{"name":"Ryumin Evgeniy","email":"cmp08@ya.ru"}],"license":"MIT","bugs":{"url":"https://github.com/ahmadyusri/adonis-request-throttler.git/issues"},"homepage":"https://github.com/ahmadyusri/adonis-request-throttler.git#readme","types":"build/adonis-typings/index.d.ts","typings":"build/adonis-typings/index.d.ts","devDependencies":{"@adonisjs/ioc-transformer":"^2.2.1","@adonisjs/mrm-preset":"^2.4.0","@types/jest":"^26.0.23","@types/ms":"^0.7.31","@types/node":"^14.17.1","@types/ramda":"^0.27.19","adonis-preset-ts":"^2.1.0","adonis-provider-tester":"^2.1.0","commitizen":"^4.1.2","cpx":"^1.5.0","cz-conventional-changelog":"^3.2.0","debug":"^4.1.1","del-cli":"^3.0.1","doctoc":"^1.4.0","esbuild":"^0.17.10","eslint":"^7.27.0","eslint-config-prettier":"^8.3.0","eslint-plugin-adonis":"^1.3.1","eslint-plugin-prettier":"^3.4.0","get-port":"^5.1.1","github-label-sync":"^2.0.0","husky":"^4.2.5","jest":"^27.0.1","mrm":"^2.6.2","np":"^6.3.2","npm-audit-html":"^1.4.1","pino-pretty":"^4.1.0","prettier":"^2.0.5","reflect-metadata":"^0.1.13","source-map-support":"^0.5.19","supertest":"^5.0.0","ts-jest":"^27.0.1","ts-mockito":"^2.6.1","ts-node":"^10.0.0","typescript":"^4.3.2"},"husky":{"hooks":{"pre-commit":"npm audit --production --json | ./node_modules/.bin/npm-audit-html && git add npm-audit.html && doctoc README.md --title='## Table of contents' && git add README.md","commit-msg":"node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js"}},"nyc":{"exclude":["test"],"extension":[".ts"]},"main":"build/index.js","adonisjs":{"types":"@ahmadyusri/adonis-request-throttler","providers":["@ahmadyusri/adonis-request-throttler"],"templates":{"config":[{"src":"config.txt","dest":"request-throttler"}]}},"config":{"commitizen":{"path":"cz-conventional-changelog"}},"np":{"contents":".","anyBranch":false},"dependencies":{"@adonisjs/events":"^7.0.1","@adonisjs/redis":"^7.0.4","adonis5-cache":"^1.3.1","dayjs":"^1.10.5","ms":"^2.1.3"},"gitHead":"999e786dd12a6a80d6ce2055ed571174ba589c7f","_id":"@ahmadyusri/adonis-request-throttler@2.0.8","_nodeVersion":"16.10.0","_npmVersion":"7.24.0","dist":{"integrity":"sha512-pRQMqJnEmFH4QLKJ6CeXHOXjQYd36Qee/d65K/IdQrz4xUqt3EnT2poYb99tGlWzT/WaMnUtub3X3E2J7i7/Vg==","shasum":"3d2a18ea03e2045e87cf355c7c743d813d06f22e","tarball":"https://registry.npmjs.org/@ahmadyusri/adonis-request-throttler/-/adonis-request-throttler-2.0.8.tgz","fileCount":20,"unpackedSize":28548,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICbAE1sTPBpmynFpLI5fHQPvqnjIxYxa6anUJcjnuO5RAiBJgWY88tskOz+v97eJBtjT1vqj9usE8iBva9EIgqDkCQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/mKiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobVg/9HC2oLgKEpstOtLjjVh2nTpbGXxvIfoE0dkfX3gkJMyMJC/XC\r\naWR2M3vJ4eV5FrvwI3H/IB3IiqkzT6TOodi93ucdcXmgEoOxwn5hrIfuZa2s\r\nYu++4EqtX+J0VltGcSJymJBLPr+inTgWH93nXDsI3N5m0tkIXXZjnSjxzR7l\r\n485FEHGaWkNQ7rLKbC+4/PhQDWLaNk4Wx+3b3W1Ff+YZ+6Mrx2bQr1SURxXY\r\nYWwbQ83tR8e7KeKnvZHtIXQ26taqSQerHvr1FIHwXiHJw6uwB+/zmX7ovh/4\r\nxeJzS+4nLxKZZRuZTOOM3BSYjSz+de/Fkw9YNPyimPa6XYm/f17b6iwhH8Vg\r\n7D+7O90YjglIh8XwA8mDe6+bOXh6uFZGAdKJmVotZ86yAS+frnqPdvFLhszL\r\ngMr8SwevQY72eGWrzV5rl3ECBR5soNoY8ounlwhKMeIt4rCgtr+9zWI2fLx+\r\n2jsxE7udqD/GW2yRWQaXXIOMIVQFX3RJBe+fHB9io5xISX3YXhPxRN5TkJIg\r\n8t0ubgIOAjH4wm+WHt69O80I67//zda/9ugWlJxTx7PjCmYM6qqOlNlMwMQE\r\nRRXyALaQm3oy4olWUhcZBLjQeOfl23aBRRM7tDRKpRCLmAcCt4/hOvnCBFTw\r\nnQRtc4sbnUpIKCowzjCy78AB8Jgra40VyFE=\r\n=F+Hx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ahmadyusri","email":"yusriahmad2@gmail.com"},"directories":{},"maintainers":[{"name":"ahmadyusri","email":"yusriahmad2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/adonis-request-throttler_2.0.8_1677615778052_0.6430487011047803"},"_hasShrinkwrap":false}},"maintainers":[{"name":"ahmadyusri","email":"yusriahmad2@gmail.com"}],"description":"Request throttler provider for AdonisJS 5","homepage":"https://github.com/ahmadyusri/adonis-request-throttler.git#readme","keywords":["Adonis","5","@ahmadyusri/adonis-request-throttler"],"repository":{"type":"git","url":"git+https://github.com/ahmadyusri/adonis-request-throttler.git"},"contributors":[{"name":"Vladyslav Parashchenko","email":"vladyslavparashchenko37@gmail.com"},{"name":"Ryumin Evgeniy","email":"cmp08@ya.ru"}],"author":{"name":"Vladyslav Parashchenko"},"bugs":{"url":"https://github.com/ahmadyusri/adonis-request-throttler.git/issues"},"license":"MIT","readme":"# Adonis-Request-Throttler\n> Request limiter for Adonis JS 5 Fork from [adonis-request-throttler](https://www.npmjs.com/package/adonis-request-throttler)\n\n[![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url]\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n## Table of contents\n\n- [Installation](#installation)\n- [Sample Usage](#sample-usage)\n  - [Throttler middleware](#throttler-middleware)\n  - [Throttler service](#throttler-service)\n- [Configuration](#configuration)\n- [Request recognizer](#request-recognizer)\n- [Cache storage](#cache-storage)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n# Installation\nInstall [Adonis redis client](https://github.com/adonisjs/redis), if you want to use redis as storage for request info.\n```bash\nnpm i --save @ahmadyusri/adonis-request-throttler\n```\n\nInstall provider:\n```bash\nnode ace configure @ahmadyusri/adonis-request-throttler\n```\n* For other configuration, please update the `config/request-throttler.ts`.\n\n# Sample Usage\n## Throttler middleware\nAfter adding request throttler to your app, you must register the middleware.\n```ts\n// start/kernel.ts\nServer.middleware.registerNamed({\n  throttle: 'Adonis/Addons/RequestThrottler/Middleware'\n})\n```\nAnd then you can add middleware to your routes:\n```js\nRoute\n  .get('subscribers', 'SubscriberController.index')\n  .middleware('throttle')\n```\nThis middleware will limit user requests to endpoint. Configure default count and timeout in throttle config. For custom configuration you can add values as middleware params:\n```js\nRoute\n  .get('subscribers', 'SubscriberController.index')\n  .middleware('throttle:10,20')\n```\nFirst param is responsible for max attempt count, second params means time limit after exceeding the quota.\n\n## Throttler service\n\nYou can also use throttler in your services by client identifier:\n```ts\nimport RequestThrottler from '@ioc:Adonis/Addons/RequestThrottler'\n\nRequestThrottler.verifyClient(userId, 10, 15)\n```\nOr you can verify request in your controller:\n```ts\nimport {HttpContextContract} from \"@ioc:Adonis/Core/HttpContext\";\nimport RequestThrottler from '@ioc:Adonis/Addons/RequestThrottler'\n\nexport default class ControllerExample {\n  public async index({ request }: HttpContextContract) {\n    await RequestThrottler.verifyRequest(request)\n\n    return // endpoint data\n  }\n}\n\n```\n# Configuration\nFor configuring request throttler use **request-throttler.ts** file in config dir.\n```ts\nimport { ThrottleConfig } from '@ioc:Adonis/Addons/RequestThrottler'\n\nexport default {\n\tmaxAttempts: 10,\n\n\tmaxAttemptPeriod: 600000,\n\n\tttlUnits: 'ms',\n\n\tcacheStorage: 'redis',\n\n\tuseOwnCache: true,\n\n\tlimitExceptionParams: {\n\t\tcode: 'E_LIMIT_EXCEPTION',\n\t\tmessage: 'Maximum number of login attempts exceeded.',\n\t\tstatus: 429,\n\t},\n\n\trequestKeysForRecognizing: ['method', 'hostname', 'url', 'ip'],\n} as ThrottleConfig\n```\nYou can configure such options:\n- **maxAttempts** - permitted request count for user for permitted request count\n\n- **maxAttemptPeriod** - specify ttl for record, which store info about last user request\n\n- **ttlUnits** - time units for maxAttemptPeriod property\n\n- **cacheStorage** - specify storage for requests information\n\n- **useOwnCache** - specify is request throttler uses own cache provider or takes already instantiated cache provider from Adonis IoC container\n\n- **limitExceptionParams** - specify params for limit exception, you can change http status or add localization for message\n\n- **requestKeysForRecognizing** - specify request keys for recognizing the client and the route\n\n# Request recognizer\nBy default for request verifying throttler takes info about method, hostname, url, ip of request. If you need to specify request recognizing you should implement **ClientRecognizerContract** interface in your custom recognizer.\n\n```ts\nimport { RequestContract } from '@ioc:Adonis/Core/Request'\nimport { ClientRecognizerContract } from '@ioc:Adonis/Addons/RequestThrottler'\n\nexport default class CustomClientRecognizer implements ClientRecognizerContract {\n\tpublic identifyClient(request: RequestContract): Promise<string> | string {\n\t\treturn // client-identifier\n\t}\n}\n```\nAnd then you should register your recognizer. For example you can do it in this way:\n```ts\nimport RequestThrottler from '@ioc:Adonis/Addons/RequestThrottler'\n\nRequestThrottler.useClientRecognizer(new CustomClientRecognizer())\n```\nThen your requests will recognize using your custom recognizer.\n\n# Cache storage\nThis packages based on [adonis cache package](https://github.com/reg2005/adonis5-cache#readme). Throttler can work in two modes. By default throttler creates own cache client and uses it for storing info about requests. If you use Adonis cache you can use already instantiated provider for throttler. For using adonis cache set false to **useOwnCache** parameter in your throttler config.\n\n**You need the same `ttlUnits` in your `cache` and `request-throttler` config.**\n\nYou should register cache provider before request-throttler:\n```json\n{\n\"providers\": [\n    \"./providers/AppProvider\",\n    \"@adonisjs/core\",\n    \"@adonisjs/lucid\",\n    \"@adonisjs/redis\",\n    \"adonis5-cache\",\n    \"adonis-request-throttler\"\n  ]\n}\n```\nWhen you use [adonis5-cache](https://github.com/reg2005/adonis5-cache#readme) as storage, you can add custom storages for storing request data. Read more about this in adonis5-cache [docs](https://github.com/reg2005/adonis5-cache#readme).\n\n[typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript\n[typescript-url]:  \"typescript\"\n\n[npm-image]: https://img.shields.io/npm/v/adonis-request-throttler.svg?style=for-the-badge&logo=npm\n[npm-url]: https://www.npmjs.com/package/adonis-request-throttler \"npm\"\n\n[license-image]: https://img.shields.io/npm/l/adonis-request-throttler?color=blueviolet&style=for-the-badge\n[license-url]: LICENSE.md \"license\"\n","readmeFilename":"README.md"}