@adonisjs/core 6.19.0 → 7.0.0-next.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/build/commands/add.d.ts +4 -5
- package/build/commands/add.js +7 -60
- package/build/commands/build.d.ts +1 -3
- package/build/commands/build.js +4 -36
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.d.ts +3 -3
- package/build/commands/configure.js +3 -3
- package/build/commands/eject.d.ts +1 -1
- package/build/commands/eject.js +3 -3
- package/build/commands/env/add.d.ts +2 -2
- package/build/commands/env/add.js +2 -2
- package/build/commands/generate_key.d.ts +1 -1
- package/build/commands/generate_key.js +1 -1
- package/build/commands/inspect_rcfile.d.ts +1 -1
- package/build/commands/inspect_rcfile.js +1 -1
- package/build/commands/list/routes.d.ts +2 -2
- package/build/commands/list/routes.js +2 -2
- package/build/commands/make/command.d.ts +1 -1
- package/build/commands/make/command.js +3 -3
- package/build/commands/make/controller.d.ts +2 -2
- package/build/commands/make/controller.js +2 -2
- package/build/commands/make/event.d.ts +2 -2
- package/build/commands/make/event.js +2 -2
- package/build/commands/make/exception.d.ts +2 -2
- package/build/commands/make/exception.js +2 -2
- package/build/commands/make/listener.d.ts +2 -2
- package/build/commands/make/listener.js +2 -2
- package/build/commands/make/middleware.d.ts +2 -2
- package/build/commands/make/middleware.js +4 -4
- package/build/commands/make/preload.d.ts +1 -1
- package/build/commands/make/preload.js +4 -4
- package/build/commands/make/provider.d.ts +1 -1
- package/build/commands/make/provider.js +4 -4
- package/build/commands/make/service.d.ts +2 -2
- package/build/commands/make/service.js +2 -2
- package/build/commands/make/test.d.ts +1 -1
- package/build/commands/make/test.js +2 -2
- package/build/commands/make/validator.d.ts +2 -2
- package/build/commands/make/validator.js +2 -2
- package/build/commands/make/view.d.ts +1 -1
- package/build/commands/make/view.js +2 -2
- package/build/commands/repl.d.ts +2 -2
- package/build/commands/repl.js +1 -1
- package/build/commands/serve.d.ts +2 -4
- package/build/commands/serve.js +11 -43
- package/build/commands/test.d.ts +2 -4
- package/build/commands/test.js +4 -32
- package/build/factories/core/ace.d.ts +31 -4
- package/build/factories/core/ace.js +20 -4
- package/build/factories/core/ignitor.d.ts +80 -9
- package/build/factories/core/ignitor.js +84 -13
- package/build/factories/core/main.d.ts +3 -3
- package/build/factories/core/main.js +3 -3
- package/build/factories/core/test_utils.d.ts +32 -4
- package/build/factories/core/test_utils.js +21 -4
- package/build/factories/stubs.d.ts +54 -5
- package/build/factories/stubs.js +55 -6
- package/build/index.d.ts +5 -4
- package/build/index.js +13 -9
- package/build/modules/ace/codemods.d.ts +71 -11
- package/build/modules/ace/codemods.js +90 -22
- package/build/modules/ace/commands.d.ts +49 -13
- package/build/modules/ace/commands.js +48 -10
- package/build/modules/ace/create_kernel.d.ts +19 -8
- package/build/modules/ace/create_kernel.js +19 -8
- package/build/modules/ace/kernel.d.ts +18 -4
- package/build/modules/ace/kernel.js +17 -3
- package/build/modules/ace/main.d.ts +3 -3
- package/build/modules/ace/main.js +3 -3
- package/build/modules/dumper/define_config.d.ts +25 -4
- package/build/modules/dumper/define_config.js +23 -2
- package/build/modules/dumper/dumper.d.ts +82 -12
- package/build/modules/dumper/dumper.js +82 -12
- package/build/modules/dumper/errors.d.ts +31 -10
- package/build/modules/dumper/errors.js +28 -7
- package/build/modules/dumper/main.d.ts +3 -3
- package/build/modules/dumper/main.js +3 -3
- package/build/modules/dumper/plugins/edge.d.ts +1 -1
- package/build/modules/hash/define_config.d.ts +53 -8
- package/build/modules/hash/define_config.js +51 -6
- package/build/modules/hash/main.d.ts +1 -1
- package/build/modules/hash/main.js +1 -1
- package/build/modules/http/main.d.ts +1 -1
- package/build/modules/http/main.js +1 -1
- package/build/modules/http/request_validator.d.ts +36 -9
- package/build/modules/http/request_validator.js +32 -5
- package/build/modules/transformers/main.d.ts +1 -0
- package/build/modules/transformers/main.js +9 -0
- package/build/providers/app_provider.d.ts +173 -1
- package/build/providers/app_provider.js +204 -8
- package/build/providers/edge_provider.d.ts +31 -2
- package/build/providers/edge_provider.js +31 -2
- package/build/providers/hash_provider.d.ts +38 -1
- package/build/providers/hash_provider.js +40 -3
- package/build/providers/repl_provider.d.ts +40 -1
- package/build/providers/repl_provider.js +52 -2
- package/build/providers/vinejs_provider.d.ts +32 -5
- package/build/providers/vinejs_provider.js +31 -4
- package/build/services/ace.d.ts +1 -1
- package/build/services/ace.js +1 -1
- package/build/services/app.d.ts +1 -1
- package/build/services/config.d.ts +1 -1
- package/build/services/config.js +1 -1
- package/build/services/dumper.js +1 -1
- package/build/services/emitter.d.ts +1 -1
- package/build/services/emitter.js +1 -1
- package/build/services/encryption.d.ts +1 -1
- package/build/services/encryption.js +1 -1
- package/build/services/hash.d.ts +1 -1
- package/build/services/hash.js +1 -1
- package/build/services/logger.d.ts +1 -1
- package/build/services/logger.js +1 -1
- package/build/services/repl.d.ts +1 -1
- package/build/services/repl.js +1 -1
- package/build/services/router.d.ts +1 -1
- package/build/services/router.js +1 -1
- package/build/services/server.d.ts +1 -1
- package/build/services/server.js +1 -1
- package/build/services/test_utils.d.ts +1 -1
- package/build/services/test_utils.js +1 -1
- package/build/services/url_builder.d.ts +4 -0
- package/build/services/url_builder.js +21 -0
- package/build/src/assembler_hooks/index_entities.d.ts +51 -0
- package/build/src/assembler_hooks/index_entities.js +96 -0
- package/build/src/cli_formatters/routes_list.d.ts +24 -12
- package/build/src/cli_formatters/routes_list.js +43 -46
- package/build/src/config_provider.d.ts +48 -3
- package/build/src/config_provider.js +47 -2
- package/build/src/debug.d.ts +15 -0
- package/build/src/debug.js +15 -0
- package/build/src/exceptions.d.ts +41 -1
- package/build/src/exceptions.js +41 -1
- package/build/src/helpers/assert.d.ts +47 -1
- package/build/src/helpers/assert.js +47 -1
- package/build/src/helpers/is.d.ts +21 -0
- package/build/src/helpers/is.js +21 -0
- package/build/src/helpers/main.d.ts +48 -5
- package/build/src/helpers/main.js +48 -5
- package/build/src/helpers/string.d.ts +89 -9
- package/build/src/helpers/string.js +15 -2
- package/build/src/helpers/types.d.ts +96 -2
- package/build/src/helpers/types.js +96 -2
- package/build/src/helpers/verification_token.d.ts +22 -1
- package/build/src/helpers/verification_token.js +24 -2
- package/build/src/ignitor/ace.d.ts +23 -3
- package/build/src/ignitor/ace.js +21 -1
- package/build/src/ignitor/http.d.ts +16 -3
- package/build/src/ignitor/http.js +16 -3
- package/build/src/ignitor/main.d.ts +29 -6
- package/build/src/ignitor/main.js +30 -7
- package/build/src/ignitor/test.d.ts +26 -3
- package/build/src/ignitor/test.js +24 -1
- package/build/src/test_utils/http.d.ts +19 -3
- package/build/src/test_utils/http.js +24 -3
- package/build/src/test_utils/main.d.ts +22 -4
- package/build/src/test_utils/main.js +21 -3
- package/build/src/types.d.ts +277 -26
- package/build/src/utils.d.ts +34 -0
- package/build/src/utils.js +49 -0
- package/build/src/vine.d.ts +24 -1
- package/build/src/vine.js +27 -1
- package/build/stubs/main.js +1 -2
- package/build/toolkit/main.js +1 -1
- package/build/types/helpers.d.ts +2 -1
- package/build/types/transformers.d.ts +1 -0
- package/build/types/transformers.js +9 -0
- package/package.json +51 -50
- package/build/src/helpers/parse_binding_reference.d.ts +0 -45
- package/build/src/helpers/parse_binding_reference.js +0 -83
- package/build/src/internal_helpers.d.ts +0 -15
- package/build/src/internal_helpers.js +0 -63
|
@@ -7,20 +7,49 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
import edge from 'edge.js';
|
|
10
|
-
import { pluginEdgeDumper } from
|
|
11
|
-
import { BriskRoute, HttpContext } from
|
|
10
|
+
import { pluginEdgeDumper } from "../modules/dumper/plugins/edge.js";
|
|
11
|
+
import { BriskRoute, HttpContext } from "../modules/http/main.js";
|
|
12
12
|
/**
|
|
13
13
|
* The Edge service provider configures Edge to work within
|
|
14
14
|
* an AdonisJS application environment
|
|
15
|
+
*
|
|
16
|
+
* This provider integrates EdgeJS template engine with AdonisJS by:
|
|
17
|
+
* - Mounting the views directory
|
|
18
|
+
* - Configuring template caching for production
|
|
19
|
+
* - Adding global helpers for route generation
|
|
20
|
+
* - Creating isolated renderer instances for HTTP contexts
|
|
21
|
+
* - Adding render macro to BriskRoute for template rendering
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* const provider = new EdgeServiceProvider(app)
|
|
25
|
+
* await provider.boot()
|
|
15
26
|
*/
|
|
16
27
|
export default class EdgeServiceProvider {
|
|
17
28
|
app;
|
|
29
|
+
/**
|
|
30
|
+
* Edge service provider constructor
|
|
31
|
+
*
|
|
32
|
+
* Sets the usingEdgeJS flag to true to indicate EdgeJS is being used.
|
|
33
|
+
*
|
|
34
|
+
* @param app - The application service instance
|
|
35
|
+
*/
|
|
18
36
|
constructor(app) {
|
|
19
37
|
this.app = app;
|
|
20
38
|
this.app.usingEdgeJS = true;
|
|
21
39
|
}
|
|
22
40
|
/**
|
|
23
41
|
* Bridge AdonisJS and Edge
|
|
42
|
+
*
|
|
43
|
+
* Configures EdgeJS integration by:
|
|
44
|
+
* - Setting up template mounting and caching
|
|
45
|
+
* - Defining global helpers (route, signedRoute, app, config)
|
|
46
|
+
* - Adding view getter to HttpContext for isolated rendering
|
|
47
|
+
* - Adding render macro to BriskRoute
|
|
48
|
+
* - Registering dumper plugin
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* await provider.boot()
|
|
52
|
+
* // Now edge templates can use {{ route('home') }} helper
|
|
24
53
|
*/
|
|
25
54
|
async boot() {
|
|
26
55
|
const app = this.app;
|
|
@@ -1,21 +1,58 @@
|
|
|
1
|
-
import type { ApplicationService } from '../src/types.
|
|
1
|
+
import type { ApplicationService } from '../src/types.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Registers the passwords hasher with the container
|
|
4
|
+
*
|
|
5
|
+
* This provider sets up password hashing functionality by:
|
|
6
|
+
* - Registering the HashManager with configuration from config/hash.ts
|
|
7
|
+
* - Providing a Hash class that uses the default hasher
|
|
8
|
+
* - Supporting multiple hashing drivers (bcrypt, argon2, etc.)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const provider = new HashServiceProvider(app)
|
|
12
|
+
* provider.register()
|
|
13
|
+
* const hash = await app.container.make('hash')
|
|
4
14
|
*/
|
|
5
15
|
export default class HashServiceProvider {
|
|
6
16
|
protected app: ApplicationService;
|
|
17
|
+
/**
|
|
18
|
+
* Hash service provider constructor
|
|
19
|
+
*
|
|
20
|
+
* @param app - The application service instance
|
|
21
|
+
*/
|
|
7
22
|
constructor(app: ApplicationService);
|
|
8
23
|
/**
|
|
9
24
|
* Registering the hash class to resolve an instance with the
|
|
10
25
|
* default hasher.
|
|
26
|
+
*
|
|
27
|
+
* Creates a singleton binding for the Hash class that resolves
|
|
28
|
+
* the default hasher from the hash manager.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* const hash = await container.make(Hash)
|
|
32
|
+
* const hashed = await hash.make('password')
|
|
11
33
|
*/
|
|
12
34
|
protected registerHash(): void;
|
|
13
35
|
/**
|
|
14
36
|
* Registers the hash manager with the container
|
|
37
|
+
*
|
|
38
|
+
* Creates a singleton binding for 'hash' that instantiates
|
|
39
|
+
* the HashManager with configuration from config/hash.ts file.
|
|
40
|
+
* Throws an error if the configuration is invalid.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* const hashManager = await container.make('hash')
|
|
44
|
+
* const bcryptHasher = hashManager.use('bcrypt')
|
|
15
45
|
*/
|
|
16
46
|
protected registerHashManager(): void;
|
|
17
47
|
/**
|
|
18
48
|
* Registers bindings
|
|
49
|
+
*
|
|
50
|
+
* Called during the application bootstrap phase to register
|
|
51
|
+
* the hash manager and hash class with the IoC container.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* const provider = new HashServiceProvider(app)
|
|
55
|
+
* provider.register() // Registers hash services
|
|
19
56
|
*/
|
|
20
57
|
register(): void;
|
|
21
58
|
}
|
|
@@ -6,20 +6,42 @@
|
|
|
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 { RuntimeException } from '@poppinss/utils';
|
|
10
|
-
import { Hash } from
|
|
11
|
-
import { configProvider } from
|
|
9
|
+
import { RuntimeException } from '@poppinss/utils/exception';
|
|
10
|
+
import { Hash } from "../modules/hash/main.js";
|
|
11
|
+
import { configProvider } from "../src/config_provider.js";
|
|
12
12
|
/**
|
|
13
13
|
* Registers the passwords hasher with the container
|
|
14
|
+
*
|
|
15
|
+
* This provider sets up password hashing functionality by:
|
|
16
|
+
* - Registering the HashManager with configuration from config/hash.ts
|
|
17
|
+
* - Providing a Hash class that uses the default hasher
|
|
18
|
+
* - Supporting multiple hashing drivers (bcrypt, argon2, etc.)
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const provider = new HashServiceProvider(app)
|
|
22
|
+
* provider.register()
|
|
23
|
+
* const hash = await app.container.make('hash')
|
|
14
24
|
*/
|
|
15
25
|
export default class HashServiceProvider {
|
|
16
26
|
app;
|
|
27
|
+
/**
|
|
28
|
+
* Hash service provider constructor
|
|
29
|
+
*
|
|
30
|
+
* @param app - The application service instance
|
|
31
|
+
*/
|
|
17
32
|
constructor(app) {
|
|
18
33
|
this.app = app;
|
|
19
34
|
}
|
|
20
35
|
/**
|
|
21
36
|
* Registering the hash class to resolve an instance with the
|
|
22
37
|
* default hasher.
|
|
38
|
+
*
|
|
39
|
+
* Creates a singleton binding for the Hash class that resolves
|
|
40
|
+
* the default hasher from the hash manager.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* const hash = await container.make(Hash)
|
|
44
|
+
* const hashed = await hash.make('password')
|
|
23
45
|
*/
|
|
24
46
|
registerHash() {
|
|
25
47
|
this.app.container.singleton(Hash, async (resolver) => {
|
|
@@ -29,6 +51,14 @@ export default class HashServiceProvider {
|
|
|
29
51
|
}
|
|
30
52
|
/**
|
|
31
53
|
* Registers the hash manager with the container
|
|
54
|
+
*
|
|
55
|
+
* Creates a singleton binding for 'hash' that instantiates
|
|
56
|
+
* the HashManager with configuration from config/hash.ts file.
|
|
57
|
+
* Throws an error if the configuration is invalid.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* const hashManager = await container.make('hash')
|
|
61
|
+
* const bcryptHasher = hashManager.use('bcrypt')
|
|
32
62
|
*/
|
|
33
63
|
registerHashManager() {
|
|
34
64
|
this.app.container.singleton('hash', async () => {
|
|
@@ -46,6 +76,13 @@ export default class HashServiceProvider {
|
|
|
46
76
|
}
|
|
47
77
|
/**
|
|
48
78
|
* Registers bindings
|
|
79
|
+
*
|
|
80
|
+
* Called during the application bootstrap phase to register
|
|
81
|
+
* the hash manager and hash class with the IoC container.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* const provider = new HashServiceProvider(app)
|
|
85
|
+
* provider.register() // Registers hash services
|
|
49
86
|
*/
|
|
50
87
|
register() {
|
|
51
88
|
this.registerHashManager();
|
|
@@ -1,13 +1,52 @@
|
|
|
1
|
-
import type { ApplicationService } from '../src/types.
|
|
1
|
+
import type { ApplicationService } from '../src/types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* REPL Service Provider configures the interactive Node.js REPL
|
|
4
|
+
* for AdonisJS applications
|
|
5
|
+
*
|
|
6
|
+
* This provider sets up:
|
|
7
|
+
* - REPL instance with history file support
|
|
8
|
+
* - Helper methods for importing modules and making container bindings
|
|
9
|
+
* - Quick access methods for loading common services (app, router, etc.)
|
|
10
|
+
* - Utility methods for development and debugging
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const provider = new ReplServiceProvider(app)
|
|
14
|
+
* provider.register()
|
|
15
|
+
* await provider.boot()
|
|
16
|
+
*/
|
|
2
17
|
export default class ReplServiceProvider {
|
|
3
18
|
protected app: ApplicationService;
|
|
19
|
+
/**
|
|
20
|
+
* REPL service provider constructor
|
|
21
|
+
*
|
|
22
|
+
* @param app - The application service instance
|
|
23
|
+
*/
|
|
4
24
|
constructor(app: ApplicationService);
|
|
5
25
|
/**
|
|
6
26
|
* Registers the REPL binding
|
|
27
|
+
*
|
|
28
|
+
* Creates a singleton binding for the REPL with history file
|
|
29
|
+
* support in the user's home directory.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* const provider = new ReplServiceProvider(app)
|
|
33
|
+
* provider.register()
|
|
34
|
+
* const repl = await app.container.make('repl')
|
|
7
35
|
*/
|
|
8
36
|
register(): void;
|
|
9
37
|
/**
|
|
10
38
|
* Registering REPL bindings during provider boot
|
|
39
|
+
*
|
|
40
|
+
* Adds helper methods to the REPL instance including:
|
|
41
|
+
* - importDefault: Import default export from modules
|
|
42
|
+
* - importAll: Import all files from a directory
|
|
43
|
+
* - make: Create instances using container.make
|
|
44
|
+
* - load* methods: Quick access to common services
|
|
45
|
+
* - loadHelpers: Load utility helper functions
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* await provider.boot()
|
|
49
|
+
* // REPL now has helper methods available
|
|
11
50
|
*/
|
|
12
51
|
boot(): Promise<void>;
|
|
13
52
|
}
|
|
@@ -8,23 +8,62 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { join } from 'node:path';
|
|
10
10
|
import { homedir } from 'node:os';
|
|
11
|
-
import { fsImportAll } from '@poppinss/utils';
|
|
12
|
-
import { Repl } from
|
|
11
|
+
import { fsImportAll } from '@poppinss/utils/fs';
|
|
12
|
+
import { Repl } from "../modules/repl.js";
|
|
13
13
|
/**
|
|
14
14
|
* Resolves a container binding and sets it on the REPL
|
|
15
15
|
* context
|
|
16
|
+
*
|
|
17
|
+
* This helper function makes a service from the container and
|
|
18
|
+
* adds it to the REPL context with a notification message.
|
|
19
|
+
*
|
|
20
|
+
* @param app - The application service instance
|
|
21
|
+
* @param repl - The REPL instance to add the binding to
|
|
22
|
+
* @param binding - The container binding key to resolve
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* await resolveBindingForRepl(app, repl, 'router')
|
|
26
|
+
* // Now 'router' variable is available in REPL
|
|
16
27
|
*/
|
|
17
28
|
async function resolveBindingForRepl(app, repl, binding) {
|
|
18
29
|
repl.server.context[binding] = await app.container.make(binding);
|
|
19
30
|
repl.notify(`Loaded "${binding}" service. You can access it using the "${repl.colors.underline(binding)}" variable`);
|
|
20
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* REPL Service Provider configures the interactive Node.js REPL
|
|
34
|
+
* for AdonisJS applications
|
|
35
|
+
*
|
|
36
|
+
* This provider sets up:
|
|
37
|
+
* - REPL instance with history file support
|
|
38
|
+
* - Helper methods for importing modules and making container bindings
|
|
39
|
+
* - Quick access methods for loading common services (app, router, etc.)
|
|
40
|
+
* - Utility methods for development and debugging
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* const provider = new ReplServiceProvider(app)
|
|
44
|
+
* provider.register()
|
|
45
|
+
* await provider.boot()
|
|
46
|
+
*/
|
|
21
47
|
export default class ReplServiceProvider {
|
|
22
48
|
app;
|
|
49
|
+
/**
|
|
50
|
+
* REPL service provider constructor
|
|
51
|
+
*
|
|
52
|
+
* @param app - The application service instance
|
|
53
|
+
*/
|
|
23
54
|
constructor(app) {
|
|
24
55
|
this.app = app;
|
|
25
56
|
}
|
|
26
57
|
/**
|
|
27
58
|
* Registers the REPL binding
|
|
59
|
+
*
|
|
60
|
+
* Creates a singleton binding for the REPL with history file
|
|
61
|
+
* support in the user's home directory.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* const provider = new ReplServiceProvider(app)
|
|
65
|
+
* provider.register()
|
|
66
|
+
* const repl = await app.container.make('repl')
|
|
28
67
|
*/
|
|
29
68
|
register() {
|
|
30
69
|
this.app.container.singleton(Repl, async () => {
|
|
@@ -36,6 +75,17 @@ export default class ReplServiceProvider {
|
|
|
36
75
|
}
|
|
37
76
|
/**
|
|
38
77
|
* Registering REPL bindings during provider boot
|
|
78
|
+
*
|
|
79
|
+
* Adds helper methods to the REPL instance including:
|
|
80
|
+
* - importDefault: Import default export from modules
|
|
81
|
+
* - importAll: Import all files from a directory
|
|
82
|
+
* - make: Create instances using container.make
|
|
83
|
+
* - load* methods: Quick access to common services
|
|
84
|
+
* - loadHelpers: Load utility helper functions
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* await provider.boot()
|
|
88
|
+
* // REPL now has helper methods available
|
|
39
89
|
*/
|
|
40
90
|
async boot() {
|
|
41
91
|
this.app.container.resolving('repl', (repl) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ApplicationService } from '../src/types.
|
|
2
|
-
import { RequestValidator } from '../modules/http/main.
|
|
3
|
-
import { FileRuleValidationOptions, VineMultipartFile } from '../src/vine.
|
|
1
|
+
import type { ApplicationService } from '../src/types.ts';
|
|
2
|
+
import { RequestValidator } from '../modules/http/main.ts';
|
|
3
|
+
import { type FileRuleValidationOptions, VineMultipartFile } from '../src/vine.ts';
|
|
4
4
|
/**
|
|
5
5
|
* Extend VineJS
|
|
6
6
|
*/
|
|
@@ -17,11 +17,38 @@ declare module '@adonisjs/core/http' {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* The
|
|
21
|
-
*
|
|
20
|
+
* The VineJS service provider integrates VineJS validation
|
|
21
|
+
* library with AdonisJS application environment
|
|
22
|
+
*
|
|
23
|
+
* This provider sets up:
|
|
24
|
+
* - File validation rule for multipart file uploads
|
|
25
|
+
* - Request validation macro for easy validation in HTTP contexts
|
|
26
|
+
* - Extension of VineJS with AdonisJS-specific validation features
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const provider = new VineJSServiceProvider(app)
|
|
30
|
+
* provider.boot()
|
|
31
|
+
* // Now Request has validateUsing method
|
|
22
32
|
*/
|
|
23
33
|
export default class VineJSServiceProvider {
|
|
24
34
|
protected app: ApplicationService;
|
|
35
|
+
/**
|
|
36
|
+
* VineJS service provider constructor
|
|
37
|
+
*
|
|
38
|
+
* Sets the usingVineJS flag to true to indicate VineJS is being used.
|
|
39
|
+
*
|
|
40
|
+
* @param app - The application service instance
|
|
41
|
+
*/
|
|
25
42
|
constructor(app: ApplicationService);
|
|
43
|
+
/**
|
|
44
|
+
* Boot the VineJS service provider
|
|
45
|
+
*
|
|
46
|
+
* Extends VineJS with file validation macro and adds validateUsing
|
|
47
|
+
* method to the Request class for easy validation in HTTP contexts.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* provider.boot()
|
|
51
|
+
* // Now vine.file() and request.validateUsing() are available
|
|
52
|
+
*/
|
|
26
53
|
boot(): void;
|
|
27
54
|
}
|
|
@@ -7,18 +7,45 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
import { Vine } from '@vinejs/vine';
|
|
10
|
-
import { Request, RequestValidator } from
|
|
11
|
-
import { VineMultipartFile } from
|
|
10
|
+
import { Request, RequestValidator } from "../modules/http/main.js";
|
|
11
|
+
import { VineMultipartFile } from "../src/vine.js";
|
|
12
12
|
/**
|
|
13
|
-
* The
|
|
14
|
-
*
|
|
13
|
+
* The VineJS service provider integrates VineJS validation
|
|
14
|
+
* library with AdonisJS application environment
|
|
15
|
+
*
|
|
16
|
+
* This provider sets up:
|
|
17
|
+
* - File validation rule for multipart file uploads
|
|
18
|
+
* - Request validation macro for easy validation in HTTP contexts
|
|
19
|
+
* - Extension of VineJS with AdonisJS-specific validation features
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const provider = new VineJSServiceProvider(app)
|
|
23
|
+
* provider.boot()
|
|
24
|
+
* // Now Request has validateUsing method
|
|
15
25
|
*/
|
|
16
26
|
export default class VineJSServiceProvider {
|
|
17
27
|
app;
|
|
28
|
+
/**
|
|
29
|
+
* VineJS service provider constructor
|
|
30
|
+
*
|
|
31
|
+
* Sets the usingVineJS flag to true to indicate VineJS is being used.
|
|
32
|
+
*
|
|
33
|
+
* @param app - The application service instance
|
|
34
|
+
*/
|
|
18
35
|
constructor(app) {
|
|
19
36
|
this.app = app;
|
|
20
37
|
this.app.usingVineJS = true;
|
|
21
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Boot the VineJS service provider
|
|
41
|
+
*
|
|
42
|
+
* Extends VineJS with file validation macro and adds validateUsing
|
|
43
|
+
* method to the Request class for easy validation in HTTP contexts.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* provider.boot()
|
|
47
|
+
* // Now vine.file() and request.validateUsing() are available
|
|
48
|
+
*/
|
|
22
49
|
boot() {
|
|
23
50
|
const experimentalFlags = this.app.experimentalFlags;
|
|
24
51
|
/**
|
package/build/services/ace.d.ts
CHANGED
package/build/services/ace.js
CHANGED
package/build/services/app.d.ts
CHANGED
package/build/services/config.js
CHANGED
|
@@ -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 app from
|
|
9
|
+
import app from "./app.js";
|
|
10
10
|
let config;
|
|
11
11
|
/**
|
|
12
12
|
* The config service uses the config instance from the app service
|
package/build/services/dumper.js
CHANGED
|
@@ -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 app from
|
|
9
|
+
import app from "./app.js";
|
|
10
10
|
let dumper;
|
|
11
11
|
/**
|
|
12
12
|
* dumper service is an instance of the "Dumper" class stored inside
|
|
@@ -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 app from
|
|
9
|
+
import app from "./app.js";
|
|
10
10
|
let emitter;
|
|
11
11
|
/**
|
|
12
12
|
* Returns a singleton instance of the emitter class
|
|
@@ -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 app from
|
|
9
|
+
import app from "./app.js";
|
|
10
10
|
let encryption;
|
|
11
11
|
/**
|
|
12
12
|
* Returns a singleton instance of the encryption class
|
package/build/services/hash.d.ts
CHANGED
package/build/services/hash.js
CHANGED
|
@@ -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 app from
|
|
9
|
+
import app from "./app.js";
|
|
10
10
|
let hash;
|
|
11
11
|
/**
|
|
12
12
|
* Returns a singleton instance of the Hash manager from the
|
package/build/services/logger.js
CHANGED
|
@@ -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 app from
|
|
9
|
+
import app from "./app.js";
|
|
10
10
|
let logger;
|
|
11
11
|
/**
|
|
12
12
|
* Returns a singleton instance of the logger class
|
package/build/services/repl.d.ts
CHANGED
package/build/services/repl.js
CHANGED
|
@@ -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 app from
|
|
9
|
+
import app from "./app.js";
|
|
10
10
|
let repl;
|
|
11
11
|
/**
|
|
12
12
|
* Returns a singleton instance of the Repl class from
|
package/build/services/router.js
CHANGED
|
@@ -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 app from
|
|
9
|
+
import app from "./app.js";
|
|
10
10
|
let router;
|
|
11
11
|
/**
|
|
12
12
|
* Returns a singleton instance of the router class from
|
package/build/services/server.js
CHANGED
|
@@ -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 app from
|
|
9
|
+
import app from "./app.js";
|
|
10
10
|
let server;
|
|
11
11
|
/**
|
|
12
12
|
* Returns a singleton instance of the HTTP server
|
|
@@ -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 app from
|
|
9
|
+
import app from "./app.js";
|
|
10
10
|
let testUtils;
|
|
11
11
|
/**
|
|
12
12
|
* Returns a singleton instance of the TestUtils class
|
|
@@ -0,0 +1,21 @@
|
|
|
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 app from "./app.js";
|
|
10
|
+
let urlFor;
|
|
11
|
+
let signedUrlFor;
|
|
12
|
+
/**
|
|
13
|
+
* Returns a singleton instance of the router class from
|
|
14
|
+
* the container
|
|
15
|
+
*/
|
|
16
|
+
await app.booted(async () => {
|
|
17
|
+
const router = await app.container.make('router');
|
|
18
|
+
urlFor = router.urlBuilder.urlFor;
|
|
19
|
+
signedUrlFor = router.urlBuilder.signedUrlFor;
|
|
20
|
+
});
|
|
21
|
+
export { urlFor, signedUrlFor };
|