@adonisjs/core 5.9.0 → 6.0.0-0
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/README.md +6 -15
- package/build/commands/commands.json +1 -0
- package/build/commands/eject.d.ts +8 -0
- package/build/commands/eject.js +34 -0
- package/build/commands/{GenerateKey.d.ts → generate_key.d.ts} +3 -4
- package/build/commands/generate_key.js +47 -0
- package/build/commands/main.js +36 -0
- package/build/commands/make/_base.d.ts +6 -0
- package/build/commands/make/_base.js +19 -0
- package/build/commands/make/command.d.ts +8 -0
- package/build/commands/make/command.js +25 -0
- package/build/commands/make/controller.d.ts +12 -0
- package/build/commands/make/controller.js +57 -0
- package/build/commands/make/event.d.ts +8 -0
- package/build/commands/make/event.js +25 -0
- package/build/commands/make/listener.d.ts +10 -0
- package/build/commands/make/listener.js +48 -0
- package/build/commands/make/middleware.d.ts +8 -0
- package/build/commands/make/middleware.js +25 -0
- package/build/commands/make/provider.d.ts +8 -0
- package/build/commands/make/provider.js +25 -0
- package/build/index.d.ts +140 -0
- package/build/index.js +21 -0
- package/build/legacy/validator.d.ts +1 -0
- package/build/legacy/validator.js +1 -0
- package/build/modules/ace/commands.d.ts +26 -0
- package/build/modules/ace/commands.js +63 -0
- package/build/modules/ace/create_kernel.d.ts +3 -0
- package/build/modules/ace/create_kernel.js +33 -0
- package/build/modules/ace/kernel.d.ts +7 -0
- package/build/modules/ace/kernel.js +14 -0
- package/build/modules/ace/main.d.ts +3 -0
- package/build/modules/ace/main.js +3 -0
- package/build/modules/app.d.ts +1 -0
- package/build/modules/app.js +1 -0
- package/build/modules/bodyparser/bodyparser_middleware.d.ts +2 -0
- package/build/modules/bodyparser/bodyparser_middleware.js +2 -0
- package/build/modules/bodyparser/main.d.ts +1 -0
- package/build/modules/bodyparser/main.js +1 -0
- package/build/modules/config.d.ts +1 -0
- package/build/modules/config.js +1 -0
- package/build/modules/container.d.ts +1 -0
- package/build/modules/container.js +1 -0
- package/build/modules/encryption.d.ts +1 -0
- package/build/modules/encryption.js +1 -0
- package/build/modules/env.d.ts +1 -0
- package/build/modules/env.js +1 -0
- package/build/modules/events.d.ts +1 -0
- package/build/modules/events.js +1 -0
- package/build/modules/hash/define_config.d.ts +15 -0
- package/build/modules/hash/define_config.js +19 -0
- package/build/modules/hash/drivers_collection.d.ts +9 -0
- package/build/modules/hash/drivers_collection.js +22 -0
- package/build/modules/hash/main.d.ts +2 -0
- package/build/modules/hash/main.js +2 -0
- package/build/modules/http.d.ts +1 -0
- package/build/modules/http.js +1 -0
- package/build/modules/logger.d.ts +1 -0
- package/build/modules/logger.js +1 -0
- package/build/providers/app_provider.d.ts +16 -0
- package/build/providers/app_provider.js +74 -0
- package/build/providers/hash_provider.d.ts +9 -0
- package/build/providers/hash_provider.js +29 -0
- package/build/providers/http_provider.d.ts +9 -0
- package/build/providers/http_provider.js +36 -0
- package/build/services/ace.d.ts +3 -0
- package/build/services/ace.js +6 -0
- package/build/services/app.d.ts +4 -12
- package/build/services/app.js +5 -12
- package/build/services/config.d.ts +3 -3
- package/build/services/config.js +6 -12
- package/build/services/emitter.d.ts +3 -0
- package/build/services/emitter.js +7 -0
- package/build/services/encryption.d.ts +3 -3
- package/build/services/encryption.js +7 -12
- package/build/services/hash.d.ts +3 -3
- package/build/services/hash.js +7 -12
- package/build/services/logger.d.ts +3 -0
- package/build/services/logger.js +7 -0
- package/build/services/router.d.ts +3 -0
- package/build/services/router.js +7 -0
- package/build/services/server.d.ts +3 -0
- package/build/services/server.js +7 -0
- package/build/services/test_utils.d.ts +3 -0
- package/build/services/test_utils.js +6 -0
- package/build/src/debug.d.ts +3 -0
- package/build/src/debug.js +2 -0
- package/build/src/helpers/is.d.ts +2 -0
- package/build/src/helpers/is.js +2 -0
- package/build/src/helpers/main.d.ts +2 -0
- package/build/src/helpers/main.js +2 -0
- package/build/src/helpers/string.d.ts +17 -0
- package/build/src/helpers/string.js +26 -0
- package/build/src/helpers/string_builder.d.ts +23 -0
- package/build/src/helpers/string_builder.js +86 -0
- package/build/src/helpers/types.d.ts +24 -0
- package/build/src/helpers/types.js +29 -0
- package/build/src/ignitor/ace.d.ts +8 -0
- package/build/src/ignitor/ace.js +31 -0
- package/build/src/ignitor/http.d.ts +10 -0
- package/build/src/ignitor/http.js +62 -0
- package/build/src/ignitor/main.d.ts +17 -0
- package/build/src/ignitor/main.js +45 -0
- package/build/src/ignitor/test.d.ts +8 -0
- package/build/src/ignitor/test.js +18 -0
- package/build/src/test_utils/http.d.ts +10 -0
- package/build/src/test_utils/http.js +42 -0
- package/build/src/test_utils/main.d.ts +19 -0
- package/build/src/test_utils/main.js +33 -0
- package/build/src/types.d.ts +63 -0
- package/build/src/types.js +1 -0
- package/build/stubs/index.d.ts +1 -0
- package/build/stubs/index.js +2 -0
- package/build/stubs/make/command/main.stub +19 -0
- package/build/stubs/make/controller/api.stub +33 -0
- package/build/stubs/make/controller/main.stub +9 -0
- package/build/stubs/make/controller/resource.stub +43 -0
- package/build/stubs/make/event/main.stub +15 -0
- package/build/stubs/make/listener/for_event.stub +13 -0
- package/build/stubs/make/listener/main.stub +7 -0
- package/build/stubs/make/middleware/main.stub +22 -0
- package/build/stubs/make/provider/main.stub +35 -0
- package/build/types/ace.d.ts +5 -0
- package/build/types/ace.js +1 -0
- package/build/types/app.d.ts +1 -0
- package/build/types/app.js +1 -0
- package/build/types/bodyparser.d.ts +1 -0
- package/build/types/bodyparser.js +1 -0
- package/build/types/container.d.ts +1 -0
- package/build/types/container.js +1 -0
- package/build/types/encryption.d.ts +1 -0
- package/build/types/encryption.js +1 -0
- package/build/types/events.d.ts +1 -0
- package/build/types/events.js +1 -0
- package/build/types/hash.d.ts +1 -0
- package/build/types/hash.js +1 -0
- package/build/types/http.d.ts +1 -0
- package/build/types/http.js +1 -0
- package/build/types/logger.d.ts +1 -0
- package/build/types/logger.js +1 -0
- package/package.json +226 -245
- package/build/adonis-typings/ace.d.ts +0 -5
- package/build/adonis-typings/ace.js +0 -8
- package/build/adonis-typings/assets-manager.d.ts +0 -92
- package/build/adonis-typings/assets-manager.js +0 -8
- package/build/adonis-typings/container.d.ts +0 -14
- package/build/adonis-typings/container.js +0 -8
- package/build/adonis-typings/cors.d.ts +0 -15
- package/build/adonis-typings/cors.js +0 -8
- package/build/adonis-typings/exception-handler.d.ts +0 -31
- package/build/adonis-typings/exception-handler.js +0 -8
- package/build/adonis-typings/health-check.d.ts +0 -40
- package/build/adonis-typings/health-check.js +0 -8
- package/build/adonis-typings/index.d.ts +0 -17
- package/build/adonis-typings/index.js +0 -25
- package/build/adonis-typings/static.d.ts +0 -15
- package/build/adonis-typings/static.js +0 -8
- package/build/adonis-typings/test-utils.d.ts +0 -24
- package/build/adonis-typings/test-utils.js +0 -8
- package/build/adonis-typings/tests.d.ts +0 -13
- package/build/adonis-typings/tests.js +0 -11
- package/build/commands/DumpRc.d.ts +0 -13
- package/build/commands/DumpRc.js +0 -33
- package/build/commands/GenerateKey.js +0 -25
- package/build/commands/ListRoutes/Renderers/Base.d.ts +0 -31
- package/build/commands/ListRoutes/Renderers/Base.js +0 -70
- package/build/commands/ListRoutes/Renderers/PrettyRenderer.d.ts +0 -51
- package/build/commands/ListRoutes/Renderers/PrettyRenderer.js +0 -135
- package/build/commands/ListRoutes/Renderers/TableRenderer.d.ts +0 -36
- package/build/commands/ListRoutes/Renderers/TableRenderer.js +0 -137
- package/build/commands/ListRoutes/index.d.ts +0 -75
- package/build/commands/ListRoutes/index.js +0 -166
- package/build/commands/index.d.ts +0 -2
- package/build/commands/index.js +0 -15
- package/build/config.d.ts +0 -2
- package/build/config.js +0 -15
- package/build/instructions.js +0 -81
- package/build/providers/AppProvider.d.ts +0 -68
- package/build/providers/AppProvider.js +0 -201
- package/build/services/base.d.ts +0 -3
- package/build/services/base.js +0 -23
- package/build/services/bodyparser.d.ts +0 -2
- package/build/services/bodyparser.js +0 -12
- package/build/services/drive.d.ts +0 -3
- package/build/services/drive.js +0 -12
- package/build/services/event.d.ts +0 -3
- package/build/services/event.js +0 -12
- package/build/services/healthChecks.d.ts +0 -3
- package/build/services/healthChecks.js +0 -12
- package/build/services/httpContext.d.ts +0 -3
- package/build/services/httpContext.js +0 -12
- package/build/services/route.d.ts +0 -3
- package/build/services/route.js +0 -12
- package/build/services/validator.d.ts +0 -3
- package/build/services/validator.js +0 -12
- package/build/src/AssetsManager/Drivers/Base.d.ts +0 -27
- package/build/src/AssetsManager/Drivers/Base.js +0 -66
- package/build/src/AssetsManager/Drivers/Encore.d.ts +0 -58
- package/build/src/AssetsManager/Drivers/Encore.js +0 -93
- package/build/src/AssetsManager/Drivers/Fake.d.ts +0 -38
- package/build/src/AssetsManager/Drivers/Fake.js +0 -61
- package/build/src/AssetsManager/Drivers/Vite.d.ts +0 -84
- package/build/src/AssetsManager/Drivers/Vite.js +0 -139
- package/build/src/AssetsManager/index.d.ts +0 -87
- package/build/src/AssetsManager/index.js +0 -184
- package/build/src/Bindings/Repl.d.ts +0 -8
- package/build/src/Bindings/Repl.js +0 -90
- package/build/src/Bindings/Tests.d.ts +0 -7
- package/build/src/Bindings/Tests.js +0 -66
- package/build/src/HealthCheck/Checkers/AppKey.d.ts +0 -6
- package/build/src/HealthCheck/Checkers/AppKey.js +0 -60
- package/build/src/HealthCheck/Checkers/Env.d.ts +0 -6
- package/build/src/HealthCheck/Checkers/Env.js +0 -42
- package/build/src/HealthCheck/index.d.ts +0 -48
- package/build/src/HealthCheck/index.js +0 -99
- package/build/src/Hooks/Cors/index.d.ts +0 -70
- package/build/src/Hooks/Cors/index.js +0 -314
- package/build/src/Hooks/Static/index.d.ts +0 -18
- package/build/src/Hooks/Static/index.js +0 -66
- package/build/src/HttpExceptionHandler/index.d.ts +0 -82
- package/build/src/HttpExceptionHandler/index.js +0 -213
- package/build/src/Ignitor/Ace/App/index.d.ts +0 -60
- package/build/src/Ignitor/Ace/App/index.js +0 -236
- package/build/src/Ignitor/Ace/Exceptions/index.d.ts +0 -4
- package/build/src/Ignitor/Ace/Exceptions/index.js +0 -19
- package/build/src/Ignitor/Ace/GenerateManifest/index.d.ts +0 -28
- package/build/src/Ignitor/Ace/GenerateManifest/index.js +0 -75
- package/build/src/Ignitor/Ace/index.d.ts +0 -11
- package/build/src/Ignitor/Ace/index.js +0 -36
- package/build/src/Ignitor/HttpServer/index.d.ts +0 -56
- package/build/src/Ignitor/HttpServer/index.js +0 -127
- package/build/src/Ignitor/Kernel/index.d.ts +0 -56
- package/build/src/Ignitor/Kernel/index.js +0 -123
- package/build/src/Ignitor/SignalsListener/index.d.ts +0 -23
- package/build/src/Ignitor/SignalsListener/index.js +0 -66
- package/build/src/Ignitor/index.d.ts +0 -32
- package/build/src/Ignitor/index.js +0 -58
- package/build/src/TestUtils/HttpServer/index.d.ts +0 -27
- package/build/src/TestUtils/HttpServer/index.js +0 -56
- package/build/src/TestUtils/index.d.ts +0 -24
- package/build/src/TestUtils/index.js +0 -43
- package/build/src/utils/index.d.ts +0 -18
- package/build/src/utils/index.js +0 -82
- package/build/standalone.d.ts +0 -9
- package/build/standalone.js +0 -52
- package/build/templates/config/app.txt +0 -303
- package/build/templates/config/bodyparser.txt +0 -211
- package/build/templates/config/cors.txt +0 -134
- package/build/templates/config/drive.txt +0 -149
- package/build/templates/config/hash.txt +0 -96
- package/build/templates/config/static.txt +0 -89
- package/build/templates/contracts/drive.txt +0 -13
- package/build/templates/contracts/env.txt +0 -24
- package/build/templates/contracts/events.txt +0 -31
- package/build/templates/contracts/hash.txt +0 -13
- package/build/templates/env.txt +0 -31
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config source: https://git.io/JfefZ
|
|
3
|
-
*
|
|
4
|
-
* Feel free to let us know via PR, if you find something broken in this config
|
|
5
|
-
* file.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import proxyAddr from 'proxy-addr'
|
|
9
|
-
import Env from '@ioc:Adonis/Core/Env'
|
|
10
|
-
{{#assetsManager}}
|
|
11
|
-
import Application from '@ioc:Adonis/Core/Application'
|
|
12
|
-
{{/assetsManager}}
|
|
13
|
-
import type { ServerConfig } from '@ioc:Adonis/Core/Server'
|
|
14
|
-
import type { LoggerConfig } from '@ioc:Adonis/Core/Logger'
|
|
15
|
-
import type { ProfilerConfig } from '@ioc:Adonis/Core/Profiler'
|
|
16
|
-
import type { ValidatorConfig } from '@ioc:Adonis/Core/Validator'
|
|
17
|
-
{{#assetsManager}}
|
|
18
|
-
import type { AssetsManagerConfig } from '@ioc:Adonis/Core/AssetsManager'
|
|
19
|
-
{{/assetsManager}}
|
|
20
|
-
|
|
21
|
-
/*
|
|
22
|
-
|--------------------------------------------------------------------------
|
|
23
|
-
| Application secret key
|
|
24
|
-
|--------------------------------------------------------------------------
|
|
25
|
-
|
|
|
26
|
-
| The secret to encrypt and sign different values in your application.
|
|
27
|
-
| Make sure to keep the `APP_KEY` as an environment variable and secure.
|
|
28
|
-
|
|
|
29
|
-
| Note: Changing the application key for an existing app will make all
|
|
30
|
-
| the cookies invalid and also the existing encrypted data will not
|
|
31
|
-
| be decrypted.
|
|
32
|
-
|
|
|
33
|
-
*/
|
|
34
|
-
export const appKey: string = Env.get('APP_KEY')
|
|
35
|
-
|
|
36
|
-
/*
|
|
37
|
-
|--------------------------------------------------------------------------
|
|
38
|
-
| Http server configuration
|
|
39
|
-
|--------------------------------------------------------------------------
|
|
40
|
-
|
|
|
41
|
-
| The configuration for the HTTP(s) server. Make sure to go through all
|
|
42
|
-
| the config properties to make keep server secure.
|
|
43
|
-
|
|
|
44
|
-
*/
|
|
45
|
-
export const http: ServerConfig = {
|
|
46
|
-
/*
|
|
47
|
-
|--------------------------------------------------------------------------
|
|
48
|
-
| Allow method spoofing
|
|
49
|
-
|--------------------------------------------------------------------------
|
|
50
|
-
|
|
|
51
|
-
| Method spoofing enables defining custom HTTP methods using a query string
|
|
52
|
-
| `_method`. This is usually required when you are making traditional
|
|
53
|
-
| form requests and wants to use HTTP verbs like `PUT`, `DELETE` and
|
|
54
|
-
| so on.
|
|
55
|
-
|
|
|
56
|
-
*/
|
|
57
|
-
allowMethodSpoofing: false,
|
|
58
|
-
|
|
59
|
-
/*
|
|
60
|
-
|--------------------------------------------------------------------------
|
|
61
|
-
| Subdomain offset
|
|
62
|
-
|--------------------------------------------------------------------------
|
|
63
|
-
*/
|
|
64
|
-
subdomainOffset: 2,
|
|
65
|
-
|
|
66
|
-
/*
|
|
67
|
-
|--------------------------------------------------------------------------
|
|
68
|
-
| Request Ids
|
|
69
|
-
|--------------------------------------------------------------------------
|
|
70
|
-
|
|
|
71
|
-
| Setting this value to `true` will generate a unique request id for each
|
|
72
|
-
| HTTP request and set it as `x-request-id` header.
|
|
73
|
-
|
|
|
74
|
-
*/
|
|
75
|
-
generateRequestId: false,
|
|
76
|
-
|
|
77
|
-
/*
|
|
78
|
-
|--------------------------------------------------------------------------
|
|
79
|
-
| Trusting proxy servers
|
|
80
|
-
|--------------------------------------------------------------------------
|
|
81
|
-
|
|
|
82
|
-
| Define the proxy servers that AdonisJs must trust for reading `X-Forwarded`
|
|
83
|
-
| headers.
|
|
84
|
-
|
|
|
85
|
-
*/
|
|
86
|
-
trustProxy: proxyAddr.compile('loopback'),
|
|
87
|
-
|
|
88
|
-
/*
|
|
89
|
-
|--------------------------------------------------------------------------
|
|
90
|
-
| Generating Etag
|
|
91
|
-
|--------------------------------------------------------------------------
|
|
92
|
-
|
|
|
93
|
-
| Whether or not to generate an etag for every response.
|
|
94
|
-
|
|
|
95
|
-
*/
|
|
96
|
-
etag: false,
|
|
97
|
-
|
|
98
|
-
/*
|
|
99
|
-
|--------------------------------------------------------------------------
|
|
100
|
-
| JSONP Callback
|
|
101
|
-
|--------------------------------------------------------------------------
|
|
102
|
-
*/
|
|
103
|
-
jsonpCallbackName: 'callback',
|
|
104
|
-
|
|
105
|
-
/*
|
|
106
|
-
|--------------------------------------------------------------------------
|
|
107
|
-
| Cookie settings
|
|
108
|
-
|--------------------------------------------------------------------------
|
|
109
|
-
*/
|
|
110
|
-
cookie: {
|
|
111
|
-
domain: '',
|
|
112
|
-
path: '/',
|
|
113
|
-
maxAge: '2h',
|
|
114
|
-
httpOnly: true,
|
|
115
|
-
secure: false,
|
|
116
|
-
sameSite: false,
|
|
117
|
-
},
|
|
118
|
-
{{#forceContentNegotiationToJSON}}
|
|
119
|
-
|
|
120
|
-
/*
|
|
121
|
-
|--------------------------------------------------------------------------
|
|
122
|
-
| Force Content Negotiation
|
|
123
|
-
|--------------------------------------------------------------------------
|
|
124
|
-
|
|
|
125
|
-
| The internals of the framework relies on the content negotiation to
|
|
126
|
-
| detect the best possible response type for a given HTTP request.
|
|
127
|
-
|
|
|
128
|
-
| However, it is a very common these days that API servers always wants to
|
|
129
|
-
| make response in JSON regardless of the existence of the `Accept` header.
|
|
130
|
-
|
|
|
131
|
-
| By setting `forceContentNegotiationTo = 'application/json'`, you negotiate
|
|
132
|
-
| with the server in advance to always return JSON without relying on the
|
|
133
|
-
| client to set the header explicitly.
|
|
134
|
-
|
|
|
135
|
-
*/
|
|
136
|
-
forceContentNegotiationTo: 'application/json',
|
|
137
|
-
{{/forceContentNegotiationToJSON}}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/*
|
|
141
|
-
|--------------------------------------------------------------------------
|
|
142
|
-
| Logger
|
|
143
|
-
|--------------------------------------------------------------------------
|
|
144
|
-
*/
|
|
145
|
-
export const logger: LoggerConfig = {
|
|
146
|
-
/*
|
|
147
|
-
|--------------------------------------------------------------------------
|
|
148
|
-
| Application name
|
|
149
|
-
|--------------------------------------------------------------------------
|
|
150
|
-
|
|
|
151
|
-
| The name of the application you want to add to the log. It is recommended
|
|
152
|
-
| to always have app name in every log line.
|
|
153
|
-
|
|
|
154
|
-
| The `APP_NAME` environment variable is automatically set by AdonisJS by
|
|
155
|
-
| reading the `name` property from the `package.json` file.
|
|
156
|
-
|
|
|
157
|
-
*/
|
|
158
|
-
name: Env.get('APP_NAME'),
|
|
159
|
-
|
|
160
|
-
/*
|
|
161
|
-
|--------------------------------------------------------------------------
|
|
162
|
-
| Toggle logger
|
|
163
|
-
|--------------------------------------------------------------------------
|
|
164
|
-
|
|
|
165
|
-
| Enable or disable logger application wide
|
|
166
|
-
|
|
|
167
|
-
*/
|
|
168
|
-
enabled: true,
|
|
169
|
-
|
|
170
|
-
/*
|
|
171
|
-
|--------------------------------------------------------------------------
|
|
172
|
-
| Logging level
|
|
173
|
-
|--------------------------------------------------------------------------
|
|
174
|
-
|
|
|
175
|
-
| The level from which you want the logger to flush logs. It is recommended
|
|
176
|
-
| to make use of the environment variable, so that you can define log levels
|
|
177
|
-
| at deployment level and not code level.
|
|
178
|
-
|
|
|
179
|
-
*/
|
|
180
|
-
level: Env.get('LOG_LEVEL', 'info'),
|
|
181
|
-
|
|
182
|
-
/*
|
|
183
|
-
|--------------------------------------------------------------------------
|
|
184
|
-
| Pretty print
|
|
185
|
-
|--------------------------------------------------------------------------
|
|
186
|
-
|
|
|
187
|
-
| It is highly advised NOT to use `prettyPrint` in production, since it
|
|
188
|
-
| can have huge impact on performance.
|
|
189
|
-
|
|
|
190
|
-
*/
|
|
191
|
-
prettyPrint: Env.get('NODE_ENV') === 'development',
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/*
|
|
195
|
-
|--------------------------------------------------------------------------
|
|
196
|
-
| Profiler
|
|
197
|
-
|--------------------------------------------------------------------------
|
|
198
|
-
*/
|
|
199
|
-
export const profiler: ProfilerConfig = {
|
|
200
|
-
/*
|
|
201
|
-
|--------------------------------------------------------------------------
|
|
202
|
-
| Toggle profiler
|
|
203
|
-
|--------------------------------------------------------------------------
|
|
204
|
-
|
|
|
205
|
-
| Enable or disable profiler
|
|
206
|
-
|
|
|
207
|
-
*/
|
|
208
|
-
enabled: true,
|
|
209
|
-
|
|
210
|
-
/*
|
|
211
|
-
|--------------------------------------------------------------------------
|
|
212
|
-
| Blacklist actions/row labels
|
|
213
|
-
|--------------------------------------------------------------------------
|
|
214
|
-
|
|
|
215
|
-
| Define an array of actions or row labels that you want to disable from
|
|
216
|
-
| getting profiled.
|
|
217
|
-
|
|
|
218
|
-
*/
|
|
219
|
-
blacklist: [],
|
|
220
|
-
|
|
221
|
-
/*
|
|
222
|
-
|--------------------------------------------------------------------------
|
|
223
|
-
| Whitelist actions/row labels
|
|
224
|
-
|--------------------------------------------------------------------------
|
|
225
|
-
|
|
|
226
|
-
| Define an array of actions or row labels that you want to whitelist for
|
|
227
|
-
| the profiler. When whitelist is defined, then `blacklist` is ignored.
|
|
228
|
-
|
|
|
229
|
-
*/
|
|
230
|
-
whitelist: [],
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/*
|
|
234
|
-
|--------------------------------------------------------------------------
|
|
235
|
-
| Validator
|
|
236
|
-
|--------------------------------------------------------------------------
|
|
237
|
-
|
|
|
238
|
-
| Configure the global configuration for the validator. Here's the reference
|
|
239
|
-
| to the default config https://git.io/JT0WE
|
|
240
|
-
|
|
|
241
|
-
*/
|
|
242
|
-
export const validator: ValidatorConfig = {
|
|
243
|
-
}
|
|
244
|
-
{{#assetsManager}}
|
|
245
|
-
|
|
246
|
-
/*
|
|
247
|
-
|--------------------------------------------------------------------------
|
|
248
|
-
| Assets
|
|
249
|
-
|--------------------------------------------------------------------------
|
|
250
|
-
|
|
|
251
|
-
| Configure the asset manager you are using to compile the frontend assets
|
|
252
|
-
|
|
|
253
|
-
*/
|
|
254
|
-
export const assets: AssetsManagerConfig = {
|
|
255
|
-
/*
|
|
256
|
-
|--------------------------------------------------------------------------
|
|
257
|
-
| Driver
|
|
258
|
-
|--------------------------------------------------------------------------
|
|
259
|
-
|
|
|
260
|
-
| Currently we only support webpack encore and may introduce more drivers
|
|
261
|
-
| in the future
|
|
262
|
-
|
|
|
263
|
-
*/
|
|
264
|
-
driver: Env.get('ASSETS_DRIVER'),
|
|
265
|
-
|
|
266
|
-
/*
|
|
267
|
-
|--------------------------------------------------------------------------
|
|
268
|
-
| Public path
|
|
269
|
-
|--------------------------------------------------------------------------
|
|
270
|
-
|
|
|
271
|
-
| Directory to search for the "manifest.json" and the "entrypoints.json"
|
|
272
|
-
| files
|
|
273
|
-
|
|
|
274
|
-
*/
|
|
275
|
-
publicPath: Application.publicPath('assets'),
|
|
276
|
-
|
|
277
|
-
/*
|
|
278
|
-
|--------------------------------------------------------------------------
|
|
279
|
-
| Script tag
|
|
280
|
-
|--------------------------------------------------------------------------
|
|
281
|
-
|
|
|
282
|
-
| Define attributes for the entryPointScripts tags
|
|
283
|
-
|
|
|
284
|
-
*/
|
|
285
|
-
script: {
|
|
286
|
-
attributes: {
|
|
287
|
-
defer: true,
|
|
288
|
-
},
|
|
289
|
-
},
|
|
290
|
-
|
|
291
|
-
/*
|
|
292
|
-
|--------------------------------------------------------------------------
|
|
293
|
-
| Style tag
|
|
294
|
-
|--------------------------------------------------------------------------
|
|
295
|
-
|
|
|
296
|
-
| Define attributes for the entryPointStyles tags
|
|
297
|
-
|
|
|
298
|
-
*/
|
|
299
|
-
style: {
|
|
300
|
-
attributes: {},
|
|
301
|
-
},
|
|
302
|
-
}
|
|
303
|
-
{{/assetsManager}}
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config source: https://git.io/Jfefn
|
|
3
|
-
*
|
|
4
|
-
* Feel free to let us know via PR, if you find something broken in this config
|
|
5
|
-
* file.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { BodyParserConfig } from '@ioc:Adonis/Core/BodyParser'
|
|
9
|
-
|
|
10
|
-
const bodyParserConfig: BodyParserConfig = {
|
|
11
|
-
/*
|
|
12
|
-
|--------------------------------------------------------------------------
|
|
13
|
-
| White listed methods
|
|
14
|
-
|--------------------------------------------------------------------------
|
|
15
|
-
|
|
|
16
|
-
| HTTP methods for which body parsing must be performed. It is a good practice
|
|
17
|
-
| to avoid body parsing for `GET` requests.
|
|
18
|
-
|
|
|
19
|
-
*/
|
|
20
|
-
whitelistedMethods: ['POST', 'PUT', 'PATCH', 'DELETE'],
|
|
21
|
-
|
|
22
|
-
/*
|
|
23
|
-
|--------------------------------------------------------------------------
|
|
24
|
-
| JSON parser settings
|
|
25
|
-
|--------------------------------------------------------------------------
|
|
26
|
-
|
|
|
27
|
-
| The settings for the JSON parser. The types defines the request content
|
|
28
|
-
| types which gets processed by the JSON parser.
|
|
29
|
-
|
|
|
30
|
-
*/
|
|
31
|
-
json: {
|
|
32
|
-
encoding: 'utf-8',
|
|
33
|
-
limit: '1mb',
|
|
34
|
-
strict: true,
|
|
35
|
-
types: [
|
|
36
|
-
'application/json',
|
|
37
|
-
'application/json-patch+json',
|
|
38
|
-
'application/vnd.api+json',
|
|
39
|
-
'application/csp-report',
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
/*
|
|
44
|
-
|--------------------------------------------------------------------------
|
|
45
|
-
| Form parser settings
|
|
46
|
-
|--------------------------------------------------------------------------
|
|
47
|
-
|
|
|
48
|
-
| The settings for the `application/x-www-form-urlencoded` parser. The types
|
|
49
|
-
| defines the request content types which gets processed by the form parser.
|
|
50
|
-
|
|
|
51
|
-
*/
|
|
52
|
-
form: {
|
|
53
|
-
encoding: 'utf-8',
|
|
54
|
-
limit: '1mb',
|
|
55
|
-
queryString: {},
|
|
56
|
-
|
|
57
|
-
/*
|
|
58
|
-
|--------------------------------------------------------------------------
|
|
59
|
-
| Convert empty strings to null
|
|
60
|
-
|--------------------------------------------------------------------------
|
|
61
|
-
|
|
|
62
|
-
| Convert empty form fields to null. HTML forms results in field string
|
|
63
|
-
| value when the field is left blank. This option normalizes all the blank
|
|
64
|
-
| field values to "null"
|
|
65
|
-
|
|
|
66
|
-
*/
|
|
67
|
-
convertEmptyStringsToNull: true,
|
|
68
|
-
|
|
69
|
-
types: [
|
|
70
|
-
'application/x-www-form-urlencoded',
|
|
71
|
-
],
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
/*
|
|
75
|
-
|--------------------------------------------------------------------------
|
|
76
|
-
| Raw body parser settings
|
|
77
|
-
|--------------------------------------------------------------------------
|
|
78
|
-
|
|
|
79
|
-
| Raw body just reads the request body stream as a plain text, which you
|
|
80
|
-
| can process by hand. This must be used when request body type is not
|
|
81
|
-
| supported by the body parser.
|
|
82
|
-
|
|
|
83
|
-
*/
|
|
84
|
-
raw: {
|
|
85
|
-
encoding: 'utf-8',
|
|
86
|
-
limit: '1mb',
|
|
87
|
-
queryString: {},
|
|
88
|
-
types: [
|
|
89
|
-
'text/*',
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
/*
|
|
94
|
-
|--------------------------------------------------------------------------
|
|
95
|
-
| Multipart parser settings
|
|
96
|
-
|--------------------------------------------------------------------------
|
|
97
|
-
|
|
|
98
|
-
| The settings for the `multipart/form-data` parser. The types defines the
|
|
99
|
-
| request content types which gets processed by the form parser.
|
|
100
|
-
|
|
|
101
|
-
*/
|
|
102
|
-
multipart: {
|
|
103
|
-
/*
|
|
104
|
-
|--------------------------------------------------------------------------
|
|
105
|
-
| Auto process
|
|
106
|
-
|--------------------------------------------------------------------------
|
|
107
|
-
|
|
|
108
|
-
| The auto process option will process uploaded files and writes them to
|
|
109
|
-
| the `tmp` folder. You can turn it off and then manually use the stream
|
|
110
|
-
| to pipe stream to a different destination.
|
|
111
|
-
|
|
|
112
|
-
| It is recommended to keep `autoProcess=true`. Unless you are processing bigger
|
|
113
|
-
| file sizes.
|
|
114
|
-
|
|
|
115
|
-
*/
|
|
116
|
-
autoProcess: true,
|
|
117
|
-
|
|
118
|
-
/*
|
|
119
|
-
|--------------------------------------------------------------------------
|
|
120
|
-
| Files to be processed manually
|
|
121
|
-
|--------------------------------------------------------------------------
|
|
122
|
-
|
|
|
123
|
-
| You can turn off `autoProcess` for certain routes by defining
|
|
124
|
-
| routes inside the following array.
|
|
125
|
-
|
|
|
126
|
-
| NOTE: Make sure the route pattern starts with a leading slash.
|
|
127
|
-
|
|
|
128
|
-
| Correct
|
|
129
|
-
| ```js
|
|
130
|
-
| /projects/:id/file
|
|
131
|
-
| ```
|
|
132
|
-
|
|
|
133
|
-
| Incorrect
|
|
134
|
-
| ```js
|
|
135
|
-
| projects/:id/file
|
|
136
|
-
| ```
|
|
137
|
-
*/
|
|
138
|
-
processManually: [],
|
|
139
|
-
|
|
140
|
-
/*
|
|
141
|
-
|--------------------------------------------------------------------------
|
|
142
|
-
| Temporary file name
|
|
143
|
-
|--------------------------------------------------------------------------
|
|
144
|
-
|
|
|
145
|
-
| When auto processing is on. We will use this method to compute the temporary
|
|
146
|
-
| file name. AdonisJs will compute a unique `tmpPath` for you automatically,
|
|
147
|
-
| However, you can also define your own custom method.
|
|
148
|
-
|
|
|
149
|
-
*/
|
|
150
|
-
// tmpFileName () {
|
|
151
|
-
// },
|
|
152
|
-
|
|
153
|
-
/*
|
|
154
|
-
|--------------------------------------------------------------------------
|
|
155
|
-
| Encoding
|
|
156
|
-
|--------------------------------------------------------------------------
|
|
157
|
-
|
|
|
158
|
-
| Request body encoding
|
|
159
|
-
|
|
|
160
|
-
*/
|
|
161
|
-
encoding: 'utf-8',
|
|
162
|
-
|
|
163
|
-
/*
|
|
164
|
-
|--------------------------------------------------------------------------
|
|
165
|
-
| Convert empty strings to null
|
|
166
|
-
|--------------------------------------------------------------------------
|
|
167
|
-
|
|
|
168
|
-
| Convert empty form fields to null. HTML forms results in field string
|
|
169
|
-
| value when the field is left blank. This option normalizes all the blank
|
|
170
|
-
| field values to "null"
|
|
171
|
-
|
|
|
172
|
-
*/
|
|
173
|
-
convertEmptyStringsToNull: true,
|
|
174
|
-
|
|
175
|
-
/*
|
|
176
|
-
|--------------------------------------------------------------------------
|
|
177
|
-
| Max Fields
|
|
178
|
-
|--------------------------------------------------------------------------
|
|
179
|
-
|
|
|
180
|
-
| The maximum number of fields allowed in the request body. The field includes
|
|
181
|
-
| text inputs and files both.
|
|
182
|
-
|
|
|
183
|
-
*/
|
|
184
|
-
maxFields: 1000,
|
|
185
|
-
|
|
186
|
-
/*
|
|
187
|
-
|--------------------------------------------------------------------------
|
|
188
|
-
| Request body limit
|
|
189
|
-
|--------------------------------------------------------------------------
|
|
190
|
-
|
|
|
191
|
-
| The total limit to the multipart body. This includes all request files
|
|
192
|
-
| and fields data.
|
|
193
|
-
|
|
|
194
|
-
*/
|
|
195
|
-
limit: '20mb',
|
|
196
|
-
|
|
197
|
-
/*
|
|
198
|
-
|--------------------------------------------------------------------------
|
|
199
|
-
| Types
|
|
200
|
-
|--------------------------------------------------------------------------
|
|
201
|
-
|
|
|
202
|
-
| The types that will be considered and parsed as multipart body.
|
|
203
|
-
|
|
|
204
|
-
*/
|
|
205
|
-
types: [
|
|
206
|
-
'multipart/form-data',
|
|
207
|
-
],
|
|
208
|
-
},
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export default bodyParserConfig
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config source: https://git.io/JfefC
|
|
3
|
-
*
|
|
4
|
-
* Feel free to let us know via PR, if you find something broken in this config
|
|
5
|
-
* file.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { CorsConfig } from '@ioc:Adonis/Core/Cors'
|
|
9
|
-
|
|
10
|
-
const corsConfig: CorsConfig = {
|
|
11
|
-
/*
|
|
12
|
-
|--------------------------------------------------------------------------
|
|
13
|
-
| Enabled
|
|
14
|
-
|--------------------------------------------------------------------------
|
|
15
|
-
|
|
|
16
|
-
| A boolean to enable or disable CORS integration from your AdonisJs
|
|
17
|
-
| application.
|
|
18
|
-
|
|
|
19
|
-
| Setting the value to `true` will enable the CORS for all HTTP request. However,
|
|
20
|
-
| you can define a function to enable/disable it on per request basis as well.
|
|
21
|
-
|
|
|
22
|
-
*/
|
|
23
|
-
enabled: false,
|
|
24
|
-
|
|
25
|
-
// You can also use a function that return true or false.
|
|
26
|
-
// enabled: (request) => request.url().startsWith('/api')
|
|
27
|
-
|
|
28
|
-
/*
|
|
29
|
-
|--------------------------------------------------------------------------
|
|
30
|
-
| Origin
|
|
31
|
-
|--------------------------------------------------------------------------
|
|
32
|
-
|
|
|
33
|
-
| Set a list of origins to be allowed for `Access-Control-Allow-Origin`.
|
|
34
|
-
| The value can be one of the following:
|
|
35
|
-
|
|
|
36
|
-
| https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
|
|
37
|
-
|
|
|
38
|
-
| Boolean (true) - Allow current request origin.
|
|
39
|
-
| Boolean (false) - Disallow all.
|
|
40
|
-
| String - Comma separated list of allowed origins.
|
|
41
|
-
| Array - An array of allowed origins.
|
|
42
|
-
| String (*) - A wildcard (*) to allow all request origins.
|
|
43
|
-
| Function - Receives the current origin string and should return
|
|
44
|
-
| one of the above values.
|
|
45
|
-
|
|
|
46
|
-
*/
|
|
47
|
-
origin: true,
|
|
48
|
-
|
|
49
|
-
/*
|
|
50
|
-
|--------------------------------------------------------------------------
|
|
51
|
-
| Methods
|
|
52
|
-
|--------------------------------------------------------------------------
|
|
53
|
-
|
|
|
54
|
-
| An array of allowed HTTP methods for CORS. The `Access-Control-Request-Method`
|
|
55
|
-
| is checked against the following list.
|
|
56
|
-
|
|
|
57
|
-
| Following is the list of default methods. Feel free to add more.
|
|
58
|
-
*/
|
|
59
|
-
methods: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE'],
|
|
60
|
-
|
|
61
|
-
/*
|
|
62
|
-
|--------------------------------------------------------------------------
|
|
63
|
-
| Headers
|
|
64
|
-
|--------------------------------------------------------------------------
|
|
65
|
-
|
|
|
66
|
-
| List of headers to be allowed for `Access-Control-Allow-Headers` header.
|
|
67
|
-
| The value can be one of the following:
|
|
68
|
-
|
|
|
69
|
-
| https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Headers
|
|
70
|
-
|
|
|
71
|
-
| Boolean(true) - Allow all headers mentioned in `Access-Control-Request-Headers`.
|
|
72
|
-
| Boolean(false) - Disallow all headers.
|
|
73
|
-
| String - Comma separated list of allowed headers.
|
|
74
|
-
| Array - An array of allowed headers.
|
|
75
|
-
| Function - Receives the current header and should return one of the above values.
|
|
76
|
-
|
|
|
77
|
-
*/
|
|
78
|
-
headers: true,
|
|
79
|
-
|
|
80
|
-
/*
|
|
81
|
-
|--------------------------------------------------------------------------
|
|
82
|
-
| Expose Headers
|
|
83
|
-
|--------------------------------------------------------------------------
|
|
84
|
-
|
|
|
85
|
-
| A list of headers to be exposed by setting `Access-Control-Expose-Headers`.
|
|
86
|
-
| header. By default following 6 simple response headers are exposed.
|
|
87
|
-
|
|
|
88
|
-
| Cache-Control
|
|
89
|
-
| Content-Language
|
|
90
|
-
| Content-Type
|
|
91
|
-
| Expires
|
|
92
|
-
| Last-Modified
|
|
93
|
-
| Pragma
|
|
94
|
-
|
|
|
95
|
-
| In order to add more headers, simply define them inside the following array.
|
|
96
|
-
|
|
|
97
|
-
| https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers
|
|
98
|
-
|
|
|
99
|
-
*/
|
|
100
|
-
exposeHeaders: [
|
|
101
|
-
'cache-control',
|
|
102
|
-
'content-language',
|
|
103
|
-
'content-type',
|
|
104
|
-
'expires',
|
|
105
|
-
'last-modified',
|
|
106
|
-
'pragma',
|
|
107
|
-
],
|
|
108
|
-
|
|
109
|
-
/*
|
|
110
|
-
|--------------------------------------------------------------------------
|
|
111
|
-
| Credentials
|
|
112
|
-
|--------------------------------------------------------------------------
|
|
113
|
-
|
|
|
114
|
-
| Toggle `Access-Control-Allow-Credentials` header. If value is set to `true`,
|
|
115
|
-
| then header will be set, otherwise not.
|
|
116
|
-
|
|
|
117
|
-
| https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials
|
|
118
|
-
|
|
|
119
|
-
*/
|
|
120
|
-
credentials: true,
|
|
121
|
-
|
|
122
|
-
/*
|
|
123
|
-
|--------------------------------------------------------------------------
|
|
124
|
-
| MaxAge
|
|
125
|
-
|--------------------------------------------------------------------------
|
|
126
|
-
|
|
|
127
|
-
| Define `Access-Control-Max-Age` header in seconds.
|
|
128
|
-
| https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age
|
|
129
|
-
|
|
|
130
|
-
*/
|
|
131
|
-
maxAge: 90,
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export default corsConfig
|