@adonisjs/core 6.1.5-9 → 6.2.1
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 +3 -5
- package/build/commands/build.d.ts +3 -5
- package/build/commands/build.js +5 -9
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.d.ts +21 -28
- package/build/commands/configure.js +60 -118
- package/build/commands/eject.js +2 -1
- package/build/commands/generate_key.js +2 -2
- package/build/commands/inspect_rcfile.js +19 -2
- package/build/commands/main.d.ts +4 -0
- package/build/commands/make/command.d.ts +1 -1
- package/build/commands/make/command.js +5 -2
- package/build/commands/make/controller.d.ts +2 -1
- package/build/commands/make/controller.js +33 -10
- package/build/commands/make/event.d.ts +1 -1
- package/build/commands/make/event.js +5 -3
- package/build/commands/make/exception.d.ts +1 -1
- package/build/commands/make/exception.js +6 -4
- package/build/commands/make/listener.d.ts +1 -1
- package/build/commands/make/listener.js +9 -6
- package/build/commands/make/middleware.d.ts +2 -1
- package/build/commands/make/middleware.js +50 -4
- package/build/commands/make/preload.d.ts +4 -3
- package/build/commands/make/preload.js +34 -35
- package/build/commands/make/provider.d.ts +7 -1
- package/build/commands/make/provider.js +57 -7
- package/build/commands/make/service.d.ts +1 -1
- package/build/commands/make/service.js +5 -3
- package/build/commands/make/test.d.ts +1 -1
- package/build/commands/make/test.js +7 -5
- package/build/commands/make/validator.d.ts +19 -0
- package/build/commands/make/validator.js +53 -0
- package/build/commands/make/view.d.ts +14 -0
- package/build/commands/make/view.js +37 -0
- package/build/commands/serve.js +7 -4
- package/build/commands/test.js +2 -2
- package/build/factories/core/ace.d.ts +2 -2
- package/build/factories/core/ignitor.d.ts +2 -2
- package/build/factories/core/ignitor.js +8 -9
- package/build/factories/core/main.d.ts +0 -1
- package/build/factories/core/main.js +0 -1
- package/build/factories/core/test_utils.d.ts +2 -2
- package/build/factories/stubs.d.ts +2 -2
- package/build/factories/stubs.js +3 -2
- package/build/index.d.ts +11 -140
- package/build/index.js +5 -1
- package/build/modules/ace/codemods.d.ts +93 -0
- package/build/modules/ace/codemods.js +259 -0
- package/build/modules/ace/commands.d.ts +6 -81
- package/build/modules/ace/commands.js +12 -33
- package/build/modules/ace/create_kernel.d.ts +1 -1
- package/build/modules/ace/create_kernel.js +19 -3
- package/build/modules/env/editor.d.ts +1 -0
- package/build/modules/env/editor.js +9 -0
- package/build/modules/hash/define_config.d.ts +29 -12
- package/build/modules/hash/define_config.js +52 -11
- package/build/modules/hash/drivers/argon.d.ts +1 -0
- package/build/modules/hash/drivers/argon.js +9 -0
- package/build/modules/hash/drivers/bcrypt.d.ts +1 -0
- package/build/modules/hash/drivers/bcrypt.js +9 -0
- package/build/modules/hash/drivers/scrypt.d.ts +1 -0
- package/build/modules/hash/drivers/scrypt.js +9 -0
- package/build/modules/hash/main.d.ts +1 -2
- package/build/modules/hash/main.js +1 -2
- package/build/modules/hash/phc_formatter.d.ts +1 -0
- package/build/modules/hash/phc_formatter.js +9 -0
- package/build/modules/http/main.d.ts +5 -0
- package/build/modules/http/main.js +5 -0
- package/build/modules/http/request_validator.d.ts +4 -14
- package/build/modules/http/request_validator.js +2 -10
- package/build/providers/app_provider.d.ts +14 -0
- package/build/providers/app_provider.js +47 -3
- package/build/providers/edge_provider.d.ts +31 -0
- package/build/providers/edge_provider.js +70 -0
- package/build/providers/hash_provider.d.ts +0 -4
- package/build/providers/hash_provider.js +11 -11
- package/build/providers/repl_provider.js +74 -7
- package/build/providers/vinejs_provider.d.ts +43 -0
- package/build/{src/vinejs/extensions/validates_files.js → providers/vinejs_provider.js} +26 -5
- package/build/src/config_provider.d.ts +9 -0
- package/build/src/config_provider.js +26 -0
- package/build/src/debug.d.ts +1 -1
- package/build/src/helpers/assert.d.ts +1 -0
- package/build/src/helpers/assert.js +9 -0
- package/build/src/helpers/main.d.ts +2 -2
- package/build/src/helpers/main.js +2 -2
- package/build/src/helpers/types.d.ts +109 -16
- package/build/src/helpers/types.js +3 -3
- package/build/src/ignitor/ace.js +3 -1
- package/build/src/ignitor/http.d.ts +2 -2
- package/build/src/ignitor/http.js +5 -1
- package/build/src/ignitor/main.d.ts +2 -2
- package/build/src/ignitor/main.js +1 -1
- package/build/src/test_utils/http.d.ts +2 -2
- package/build/src/test_utils/main.d.ts +3 -3
- package/build/src/types.d.ts +18 -17
- package/build/stubs/make/command/main.stub +6 -4
- package/build/stubs/make/controller/actions.stub +14 -0
- package/build/stubs/make/controller/api.stub +6 -4
- package/build/stubs/make/controller/main.stub +6 -4
- package/build/stubs/make/controller/resource.stub +6 -4
- package/build/stubs/make/event/main.stub +5 -3
- package/build/stubs/make/exception/main.stub +5 -3
- package/build/stubs/make/listener/for_event.stub +6 -4
- package/build/stubs/make/listener/main.stub +5 -3
- package/build/stubs/make/middleware/main.stub +7 -5
- package/build/stubs/make/{preload_file → preload}/main.stub +5 -3
- package/build/stubs/make/provider/main.stub +6 -4
- package/build/stubs/make/service/main.stub +5 -3
- package/build/stubs/make/test/main.stub +5 -3
- package/build/stubs/make/validator/main.stub +7 -0
- package/build/stubs/make/validator/resource.stub +26 -0
- package/build/stubs/make/view/main.stub +6 -0
- package/build/types/bodyparser.js +1 -1
- package/build/types/helpers.d.ts +1 -0
- package/build/{src/vinejs/extensions/main.js → types/helpers.js} +1 -1
- package/build/types/http.d.ts +7 -0
- package/package.json +69 -60
- package/build/commands/make/_base.d.ts +0 -36
- package/build/commands/make/_base.js +0 -27
- package/build/modules/ace/shell.d.ts +0 -12
- package/build/modules/ace/shell.js +0 -49
- package/build/modules/hash/drivers_collection.d.ts +0 -21
- package/build/modules/hash/drivers_collection.js +0 -45
- package/build/providers/http_provider.d.ts +0 -26
- package/build/providers/http_provider.js +0 -61
- package/build/src/bindings/repl.d.ts +0 -6
- package/build/src/bindings/repl.js +0 -78
- package/build/src/vinejs/extensions/main.d.ts +0 -1
- package/build/src/vinejs/extensions/validates_files.d.ts +0 -22
- /package/build/modules/{env.d.ts → env/main.d.ts} +0 -0
- /package/build/modules/{env.js → env/main.js} +0 -0
- /package/build/stubs/{index.d.ts → main.d.ts} +0 -0
- /package/build/stubs/{index.js → main.js} +0 -0
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
|
|
4
|
+
"version": "6.2.1",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.16.0"
|
|
7
7
|
},
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"build/modules",
|
|
12
12
|
"build/commands",
|
|
13
|
-
"build/legacy",
|
|
14
13
|
"build/providers",
|
|
15
14
|
"build/services",
|
|
16
15
|
"build/factories",
|
|
@@ -36,19 +35,23 @@
|
|
|
36
35
|
"./providers/*": "./build/providers/*.js",
|
|
37
36
|
"./helpers": "./build/src/helpers/main.js",
|
|
38
37
|
"./helpers/*": "./build/src/helpers/*.js",
|
|
39
|
-
"./vinejs/extensions": "./build/src/vinejs/extensions/main.js",
|
|
40
38
|
"./ace": "./build/modules/ace/main.js",
|
|
41
|
-
"./ace/
|
|
39
|
+
"./ace/codemods": "./build/modules/ace/codemods.js",
|
|
42
40
|
"./bodyparser": "./build/modules/bodyparser/main.js",
|
|
43
41
|
"./bodyparser_middleware": "./build/modules/bodyparser/bodyparser_middleware.js",
|
|
44
42
|
"./hash": "./build/modules/hash/main.js",
|
|
43
|
+
"./hash/phc_formatter": "./build/modules/hash/phc_formatter.js",
|
|
44
|
+
"./hash/drivers/argon": "./build/modules/hash/drivers/argon.js",
|
|
45
|
+
"./hash/drivers/bcrypt": "./build/modules/hash/drivers/bcrypt.js",
|
|
46
|
+
"./hash/drivers/scrypt": "./build/modules/hash/drivers/scrypt.js",
|
|
45
47
|
"./app": "./build/modules/app.js",
|
|
46
48
|
"./config": "./build/modules/config.js",
|
|
47
49
|
"./container": "./build/modules/container.js",
|
|
48
50
|
"./encryption": "./build/modules/encryption.js",
|
|
49
|
-
"./env": "./build/modules/env.js",
|
|
51
|
+
"./env": "./build/modules/env/main.js",
|
|
52
|
+
"./env/editor": "./build/modules/env/editor.js",
|
|
50
53
|
"./events": "./build/modules/events.js",
|
|
51
|
-
"./http": "./build/modules/http.js",
|
|
54
|
+
"./http": "./build/modules/http/main.js",
|
|
52
55
|
"./logger": "./build/modules/logger.js",
|
|
53
56
|
"./repl": "./build/modules/repl.js",
|
|
54
57
|
"./package.json": "./package.json",
|
|
@@ -74,71 +77,74 @@
|
|
|
74
77
|
"index:commands": "node --loader=ts-node/esm toolkit/main.js index build/commands"
|
|
75
78
|
},
|
|
76
79
|
"devDependencies": {
|
|
77
|
-
"@adonisjs/assembler": "^
|
|
78
|
-
"@adonisjs/eslint-config": "^1.
|
|
79
|
-
"@adonisjs/prettier-config": "^1.
|
|
80
|
-
"@adonisjs/tsconfig": "^1.
|
|
81
|
-
"@commitlint/cli": "^
|
|
82
|
-
"@commitlint/config-conventional": "^
|
|
83
|
-
"@japa/assert": "2.
|
|
84
|
-
"@japa/expect-type": "2.0.
|
|
85
|
-
"@japa/file-system": "2.
|
|
86
|
-
"@japa/runner": "^3.
|
|
87
|
-
"@swc/core": "^1.3.
|
|
88
|
-
"@types/node": "^20.
|
|
89
|
-
"@types/pretty-hrtime": "^1.0.
|
|
90
|
-
"@types/sinon": "^
|
|
91
|
-
"@types/supertest": "^
|
|
92
|
-
"@types/test-console": "^2.0.
|
|
93
|
-
"@vinejs/vine": "^1.
|
|
94
|
-
"
|
|
80
|
+
"@adonisjs/assembler": "^7.1.0",
|
|
81
|
+
"@adonisjs/eslint-config": "^1.2.0",
|
|
82
|
+
"@adonisjs/prettier-config": "^1.2.0",
|
|
83
|
+
"@adonisjs/tsconfig": "^1.2.0",
|
|
84
|
+
"@commitlint/cli": "^18.5.0",
|
|
85
|
+
"@commitlint/config-conventional": "^18.5.0",
|
|
86
|
+
"@japa/assert": "^2.1.0",
|
|
87
|
+
"@japa/expect-type": "^2.0.1",
|
|
88
|
+
"@japa/file-system": "^2.2.0",
|
|
89
|
+
"@japa/runner": "^3.1.1",
|
|
90
|
+
"@swc/core": "^1.3.105",
|
|
91
|
+
"@types/node": "^20.11.5",
|
|
92
|
+
"@types/pretty-hrtime": "^1.0.3",
|
|
93
|
+
"@types/sinon": "^17.0.3",
|
|
94
|
+
"@types/supertest": "^6.0.2",
|
|
95
|
+
"@types/test-console": "^2.0.3",
|
|
96
|
+
"@vinejs/vine": "^1.7.0",
|
|
97
|
+
"argon2": "^0.31.1",
|
|
98
|
+
"bcrypt": "^5.1.1",
|
|
99
|
+
"c8": "^9.1.0",
|
|
95
100
|
"copyfiles": "^2.4.1",
|
|
96
101
|
"cross-env": "^7.0.3",
|
|
97
|
-
"del-cli": "^5.
|
|
98
|
-
"
|
|
102
|
+
"del-cli": "^5.1.0",
|
|
103
|
+
"edge.js": "^6.0.1",
|
|
104
|
+
"eslint": "^8.56.0",
|
|
105
|
+
"execa": "^8.0.1",
|
|
99
106
|
"get-port": "^7.0.0",
|
|
100
107
|
"github-label-sync": "^2.3.1",
|
|
101
108
|
"husky": "^8.0.3",
|
|
102
|
-
"np": "^
|
|
103
|
-
"prettier": "^3.
|
|
104
|
-
"sinon": "^
|
|
105
|
-
"supertest": "^6.3.
|
|
109
|
+
"np": "^9.2.0",
|
|
110
|
+
"prettier": "^3.2.4",
|
|
111
|
+
"sinon": "^17.0.1",
|
|
112
|
+
"supertest": "^6.3.4",
|
|
106
113
|
"test-console": "^2.0.0",
|
|
107
|
-
"ts-node": "^10.9.
|
|
108
|
-
"typescript": "^5.
|
|
114
|
+
"ts-node": "^10.9.2",
|
|
115
|
+
"typescript": "^5.3.3"
|
|
109
116
|
},
|
|
110
117
|
"dependencies": {
|
|
111
|
-
"@adonisjs/ace": "^
|
|
112
|
-
"@adonisjs/application": "^
|
|
113
|
-
"@adonisjs/bodyparser": "^
|
|
114
|
-
"@adonisjs/config": "^
|
|
115
|
-
"@adonisjs/encryption": "^
|
|
116
|
-
"@adonisjs/env": "^
|
|
117
|
-
"@adonisjs/events": "^
|
|
118
|
-
"@adonisjs/fold": "^
|
|
119
|
-
"@adonisjs/hash": "^
|
|
120
|
-
"@adonisjs/http-server": "^
|
|
121
|
-
"@adonisjs/logger": "^
|
|
122
|
-
"@adonisjs/repl": "^4.0.0
|
|
123
|
-
"@
|
|
124
|
-
"@
|
|
125
|
-
"@poppinss/
|
|
126
|
-
"@
|
|
127
|
-
"@
|
|
128
|
-
"@types/he": "^1.2.0",
|
|
129
|
-
"execa": "^7.1.1",
|
|
118
|
+
"@adonisjs/ace": "^13.0.0",
|
|
119
|
+
"@adonisjs/application": "^8.0.0",
|
|
120
|
+
"@adonisjs/bodyparser": "^10.0.0",
|
|
121
|
+
"@adonisjs/config": "^5.0.0",
|
|
122
|
+
"@adonisjs/encryption": "^6.0.0",
|
|
123
|
+
"@adonisjs/env": "^5.0.0",
|
|
124
|
+
"@adonisjs/events": "^9.0.0",
|
|
125
|
+
"@adonisjs/fold": "^10.0.0",
|
|
126
|
+
"@adonisjs/hash": "^9.0.0",
|
|
127
|
+
"@adonisjs/http-server": "^7.0.1",
|
|
128
|
+
"@adonisjs/logger": "^6.0.0",
|
|
129
|
+
"@adonisjs/repl": "^4.0.0",
|
|
130
|
+
"@paralleldrive/cuid2": "^2.2.2",
|
|
131
|
+
"@poppinss/macroable": "^1.0.1",
|
|
132
|
+
"@poppinss/utils": "^6.7.1",
|
|
133
|
+
"@sindresorhus/is": "^6.0.1",
|
|
134
|
+
"@types/he": "^1.2.3",
|
|
130
135
|
"he": "^1.2.0",
|
|
131
136
|
"parse-imports": "^1.1.2",
|
|
132
137
|
"pretty-hrtime": "^1.0.3",
|
|
133
|
-
"string-width": "^
|
|
134
|
-
"youch": "^3.2
|
|
135
|
-
"youch-terminal": "^2.2.
|
|
138
|
+
"string-width": "^7.1.0",
|
|
139
|
+
"youch": "^3.3.2",
|
|
140
|
+
"youch-terminal": "^2.2.3"
|
|
136
141
|
},
|
|
137
142
|
"peerDependencies": {
|
|
138
|
-
"@adonisjs/assembler": "^
|
|
139
|
-
"@vinejs/vine": "^1.
|
|
140
|
-
"argon2": "^0.
|
|
141
|
-
"bcrypt": "^5.
|
|
143
|
+
"@adonisjs/assembler": "^7.0.0",
|
|
144
|
+
"@vinejs/vine": "^1.7.0",
|
|
145
|
+
"argon2": "^0.31.1",
|
|
146
|
+
"bcrypt": "^5.1.1",
|
|
147
|
+
"edge.js": "^6.0.1"
|
|
142
148
|
},
|
|
143
149
|
"peerDependenciesMeta": {
|
|
144
150
|
"argon2": {
|
|
@@ -152,6 +158,9 @@
|
|
|
152
158
|
},
|
|
153
159
|
"@vinejs/vine": {
|
|
154
160
|
"optional": true
|
|
161
|
+
},
|
|
162
|
+
"edge.js": {
|
|
163
|
+
"optional": true
|
|
155
164
|
}
|
|
156
165
|
},
|
|
157
166
|
"author": "virk,adonisjs",
|
|
@@ -180,11 +189,11 @@
|
|
|
180
189
|
},
|
|
181
190
|
"publishConfig": {
|
|
182
191
|
"access": "public",
|
|
183
|
-
"tag": "
|
|
192
|
+
"tag": "latest"
|
|
184
193
|
},
|
|
185
194
|
"np": {
|
|
186
195
|
"message": "chore(release): %s",
|
|
187
|
-
"tag": "
|
|
196
|
+
"tag": "latest",
|
|
188
197
|
"branch": "main",
|
|
189
198
|
"anyBranch": false
|
|
190
199
|
},
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../modules/ace/main.js';
|
|
2
|
-
import type { CommandOptions } from '../../types/ace.js';
|
|
3
|
-
/**
|
|
4
|
-
* Base command for make commands
|
|
5
|
-
*/
|
|
6
|
-
export default abstract class extends BaseCommand {
|
|
7
|
-
/**
|
|
8
|
-
* Allowing unknown flags to enable custom workflows
|
|
9
|
-
*/
|
|
10
|
-
static options: CommandOptions;
|
|
11
|
-
/**
|
|
12
|
-
* Generates the resource from stub
|
|
13
|
-
*/
|
|
14
|
-
protected generate(stubPath: string, stubState: Record<string, any>): Promise<{
|
|
15
|
-
relativeFileName: string;
|
|
16
|
-
contents: any;
|
|
17
|
-
destination: any;
|
|
18
|
-
attributes: any;
|
|
19
|
-
status: "created";
|
|
20
|
-
skipReason: null;
|
|
21
|
-
} | {
|
|
22
|
-
relativeFileName: string;
|
|
23
|
-
contents: any;
|
|
24
|
-
destination: any;
|
|
25
|
-
attributes: any;
|
|
26
|
-
status: "force_created";
|
|
27
|
-
skipReason: null;
|
|
28
|
-
} | {
|
|
29
|
-
relativeFileName: string;
|
|
30
|
-
contents: any;
|
|
31
|
-
destination: any;
|
|
32
|
-
attributes: any;
|
|
33
|
-
status: "skipped";
|
|
34
|
-
skipReason: string;
|
|
35
|
-
}>;
|
|
36
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
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 { stubsRoot } from '../../stubs/index.js';
|
|
10
|
-
import { BaseCommand } from '../../modules/ace/main.js';
|
|
11
|
-
/**
|
|
12
|
-
* Base command for make commands
|
|
13
|
-
*/
|
|
14
|
-
export default class default_1 extends BaseCommand {
|
|
15
|
-
/**
|
|
16
|
-
* Allowing unknown flags to enable custom workflows
|
|
17
|
-
*/
|
|
18
|
-
static options = {
|
|
19
|
-
allowUnknownFlags: true,
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Generates the resource from stub
|
|
23
|
-
*/
|
|
24
|
-
async generate(stubPath, stubState) {
|
|
25
|
-
return this.makeUsingStub(stubPath, stubState, stubsRoot);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="@types/node" resolution-mode="require"/>
|
|
2
|
-
/**
|
|
3
|
-
* Ace shell is used to run the ace commands inside a TypeScript project
|
|
4
|
-
* without pre-compiling TypeScript source files.
|
|
5
|
-
*
|
|
6
|
-
* Under the hood a child process is used to execute the "bin/console.ts" file. This
|
|
7
|
-
* is required because we have to use "ts-node/esm" loader in order to run TypeScript
|
|
8
|
-
* files.
|
|
9
|
-
*/
|
|
10
|
-
export declare function aceShell(cwd: URL): {
|
|
11
|
-
handle(argv: string[]): Promise<void>;
|
|
12
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
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
|
-
const DEFAULT_NODE_ARGS = [
|
|
10
|
-
// Use ts-node/esm loader. The project must install it
|
|
11
|
-
'--loader=ts-node/esm',
|
|
12
|
-
// Disable annonying warnings
|
|
13
|
-
'--no-warnings',
|
|
14
|
-
// Enable expiremental meta resolve for cases where someone uses magic import string
|
|
15
|
-
'--experimental-import-meta-resolve',
|
|
16
|
-
// Enable source maps, since TSNode source maps are broken
|
|
17
|
-
'--enable-source-maps',
|
|
18
|
-
];
|
|
19
|
-
/**
|
|
20
|
-
* Ace shell is used to run the ace commands inside a TypeScript project
|
|
21
|
-
* without pre-compiling TypeScript source files.
|
|
22
|
-
*
|
|
23
|
-
* Under the hood a child process is used to execute the "bin/console.ts" file. This
|
|
24
|
-
* is required because we have to use "ts-node/esm" loader in order to run TypeScript
|
|
25
|
-
* files.
|
|
26
|
-
*/
|
|
27
|
-
export function aceShell(cwd) {
|
|
28
|
-
return {
|
|
29
|
-
async handle(argv) {
|
|
30
|
-
const { execaNode } = await import('execa');
|
|
31
|
-
const childProcess = execaNode('bin/console.js', argv, {
|
|
32
|
-
nodeOptions: DEFAULT_NODE_ARGS,
|
|
33
|
-
preferLocal: true,
|
|
34
|
-
windowsHide: false,
|
|
35
|
-
localDir: cwd,
|
|
36
|
-
cwd,
|
|
37
|
-
buffer: false,
|
|
38
|
-
stdio: 'inherit',
|
|
39
|
-
});
|
|
40
|
-
try {
|
|
41
|
-
const result = await childProcess;
|
|
42
|
-
process.exitCode = result.exitCode;
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
process.exitCode = 1;
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { HashDriversList } from '../../src/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* A global collection of Hash drivers
|
|
4
|
-
*/
|
|
5
|
-
declare class HashDriversCollection {
|
|
6
|
-
/**
|
|
7
|
-
* List of registered drivers
|
|
8
|
-
*/
|
|
9
|
-
list: Partial<HashDriversList>;
|
|
10
|
-
/**
|
|
11
|
-
* Extend drivers collection and add a custom
|
|
12
|
-
* driver to it.
|
|
13
|
-
*/
|
|
14
|
-
extend<Name extends keyof HashDriversList>(driverName: Name, factoryCallback: HashDriversList[Name]): this;
|
|
15
|
-
/**
|
|
16
|
-
* Creates the driver instance with config
|
|
17
|
-
*/
|
|
18
|
-
create<Name extends keyof HashDriversList>(name: Name, config: Parameters<HashDriversList[Name]>[0]): import("@adonisjs/hash").Bcrypt | import("@adonisjs/hash").Argon | import("@adonisjs/hash").Scrypt;
|
|
19
|
-
}
|
|
20
|
-
declare const _default: HashDriversCollection;
|
|
21
|
-
export default _default;
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
/**
|
|
10
|
-
* This class exists in the core, because it maintains a list of
|
|
11
|
-
* globally available drivers applicable to the hash manager
|
|
12
|
-
* instance registered with the container.
|
|
13
|
-
*
|
|
14
|
-
* In other words, these drivers are not needed by the hash module
|
|
15
|
-
* regular usage and specific to AdonisJS container flow.
|
|
16
|
-
*/
|
|
17
|
-
import { RuntimeException } from '@poppinss/utils';
|
|
18
|
-
/**
|
|
19
|
-
* A global collection of Hash drivers
|
|
20
|
-
*/
|
|
21
|
-
class HashDriversCollection {
|
|
22
|
-
/**
|
|
23
|
-
* List of registered drivers
|
|
24
|
-
*/
|
|
25
|
-
list = {};
|
|
26
|
-
/**
|
|
27
|
-
* Extend drivers collection and add a custom
|
|
28
|
-
* driver to it.
|
|
29
|
-
*/
|
|
30
|
-
extend(driverName, factoryCallback) {
|
|
31
|
-
this.list[driverName] = factoryCallback;
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Creates the driver instance with config
|
|
36
|
-
*/
|
|
37
|
-
create(name, config) {
|
|
38
|
-
const driverFactory = this.list[name];
|
|
39
|
-
if (!driverFactory) {
|
|
40
|
-
throw new RuntimeException(`Unknown hash driver "${String(name)}". Make sure the driver is registered`);
|
|
41
|
-
}
|
|
42
|
-
return driverFactory(config);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
export default new HashDriversCollection();
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ApplicationService } from '../src/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Http Service provider binds the router and the HTTP server to
|
|
4
|
-
* the container.
|
|
5
|
-
*/
|
|
6
|
-
export default class HttpServiceProvider {
|
|
7
|
-
protected app: ApplicationService;
|
|
8
|
-
constructor(app: ApplicationService);
|
|
9
|
-
/**
|
|
10
|
-
* Registers the HTTP server with the container as a singleton
|
|
11
|
-
*/
|
|
12
|
-
protected registerServer(): void;
|
|
13
|
-
/**
|
|
14
|
-
* Registers router with the container as a singleton
|
|
15
|
-
*/
|
|
16
|
-
protected registerRouter(): void;
|
|
17
|
-
/**
|
|
18
|
-
* Self construct bodyparser middleware class, since it needs
|
|
19
|
-
* config that cannot be resolved by the container
|
|
20
|
-
*/
|
|
21
|
-
protected registerBodyParserMiddleware(): void;
|
|
22
|
-
/**
|
|
23
|
-
* Registers bindings
|
|
24
|
-
*/
|
|
25
|
-
register(): void;
|
|
26
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
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 { Router, Server } from '../modules/http/main.js';
|
|
10
|
-
import BodyParserMiddleware from '../modules/bodyparser/bodyparser_middleware.js';
|
|
11
|
-
/**
|
|
12
|
-
* Http Service provider binds the router and the HTTP server to
|
|
13
|
-
* the container.
|
|
14
|
-
*/
|
|
15
|
-
export default class HttpServiceProvider {
|
|
16
|
-
app;
|
|
17
|
-
constructor(app) {
|
|
18
|
-
this.app = app;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Registers the HTTP server with the container as a singleton
|
|
22
|
-
*/
|
|
23
|
-
registerServer() {
|
|
24
|
-
this.app.container.singleton(Server, async (resolver) => {
|
|
25
|
-
const encryption = await resolver.make('encryption');
|
|
26
|
-
const emitter = await resolver.make('emitter');
|
|
27
|
-
const logger = await resolver.make('logger');
|
|
28
|
-
const config = this.app.config.get('app.http');
|
|
29
|
-
return new Server(this.app, encryption, emitter, logger, config);
|
|
30
|
-
});
|
|
31
|
-
this.app.container.alias('server', Server);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Registers router with the container as a singleton
|
|
35
|
-
*/
|
|
36
|
-
registerRouter() {
|
|
37
|
-
this.app.container.singleton(Router, async (resolver) => {
|
|
38
|
-
const server = await resolver.make('server');
|
|
39
|
-
return server.getRouter();
|
|
40
|
-
});
|
|
41
|
-
this.app.container.alias('router', Router);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Self construct bodyparser middleware class, since it needs
|
|
45
|
-
* config that cannot be resolved by the container
|
|
46
|
-
*/
|
|
47
|
-
registerBodyParserMiddleware() {
|
|
48
|
-
this.app.container.bind(BodyParserMiddleware, () => {
|
|
49
|
-
const config = this.app.config.get('bodyparser');
|
|
50
|
-
return new BodyParserMiddleware(config);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Registers bindings
|
|
55
|
-
*/
|
|
56
|
-
register() {
|
|
57
|
-
this.registerServer();
|
|
58
|
-
this.registerRouter();
|
|
59
|
-
this.registerBodyParserMiddleware();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
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
|
-
/**
|
|
10
|
-
* Resolves a container binding and sets it on the REPL
|
|
11
|
-
* context
|
|
12
|
-
*/
|
|
13
|
-
async function resolveBindingForRepl(app, repl, binding) {
|
|
14
|
-
repl.server.context[binding] = await app.container.make(binding);
|
|
15
|
-
repl.notify(`Loaded "${binding}" service. You can access it using the "${repl.colors.underline(binding)}" variable`);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Registers REPL methods
|
|
19
|
-
*/
|
|
20
|
-
export function defineReplBindings(app, repl) {
|
|
21
|
-
repl.addMethod('importDefault', (_, modulePath) => {
|
|
22
|
-
return app.importDefault(modulePath);
|
|
23
|
-
}, {
|
|
24
|
-
description: 'Returns the default export for a module',
|
|
25
|
-
});
|
|
26
|
-
repl.addMethod('make', (_, service, runtimeValues) => {
|
|
27
|
-
return app.container.make(service, runtimeValues);
|
|
28
|
-
}, {
|
|
29
|
-
description: 'Make class instance using "container.make" method',
|
|
30
|
-
});
|
|
31
|
-
repl.addMethod('loadApp', () => {
|
|
32
|
-
return resolveBindingForRepl(app, repl, 'app');
|
|
33
|
-
}, {
|
|
34
|
-
description: 'Load "app" service in the REPL context',
|
|
35
|
-
});
|
|
36
|
-
repl.addMethod('loadEncryption', () => {
|
|
37
|
-
return resolveBindingForRepl(app, repl, 'encryption');
|
|
38
|
-
}, {
|
|
39
|
-
description: 'Load "encryption" service in the REPL context',
|
|
40
|
-
});
|
|
41
|
-
repl.addMethod('loadHash', () => {
|
|
42
|
-
return resolveBindingForRepl(app, repl, 'hash');
|
|
43
|
-
}, {
|
|
44
|
-
description: 'Load "hash" service in the REPL context',
|
|
45
|
-
});
|
|
46
|
-
repl.addMethod('loadRouter', () => {
|
|
47
|
-
return resolveBindingForRepl(app, repl, 'router');
|
|
48
|
-
}, {
|
|
49
|
-
description: 'Load "router" service in the REPL context',
|
|
50
|
-
});
|
|
51
|
-
repl.addMethod('loadConfig', () => {
|
|
52
|
-
return resolveBindingForRepl(app, repl, 'config');
|
|
53
|
-
}, {
|
|
54
|
-
description: 'Load "config" service in the REPL context',
|
|
55
|
-
});
|
|
56
|
-
repl.addMethod('loadTestUtils', () => {
|
|
57
|
-
return resolveBindingForRepl(app, repl, 'testUtils');
|
|
58
|
-
}, {
|
|
59
|
-
description: 'Load "testUtils" service in the REPL context',
|
|
60
|
-
});
|
|
61
|
-
repl.addMethod('loadHelpers', async () => {
|
|
62
|
-
const { default: isModule } = await import('../helpers/is.js');
|
|
63
|
-
const { default: stringModule } = await import('../helpers/string.js');
|
|
64
|
-
const { base64, cuid, fsReadAll, slash, parseImports } = await import('../helpers/main.js');
|
|
65
|
-
repl.server.context.helpers = {
|
|
66
|
-
string: stringModule,
|
|
67
|
-
is: isModule,
|
|
68
|
-
base64,
|
|
69
|
-
cuid,
|
|
70
|
-
fsReadAll,
|
|
71
|
-
slash,
|
|
72
|
-
parseImports,
|
|
73
|
-
};
|
|
74
|
-
repl.notify(`Loaded "helpers" module. You can access it using the "${repl.colors.underline('helpers')}" variable`);
|
|
75
|
-
}, {
|
|
76
|
-
description: 'Load "helpers" module in the REPL context',
|
|
77
|
-
});
|
|
78
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './validates_files.js';
|
|
@@ -1,22 +0,0 @@
|
|
|
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 {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|