diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index f78e2bd..ffaa115 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,4 +1,4 @@ -## 👉 [Please follow one of these issue templates](https://github.com/AthennaIO/Template/issues/new/choose) 👈 +## 👉 [Please follow one of these issue templates](https://github.com/AthennaIO/Validator/issues/new/choose) 👈 diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 34f72e5..8bf70fb 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -36,7 +36,7 @@ body: label: Version description: | The version you are using. - Is it the [latest](https://github.com/AthennaIO/Template/releases)? Test and see if the bug has already been fixed. + Is it the [latest](https://github.com/AthennaIO/Validator/releases)? Test and see if the bug has already been fixed. placeholder: ex. 1.0.0 validations: required: true diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml index 0636c56..32fb4fb 100644 --- a/.github/ISSUE_TEMPLATE/feature.yml +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -18,7 +18,7 @@ body: id: solution attributes: label: Motivation - description: Outline your motivation for the proposal. How will it make @athenna/template better? + description: Outline your motivation for the proposal. How will it make @athenna/validator better? validations: required: true - type: textarea diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8a4ca1e..371a4e2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -23,7 +23,7 @@ creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._ -- [ ] I have read the [CONTRIBUTING](https://github.com/AthennaIO/Template/blob/master/CONTRIBUTING.md) documentation +- [ ] I have read the [CONTRIBUTING](https://github.com/AthennaIO/Validator/blob/master/CONTRIBUTING.md) documentation - [ ] Lint and unit tests pass locally with my changes - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added necessary documentation (if appropriate) diff --git a/README.md b/README.md index 5420bc2..a161913 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ -# Template 📔 +# Validator ✅ -> Template for new projects +> The Athenna validation solution. Built on top of VineJS. [![GitHub followers](https://img.shields.io/github/followers/athennaio.svg?style=social&label=Follow&maxAge=2592000)](https://github.com/athennaio?tab=followers) -[![GitHub stars](https://img.shields.io/github/stars/AthennaIO/Template.svg?style=social&label=Star&maxAge=2592000)](https://github.com/AthennaIO/Template/stargazers/) +[![GitHub stars](https://img.shields.io/github/stars/AthennaIO/Validator.svg?style=social&label=Star&maxAge=2592000)](https://github.com/AthennaIO/Validator/stargazers/)

Buy Me A Coffee

- GitHub language count + GitHub language count - Repository size + Repository size License @@ -27,7 +27,7 @@ ## Contributing -> If you want to contribute to this project, first read the [CONTRIBUTING.MD](https://github.com/AthennaIO/Template/blob/develop/CONTRIBUTING.md) file. It will be a pleasure to receive your help. +> If you want to contribute to this project, first read the [CONTRIBUTING.MD](https://github.com/AthennaIO/Validator/blob/develop/CONTRIBUTING.md) file. It will be a pleasure to receive your help. --- @@ -36,7 +36,7 @@

- - + +

