@adonisjs/core 6.1.5-8 → 6.1.5-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/commands/commands.json +1 -1
- package/build/factories/core/ignitor.js +1 -1
- package/build/modules/http/main.d.ts +2 -0
- package/build/modules/http/main.js +10 -0
- package/build/modules/http/request_validator.d.ts +44 -0
- package/build/modules/http/request_validator.js +74 -0
- package/build/providers/http_provider.js +1 -1
- package/build/providers/repl_provider.js +5 -1
- package/build/src/cli_formatters/routes_list.d.ts +1 -1
- package/build/src/test_utils/main.d.ts +2 -2
- package/build/src/test_utils/main.js +1 -1
- package/build/src/types.d.ts +1 -1
- package/build/src/vinejs/extensions/main.d.ts +1 -0
- package/build/{modules/http.js → src/vinejs/extensions/main.js} +1 -1
- package/build/src/vinejs/extensions/validates_files.d.ts +22 -0
- package/build/src/vinejs/extensions/validates_files.js +76 -0
- package/package.json +18 -12
- package/build/modules/http.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"commands":[{"commandName":"build","description":"Build application for production by compiling frontend assets and TypeScript source to JavaScript","help":["Create the production build using the following command.","```","{{ binaryName }} build","```","","The assets bundler dev server runs automatically after detecting vite config or webpack config files","You may pass vite CLI args using the --assets-args command line flag.","```","{{ binaryName }} build --assets-args=\"--debug --base=/public\"","```"],"namespace":null,"aliases":[],"flags":[{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change"},{"name":"ignoreTsErrors","flagName":"ignore-ts-errors","required":false,"type":"boolean","description":"Ignore TypeScript errors and continue with the build process"},{"name":"packageManager","flagName":"package-manager","required":false,"type":"string","description":"Select the package manager you want to use to install production dependencies"},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Build frontend assets","showNegatedVariantInHelp":true,"default":true},{"name":"assetsArgs","flagName":"assets-args","required":false,"type":"array","description":"Define CLI arguments to pass to the assets bundler"}],"args":[],"options":{},"filePath":"build.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/build.js"},{"commandName":"configure","description":"Configure a package post installation","help":"","namespace":null,"aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Display logs in verbose mode"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Package name","type":"string"}],"options":{},"filePath":"configure.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/configure.js"},{"commandName":"eject","description":"Eject scaffolding stubs to your application root","help":"","namespace":null,"aliases":[],"flags":[{"name":"pkg","flagName":"pkg","required":false,"type":"string","description":"Mention package name for searching stubs","default":"@adonisjs/core"}],"args":[{"name":"stubPath","argumentName":"stub-path","required":true,"description":"Path to the stubs directory or a single stub file","type":"string"}],"options":{},"filePath":"eject.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/eject.js"},{"commandName":"generate:key","description":"Generate a secure random application key","help":"","namespace":"generate","aliases":[],"flags":[{"name":"show","flagName":"show","required":false,"type":"boolean","description":"Display the key on the terminal, instead of writing it to .env file"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Force update .env file in production environment"}],"args":[],"options":{},"filePath":"generate_key.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/generate_key.js"},{"commandName":"inspect:rcfile","description":"Inspect the RC file with its default values","help":"","namespace":"inspect","aliases":[],"flags":[],"args":[],"options":{},"filePath":"inspect_rcfile.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/inspect_rcfile.js"},{"commandName":"list:routes","description":"List application routes. This command will boot the application in the console environment","help":"","namespace":"list","aliases":[],"flags":[{"name":"middleware","flagName":"middleware","required":false,"type":"array","description":"View routes that includes all the mentioned middleware names. Use * to see routes that are using one or more middleware"},{"name":"ignoreMiddleware","flagName":"ignore-middleware","required":false,"type":"array","description":"View routes that does not include all the mentioned middleware names. Use * to see routes that are using zero middleware"},{"name":"json","flagName":"json","required":false,"type":"boolean","description":"Get routes list as a JSON string"},{"name":"table","flagName":"table","required":false,"type":"boolean","description":"View list of routes as a table"}],"args":[{"name":"match","argumentName":"match","required":false,"description":"Find routes matching the given keyword. Route name, pattern and controller name will be searched against the keyword","type":"string"}],"options":{"startApp":true},"filePath":"list/routes.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/list/routes.js"},{"commandName":"make:command","description":"Create a new ace command class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the command","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/command.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/make/command.js"},{"commandName":"make:controller","description":"Create a new HTTP controller class","help":"","namespace":"make","aliases":[],"flags":[{"name":"singular","flagName":"singular","required":false,"type":"boolean","description":"Convert controller class and file name to its singular form","alias":"r"},{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Generate controller with resource actions","alias":"r"},{"name":"api","flagName":"api","required":false,"type":"boolean","description":"Generate controller with api resource actions","alias":"a"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"The name of the controller","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/controller.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/make/controller.js"},{"commandName":"make:event","description":"Create a new event class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the event","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/event.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/make/event.js"},{"commandName":"make:exception","description":"Create a new ace exception class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the exception","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/exception.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/make/exception.js"},{"commandName":"make:listener","description":"Create a new event listener class","help":"","namespace":"make","aliases":[],"flags":[{"name":"event","flagName":"event","required":false,"type":"string","description":"Generate an event class alongside the listener","alias":"e"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the listener","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/listener.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/make/listener.js"},{"commandName":"make:middleware","description":"Create a new middleware class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the middleware","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/middleware.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/make/middleware.js"},{"commandName":"make:preload","description":"Create a new preload file inside the start directory","help":"","namespace":"make","aliases":[],"flags":[{"name":"environments","flagName":"environments","required":false,"type":"array","description":"Define the preload file's environment. Accepted values are \"web,console,test,repl\""}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the preload file","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/preload.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/make/preload.js"},{"commandName":"make:provider","description":"Create a new service provider class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the provider","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/provider.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/make/provider.js"},{"commandName":"make:service","description":"Create a new service class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the service","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/service.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/make/service.js"},{"commandName":"make:test","description":"Create a new Japa test file","help":"","namespace":"make","aliases":[],"flags":[{"name":"suite","flagName":"suite","required":false,"type":"string","description":"The suite for which to create the test file"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the test file","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/test.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/make/test.js"},{"commandName":"repl","description":"Start a new REPL session","help":"","namespace":null,"aliases":[],"flags":[],"args":[],"options":{"startApp":true,"staysAlive":true},"filePath":"repl.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/repl.js"},{"commandName":"serve","description":"Start the development HTTP server along with the file watcher to perform restarts on file change","help":["Start the development server with file watcher using the following command.","```","{{ binaryName }} serve --watch","```","","The assets bundler dev server runs automatically after detecting vite config or webpack config files","You may pass vite CLI args using the --assets-args command line flag.","```","{{ binaryName }} serve --assets-args=\"--debug --base=/public\"","```"],"namespace":null,"aliases":[],"flags":[{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Start assets bundler dev server","showNegatedVariantInHelp":true,"default":true},{"name":"assetsArgs","flagName":"assets-args","required":false,"type":"array","description":"Define CLI arguments to pass to the assets bundler"}],"args":[],"options":{"staysAlive":true},"filePath":"serve.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/serve.js"},{"commandName":"test","description":"Run tests along with the file watcher to re-run tests on file change","help":"","namespace":null,"aliases":[],"flags":[{"name":"files","flagName":"files","required":false,"type":"array","description":"Filter tests by the filename"},{"name":"tags","flagName":"tags","required":false,"type":"array","description":"Filter tests by tags"},{"name":"groups","flagName":"groups","required":false,"type":"array","description":"Filter tests by parent group title"},{"name":"tests","flagName":"tests","required":false,"type":"array","description":"Filter tests by test title"},{"name":"reporters","flagName":"reporters","required":false,"type":"array","description":"Activate one or more test reporters"},{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and re-run tests on file change"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes"},{"name":"timeout","flagName":"timeout","required":false,"type":"number","description":"Define default timeout for all tests"},{"name":"retries","flagName":"retries","required":false,"type":"number","description":"Define default retries for all tests"},{"name":"failed","flagName":"failed","required":false,"type":"boolean","description":"Execute tests failed during the last run"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Start assets bundler dev server.","showNegatedVariantInHelp":true,"default":true},{"name":"assetsArgs","flagName":"assets-args","required":false,"type":"array","description":"Define CLI arguments to pass to the assets bundler"}],"args":[{"name":"suites","argumentName":"suites","required":false,"description":"Mention suite names to run tests for selected suites","type":"spread"}],"options":{"allowUnknownFlags":true,"staysAlive":true},"filePath":"test.js","absoluteFilePath":"C:/Users/Julien/Documents/Taff/adonis/core/build/commands/test.js"}],"version":1}
|
|
1
|
+
{"commands":[{"commandName":"build","description":"Build application for production by compiling frontend assets and TypeScript source to JavaScript","help":["Create the production build using the following command.","```","{{ binaryName }} build","```","","The assets bundler dev server runs automatically after detecting vite config or webpack config files","You may pass vite CLI args using the --assets-args command line flag.","```","{{ binaryName }} build --assets-args=\"--debug --base=/public\"","```"],"namespace":null,"aliases":[],"flags":[{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change"},{"name":"ignoreTsErrors","flagName":"ignore-ts-errors","required":false,"type":"boolean","description":"Ignore TypeScript errors and continue with the build process"},{"name":"packageManager","flagName":"package-manager","required":false,"type":"string","description":"Select the package manager you want to use to install production dependencies"},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Build frontend assets","showNegatedVariantInHelp":true,"default":true},{"name":"assetsArgs","flagName":"assets-args","required":false,"type":"array","description":"Define CLI arguments to pass to the assets bundler"}],"args":[],"options":{},"filePath":"build.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/build.js"},{"commandName":"configure","description":"Configure a package post installation","help":"","namespace":null,"aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Display logs in verbose mode"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Package name","type":"string"}],"options":{},"filePath":"configure.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/configure.js"},{"commandName":"eject","description":"Eject scaffolding stubs to your application root","help":"","namespace":null,"aliases":[],"flags":[{"name":"pkg","flagName":"pkg","required":false,"type":"string","description":"Mention package name for searching stubs","default":"@adonisjs/core"}],"args":[{"name":"stubPath","argumentName":"stub-path","required":true,"description":"Path to the stubs directory or a single stub file","type":"string"}],"options":{},"filePath":"eject.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/eject.js"},{"commandName":"generate:key","description":"Generate a secure random application key","help":"","namespace":"generate","aliases":[],"flags":[{"name":"show","flagName":"show","required":false,"type":"boolean","description":"Display the key on the terminal, instead of writing it to .env file"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Force update .env file in production environment"}],"args":[],"options":{},"filePath":"generate_key.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/generate_key.js"},{"commandName":"inspect:rcfile","description":"Inspect the RC file with its default values","help":"","namespace":"inspect","aliases":[],"flags":[],"args":[],"options":{},"filePath":"inspect_rcfile.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/inspect_rcfile.js"},{"commandName":"list:routes","description":"List application routes. This command will boot the application in the console environment","help":"","namespace":"list","aliases":[],"flags":[{"name":"middleware","flagName":"middleware","required":false,"type":"array","description":"View routes that includes all the mentioned middleware names. Use * to see routes that are using one or more middleware"},{"name":"ignoreMiddleware","flagName":"ignore-middleware","required":false,"type":"array","description":"View routes that does not include all the mentioned middleware names. Use * to see routes that are using zero middleware"},{"name":"json","flagName":"json","required":false,"type":"boolean","description":"Get routes list as a JSON string"},{"name":"table","flagName":"table","required":false,"type":"boolean","description":"View list of routes as a table"}],"args":[{"name":"match","argumentName":"match","required":false,"description":"Find routes matching the given keyword. Route name, pattern and controller name will be searched against the keyword","type":"string"}],"options":{"startApp":true},"filePath":"list/routes.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/list/routes.js"},{"commandName":"make:command","description":"Create a new ace command class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the command","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/command.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/command.js"},{"commandName":"make:controller","description":"Create a new HTTP controller class","help":"","namespace":"make","aliases":[],"flags":[{"name":"singular","flagName":"singular","required":false,"type":"boolean","description":"Convert controller class and file name to its singular form","alias":"r"},{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Generate controller with resource actions","alias":"r"},{"name":"api","flagName":"api","required":false,"type":"boolean","description":"Generate controller with api resource actions","alias":"a"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"The name of the controller","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/controller.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/controller.js"},{"commandName":"make:event","description":"Create a new event class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the event","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/event.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/event.js"},{"commandName":"make:exception","description":"Create a new ace exception class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the exception","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/exception.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/exception.js"},{"commandName":"make:listener","description":"Create a new event listener class","help":"","namespace":"make","aliases":[],"flags":[{"name":"event","flagName":"event","required":false,"type":"string","description":"Generate an event class alongside the listener","alias":"e"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the listener","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/listener.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/listener.js"},{"commandName":"make:middleware","description":"Create a new middleware class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the middleware","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/middleware.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/middleware.js"},{"commandName":"make:preload","description":"Create a new preload file inside the start directory","help":"","namespace":"make","aliases":[],"flags":[{"name":"environments","flagName":"environments","required":false,"type":"array","description":"Define the preload file's environment. Accepted values are \"web,console,test,repl\""}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the preload file","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/preload.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/preload.js"},{"commandName":"make:provider","description":"Create a new service provider class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the provider","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/provider.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/provider.js"},{"commandName":"make:service","description":"Create a new service class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the service","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/service.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/service.js"},{"commandName":"make:test","description":"Create a new Japa test file","help":"","namespace":"make","aliases":[],"flags":[{"name":"suite","flagName":"suite","required":false,"type":"string","description":"The suite for which to create the test file"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the test file","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/test.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/test.js"},{"commandName":"repl","description":"Start a new REPL session","help":"","namespace":null,"aliases":[],"flags":[],"args":[],"options":{"startApp":true,"staysAlive":true},"filePath":"repl.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/repl.js"},{"commandName":"serve","description":"Start the development HTTP server along with the file watcher to perform restarts on file change","help":["Start the development server with file watcher using the following command.","```","{{ binaryName }} serve --watch","```","","The assets bundler dev server runs automatically after detecting vite config or webpack config files","You may pass vite CLI args using the --assets-args command line flag.","```","{{ binaryName }} serve --assets-args=\"--debug --base=/public\"","```"],"namespace":null,"aliases":[],"flags":[{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Start assets bundler dev server","showNegatedVariantInHelp":true,"default":true},{"name":"assetsArgs","flagName":"assets-args","required":false,"type":"array","description":"Define CLI arguments to pass to the assets bundler"}],"args":[],"options":{"staysAlive":true},"filePath":"serve.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/serve.js"},{"commandName":"test","description":"Run tests along with the file watcher to re-run tests on file change","help":"","namespace":null,"aliases":[],"flags":[{"name":"files","flagName":"files","required":false,"type":"array","description":"Filter tests by the filename"},{"name":"tags","flagName":"tags","required":false,"type":"array","description":"Filter tests by tags"},{"name":"groups","flagName":"groups","required":false,"type":"array","description":"Filter tests by parent group title"},{"name":"tests","flagName":"tests","required":false,"type":"array","description":"Filter tests by test title"},{"name":"reporters","flagName":"reporters","required":false,"type":"array","description":"Activate one or more test reporters"},{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and re-run tests on file change"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes"},{"name":"timeout","flagName":"timeout","required":false,"type":"number","description":"Define default timeout for all tests"},{"name":"retries","flagName":"retries","required":false,"type":"number","description":"Define default retries for all tests"},{"name":"failed","flagName":"failed","required":false,"type":"boolean","description":"Execute tests failed during the last run"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Start assets bundler dev server.","showNegatedVariantInHelp":true,"default":true},{"name":"assetsArgs","flagName":"assets-args","required":false,"type":"array","description":"Define CLI arguments to pass to the assets bundler"}],"args":[{"name":"suites","argumentName":"suites","required":false,"description":"Mention suite names to run tests for selected suites","type":"spread"}],"options":{"allowUnknownFlags":true,"staysAlive":true},"filePath":"test.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/test.js"}],"version":1}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
import { Ignitor } from '../../src/ignitor/main.js';
|
|
10
|
-
import { defineConfig as defineHttpConfig } from '../../modules/http.js';
|
|
10
|
+
import { defineConfig as defineHttpConfig } from '../../modules/http/main.js';
|
|
11
11
|
import { defineConfig as defineLoggerConfig } from '../../modules/logger.js';
|
|
12
12
|
import { defineConfig as defineHashConfig } from '../../modules/hash/main.js';
|
|
13
13
|
import { defineConfig as defineBodyParserConfig } from '../../modules/bodyparser/main.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/core
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
export * from '@adonisjs/http-server';
|
|
10
|
+
export { RequestValidator } from './request_validator.js';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type VineValidator } from '@vinejs/vine';
|
|
2
|
+
import type { Infer, SchemaTypes, ValidationOptions, ErrorReporterContract, MessagesProviderContact } from '@vinejs/vine/types';
|
|
3
|
+
import { type HttpContext } from '@adonisjs/http-server';
|
|
4
|
+
/**
|
|
5
|
+
* Request validation options with custom data as well
|
|
6
|
+
*/
|
|
7
|
+
type RequestValidationOptions<MetaData extends undefined | Record<string, any>> = ValidationOptions<MetaData> & {
|
|
8
|
+
data?: any;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Request validator is used validate HTTP request data using
|
|
12
|
+
* VineJS validators. You may validate the request body,
|
|
13
|
+
* files, cookies, and headers.
|
|
14
|
+
*/
|
|
15
|
+
export declare class RequestValidator {
|
|
16
|
+
#private;
|
|
17
|
+
constructor(ctx: HttpContext);
|
|
18
|
+
/**
|
|
19
|
+
* The error reporter method returns the error reporter
|
|
20
|
+
* to use for reporting errors.
|
|
21
|
+
*
|
|
22
|
+
* You can use this function to pick a different error reporter
|
|
23
|
+
* for each HTTP request
|
|
24
|
+
*/
|
|
25
|
+
static errorReporter?: (_: HttpContext) => ErrorReporterContract;
|
|
26
|
+
/**
|
|
27
|
+
* The messages provider method returns the messages provider to use
|
|
28
|
+
* finding custom error messages
|
|
29
|
+
*
|
|
30
|
+
* You can use this function to pick a different messages provider for
|
|
31
|
+
* each HTTP request
|
|
32
|
+
*/
|
|
33
|
+
static messagesProvider?: (_: HttpContext) => MessagesProviderContact;
|
|
34
|
+
/**
|
|
35
|
+
* The validate method can be used to validate the request
|
|
36
|
+
* data for the current request using VineJS validators
|
|
37
|
+
*/
|
|
38
|
+
validateUsing<Schema extends SchemaTypes, MetaData extends undefined | Record<string, any>>(validator: VineValidator<Schema, MetaData>, ...[options]: [undefined] extends MetaData ? [options?: RequestValidationOptions<MetaData> | undefined] : [options: RequestValidationOptions<MetaData>]): Promise<Infer<Schema>>;
|
|
39
|
+
}
|
|
40
|
+
declare module '@adonisjs/http-server' {
|
|
41
|
+
interface Request extends RequestValidator {
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/core
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
import { Request } from '@adonisjs/http-server';
|
|
10
|
+
/**
|
|
11
|
+
* Request validator is used validate HTTP request data using
|
|
12
|
+
* VineJS validators. You may validate the request body,
|
|
13
|
+
* files, cookies, and headers.
|
|
14
|
+
*/
|
|
15
|
+
export class RequestValidator {
|
|
16
|
+
#ctx;
|
|
17
|
+
constructor(ctx) {
|
|
18
|
+
this.#ctx = ctx;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The error reporter method returns the error reporter
|
|
22
|
+
* to use for reporting errors.
|
|
23
|
+
*
|
|
24
|
+
* You can use this function to pick a different error reporter
|
|
25
|
+
* for each HTTP request
|
|
26
|
+
*/
|
|
27
|
+
static errorReporter;
|
|
28
|
+
/**
|
|
29
|
+
* The messages provider method returns the messages provider to use
|
|
30
|
+
* finding custom error messages
|
|
31
|
+
*
|
|
32
|
+
* You can use this function to pick a different messages provider for
|
|
33
|
+
* each HTTP request
|
|
34
|
+
*/
|
|
35
|
+
static messagesProvider;
|
|
36
|
+
/**
|
|
37
|
+
* The validate method can be used to validate the request
|
|
38
|
+
* data for the current request using VineJS validators
|
|
39
|
+
*/
|
|
40
|
+
validateUsing(validator, ...[options]) {
|
|
41
|
+
const validatorOptions = options || {};
|
|
42
|
+
/**
|
|
43
|
+
* Assign request specific error reporter
|
|
44
|
+
*/
|
|
45
|
+
if (RequestValidator.errorReporter) {
|
|
46
|
+
const errorReporter = RequestValidator.errorReporter(this.#ctx);
|
|
47
|
+
validatorOptions.errorReporter = () => errorReporter;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Assign request specific messages provider
|
|
51
|
+
*/
|
|
52
|
+
if (RequestValidator.messagesProvider) {
|
|
53
|
+
validatorOptions.messagesProvider = RequestValidator.messagesProvider(this.#ctx);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Data to validate
|
|
57
|
+
*/
|
|
58
|
+
const data = validatorOptions.data || {
|
|
59
|
+
...this.#ctx.request.all(),
|
|
60
|
+
...this.#ctx.request.allFiles(),
|
|
61
|
+
params: this.#ctx.request.params(),
|
|
62
|
+
headers: this.#ctx.request.headers(),
|
|
63
|
+
cookies: this.#ctx.request.cookiesList(),
|
|
64
|
+
};
|
|
65
|
+
return validator.validate(data, validatorOptions);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The validate method can be used to validate the request
|
|
70
|
+
* data for the current request using VineJS validators
|
|
71
|
+
*/
|
|
72
|
+
Request.macro('validateUsing', function (...args) {
|
|
73
|
+
return new RequestValidator(this.ctx).validateUsing(...args);
|
|
74
|
+
});
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* For the full copyright and license information, please view the LICENSE
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
|
-
import { Router, Server } from '../modules/http.js';
|
|
9
|
+
import { Router, Server } from '../modules/http/main.js';
|
|
10
10
|
import BodyParserMiddleware from '../modules/bodyparser/bodyparser_middleware.js';
|
|
11
11
|
/**
|
|
12
12
|
* Http Service provider binds the router and the HTTP server to
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* For the full copyright and license information, please view the LICENSE
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
|
+
import { join } from 'node:path';
|
|
10
|
+
import { homedir } from 'node:os';
|
|
9
11
|
export default class ReplServiceProvider {
|
|
10
12
|
app;
|
|
11
13
|
constructor(app) {
|
|
@@ -17,7 +19,9 @@ export default class ReplServiceProvider {
|
|
|
17
19
|
register() {
|
|
18
20
|
this.app.container.singleton('repl', async () => {
|
|
19
21
|
const { Repl } = await import('../modules/repl.js');
|
|
20
|
-
return new Repl(
|
|
22
|
+
return new Repl({
|
|
23
|
+
historyFilePath: join(homedir(), '.adonisjs_v6_repl_history'),
|
|
24
|
+
});
|
|
21
25
|
});
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import Macroable from '@poppinss/macroable';
|
|
3
3
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
4
4
|
import { HttpServerUtils } from './http.js';
|
|
5
|
-
import { CookieClient } from '../../modules/http.js';
|
|
5
|
+
import { CookieClient } from '../../modules/http/main.js';
|
|
6
6
|
import type { ApplicationService } from '../types.js';
|
|
7
7
|
/**
|
|
8
8
|
* Test utils has a collection of helper methods to make testing
|
|
@@ -33,5 +33,5 @@ export declare class TestUtils extends Macroable {
|
|
|
33
33
|
createHttpContext(options?: {
|
|
34
34
|
req?: IncomingMessage;
|
|
35
35
|
res?: ServerResponse;
|
|
36
|
-
}): Promise<import("../../modules/http.js").HttpContext>;
|
|
36
|
+
}): Promise<import("../../modules/http/main.js").HttpContext>;
|
|
37
37
|
}
|
|
@@ -10,7 +10,7 @@ import { Socket } from 'node:net';
|
|
|
10
10
|
import Macroable from '@poppinss/macroable';
|
|
11
11
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
12
12
|
import { HttpServerUtils } from './http.js';
|
|
13
|
-
import { CookieClient } from '../../modules/http.js';
|
|
13
|
+
import { CookieClient } from '../../modules/http/main.js';
|
|
14
14
|
/**
|
|
15
15
|
* Test utils has a collection of helper methods to make testing
|
|
16
16
|
* experience great for AdonisJS applications
|
package/build/src/types.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import type { Emitter } from '../modules/events.js';
|
|
|
4
4
|
import type { Kernel } from '../modules/ace/main.js';
|
|
5
5
|
import type { Application } from '../modules/app.js';
|
|
6
6
|
import type { TestUtils } from './test_utils/main.js';
|
|
7
|
-
import type { Router, Server } from '../modules/http.js';
|
|
8
7
|
import type { LoggerManager } from '../modules/logger.js';
|
|
9
8
|
import type { Encryption } from '../modules/encryption.js';
|
|
9
|
+
import type { Router, Server } from '../modules/http/main.js';
|
|
10
10
|
import type { HttpRequestFinishedPayload } from '../types/http.js';
|
|
11
11
|
import type { ContainerResolveEventData } from '../types/container.js';
|
|
12
12
|
import type { LoggerConfig, LoggerManagerConfig } from '../types/logger.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './validates_files.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseLiteralType } from '@vinejs/vine';
|
|
2
|
+
import type { FieldContext, FieldOptions, Validation } from '@vinejs/vine/types';
|
|
3
|
+
import type { MultipartFile, FileValidationOptions } from '@adonisjs/bodyparser/types';
|
|
4
|
+
type ValidationOptions = Partial<FileValidationOptions> | ((field: FieldContext) => Partial<FileValidationOptions>);
|
|
5
|
+
/**
|
|
6
|
+
* Represents a multipart file uploaded via multipart/form-data HTTP
|
|
7
|
+
* request.
|
|
8
|
+
*/
|
|
9
|
+
declare class VineMultipartFile extends BaseLiteralType<MultipartFile, MultipartFile> {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(validationOptions?: ValidationOptions, options?: FieldOptions, validations?: Validation<any>[]);
|
|
12
|
+
clone(): this;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Notifying TypeScript
|
|
16
|
+
*/
|
|
17
|
+
declare module '@vinejs/vine' {
|
|
18
|
+
interface Vine {
|
|
19
|
+
file(options?: ValidationOptions): VineMultipartFile;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/core
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
import vine, { BaseLiteralType, Vine } from '@vinejs/vine';
|
|
10
|
+
/**
|
|
11
|
+
* Checks if the value is an instance of multipart file
|
|
12
|
+
* from bodyparser.
|
|
13
|
+
*/
|
|
14
|
+
function isBodyParserFile(file) {
|
|
15
|
+
return !!(file && typeof file === 'object' && 'isMultipartFile' in file);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* VineJS validation rule that validates the file to be an
|
|
19
|
+
* instance of BodyParser MultipartFile class.
|
|
20
|
+
*/
|
|
21
|
+
const isMultipartFile = vine.createRule((file, options, field) => {
|
|
22
|
+
/**
|
|
23
|
+
* Report error when value is not a field multipart
|
|
24
|
+
* file object
|
|
25
|
+
*/
|
|
26
|
+
if (!isBodyParserFile(file)) {
|
|
27
|
+
field.report('The {{ field }} must be a file', 'file', field);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const validationOptions = typeof options === 'function' ? options(field) : options;
|
|
31
|
+
/**
|
|
32
|
+
* Set size when it's defined in the options and missing
|
|
33
|
+
* on the file instance
|
|
34
|
+
*/
|
|
35
|
+
if (file.sizeLimit === undefined && validationOptions.size) {
|
|
36
|
+
file.sizeLimit = validationOptions.size;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Set extensions when it's defined in the options and missing
|
|
40
|
+
* on the file instance
|
|
41
|
+
*/
|
|
42
|
+
if (file.allowedExtensions === undefined && validationOptions.extnames) {
|
|
43
|
+
file.allowedExtensions = validationOptions.extnames;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Validate file
|
|
47
|
+
*/
|
|
48
|
+
file.validate();
|
|
49
|
+
/**
|
|
50
|
+
* Report errors
|
|
51
|
+
*/
|
|
52
|
+
file.errors.forEach((error) => {
|
|
53
|
+
field.report(error.message, `file.${error.type}`, field, validationOptions);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Represents a multipart file uploaded via multipart/form-data HTTP
|
|
58
|
+
* request.
|
|
59
|
+
*/
|
|
60
|
+
class VineMultipartFile extends BaseLiteralType {
|
|
61
|
+
#validationOptions;
|
|
62
|
+
constructor(validationOptions, options, validations) {
|
|
63
|
+
super(options, validations || [isMultipartFile(validationOptions || {})]);
|
|
64
|
+
this.#validationOptions = validationOptions;
|
|
65
|
+
}
|
|
66
|
+
clone() {
|
|
67
|
+
return new VineMultipartFile(this.#validationOptions, this.cloneOptions(), this.cloneValidations());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The file method is used to validate a field to be a valid
|
|
72
|
+
* multipart file.
|
|
73
|
+
*/
|
|
74
|
+
Vine.macro('file', function (options) {
|
|
75
|
+
return new VineMultipartFile(options);
|
|
76
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/core",
|
|
3
3
|
"description": "Core of AdonisJS",
|
|
4
|
-
"version": "6.1.5-
|
|
4
|
+
"version": "6.1.5-9",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.16.0"
|
|
7
7
|
},
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"./providers/*": "./build/providers/*.js",
|
|
37
37
|
"./helpers": "./build/src/helpers/main.js",
|
|
38
38
|
"./helpers/*": "./build/src/helpers/*.js",
|
|
39
|
+
"./vinejs/extensions": "./build/src/vinejs/extensions/main.js",
|
|
39
40
|
"./ace": "./build/modules/ace/main.js",
|
|
40
41
|
"./ace/shell": "./build/modules/ace/shell.js",
|
|
41
42
|
"./bodyparser": "./build/modules/bodyparser/main.js",
|
|
@@ -74,31 +75,32 @@
|
|
|
74
75
|
},
|
|
75
76
|
"devDependencies": {
|
|
76
77
|
"@adonisjs/assembler": "^6.1.3-13",
|
|
77
|
-
"@adonisjs/eslint-config": "^1.1.
|
|
78
|
-
"@adonisjs/prettier-config": "^1.1.
|
|
79
|
-
"@adonisjs/tsconfig": "^1.1.
|
|
80
|
-
"@commitlint/cli": "^17.6.
|
|
81
|
-
"@commitlint/config-conventional": "^17.6.
|
|
78
|
+
"@adonisjs/eslint-config": "^1.1.8",
|
|
79
|
+
"@adonisjs/prettier-config": "^1.1.8",
|
|
80
|
+
"@adonisjs/tsconfig": "^1.1.8",
|
|
81
|
+
"@commitlint/cli": "^17.6.7",
|
|
82
|
+
"@commitlint/config-conventional": "^17.6.7",
|
|
82
83
|
"@japa/assert": "2.0.0-1",
|
|
83
84
|
"@japa/expect-type": "2.0.0-0",
|
|
84
85
|
"@japa/file-system": "2.0.0-1",
|
|
85
86
|
"@japa/runner": "^3.0.0-5",
|
|
86
|
-
"@swc/core": "^1.3.
|
|
87
|
-
"@types/node": "^20.4.
|
|
87
|
+
"@swc/core": "^1.3.70",
|
|
88
|
+
"@types/node": "^20.4.2",
|
|
88
89
|
"@types/pretty-hrtime": "^1.0.1",
|
|
89
90
|
"@types/sinon": "^10.0.15",
|
|
90
91
|
"@types/supertest": "^2.0.12",
|
|
91
92
|
"@types/test-console": "^2.0.0",
|
|
93
|
+
"@vinejs/vine": "^1.5.2",
|
|
92
94
|
"c8": "^8.0.0",
|
|
93
95
|
"copyfiles": "^2.4.1",
|
|
94
96
|
"cross-env": "^7.0.3",
|
|
95
97
|
"del-cli": "^5.0.0",
|
|
96
|
-
"eslint": "^8.
|
|
98
|
+
"eslint": "^8.45.0",
|
|
97
99
|
"get-port": "^7.0.0",
|
|
98
100
|
"github-label-sync": "^2.3.1",
|
|
99
101
|
"husky": "^8.0.3",
|
|
100
102
|
"np": "^8.0.4",
|
|
101
|
-
"prettier": "^
|
|
103
|
+
"prettier": "^3.0.0",
|
|
102
104
|
"sinon": "^15.2.0",
|
|
103
105
|
"supertest": "^6.3.3",
|
|
104
106
|
"test-console": "^2.0.0",
|
|
@@ -115,14 +117,14 @@
|
|
|
115
117
|
"@adonisjs/events": "^8.4.9-3",
|
|
116
118
|
"@adonisjs/fold": "^9.9.3-6",
|
|
117
119
|
"@adonisjs/hash": "^8.3.1-3",
|
|
118
|
-
"@adonisjs/http-server": "^6.8.2-
|
|
120
|
+
"@adonisjs/http-server": "^6.8.2-9",
|
|
119
121
|
"@adonisjs/logger": "^5.4.2-3",
|
|
120
122
|
"@adonisjs/repl": "^4.0.0-5",
|
|
121
123
|
"@antfu/install-pkg": "^0.1.1",
|
|
122
124
|
"@paralleldrive/cuid2": "^2.2.0",
|
|
123
125
|
"@poppinss/macroable": "^1.0.0-7",
|
|
124
126
|
"@poppinss/utils": "^6.5.0-3",
|
|
125
|
-
"@sindresorhus/is": "^5.
|
|
127
|
+
"@sindresorhus/is": "^5.5.2",
|
|
126
128
|
"@types/he": "^1.2.0",
|
|
127
129
|
"execa": "^7.1.1",
|
|
128
130
|
"he": "^1.2.0",
|
|
@@ -134,6 +136,7 @@
|
|
|
134
136
|
},
|
|
135
137
|
"peerDependencies": {
|
|
136
138
|
"@adonisjs/assembler": "^6.1.3-12",
|
|
139
|
+
"@vinejs/vine": "^1.5.2",
|
|
137
140
|
"argon2": "^0.30.3",
|
|
138
141
|
"bcrypt": "^5.0.1"
|
|
139
142
|
},
|
|
@@ -146,6 +149,9 @@
|
|
|
146
149
|
},
|
|
147
150
|
"@adonisjs/assembler": {
|
|
148
151
|
"optional": true
|
|
152
|
+
},
|
|
153
|
+
"@vinejs/vine": {
|
|
154
|
+
"optional": true
|
|
149
155
|
}
|
|
150
156
|
},
|
|
151
157
|
"author": "virk,adonisjs",
|
package/build/modules/http.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@adonisjs/http-server';
|