@adonisjs/core 6.1.5-26 → 6.1.5-28
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/configure.js +1 -0
- package/build/factories/core/ace.d.ts +1 -1
- package/build/factories/core/ignitor.d.ts +1 -1
- package/build/factories/core/ignitor.js +2 -4
- 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 +1 -1
- package/build/factories/stubs.d.ts +2 -2
- package/build/index.d.ts +10 -139
- package/build/index.js +4 -0
- package/build/modules/ace/codemods.d.ts +11 -6
- package/build/modules/ace/shell.d.ts +1 -1
- 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 -13
- package/build/modules/hash/define_config.js +49 -14
- 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.js +1 -0
- package/build/modules/http/request_validator.js +2 -2
- package/build/providers/app_provider.d.ts +14 -0
- package/build/providers/app_provider.js +42 -0
- package/build/providers/edge_provider.d.ts +1 -1
- package/build/providers/hash_provider.d.ts +1 -9
- package/build/providers/hash_provider.js +11 -28
- package/build/providers/vinejs_provider.d.ts +1 -1
- 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/ignitor/http.d.ts +2 -2
- package/build/src/ignitor/main.d.ts +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 +12 -14
- package/build/stubs/make/command/main.stub +6 -4
- 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/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 +5 -3
- package/build/stubs/make/view/main.stub +5 -3
- package/package.json +36 -34
- 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/modules/{env.d.ts → env/main.d.ts} +0 -0
- /package/build/modules/{env.js → env/main.js} +0 -0
|
@@ -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
|
-
}
|
|
File without changes
|
|
File without changes
|