diff --git a/bin/test.ts b/bin/test.ts index 7a0cb32..d6276d8 100644 --- a/bin/test.ts +++ b/bin/test.ts @@ -1,5 +1,5 @@ /** - * @athenna/template + * @athenna/validator * * (c) João Lenon * diff --git a/configurer/index.ts b/configurer/index.ts new file mode 100644 index 0000000..cea5499 --- /dev/null +++ b/configurer/index.ts @@ -0,0 +1,54 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { BaseConfigurer } from '@athenna/artisan' + +export default class ValidatorConfigurer extends BaseConfigurer { + public async configure() { + const task = this.logger.task() + + task.addPromise('Update commands of .athennarc.json', () => { + return this.rc + .setTo( + 'commands', + 'make:validator', + '@athenna/validator/commands/MakeValidatorCommand' + ) + .save() + }) + + task.addPromise('Update templates of .athennarc.json', () => { + return this.rc + .setTo( + 'templates', + 'validator-http', + 'node_modules/@athenna/validator/templates/validator-http.edge' + ) + .setTo( + 'templates', + 'validator-console', + 'node_modules/@athenna/validator/templates/validator-console.edge' + ) + .save() + }) + + task.addPromise('Update providers of .athennarc.json', () => { + return this.rc + .pushTo('providers', '@athenna/validator/providers/ValidatorProvider') + .save() + }) + + await task.run() + + console.log() + this.logger.success( + 'Successfully configured ({dim,yellow} @athenna/validator) library' + ) + } +} diff --git a/package-lock.json b/package-lock.json index 15876ae..f4ad115 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,25 @@ { - "name": "@athenna/template", + "name": "@athenna/validator", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@athenna/template", + "name": "@athenna/validator", "version": "1.0.0", "license": "MIT", + "dependencies": { + "@vinejs/vine": "^2.0.0" + }, "devDependencies": { - "@athenna/common": "^4.35.0", + "@athenna/artisan": "^4.42.0", + "@athenna/common": "^4.39.0", + "@athenna/config": "^4.21.0", + "@athenna/ioc": "^4.20.0", + "@athenna/logger": "^4.21.0", "@athenna/test": "^4.22.0", "@athenna/tsconfig": "^4.12.0", + "@athenna/view": "^4.22.0", "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", "commitizen": "^4.2.6", @@ -85,10 +93,448 @@ "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==", "dev": true }, + "node_modules/@athenna/artisan": { + "version": "4.42.0", + "resolved": "https://registry.npmjs.org/@athenna/artisan/-/artisan-4.42.0.tgz", + "integrity": "sha512-QclnEb9O9nwfvF1U79gZN0Nergcntm55qKdzCLvHt8mCa945g7PKrW+I9icmPNH0GQi3E9nrwHKVk2uOnmJLDw==", + "dev": true, + "dependencies": { + "chalk-rainbow": "^1.0.0", + "cli-boxes": "^3.0.0", + "cli-table3": "^0.6.4", + "columnify": "^1.6.0", + "commander": "^9.5.0", + "figlet": "^1.7.0", + "inquirer": "^9.2.16", + "log-update": "^5.0.1", + "ora": "^6.3.1" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@athenna/artisan/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@athenna/artisan/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@athenna/artisan/node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@athenna/artisan/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@athenna/artisan/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@athenna/artisan/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/@athenna/artisan/node_modules/inquirer": { + "version": "9.2.20", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.20.tgz", + "integrity": "sha512-SFwJJPS+Ms75NV+wzFBHjirG4z3tzvis31h+9NyH1tqjIu2c7vCavlXILZ73q/nPYy8/aw4W+DNzLH5MjfYXiA==", + "dev": true, + "dependencies": { + "@inquirer/figures": "^1.0.1", + "@ljharb/through": "^2.3.13", + "ansi-escapes": "^4.3.2", + "chalk": "^5.3.0", + "cli-cursor": "^3.1.0", + "cli-width": "^4.1.0", + "external-editor": "^3.1.0", + "lodash": "^4.17.21", + "mute-stream": "1.0.0", + "ora": "^5.4.1", + "run-async": "^3.0.0", + "rxjs": "^7.8.1", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@athenna/artisan/node_modules/inquirer/node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/inquirer/node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@athenna/artisan/node_modules/log-update": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", + "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", + "dev": true, + "dependencies": { + "ansi-escapes": "^5.0.0", + "cli-cursor": "^4.0.0", + "slice-ansi": "^5.0.0", + "strip-ansi": "^7.0.1", + "wrap-ansi": "^8.0.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/log-update/node_modules/ansi-escapes": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "dev": true, + "dependencies": { + "type-fest": "^1.0.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/log-update/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@athenna/artisan/node_modules/log-update/node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dev": true, + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/log-update/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/log-update/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@athenna/artisan/node_modules/log-update/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@athenna/artisan/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/@athenna/artisan/node_modules/mute-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@athenna/artisan/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/ora": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.3.1.tgz", + "integrity": "sha512-ERAyNnZOfqM+Ao3RAvIXkYh5joP220yf59gVe2X/cI6SiCxIdi4c9HZKZD8R6q/RDXEje1THBju6iExiSsgJaQ==", + "dev": true, + "dependencies": { + "chalk": "^5.0.0", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.6.1", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.1.0", + "log-symbols": "^5.1.0", + "stdin-discarder": "^0.1.0", + "strip-ansi": "^7.0.1", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/ora/node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dev": true, + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/ora/node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/ora/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/ora/node_modules/log-symbols": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "dev": true, + "dependencies": { + "chalk": "^5.0.0", + "is-unicode-supported": "^1.1.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/ora/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@athenna/artisan/node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/run-async": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", + "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/@athenna/artisan/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/@athenna/artisan/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@athenna/artisan/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/@athenna/common": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@athenna/common/-/common-4.35.0.tgz", - "integrity": "sha512-f5JRdrjdozbtHjG0YgqVLXv6fjmss7PKAQWeyqGLg4dpGmheZ19xXYONZYf3ng6d0k2+YQ7IjLzGmfwSsrO+wA==", + "version": "4.39.0", + "resolved": "https://registry.npmjs.org/@athenna/common/-/common-4.39.0.tgz", + "integrity": "sha512-15asgK0iumvN1CdMl/MpjhVnAd17oXQRvf+DotFkeHK3cqwqDYAthNDkm4JrkeUVsmUz9gjhRmlsWACmvLMi9g==", "dev": true, "dependencies": { "@fastify/formbody": "^7.4.0", @@ -99,12 +545,12 @@ "collect.js": "^4.36.1", "csv-parser": "^3.0.0", "execa": "^8.0.1", - "fastify": "^4.26.1", + "fastify": "^4.26.2", "got": "^12.6.1", "http-status-codes": "^2.2.0", "is-wsl": "^2.2.0", "js-yaml": "^4.1.0", - "json-2-csv": "^5.0.1", + "json-2-csv": "^5.5.1", "kind-of": "^6.0.3", "lodash": "^4.17.21", "mime-types": "^2.1.35", @@ -140,6 +586,46 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/@athenna/config": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@athenna/config/-/config-4.21.0.tgz", + "integrity": "sha512-pkGDufU04BH181FB/gYlv7jciws/qRuTAxkcJHqJQd/+S+DBqcJjyfb1+iUCZzmHFtrve/iTKT+GtLxR7/Dk5A==", + "dev": true, + "dependencies": { + "dotenv": "^16.4.5", + "magicast": "^0.3.3", + "syntax-error": "^1.4.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@athenna/ioc": { + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-4.20.0.tgz", + "integrity": "sha512-5msfdBRC6+D5YJHmbQng88XSKe+i8tfJ/OqZLPafpLBj6B7cMA2/u5wt1/84xC0v1Wj1M+vQ4pXIRo43ISXsFw==", + "dev": true, + "dependencies": { + "awilix": "^7.0.3" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@athenna/logger": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@athenna/logger/-/logger-4.21.0.tgz", + "integrity": "sha512-gUXbUozGsc+Il/iLRFlJsxiB7suC8Dz1lx1l0yltWcoVxoQuWbyWjD5Gvqihm/Jxj1OJZDkU6KZKNtVOvlO3Lg==", + "dev": true, + "dependencies": { + "@aws-lambda-powertools/logger": "^1.18.1", + "cls-rtracer": "^2.6.3", + "telegraf": "^4.16.3" + }, + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/@athenna/test": { "version": "4.22.0", "resolved": "https://registry.npmjs.org/@athenna/test/-/test-4.22.0.tgz", @@ -171,6 +657,42 @@ "typescript": "^5.2.2" } }, + "node_modules/@athenna/view": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@athenna/view/-/view-4.22.0.tgz", + "integrity": "sha512-AlRzn1DZ2tBAmhorbAILHMYmFkabzs+eH6mcM32x9VJFOkLEmhXI/knUMOUVuxRJfiQGMonMYS06V1eWKyEp7Q==", + "dev": true, + "dependencies": { + "edge.js": "^6.0.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-lambda-powertools/commons": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/@aws-lambda-powertools/commons/-/commons-1.18.1.tgz", + "integrity": "sha512-gFRgQ2GJDghKvf+fXvT0kQVftgOT05W+hCa7RkfZj6HSjVAO+9DZZeJL3JK1HcsLAjWRj7W9ra0/MqB3Abf+PQ==", + "dev": true + }, + "node_modules/@aws-lambda-powertools/logger": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/@aws-lambda-powertools/logger/-/logger-1.18.1.tgz", + "integrity": "sha512-GsSMqaFXCSz+llSOn2CVNMoN+j/jNsS6JP2Opy9myU0tvg7PeuU3+rN24vKyibUwpxM466IzWFBSJkYdm0bqVw==", + "dev": true, + "dependencies": { + "@aws-lambda-powertools/commons": "^1.18.1", + "lodash.merge": "^4.6.2" + }, + "peerDependencies": { + "@middy/core": ">=3.x" + }, + "peerDependenciesMeta": { + "@middy/core": { + "optional": true + } + } + }, "node_modules/@babel/code-frame": { "version": "7.22.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", @@ -240,10 +762,19 @@ "node": ">=4" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz", + "integrity": "sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz", + "integrity": "sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==", "dev": true, "engines": { "node": ">=6.9.0" @@ -319,6 +850,32 @@ "node": ">=4" } }, + "node_modules/@babel/parser": { + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.5.tgz", + "integrity": "sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.5.tgz", + "integrity": "sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.1", + "@babel/helper-validator-identifier": "^7.24.5", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", @@ -673,15 +1230,15 @@ } }, "node_modules/@fastify/ajv-compiler/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", + "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "uri-js": "^4.4.1" }, "funding": { "type": "github", @@ -783,6 +1340,15 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@inquirer/figures": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.1.tgz", + "integrity": "sha512-mtup3wVKia3ZwULPHcbs4Mor8Voi+iIXEWD7wCNbIO6lYR62oPCTQyrddi5OMYVXHzeCSoneZwJuS8sBvlEwDw==", + "dev": true, + "engines": { + "node": ">=18" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1126,6 +1692,27 @@ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", "dev": true }, + "node_modules/@ljharb/through": { + "version": "2.3.13", + "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.13.tgz", + "integrity": "sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/@lukeed/ms": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.2.tgz", + "integrity": "sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1458,13 +2045,56 @@ "node": ">=18.16.0" } }, - "node_modules/@poppinss/macroable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@poppinss/macroable/-/macroable-1.0.1.tgz", - "integrity": "sha512-bO3+rnqGhE+gdx4DOyYjY9jCm2+c5Ncyl2Gmst0w271rIFnsB00btonpdmAqvFNzS8rcas+APGm+47fYMmkpQA==", + "node_modules/@poppinss/inspect": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@poppinss/inspect/-/inspect-1.0.1.tgz", + "integrity": "sha512-kLeEaBSGhlleyYvKc7c9s3uE6xv7cwyulE0EgHf4jU/CL96h0yC4mkdw1wvC1l1PYYQozCGy46FwMBAAMOobCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@poppinss/macroable": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@poppinss/macroable/-/macroable-1.0.2.tgz", + "integrity": "sha512-xhhEcEvhQC8mP5oOr5hbE4CmUgmw/IPV1jhpGg2xSkzoFrt9i8YVqBQt9744EFesi5F7pBheWozg63RUBM/5JA==", + "engines": { + "node": ">=18.16.0" + } + }, + "node_modules/@poppinss/utils": { + "version": "6.7.3", + "resolved": "https://registry.npmjs.org/@poppinss/utils/-/utils-6.7.3.tgz", + "integrity": "sha512-zQnhVG4Q+n6+V1vrL/TF1Oy8ZcVVGUs49Sj5OBgoari/q42UiG/rht1DRvoeWd9bT1BBDwxO2vcfxj6C0u/Dgg==", + "dev": true, + "dependencies": { + "@lukeed/ms": "^2.0.2", + "@types/bytes": "^3.1.4", + "@types/pluralize": "^0.0.33", + "bytes": "^3.1.2", + "case-anything": "^2.1.13", + "flattie": "^1.1.1", + "pluralize": "^8.0.0", + "safe-stable-stringify": "^2.4.3", + "secure-json-parse": "^2.7.0", + "slash": "^5.1.0", + "slugify": "^1.6.6", + "truncatise": "^0.0.8" + }, + "engines": { + "node": ">=18.16.0" + } + }, + "node_modules/@poppinss/utils/node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", "dev": true, "engines": { - "node": ">=18.16.0" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@sinclair/typebox": { @@ -1541,6 +2171,12 @@ "node": ">=14.16" } }, + "node_modules/@telegraf/types": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@telegraf/types/-/types-7.1.0.tgz", + "integrity": "sha512-kGevOIbpMcIlCDeorKGpwZmdH7kHbqlk/Yj6dEpJMKEQw5lk0KVQY0OLXaCswy8GqlIVLd5625OB+rAntP9xVw==", + "dev": true + }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -1565,6 +2201,12 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, + "node_modules/@types/bytes": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/bytes/-/bytes-3.1.4.tgz", + "integrity": "sha512-A0uYgOj3zNc4hNjHc5lYUfJQ/HVyBXiUMKdXd7ysclaE6k9oJdavQzODHuwjpUu2/boCP8afjQYi8z/GtvNCWA==", + "dev": true + }, "node_modules/@types/chai": { "version": "4.3.11", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.11.tgz", @@ -1630,6 +2272,12 @@ "integrity": "sha512-lqa4UEhhv/2sjjIQgjX8B+RBjj47eo0mzGasklVJ78UKGQY1r0VpB9XHDaZZO9qzEFDdy4MrXLuEaSmPrPSe/A==", "dev": true }, + "node_modules/@types/pluralize": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/pluralize/-/pluralize-0.0.33.tgz", + "integrity": "sha512-JOqsl+ZoCpP4e8TDke9W79FDcSgPAR0l6pixx2JHkhnRjvShyYiAYw2LVsnA7K08Y6DeOnaU6ujmENO4os/cYg==", + "dev": true + }, "node_modules/@types/semver": { "version": "7.5.3", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz", @@ -1651,6 +2299,11 @@ "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==", "dev": true }, + "node_modules/@types/validator": { + "version": "13.11.9", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.11.9.tgz", + "integrity": "sha512-FCTsikRozryfayPuiI46QzH3fnrOoctTjvOYZkho9BTFLCOZ2rgZJHMOVgCOfttjPJcgOx52EpkY0CMfy87MIw==" + }, "node_modules/@types/yargs": { "version": "15.0.19", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.19.tgz", @@ -1855,6 +2508,32 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@vinejs/compiler": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@vinejs/compiler/-/compiler-2.5.0.tgz", + "integrity": "sha512-hg4ekaB5Y2zh+IWzBiC/WCDWrIfpVnKu/ubUvelKlidc/VbulsexoFRw5kJGHZenPVI5YzNnDeTdYSALkTV7jQ==", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@vinejs/vine": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@vinejs/vine/-/vine-2.0.0.tgz", + "integrity": "sha512-NqgT4B2uo4mMsGI8LJdpuXNnan7F3xm10+kHaXpqI0PCYpn7+Xiic6av586mmj747/qZ3iR8o4C9cL54WU1fWw==", + "dependencies": { + "@poppinss/macroable": "^1.0.2", + "@types/validator": "^13.11.9", + "@vinejs/compiler": "^2.5.0", + "camelcase": "^8.0.0", + "dayjs": "^1.11.10", + "dlv": "^1.1.3", + "normalize-url": "^8.0.1", + "validator": "^13.11.0" + }, + "engines": { + "node": ">=18.16.0" + } + }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -1874,9 +2553,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1894,6 +2573,38 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/acorn-node": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", + "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", + "dev": true, + "dependencies": { + "acorn": "^7.0.0", + "acorn-walk": "^7.0.0", + "xtend": "^4.0.2" + } + }, + "node_modules/acorn-node/node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-node/node_modules/acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -1950,15 +2661,15 @@ } }, "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", + "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "uri-js": "^4.4.1" }, "funding": { "type": "github", @@ -2323,6 +3034,15 @@ "node": ">=8" } }, + "node_modules/astring": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/astring/-/astring-1.8.6.tgz", + "integrity": "sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg==", + "dev": true, + "bin": { + "astring": "bin/astring" + } + }, "node_modules/async-retry": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", @@ -2374,6 +3094,19 @@ "fastq": "^1.17.1" } }, + "node_modules/awilix": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/awilix/-/awilix-7.0.3.tgz", + "integrity": "sha512-4Nmjyh9qloDwXfDK0DBuWd8WyFApyknoaKbE3leQflGLgNfNsBHy2/VYrlyy/mzMobjJ3J8XtNpbjzG3KRkIFQ==", + "dev": true, + "dependencies": { + "camel-case": "^4.1.2", + "fast-glob": "^3.2.11" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2479,6 +3212,28 @@ "ieee754": "^1.1.13" } }, + "node_modules/buffer-alloc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "dev": true, + "dependencies": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "node_modules/buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true + }, + "node_modules/buffer-fill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==", + "dev": true + }, "node_modules/builtins": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", @@ -2571,13 +3326,19 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2653,6 +3414,17 @@ "tslib": "^2.0.3" } }, + "node_modules/camelcase": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-8.0.0.tgz", + "integrity": "sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/capital-case": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", @@ -2664,6 +3436,18 @@ "upper-case-first": "^2.0.2" } }, + "node_modules/case-anything": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz", + "integrity": "sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==", + "dev": true, + "engines": { + "node": ">=12.13" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, "node_modules/chai": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.0.tgz", @@ -2694,6 +3478,79 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chalk-rainbow": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/chalk-rainbow/-/chalk-rainbow-1.0.0.tgz", + "integrity": "sha512-i0B903qPTUedmicQqiG7uKeoCsnuBfFQGHVuiVEhWipwC9mU0J5UGXFvSCTSDC+ckR7py/+am5/CjyiDsvwqUQ==", + "dev": true, + "dependencies": { + "chalk": "^1.1.3" + } + }, + "node_modules/chalk-rainbow/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/chalk-rainbow/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/chalk-rainbow/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/chalk-rainbow/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/chalk-rainbow/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/chalk-rainbow/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/change-case": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", @@ -2747,6 +3604,12 @@ "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "dev": true + }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -2793,9 +3656,9 @@ } }, "node_modules/cli-table3": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", - "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.4.tgz", + "integrity": "sha512-Lm3L0p+/npIQWNIiyF/nAn7T5dnOwR3xNTHXYEBFBFVPXzCVNZ5lqEC/1eo/EVfpDsQ1I+TX4ORPQgp+UI0CRw==", "dev": true, "dependencies": { "string-width": "^4.2.0" @@ -2919,6 +3782,31 @@ "node": ">=6" } }, + "node_modules/cls-rtracer": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/cls-rtracer/-/cls-rtracer-2.6.3.tgz", + "integrity": "sha512-O7M/m2M/KfT9v+q7ka9nmsadS67ce9P8+1Zgm6VFamK56oFd1iCoJ9m8hYKUQpK4+RofyaexxHJlOBkxqCDs3Q==", + "dev": true, + "dependencies": { + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=12.17.0 <13.0.0 || >=13.14.0 <14.0.0 || >=14.0.0" + } + }, + "node_modules/cls-rtracer/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/collect.js": { "version": "4.36.1", "resolved": "https://registry.npmjs.org/collect.js/-/collect.js-4.36.1.tgz", @@ -3367,6 +4255,11 @@ "integrity": "sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA==", "dev": true }, + "node_modules/dayjs": { + "version": "1.11.11", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", + "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==" + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -3430,9 +4323,9 @@ "dev": true }, "node_modules/deeks": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/deeks/-/deeks-3.0.2.tgz", - "integrity": "sha512-c6OmjIygIB/avwXwEQOiODS+nw6fEX4cvOdDMqdL7dt3dicV/xykAJ9AeVc/8/JTVQDuacjRc9KCMmXafL1Y4A==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/deeks/-/deeks-3.1.0.tgz", + "integrity": "sha512-e7oWH1LzIdv/prMQ7pmlDlaVoL64glqzvNgkgQNgyec9ORPHrT2jaOqMtRyqJuwWjtfb6v+2rk9pmaHj+F137A==", "dev": true, "engines": { "node": ">= 16" @@ -3487,17 +4380,20 @@ } }, "node_modules/define-data-property": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", - "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/define-properties": { @@ -3565,10 +4461,15 @@ "node": ">=8" } }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" + }, "node_modules/doc-path": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/doc-path/-/doc-path-4.0.2.tgz", - "integrity": "sha512-OqZEk7EM1aP3JpO+mq0pv1msEJWrzZVXu4q3YjEYJKc+Wt3/chac4KJdaGueK5IGemOwfptrLctG9I8xkb59qQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/doc-path/-/doc-path-4.1.1.tgz", + "integrity": "sha512-h1ErTglQAVv2gCnOpD3sFS6uolDbOKHDU1BZq+Kl3npPqroU3dYL42lUgMfd5UimlwtRgp7C9dLGwqQ5D2HYgQ==", "dev": true, "engines": { "node": ">=16" @@ -3596,12 +4497,84 @@ "tslib": "^2.0.3" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, + "node_modules/edge-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/edge-error/-/edge-error-4.0.1.tgz", + "integrity": "sha512-z5mNO97k8hRVpJ6Ew1qbkMTfQ44CwuWnl+ShMCrEFgD+b324CnjBS6HbiR+Wh6Wcmw9C+/XsFBHzZ+376PpD/w==", + "dev": true, + "engines": { + "node": ">=18.16.0" + } + }, + "node_modules/edge-lexer": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/edge-lexer/-/edge-lexer-6.0.1.tgz", + "integrity": "sha512-iYPlo+EyERGL4cICzqXIYVxMB6sSOXazpAqkqN4YcLtwR7K1i1KcwNkSy36T40BYvP7UjjjjAVnz+fk3NEWH9Q==", + "dev": true, + "dependencies": { + "edge-error": "^4.0.1" + }, + "engines": { + "node": ">=18.16.0" + } + }, + "node_modules/edge-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/edge-parser/-/edge-parser-9.0.2.tgz", + "integrity": "sha512-4lFpBf/tCM7q5v+00+sudIIA956neWR7iJLbtQ3cEwl6GMg+s9ZgqiLur3z04SI5MSTGLqa2xsR6SgU/rR5g5Q==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "astring": "^1.8.6", + "edge-error": "^4.0.1", + "edge-lexer": "^6.0.1", + "js-stringify": "^1.0.2" + }, + "engines": { + "node": ">=18.16.0" + } + }, + "node_modules/edge.js": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/edge.js/-/edge.js-6.0.2.tgz", + "integrity": "sha512-qH226BetmQq2LZYEPnoZzZBQqnTWVy/hdsM9GYReYci0FaqAwnabhqMdDfJyzYJJrbb9p67UtgZFBtt0A0k/KA==", + "dev": true, + "dependencies": { + "@poppinss/inspect": "^1.0.1", + "@poppinss/macroable": "^1.0.1", + "@poppinss/utils": "^6.7.2", + "classnames": "^2.5.1", + "edge-error": "^4.0.1", + "edge-lexer": "^6.0.1", + "edge-parser": "^9.0.2", + "fs-readdir-recursive": "^1.1.0", + "he": "^1.2.0", + "js-stringify": "^1.0.2", + "property-information": "^6.4.1", + "stringify-attributes": "^4.0.0" + }, + "engines": { + "node": ">=18.16.0" + } + }, "node_modules/emittery": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-1.0.1.tgz", @@ -3691,6 +4664,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-set-tostringtag": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", @@ -3740,6 +4734,18 @@ "node": ">=6" } }, + "node_modules/escape-goat": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz", + "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -4441,14 +5447,14 @@ "dev": true }, "node_modules/fast-json-stringify": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.12.0.tgz", - "integrity": "sha512-7Nnm9UPa7SfHRbHVA1kJQrGXCRzB7LMlAAqHXQFkEQqueJm1V8owm0FsE/2Do55/4CcdhwiLQERaKomOnKQkyA==", + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.15.1.tgz", + "integrity": "sha512-JopGtkvvguRqrS4gHXSSA2jf4pDgOZkeBAkLO1LbzOpiOMo7/kugoR+KiWifpLpluaVeYDkAuxCJOj4Gyc6L9A==", "dev": true, "dependencies": { "@fastify/merge-json-schemas": "^0.1.0", "ajv": "^8.10.0", - "ajv-formats": "^2.1.1", + "ajv-formats": "^3.0.1", "fast-deep-equal": "^3.1.3", "fast-uri": "^2.1.0", "json-schema-ref-resolver": "^1.0.1", @@ -4456,21 +5462,38 @@ } }, "node_modules/fast-json-stringify/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", + "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "uri-js": "^4.4.1" }, "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/fast-json-stringify/node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dev": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/fast-json-stringify/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -4493,9 +5516,9 @@ } }, "node_modules/fast-redact": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.3.0.tgz", - "integrity": "sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz", + "integrity": "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==", "dev": true, "engines": { "node": ">=6" @@ -4508,9 +5531,9 @@ "dev": true }, "node_modules/fastify": { - "version": "4.26.1", - "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.26.1.tgz", - "integrity": "sha512-tznA/G55dsxzM5XChBfcvVSloG2ejeeotfPPJSFaWmHyCDVGMpvf3nRNbsCb/JTBF9RmQFBfuujWt3Nphjesng==", + "version": "4.27.0", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.27.0.tgz", + "integrity": "sha512-ci9IXzbigB8dyi0mSy3faa3Bsj0xWAPb9JeT4KRzubdSb6pNhcADRUaXCBml6V1Ss/a05kbtQls5LBmhHydoTA==", "dev": true, "funding": [ { @@ -4532,7 +5555,7 @@ "fast-json-stringify": "^5.8.0", "find-my-way": "^8.0.0", "light-my-request": "^5.11.0", - "pino": "^8.17.0", + "pino": "^9.0.0", "process-warning": "^3.0.0", "proxy-addr": "^2.0.7", "rfdc": "^1.3.0", @@ -4556,6 +5579,18 @@ "reusify": "^1.0.4" } }, + "node_modules/figlet": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.7.0.tgz", + "integrity": "sha512-gO8l3wvqo0V7wEFLXPbkX83b7MVjRrk1oRLfYlZXol8nEpb/ON9pcKLI4qpBv5YtOTfrINtqb7b40iYY2FTWFg==", + "dev": true, + "bin": { + "figlet": "bin/index.js" + }, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -4718,14 +5753,14 @@ } }, "node_modules/find-my-way": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-8.1.0.tgz", - "integrity": "sha512-41QwjCGcVTODUmLLqTMeoHeiozbMXYMAE1CKFiDyi9zVZ2Vjh0yz3MF0WQZoIb+cmzP/XlbFjlF2NtJmvZHznA==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-8.2.0.tgz", + "integrity": "sha512-HdWXgFYc6b1BJcOBDBwjqWuHJj1WYiqrxSh25qtU4DabpMFdj/gSunNBQb83t+8Zt67D7CXEzJWTkxaShMTMOA==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-querystring": "^1.0.0", - "safe-regex2": "^2.0.0" + "safe-regex2": "^3.1.0" }, "engines": { "node": ">=14" @@ -4813,6 +5848,15 @@ "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", "dev": true }, + "node_modules/flattie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.1.tgz", + "integrity": "sha512-9UbaD6XdAL97+k/n+N7JwX46K/M6Zc6KcFYskrYL8wbBV/Uyk0CTAMY0VT+qiK5PM7AIc9aTWYtq65U7T+aCNQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -4856,6 +5900,12 @@ "node": ">= 0.6" } }, + "node_modules/fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -4929,15 +5979,19 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5225,6 +6279,27 @@ "node": ">= 0.4.0" } }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -5244,12 +6319,12 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5294,6 +6369,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, "node_modules/header-case": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", @@ -6523,6 +7619,12 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true }, + "node_modules/js-stringify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz", + "integrity": "sha512-rtS5ATOo2Q5k1G+DADISilDA6lv79zIiwFd6CcjuIxGKLFm5C+RLImRscVap9k55i+MOZwgliw+NejvkLuGD5g==", + "dev": true + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -6543,13 +7645,13 @@ } }, "node_modules/json-2-csv": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-2-csv/-/json-2-csv-5.0.1.tgz", - "integrity": "sha512-rP9ChyMskS0angbvFdQ43SwEe72mEvqcY1/V2OeukQWxtlreUuZWhMlTdWjtd4L6kJxq+HPFTI06yqLvZiEVIA==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/json-2-csv/-/json-2-csv-5.5.1.tgz", + "integrity": "sha512-KgAtAXTQopRwe90gh8SgjRSxgt9bUWbGAPMo9W0TZLA8SqiQH7khtagFfeEUjG3NBPwJu/+9uX5pMvunKaPvrQ==", "dev": true, "dependencies": { - "deeks": "3.0.2", - "doc-path": "4.0.2" + "deeks": "3.1.0", + "doc-path": "4.1.1" }, "engines": { "node": ">= 16" @@ -6684,13 +7786,13 @@ } }, "node_modules/light-my-request": { - "version": "5.11.1", - "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.11.1.tgz", - "integrity": "sha512-KXAh2m6VRlkWCk2KfmHE7tLBXKh30JE0tXUJY4dNxje4oLmPKUqlUfImiEQZLphx+Z9KTQcVv4DjGnJxkVOIbA==", + "version": "5.13.0", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.13.0.tgz", + "integrity": "sha512-9IjUN9ZyCS9pTG+KqTDEQo68Sui2lHsYBrfMyVUTTZ3XhH8PMZq7xO94Kr+eP9dhi/kcKsx4N41p2IXEBil1pQ==", "dev": true, "dependencies": { "cookie": "^0.6.0", - "process-warning": "^2.0.0", + "process-warning": "^3.0.0", "set-cookie-parser": "^2.4.1" } }, @@ -6703,12 +7805,6 @@ "node": ">= 0.6" } }, - "node_modules/light-my-request/node_modules/process-warning": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.2.tgz", - "integrity": "sha512-n9wh8tvBe5sFmsqlg+XQhaQLumwpqoAUruLwjCopgTmUBjJ/fjtBsJzKleCaIGBOMXYEhp1YfKl4d7rJ5ZKJGA==", - "dev": true - }, "node_modules/lilconfig": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.5.tgz", @@ -7258,6 +8354,17 @@ "node": ">=10" } }, + "node_modules/magicast": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.4.tgz", + "integrity": "sha512-TyDF/Pn36bBji9rWKHlZe+PZb6Mx5V8IHCSxk7X4aljM4e/vyDvZZYwHewdVaqiA0nb3ghfHU/6AUpDxWoER2Q==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.24.4", + "@babel/types": "^7.24.0", + "source-map-js": "^1.2.0" + } + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -7426,6 +8533,15 @@ "node": ">=10" } }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -7491,6 +8607,26 @@ "tslib": "^2.0.3" } }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/noms": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", @@ -7532,10 +8668,9 @@ } }, "node_modules/normalize-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", - "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", - "dev": true, + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", + "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", "engines": { "node": ">=14.16" }, @@ -7873,6 +9008,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-timeout": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-4.1.0.tgz", + "integrity": "sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -8064,31 +9208,31 @@ } }, "node_modules/pino": { - "version": "8.19.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-8.19.0.tgz", - "integrity": "sha512-oswmokxkav9bADfJ2ifrvfHUwad6MLp73Uat0IkQWY3iAw5xTRoznXbXksZs8oaOUMpmhVWD+PZogNzllWpJaA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-9.0.0.tgz", + "integrity": "sha512-uI1ThkzTShNSwvsUM6b4ND8ANzWURk9zTELMztFkmnCQeR/4wkomJ+echHee5GMWGovoSfjwdeu80DsFIt7mbA==", "dev": true, "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", "on-exit-leak-free": "^2.1.0", - "pino-abstract-transport": "v1.1.0", + "pino-abstract-transport": "^1.2.0", "pino-std-serializers": "^6.0.0", "process-warning": "^3.0.0", "quick-format-unescaped": "^4.0.3", "real-require": "^0.2.0", "safe-stable-stringify": "^2.3.1", "sonic-boom": "^3.7.0", - "thread-stream": "^2.0.0" + "thread-stream": "^2.6.0" }, "bin": { "pino": "bin.js" } }, "node_modules/pino-abstract-transport": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz", - "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.2.0.tgz", + "integrity": "sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==", "dev": true, "dependencies": { "readable-stream": "^4.0.0", @@ -8330,6 +9474,16 @@ "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==", "dev": true }, + "node_modules/property-information": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz", + "integrity": "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -8622,12 +9776,12 @@ "dev": true }, "node_modules/ret": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.2.2.tgz", - "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.4.3.tgz", + "integrity": "sha512-0f4Memo5QP7WQyUEAYUO3esD/XjOc3Zjjg5CPsAq1p8sIu0XPeMbHJemKA0BO7tV0X7+A0FoEpbmHXWxPyD3wQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=10" } }, "node_modules/retry": { @@ -8807,6 +9961,15 @@ } ] }, + "node_modules/safe-compare": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/safe-compare/-/safe-compare-1.1.4.tgz", + "integrity": "sha512-b9wZ986HHCo/HbKrRpBJb2kqXMK9CEWIE1egeEvZsYn69ay3kdfl9nG3RyOcR+jInTDf7a86WQ1d4VJX7goSSQ==", + "dev": true, + "dependencies": { + "buffer-alloc": "^1.2.0" + } + }, "node_modules/safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", @@ -8822,12 +9985,12 @@ } }, "node_modules/safe-regex2": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-2.0.0.tgz", - "integrity": "sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-3.1.0.tgz", + "integrity": "sha512-RAAZAGbap2kBfbVhvmnTFv73NWLMvDGOITFYTZBAaY8eR+Ir4ef7Up/e7amo+y1+AH+3PtLkrt9mvcTsG9LXug==", "dev": true, "dependencies": { - "ret": "~0.2.0" + "ret": "~0.4.0" } }, "node_modules/safe-stable-stringify": { @@ -8845,6 +10008,15 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, + "node_modules/sandwich-stream": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/sandwich-stream/-/sandwich-stream-2.0.2.tgz", + "integrity": "sha512-jLYV0DORrzY3xaz/S9ydJL6Iz7essZeAfnAavsJ+zsJGZ1MOnsS52yRjU3uF3pJa/lla7+wisp//fxOwOH8SKQ==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/secure-json-parse": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz", @@ -8916,6 +10088,23 @@ "integrity": "sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==", "dev": true }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/set-function-name": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", @@ -9044,6 +10233,15 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/slugify": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.6.tgz", + "integrity": "sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/snake-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", @@ -9055,9 +10253,9 @@ } }, "node_modules/sonic-boom": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.0.tgz", - "integrity": "sha512-ybz6OYOUjoQQCQ/i4LU8kaToD8ACtYP+Cj5qd2AO36bwbdewxWJ3ArmJ2cr6AvxlL2o0PqnCcPGUgkILbfkaCA==", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.1.tgz", + "integrity": "sha512-y4Z8LCDBuum+PBP3lSV7RHrXscqksve/bi0as7mhwVnBW+/wUqKT/2Kb7um8yqcFy0duYbbPxzt89Zy2nOCaxg==", "dev": true, "dependencies": { "atomic-sleep": "^1.0.0" @@ -9072,6 +10270,15 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", @@ -9129,6 +10336,79 @@ "get-source": "^2.0.12" } }, + "node_modules/stdin-discarder": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", + "dev": true, + "dependencies": { + "bl": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stdin-discarder/node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "dev": true, + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/stdin-discarder/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/stdin-discarder/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/stdin-discarder/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -9236,6 +10516,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/stringify-attributes": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/stringify-attributes/-/stringify-attributes-4.0.0.tgz", + "integrity": "sha512-6Hq3K153wTTfhEHb4V/viuqmb0DRn08JCrRnmqc4Q/tmoNuvd4DEyqkiiJXtvVz8ZSUhlCQr7zCpCVTgrelesg==", + "dev": true, + "dependencies": { + "escape-goat": "^4.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -9369,6 +10664,37 @@ "integrity": "sha512-rCC0NWGKr/IJhtRuPq/t37qvZHI/mH4I4sxflVM+qgVe5Z2uOCivzWaVbuioJaB61kvm5UvB7b49E+oBY0M8jA==", "dev": true }, + "node_modules/syntax-error": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", + "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", + "dev": true, + "dependencies": { + "acorn-node": "^1.2.0" + } + }, + "node_modules/telegraf": { + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/telegraf/-/telegraf-4.16.3.tgz", + "integrity": "sha512-yjEu2NwkHlXu0OARWoNhJlIjX09dRktiMQFsM678BAH/PEPVwctzL67+tvXqLCRQQvm3SDtki2saGO9hLlz68w==", + "dev": true, + "dependencies": { + "@telegraf/types": "^7.1.0", + "abort-controller": "^3.0.0", + "debug": "^4.3.4", + "mri": "^1.2.0", + "node-fetch": "^2.7.0", + "p-timeout": "^4.1.0", + "safe-compare": "^1.1.4", + "sandwich-stream": "^2.0.2" + }, + "bin": { + "telegraf": "lib/cli.mjs" + }, + "engines": { + "node": "^12.20.0 || >=14.13.1" + } + }, "node_modules/temp-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", @@ -9471,9 +10797,9 @@ "dev": true }, "node_modules/thread-stream": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.4.1.tgz", - "integrity": "sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.7.0.tgz", + "integrity": "sha512-qQiRWsU/wvNolI6tbbCKd9iKaTnCXsTwVxhhKM6nctPdujTyztjlbUkUTUymidWcMnZ5pWR0ej4a0tjsW021vw==", "dev": true, "dependencies": { "real-require": "^0.2.0" @@ -9558,6 +10884,15 @@ "node": ">=0.6.0" } }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -9579,6 +10914,12 @@ "node": ">=12" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, "node_modules/traverse": { "version": "0.6.8", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.8.tgz", @@ -9591,6 +10932,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/truncatise": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/truncatise/-/truncatise-0.0.8.tgz", + "integrity": "sha512-cXzueh9pzBCsLzhToB4X4gZCb3KYkrsAcBAX97JnazE74HOl3cpBJYEV7nabHeG/6/WXCU5Yujlde/WPBUwnsg==", + "dev": true + }, "node_modules/ts-api-utils": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", @@ -9925,7 +11272,6 @@ "version": "13.11.0", "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==", - "dev": true, "engines": { "node": ">= 0.10" } @@ -9945,6 +11291,22 @@ "defaults": "^1.0.3" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index a952d24..251a87e 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "@athenna/template", - "version": "1.0.0", + "name": "@athenna/validator", + "version": "4.0.0", "description": "Template for new projects.", "license": "MIT", "author": "João Lenon ", - "bugs": "https://github.com/AthennaIO/Template/issues", - "repository": "https://github.com/AthennaIO/Template.git", - "homepage": "https://github.com/AthennaIO/Template#readme", + "bugs": "https://github.com/AthennaIO/Validator/issues", + "repository": "https://github.com/AthennaIO/Validator.git", + "homepage": "https://github.com/AthennaIO/Validator#readme", "keywords": [ "esm", "athenna" @@ -37,7 +37,9 @@ "./types": "./src/types/index.js", "./package": "./package.json", "./package.json": "./package.json", - "./testing/plugins": "./src/testing/plugins/index.js" + "./testing/plugins": "./src/testing/plugins/index.js", + "./providers/ValidatorProvider": "./src/providers/ValidatorProvider.js", + "./commands/MakeValidatorCommand": "./src/commands/MakeValidatorCommand.js" }, "imports": { "#bin/*": "./bin/*.js", @@ -49,10 +51,18 @@ "#tests/*": "./tests/*.js", "#tests": "./tests/index.js" }, + "dependencies": { + "@vinejs/vine": "^2.0.0" + }, "devDependencies": { - "@athenna/common": "^4.35.0", + "@athenna/artisan": "^4.42.0", + "@athenna/common": "^4.39.0", + "@athenna/config": "^4.21.0", + "@athenna/ioc": "^4.20.0", + "@athenna/logger": "^4.21.0", "@athenna/test": "^4.22.0", "@athenna/tsconfig": "^4.12.0", + "@athenna/view": "^4.22.0", "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", "commitizen": "^4.2.6", @@ -160,5 +170,15 @@ } ] } + }, + "athenna": { + "validators": [ + "#tests/fixtures/validators/AnnotatedValidator", + "#tests/fixtures/validators/HelloValidator", + "#tests/fixtures/validators/ProductValidator" + ], + "namedValidators": { + "hello": "#tests/fixtures/validators/HelloValidator" + } } } diff --git a/src/annotations/Validator.ts b/src/annotations/Validator.ts new file mode 100644 index 0000000..382cd29 --- /dev/null +++ b/src/annotations/Validator.ts @@ -0,0 +1,56 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import 'reflect-metadata' + +import { debug } from '#src/debug' +import { Annotation } from '@athenna/ioc' +import { Options, String } from '@athenna/common' +import type { ValidatorOptions } from '#src/types/validators/ValidatorOptions' + +/** + * Create a validator inside the service provider. + */ +export function Validator(options?: ValidatorOptions): ClassDecorator { + return (target: any) => { + options = Options.create(options, { + name: String.toCamelCase(target.name), + alias: `App/Validators/${target.name}`, + type: 'transient' + }) + + options.name = `App/Validators/Names/${options.name}` + + debug('Registering validator metadata for the service container %o', { + ...options, + name: target.name, + namedAlias: options.name + }) + + if (ioc.has(options.name)) { + debug( + 'Skipping registration, named alias %s is already registered.', + options.name + ) + + return + } + + if (ioc.has(options.alias)) { + debug( + 'Skipping registration, alias %s is already registered.', + options.alias + ) + + return + } + + Annotation.defineMeta(target, options) + } +} diff --git a/src/bootstrap/Bootstrap.ts b/src/bootstrap/Bootstrap.ts deleted file mode 100644 index e2a7963..0000000 --- a/src/bootstrap/Bootstrap.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @athenna/template - * - * (c) João Lenon - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -import { debug } from '#src/debug' - -export class Bootstrap { - /** - * Executes the application. - */ - public static main(...args: string[]): string { - debug('Executing application') - - return `Bootstrap: ${args.join(' ')}` - } -} diff --git a/src/commands/MakeValidatorCommand.ts b/src/commands/MakeValidatorCommand.ts new file mode 100644 index 0000000..39440fe --- /dev/null +++ b/src/commands/MakeValidatorCommand.ts @@ -0,0 +1,70 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { Path } from '@athenna/common' +import { BaseCommand, Argument, Option } from '@athenna/artisan' + +export class MakeValidatorCommand extends BaseCommand { + @Argument({ + description: 'The validator name.' + }) + public name: string + + @Option({ + default: true, + signature: '-h, --http', + description: 'Create a validator for a Http application.' + }) + public isHttp: boolean + + @Option({ + default: false, + signature: '-c, --console', + description: 'Create a validator for a Console (CLI) application.' + }) + public isConsole: boolean + + public static signature(): string { + return 'make:validator' + } + + public static description(): string { + return 'Make a new validator file.' + } + + public async handle(): Promise { + this.logger.simple('({bold,green} [ MAKING VALIDATOR ])\n') + + const destination = Config.get( + 'rc.commands.make:validator.destination', + Path.validators() + ) + + const template = this.isConsole ? 'validator-console' : 'validator-http' + + const file = await this.generator + .fileName(this.name) + .destination(destination) + .template(template) + .setNameProperties(true) + .make() + + this.logger.success( + `Validator ({yellow} "${file.name}") successfully created.` + ) + + const importPath = this.generator.getImportPath() + + await this.rc.pushTo('validators', importPath).save() + + this.logger.success( + `Athenna RC updated: ({dim,yellow} [ validators += "${importPath}" ])` + ) + } +} diff --git a/src/debug/index.ts b/src/debug/index.ts index 5b0da91..b4426ef 100644 --- a/src/debug/index.ts +++ b/src/debug/index.ts @@ -1,5 +1,5 @@ /** - * @athenna/template + * @athenna/validator * * (c) João Lenon * @@ -9,4 +9,4 @@ import { debuglog } from 'node:util' -export const debug = debuglog('athenna:template') +export const debug = debuglog('athenna:validator') diff --git a/src/exceptions/ValidationException.ts b/src/exceptions/ValidationException.ts new file mode 100644 index 0000000..2c448fb --- /dev/null +++ b/src/exceptions/ValidationException.ts @@ -0,0 +1,21 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { Exception } from '@athenna/common' + +export class ValidationException extends Exception { + public constructor(errors: any[]) { + const status = 422 + const message = 'Validation failure' + const code = 'E_VALIDATION_ERROR' + const details = errors + + super({ code, status, message, details }) + } +} diff --git a/src/facades/Validate.ts b/src/facades/Validate.ts new file mode 100644 index 0000000..c69db76 --- /dev/null +++ b/src/facades/Validate.ts @@ -0,0 +1,15 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { Facade } from '@athenna/ioc' +import type { ValidatorImpl } from '#src/validator/ValidatorImpl' + +export const Validate = Facade.createFor( + 'Athenna/Core/Validator' +) diff --git a/src/index.ts b/src/index.ts index 8132a58..2beb203 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ /** - * @athenna/template + * @athenna/validator * * (c) João Lenon * @@ -7,4 +7,43 @@ * file that was distributed with this source code. */ -export * from '#src/bootstrap/Bootstrap' +import vine, { + VineAny, + VineDate, + VineEnum, + VineTuple, + VineArray, + VineString, + VineRecord, + VineObject, + VineNumber, + VineLiteral, + VineBoolean, + VineAccepted, + SimpleErrorReporter +} from '@vinejs/vine' + +export * from '#src/types' +export * from '#src/facades/Validate' +export * from '#src/annotations/Validator' +export * from '#src/validator/BaseValidator' +export * from '#src/validator/ValidatorImpl' +export * from '#src/providers/ValidatorProvider' +export * from '#src/exceptions/ValidationException' + +export { + vine, + VineAny, + VineDate, + VineEnum, + VineTuple, + VineArray, + VineString, + VineRecord, + VineObject, + VineNumber, + VineLiteral, + VineBoolean, + VineAccepted, + SimpleErrorReporter +} diff --git a/src/providers/ValidatorProvider.ts b/src/providers/ValidatorProvider.ts new file mode 100644 index 0000000..2b5976b --- /dev/null +++ b/src/providers/ValidatorProvider.ts @@ -0,0 +1,109 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { sep } from 'node:path' +import { Config } from '@athenna/config' +import { SimpleErrorReporter } from '#src' +import { Exec, Module, Path } from '@athenna/common' +import { Annotation, ServiceProvider } from '@athenna/ioc' +import { ValidatorImpl } from '#src/validator/ValidatorImpl' +import { ValidationException } from '#src/exceptions/ValidationException' + +class ErrorReporter extends SimpleErrorReporter { + createError(): any { + return new ValidationException(this.errors) + } +} + +export class ValidatorProvider extends ServiceProvider { + public async register() { + const validator = new ValidatorImpl() + + validator.schema.errorReporter = () => new ErrorReporter() + + this.container.instance('Athenna/Core/Validator', validator) + + await this.registerValidators() + } + + public async registerValidators() { + const validators = Config.get('rc.validators', []) + + await Exec.concurrently(validators, async path => { + const Validator = await Module.resolve(path, this.getMeta()) + + if (Annotation.isAnnotated(Validator)) { + this.registerValidatorByMeta(Validator) + + return + } + + this.container.transient(`App/Validators/${Validator.name}`, Validator) + }) + + await this.registerNamedValidators() + } + + public async registerValidatorByMeta(validator: unknown) { + const meta = Annotation.getMeta(validator) + + this.container[meta.type](meta.alias, validator) + + if (meta.name) { + this.container.alias(meta.name, meta.alias) + } + + if (meta.camelAlias) { + this.container.alias(meta.camelAlias, meta.alias) + } + + return meta + } + + public async registerNamedValidators() { + const namedValidators = Config.get>( + 'rc.namedValidators', + {} + ) + + await Exec.concurrently(Object.keys(namedValidators), async key => { + const Validator = await Module.resolve( + namedValidators[key], + this.getMeta() + ) + + if (Annotation.isAnnotated(Validator)) { + this.registerValidatorByMeta(Validator) + + return + } + + const { alias, namedAlias } = this.getNamedValidatorAlias(key, Validator) + + this.container.bind(alias, Validator).alias(namedAlias, alias) + }) + } + + /** + * Get the meta URL of the project. + */ + public getMeta() { + return Config.get('rc.parentURL', Path.toHref(Path.pwd() + sep)) + } + + /** + * Fabricate the named validator aliases. + */ + public getNamedValidatorAlias(name: string, Validator: any) { + return { + alias: `App/Validators/${Validator.name}`, + namedAlias: `App/Validators/Names/${name}` + } + } +} diff --git a/src/types/ExtendHandler.ts b/src/types/ExtendHandler.ts new file mode 100644 index 0000000..4a61ede --- /dev/null +++ b/src/types/ExtendHandler.ts @@ -0,0 +1,16 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import type { FieldContext } from '#src/types' + +export type ExtendHandlerType = ( + value: unknown, + options: any, + field: FieldContext +) => any | Promise diff --git a/src/types/index.ts b/src/types/index.ts index fd2e276..c41b604 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,8 +1,17 @@ /** - * @athenna/template + * @athenna/validator * * (c) João Lenon * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + +import type { + FieldContext, + SchemaTypes, + ErrorReporterContract +} from '@vinejs/vine/types' + +export * from '#src/types/ExtendHandler' +export type { FieldContext, SchemaTypes, ErrorReporterContract } diff --git a/src/types/validators/ValidatorOptions.ts b/src/types/validators/ValidatorOptions.ts new file mode 100644 index 0000000..228d0f5 --- /dev/null +++ b/src/types/validators/ValidatorOptions.ts @@ -0,0 +1,45 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +export type ValidatorOptions = { + /** + * The alias that will be used to register the validator inside + * the service container. + * + * @default App/Validators/YourValidatorClassName + */ + alias?: string + + /** + * The camel alias that will be used as an alias of the real + * validator alias. Camel alias is important when you want to + * work with constructor injection. By default, Athenna doesn't + * create camel alias for validators. + * + * @default undefined + */ + camelAlias?: string + + /** + * The registration type that will be used to register your validator + * inside the service container. + * + * @default 'transient' + */ + type?: 'fake' | 'scoped' | 'singleton' | 'transient' + + /** + * Set the name of your validator to be used inside routes. Athenna + * will always set the default name of your validator as the validator + * class name in camel case format. + * + * @default 'yourValidatorClassName' + */ + name?: string +} diff --git a/src/validator/BaseValidator.ts b/src/validator/BaseValidator.ts new file mode 100644 index 0000000..88e630b --- /dev/null +++ b/src/validator/BaseValidator.ts @@ -0,0 +1,22 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import type { SchemaTypes } from '#src/types' +import { Validate } from '#src/facades/Validate' + +export abstract class BaseValidator { + public validator = Validate.schema + + public abstract schema: SchemaTypes + public abstract handle(data: any): Promise + + public validate(data: any) { + return this.validator.validate({ schema: this.schema, data }) + } +} diff --git a/src/validator/ValidatorImpl.ts b/src/validator/ValidatorImpl.ts new file mode 100644 index 0000000..3eec984 --- /dev/null +++ b/src/validator/ValidatorImpl.ts @@ -0,0 +1,170 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { + vine, + VineAccepted, + VineAny, + VineArray, + VineBoolean, + VineDate, + VineEnum, + VineLiteral, + VineNumber, + VineObject, + VineRecord, + VineString, + VineTuple +} from '#src' + +import type { ExtendHandlerType } from '#src/types' + +export class ValidatorImpl { + /** + * This getter will return the vine instance to + * build your validation schemas: + * + * ```ts + * const schema = Validator.schema.object({ + * name: Validator.schema.string(), + * email: Validator.schema.string().email(), + * password: Validator.schema.string().minLength(8).maxLength(32).confirmed() + * }) + * ``` + */ + public get schema() { + return vine + } + + /** + * Extend vine validation schema by adding new + * validation rules: + * + * ```ts + * Validator.extend().string('unique', (value, options, field) => { + * if (!options.column) { + * options.column = field.name as string + * } + * + * const existsRow = await Database.table(options.table) + * .select(options.column) + * .where(options.column, value) + * .exists() + * + * if (existsRow) { + * field.report('The {{ field }} field is not unique', 'unique', field) + * } + * }) + * ``` + */ + public extend() { + const macro = (Vine: any, name: string, handler: any) => { + Vine.macro(name, handler) + } + + return { + accepted: (name: string, handler: ExtendHandlerType) => { + macro(VineAccepted, name, function (this: VineAccepted, opt: any) { + const rule = vine.createRule(handler) + return this.use(rule(opt)) + }) + + return this + }, + date: (name: string, handler: ExtendHandlerType) => { + macro(VineDate, name, function (this: VineDate, opt: any) { + const rule = vine.createRule(handler) + return this.use(rule(opt)) + }) + + return this + }, + record: (name: string, handler: ExtendHandlerType) => { + macro(VineRecord, name, function (this: VineRecord, opt: any) { + const rule = vine.createRule(handler) + return this.use(rule(opt)) + }) + + return this + }, + tuple: (name: string, handler: ExtendHandlerType) => { + macro(VineTuple, name, function (this: any, opt: any) { + const rule = vine.createRule(handler) + return this.use(rule(opt)) + }) + + return this + }, + literal: (name: string, handler: ExtendHandlerType) => { + macro(VineLiteral, name, function (this: VineLiteral, opt: any) { + const rule = vine.createRule(handler) + return this.use(rule(opt)) + }) + + return this + }, + array: (name: string, handler: ExtendHandlerType) => { + macro(VineArray, name, function (this: VineArray, opt: any) { + const rule = vine.createRule(handler) + return this.use(rule(opt)) + }) + + return this + }, + any: (name: string, handler: ExtendHandlerType) => { + macro(VineAny, name, function (this: VineAny, opt: any) { + const rule = vine.createRule(handler) + return this.use(rule(opt)) + }) + + return this + }, + string: (name: string, handler: ExtendHandlerType) => { + macro(VineString, name, function (this: VineString, opt: any) { + const rule = vine.createRule(handler) + return this.use(rule(opt)) + }) + + return this + }, + number: (name: string, handler: ExtendHandlerType) => { + macro(VineNumber, name, function (this: VineNumber, opt: any) { + const rule = vine.createRule(handler) + return this.use(rule(opt)) + }) + + return this + }, + enum: (name: string, handler: ExtendHandlerType) => { + macro(VineEnum, name, function (this: VineEnum, opt: any) { + const rule = vine.createRule(handler) + return this.use(rule(opt)) + }) + + return this + }, + boolean: (name: string, handler: ExtendHandlerType) => { + macro(VineBoolean, name, function (this: VineBoolean, opt: any) { + const rule = vine.createRule(handler) + return this.use(rule(opt)) + }) + + return this + }, + object: (name: string, handler: ExtendHandlerType) => { + macro(VineObject, name, function (this: any, opt: any) { + const rule = vine.createRule(handler) + return this.use(rule(opt)) + }) + + return this + } + } + } +} diff --git a/templates/validator-console.edge b/templates/validator-console.edge new file mode 100644 index 0000000..26d7cae --- /dev/null +++ b/templates/validator-console.edge @@ -0,0 +1,12 @@ +import { Validator, BaseValidator } from '@athenna/validator' + +@Validator() +export class {{ namePascal }} extends BaseValidator { + public schema = this.validator.object({ + name: this.validator.string() + }) + + public async handle(data: any) { + await this.validate(data) + } +} diff --git a/templates/validator-http.edge b/templates/validator-http.edge new file mode 100644 index 0000000..8c19dcd --- /dev/null +++ b/templates/validator-http.edge @@ -0,0 +1,15 @@ +import type { Context } from '@athenna/http' +import { Validator, BaseValidator } from '@athenna/validator' + +@Validator() +export class {{ namePascal }} extends BaseValidator { + public schema = this.validator.object({ + name: this.validator.string() + }) + + public async handle({ request }: Context) { + const data = request.body + + await this.validate(data) + } +} diff --git a/tests/fixtures/.gitkeep b/tests/fixtures/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fixtures/config/rc.ts b/tests/fixtures/config/rc.ts new file mode 100644 index 0000000..b842aa0 --- /dev/null +++ b/tests/fixtures/config/rc.ts @@ -0,0 +1,16 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { Path, File } from '@athenna/common' + +const athennaRc = new File(Path.pwd('package.json')).getContentAsJsonSync().athenna + +athennaRc.isInPackageJson = true + +export default athennaRc diff --git a/tests/fixtures/validators/AnnotatedValidator.ts b/tests/fixtures/validators/AnnotatedValidator.ts new file mode 100644 index 0000000..9d14fed --- /dev/null +++ b/tests/fixtures/validators/AnnotatedValidator.ts @@ -0,0 +1,26 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { Validator } from '#src/annotations/Validator' +import { BaseValidator } from '#src/validator/BaseValidator' + +@Validator({ + name: 'annotated', + alias: 'annotatedValidator', + type: 'singleton' +}) +export class AnnotatedValidator extends BaseValidator { + public schema = this.validator.object({ + name: this.validator.string() + }) + + public async handle(data: any) { + await this.validate(data) + } +} diff --git a/tests/fixtures/validators/HelloValidator.ts b/tests/fixtures/validators/HelloValidator.ts new file mode 100644 index 0000000..fed4df3 --- /dev/null +++ b/tests/fixtures/validators/HelloValidator.ts @@ -0,0 +1,20 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { BaseValidator } from '#src/validator/BaseValidator' + +export class HelloValidator extends BaseValidator { + public schema = this.validator.object({ + name: this.validator.string() + }) + + public async handle(data: any) { + await this.validate(data) + } +} diff --git a/tests/fixtures/validators/ProductValidator.ts b/tests/fixtures/validators/ProductValidator.ts new file mode 100644 index 0000000..8e6c527 --- /dev/null +++ b/tests/fixtures/validators/ProductValidator.ts @@ -0,0 +1,22 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { Validator } from '#src/annotations/Validator' +import { BaseValidator } from '#src/validator/BaseValidator' + +@Validator() +export class ProductValidator extends BaseValidator { + public schema = this.validator.object({ + name: this.validator.string() + }) + + public async handle(data: any) { + await this.validate(data) + } +} diff --git a/tests/helpers/BaseTest.ts b/tests/helpers/BaseTest.ts new file mode 100644 index 0000000..9b58401 --- /dev/null +++ b/tests/helpers/BaseTest.ts @@ -0,0 +1,31 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { Module } from '@athenna/common' +import { AfterEach } from '@athenna/test' + +export class BaseTest { + @AfterEach() + public baseAfterEach() { + ioc.reconstruct() + } + + /** + * Safe import a module, avoiding cache and if + * the module is not found, return null. + */ + public async import(path: string): Promise { + try { + return await Module.get(import(`${path}.js?version=${Math.random()}`)) + } catch (error) { + console.log(error) + return null + } + } +} diff --git a/tests/unit/TemplateTest.ts b/tests/unit/TemplateTest.ts deleted file mode 100644 index e78bab2..0000000 --- a/tests/unit/TemplateTest.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @athenna/template - * - * (c) João Lenon - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -import { Bootstrap } from '#src' -import { Test, type Context } from '@athenna/test' - -export default class TemplateTest { - @Test() - public async shouldBeAbleToCreateAndRunTestsWithThisTemplate({ assert }: Context) { - assert.equal(Bootstrap.main('Hello', 'World!'), 'Bootstrap: Hello World!') - } -} diff --git a/tests/unit/annotations/ValidatorAnnotationTest.ts b/tests/unit/annotations/ValidatorAnnotationTest.ts new file mode 100644 index 0000000..aa40433 --- /dev/null +++ b/tests/unit/annotations/ValidatorAnnotationTest.ts @@ -0,0 +1,37 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { Annotation } from '@athenna/ioc' +import { BaseTest } from '#tests/helpers/BaseTest' +import { Test, type Context, Cleanup } from '@athenna/test' + +export default class ValidatorAnnotationTest extends BaseTest { + @Test() + public async shouldBeAbleToPreregisterValidatorsUsingValidatorAnnotation({ assert }: Context) { + const ProductValidator = await this.import('#tests/fixtures/validators/ProductValidator') + + const metadata = Annotation.getMeta(ProductValidator) + + assert.isFalse(metadata.registered) + assert.isUndefined(metadata.camelAlias) + assert.equal(metadata.type, 'transient') + assert.equal(metadata.alias, 'App/Validators/ProductValidator') + assert.equal(metadata.name, 'App/Validators/Names/productValidator') + } + + @Test() + @Cleanup(() => ioc.reconstruct()) + public async shouldNotReRegisterTheValidatorIfItIsAlreadyRegisteredInTheServiceContainer({ assert }: Context) { + ioc.singleton('App/Validators/ProductValidator', () => {}) + + const ProductValidator = await this.import('#tests/fixtures/validators/ProductValidator') + + assert.isFalse(Annotation.isAnnotated(ProductValidator)) + } +} diff --git a/tests/unit/commands/MakeValidatorCommandTest.ts b/tests/unit/commands/MakeValidatorCommandTest.ts new file mode 100644 index 0000000..1d946cc --- /dev/null +++ b/tests/unit/commands/MakeValidatorCommandTest.ts @@ -0,0 +1,10 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +export class MakeValidatorCommandTest {} diff --git a/tests/unit/providers/ValidatorProviderTest.ts b/tests/unit/providers/ValidatorProviderTest.ts new file mode 100644 index 0000000..c82b104 --- /dev/null +++ b/tests/unit/providers/ValidatorProviderTest.ts @@ -0,0 +1,64 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { Path } from '@athenna/common' +import { Validate, ValidatorProvider } from '#src' +import { Test, Mock, AfterEach, type Context, BeforeEach } from '@athenna/test' + +export class ValidatorProviderTest { + @BeforeEach() + public async beforeEach() { + await Config.loadAll(Path.fixtures('config')) + } + + @AfterEach() + public async afterEach() { + Mock.restoreAll() + ioc.reconstruct() + Config.clear() + } + + @Test() + public async shouldBeAbleToRegisterValidatorImplementationInTheContainer({ assert }: Context) { + await new ValidatorProvider().register() + + assert.isTrue(ioc.has('Athenna/Core/Validator')) + } + + @Test() + public async shouldBeAbleToUseValidatorImplementationFromFacade({ assert }: Context) { + await new ValidatorProvider().register() + + assert.isDefined(Validate.schema) + } + + @Test() + public async shouldBeAbleToRegisterAllValidatorsFromAthennaRc({ assert }: Context) { + await new ValidatorProvider().register() + + assert.isTrue(ioc.has('annotatedValidator')) + assert.isTrue(ioc.has('App/Validators/HelloValidator')) + assert.isTrue(ioc.has('App/Validators/ProductValidator')) + } + + @Test() + public async shouldBeAbleToRegisterNamedValidatorsDefinedInValidatorsOfAthennaRc({ assert }: Context) { + await new ValidatorProvider().register() + + assert.isTrue(ioc.has('App/Validators/Names/annotated')) + assert.isTrue(ioc.has('App/Validators/Names/productValidator')) + } + + @Test() + public async shouldBeAbleToRegisterNamedValidatorsDefinedInAthennaRc({ assert }: Context) { + await new ValidatorProvider().register() + + assert.isTrue(ioc.has('App/Validators/Names/hello')) + } +} diff --git a/tests/unit/validator/BaseValidatorTest.ts b/tests/unit/validator/BaseValidatorTest.ts new file mode 100644 index 0000000..73a774b --- /dev/null +++ b/tests/unit/validator/BaseValidatorTest.ts @@ -0,0 +1,10 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +export class BaseValidatorTest {} diff --git a/tests/unit/validator/ValidatorImplTest.ts b/tests/unit/validator/ValidatorImplTest.ts new file mode 100644 index 0000000..07b575d --- /dev/null +++ b/tests/unit/validator/ValidatorImplTest.ts @@ -0,0 +1,10 @@ +/** + * @athenna/validator + * + * (c) João Lenon + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +export class ValidatorImplTest {}