@adonisjs/core 7.0.0-next.2 → 7.0.0-next.21
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/ace-sWl9sgM1.js +16 -0
- package/build/app-B6oge7b3.js +5 -0
- package/build/app-DNvbxVWl.js +5 -0
- package/build/bodyparser_middleware-BmARtnYe.js +3 -0
- package/build/chunk-B88MteZI.js +26 -0
- package/build/commands/add.d.ts +4 -3
- package/build/commands/add.js +76 -110
- package/build/commands/build.js +51 -107
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.js +82 -177
- package/build/commands/eject.js +17 -60
- package/build/commands/env/add.js +55 -134
- package/build/commands/generate_key.js +22 -66
- package/build/commands/inspect_rcfile.js +27 -55
- package/build/commands/list/routes.js +246 -116
- package/build/commands/make/command.js +15 -57
- package/build/commands/make/controller.js +43 -120
- package/build/commands/make/event.js +16 -62
- package/build/commands/make/exception.js +16 -62
- package/build/commands/make/listener.js +36 -93
- package/build/commands/make/middleware.js +41 -101
- package/build/commands/make/preload.js +47 -113
- package/build/commands/make/provider.js +47 -112
- package/build/commands/make/service.js +16 -55
- package/build/commands/make/test.js +47 -132
- package/build/commands/make/transformer.js +17 -64
- package/build/commands/make/validator.js +20 -80
- package/build/commands/make/view.js +15 -56
- package/build/commands/repl.js +17 -50
- package/build/commands/serve.js +80 -156
- package/build/commands/test.js +92 -208
- package/build/config-Dd2H6-_e.js +5 -0
- package/build/config_provider-DWVFHOQX.js +15 -0
- package/build/container-uxa8LpGI.js +5 -0
- package/build/core-BuPP8K6N.js +140 -0
- package/build/create_kernel-Cn8zVtvt.js +3 -0
- package/build/create_kernel-Cpqqa931.js +38 -0
- package/build/decorate-CJcHOoD-.js +7 -0
- package/build/define_config-CoWy5lbf.js +62 -0
- package/build/dumper-BTjb8j4y.js +147 -0
- package/build/edge-BVYR-Vjr.js +47 -0
- package/build/events-C4d0OPUI.js +5 -0
- package/build/exceptions-DNMesP42.js +2 -0
- package/build/factories/app.js +2 -9
- package/build/factories/bodyparser.js +2 -9
- package/build/factories/core/ace.js +16 -46
- package/build/factories/core/ignitor.js +13 -180
- package/build/factories/core/main.js +24 -11
- package/build/factories/core/test_utils.js +21 -43
- package/build/factories/encryption.d.ts +1 -1
- package/build/factories/encryption.js +2 -9
- package/build/factories/events.js +2 -9
- package/build/factories/hash.js +2 -9
- package/build/factories/http.js +2 -9
- package/build/factories/logger.js +2 -9
- package/build/factories/stubs.js +27 -91
- package/build/ignitor-BrmVPN5N.js +71 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +12 -46
- package/build/logger-0KKSqgPG.js +13 -0
- package/build/main-BU8NWUEG.js +73 -0
- package/build/main-Bfnr5tAw.js +2 -0
- package/build/main-BlJhxJJ2.js +81 -0
- package/build/main-C4B2SPOT.js +5 -0
- package/build/main-CZZ21eXm.js +171 -0
- package/build/main-D-WhqOOn.js +51 -0
- package/build/main-DOY5Q8Av.js +5 -0
- package/build/main-kn40V-hF.js +2 -0
- package/build/main-nojlltNo.js +30 -0
- package/build/{stubs/make → make}/health/controller.stub +5 -2
- package/build/modules/ace/codemods.d.ts +109 -14
- package/build/modules/ace/codemods.js +222 -382
- package/build/modules/ace/main.d.ts +30 -0
- package/build/modules/ace/main.js +2 -11
- package/build/modules/app.d.ts +17 -0
- package/build/modules/app.js +4 -9
- package/build/modules/bodyparser/bodyparser_middleware.js +2 -14
- package/build/modules/bodyparser/main.js +4 -9
- package/build/modules/config.d.ts +17 -0
- package/build/modules/config.js +4 -9
- package/build/modules/container.js +4 -9
- package/build/modules/dumper/dumper.d.ts +5 -0
- package/build/modules/dumper/main.d.ts +21 -0
- package/build/modules/dumper/main.js +6 -11
- package/build/modules/dumper/plugins/edge.js +2 -62
- package/build/modules/encryption/define_config.d.ts +128 -0
- package/build/modules/encryption/drivers/aes_256_cbc.d.ts +20 -0
- package/build/modules/encryption/drivers/aes_256_cbc.js +2 -0
- package/build/modules/encryption/drivers/aes_256_gcm.d.ts +21 -0
- package/build/modules/encryption/drivers/aes_256_gcm.js +2 -0
- package/build/modules/encryption/drivers/chacha20_poly1305.d.ts +21 -0
- package/build/modules/encryption/drivers/chacha20_poly1305.js +2 -0
- package/build/modules/encryption/main.d.ts +85 -0
- package/build/modules/encryption/main.js +5 -0
- package/build/modules/env/editor.js +2 -9
- package/build/modules/env/main.d.ts +19 -0
- package/build/modules/env/main.js +2 -9
- package/build/modules/events.js +4 -9
- package/build/modules/hash/drivers/argon.js +2 -9
- package/build/modules/hash/drivers/bcrypt.d.ts +11 -0
- package/build/modules/hash/drivers/bcrypt.js +2 -9
- package/build/modules/hash/drivers/scrypt.js +2 -9
- package/build/modules/hash/main.d.ts +18 -0
- package/build/modules/hash/main.js +5 -10
- package/build/modules/hash/phc_formatter.js +2 -9
- package/build/modules/health.js +2 -9
- package/build/modules/http/main.js +4 -15
- package/build/modules/http/request_validator.d.ts +1 -3
- package/build/modules/http/url_builder_client.d.ts +1 -0
- package/build/modules/http/url_builder_client.js +2 -0
- package/build/modules/logger.d.ts +30 -0
- package/build/modules/logger.js +4 -9
- package/build/modules/repl.js +4 -9
- package/build/modules/transformers/main.js +4 -9
- package/build/providers/app_provider.d.ts +14 -25
- package/build/providers/app_provider.js +155 -363
- package/build/providers/edge_provider.js +97 -114
- package/build/providers/hash_provider.js +28 -91
- package/build/providers/repl_provider.js +66 -152
- package/build/providers/vinejs_provider.d.ts +1 -1
- package/build/providers/vinejs_provider.js +19 -66
- package/build/repl-GSxgovJQ.js +5 -0
- package/build/services/ace.js +2 -17
- package/build/services/app.js +2 -21
- package/build/services/config.js +2 -13
- package/build/services/dumper.js +5 -21
- package/build/services/emitter.js +2 -14
- package/build/services/encryption.js +2 -14
- package/build/services/hash.js +2 -14
- package/build/services/logger.js +2 -14
- package/build/services/repl.js +2 -14
- package/build/services/router.js +2 -14
- package/build/services/server.js +2 -14
- package/build/services/test_utils.js +2 -17
- package/build/services/url_builder.d.ts +3 -3
- package/build/services/url_builder.js +5 -17
- package/build/src/assembler_hooks/index_entities.d.ts +29 -1
- package/build/src/debug.d.ts +1 -1
- package/build/src/exceptions.js +2 -49
- package/build/src/helpers/assert.js +2 -55
- package/build/src/helpers/http.d.ts +20 -0
- package/build/src/helpers/http.js +2 -0
- package/build/src/helpers/is.js +3 -31
- package/build/src/helpers/main.d.ts +1 -5
- package/build/src/helpers/main.js +5 -56
- package/build/src/helpers/string.js +2 -60
- package/build/src/helpers/types.js +26 -135
- package/build/src/helpers/verification_token.js +2 -120
- package/build/src/test_utils/main.js +8 -77
- package/build/src/types.d.ts +53 -99
- package/build/src/types.js +0 -8
- package/build/src/utils.d.ts +1 -1
- package/build/src/vine.js +2 -97
- package/build/string-Cx6q_win.js +28 -0
- package/build/test_utils-hkQDmNpX.js +10 -0
- package/build/toolkit/main.js +19 -21
- package/build/types/ace.js +2 -9
- package/build/types/app.js +2 -9
- package/build/types/bodyparser.js +2 -9
- package/build/types/common.js +2 -9
- package/build/types/container.js +2 -9
- package/build/types/encryption.d.ts +39 -1
- package/build/types/encryption.js +1 -9
- package/build/types/events.js +2 -9
- package/build/types/hash.js +2 -9
- package/build/types/health.js +2 -9
- package/build/types/helpers.d.ts +20 -0
- package/build/types/helpers.js +0 -8
- package/build/types/http.js +2 -9
- package/build/types/logger.js +2 -9
- package/build/types/repl.js +2 -9
- package/build/types/transformers.js +2 -9
- package/build/utils-CtGytdtt.js +42 -0
- package/build/verification_token-DrdoU4RH.js +46 -0
- package/build/vine-DGint2rk.js +32 -0
- package/package.json +113 -60
- package/build/modules/ace/commands.js +0 -157
- package/build/modules/ace/create_kernel.js +0 -91
- package/build/modules/ace/kernel.js +0 -40
- package/build/modules/dumper/define_config.js +0 -36
- package/build/modules/dumper/dumper.js +0 -256
- package/build/modules/dumper/errors.js +0 -119
- package/build/modules/encryption.d.ts +0 -1
- package/build/modules/encryption.js +0 -9
- package/build/modules/hash/define_config.js +0 -125
- package/build/modules/http/request_validator.js +0 -100
- package/build/src/assembler_hooks/index_entities.js +0 -107
- package/build/src/cli_formatters/routes_list.js +0 -381
- package/build/src/config_provider.js +0 -71
- package/build/src/debug.js +0 -25
- package/build/src/ignitor/ace.js +0 -102
- package/build/src/ignitor/http.js +0 -146
- package/build/src/ignitor/main.js +0 -124
- package/build/src/ignitor/test.js +0 -66
- package/build/src/test_utils/http.js +0 -82
- package/build/src/utils.js +0 -104
- package/build/stubs/main.js +0 -9
- package/build/toolkit/commands/index_commands.js +0 -30
- /package/build/{stubs/make → make}/command/main.stub +0 -0
- /package/build/{stubs/make → make}/controller/actions.stub +0 -0
- /package/build/{stubs/make → make}/controller/api.stub +0 -0
- /package/build/{stubs/make → make}/controller/main.stub +0 -0
- /package/build/{stubs/make → make}/controller/resource.stub +0 -0
- /package/build/{stubs/make → make}/event/main.stub +0 -0
- /package/build/{stubs/make → make}/exception/main.stub +0 -0
- /package/build/{stubs/make → make}/health/main.stub +0 -0
- /package/build/{stubs/make → make}/listener/for_event.stub +0 -0
- /package/build/{stubs/make → make}/listener/main.stub +0 -0
- /package/build/{stubs/make → make}/middleware/main.stub +0 -0
- /package/build/{stubs/make → make}/preload/main.stub +0 -0
- /package/build/{stubs/make → make}/provider/main.stub +0 -0
- /package/build/{stubs/make → make}/service/main.stub +0 -0
- /package/build/{stubs/make → make}/test/main.stub +0 -0
- /package/build/{stubs/make → make}/transformer/main.stub +0 -0
- /package/build/{stubs/make → make}/validator/main.stub +0 -0
- /package/build/{stubs/make → make}/validator/resource.stub +0 -0
- /package/build/{stubs/make → make}/view/main.stub +0 -0
package/build/modules/app.d.ts
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application module re-exports all functionality from @adonisjs/application.
|
|
3
|
+
* This includes the main Application class and related types for managing
|
|
4
|
+
* the AdonisJS application lifecycle, container bindings, and service providers.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // Import the Application class
|
|
8
|
+
* import { Application } from '@adonisjs/core/app'
|
|
9
|
+
*
|
|
10
|
+
* const app = new Application(new URL('../', import.meta.url))
|
|
11
|
+
* await app.init()
|
|
12
|
+
* await app.boot()
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Import application types
|
|
16
|
+
* import type { ApplicationService, ContainerBindings } from '@adonisjs/core/app'
|
|
17
|
+
*/
|
|
1
18
|
export * from '@adonisjs/application';
|
package/build/modules/app.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
export * from '@adonisjs/application';
|
|
1
|
+
import "../chunk-B88MteZI.js";
|
|
2
|
+
import "../app-DNvbxVWl.js";
|
|
3
|
+
export * from "@adonisjs/application";
|
|
4
|
+
export {};
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { BodyParserMiddleware } from '@adonisjs/bodyparser/bodyparser_middleware';
|
|
10
|
-
/**
|
|
11
|
-
* Default export allows lazy importing middleware with
|
|
12
|
-
* destructuring the named exports
|
|
13
|
-
*/
|
|
14
|
-
export default BodyParserMiddleware;
|
|
1
|
+
import { t as bodyparser_middleware_default } from "../../bodyparser_middleware-BmARtnYe.js";
|
|
2
|
+
export { bodyparser_middleware_default as default };
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
export * from '@adonisjs/bodyparser';
|
|
1
|
+
import "../../chunk-B88MteZI.js";
|
|
2
|
+
import "../../main-DOY5Q8Av.js";
|
|
3
|
+
export * from "@adonisjs/bodyparser";
|
|
4
|
+
export {};
|
|
@@ -1 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration module re-exports all functionality from @adonisjs/config.
|
|
3
|
+
* This includes the Config class and related types for managing application
|
|
4
|
+
* configuration files and environment-specific settings.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // Import the Config class
|
|
8
|
+
* import { Config } from '@adonisjs/core/config'
|
|
9
|
+
*
|
|
10
|
+
* const config = new Config()
|
|
11
|
+
* config.set('database.connection', 'mysql')
|
|
12
|
+
* const dbConnection = config.get('database.connection')
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Import configuration types
|
|
16
|
+
* import type { ConfigProvider } from '@adonisjs/core/config'
|
|
17
|
+
*/
|
|
1
18
|
export * from '@adonisjs/config';
|
package/build/modules/config.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
export * from '@adonisjs/config';
|
|
1
|
+
import "../chunk-B88MteZI.js";
|
|
2
|
+
import "../config-Dd2H6-_e.js";
|
|
3
|
+
export * from "@adonisjs/config";
|
|
4
|
+
export {};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
export * from '@adonisjs/fold';
|
|
1
|
+
import "../chunk-B88MteZI.js";
|
|
2
|
+
import "../container-uxa8LpGI.js";
|
|
3
|
+
export * from "@adonisjs/fold";
|
|
4
|
+
export {};
|
|
@@ -28,6 +28,11 @@ import type { Application } from '../app.ts';
|
|
|
28
28
|
*/
|
|
29
29
|
export declare class Dumper {
|
|
30
30
|
#private;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new Dumper instance
|
|
33
|
+
*
|
|
34
|
+
* @param app - The AdonisJS application instance
|
|
35
|
+
*/
|
|
31
36
|
constructor(app: Application<any>);
|
|
32
37
|
/**
|
|
33
38
|
* Configure the HTML formatter output options
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dumper module provides debugging and inspection utilities for AdonisJS applications.
|
|
3
|
+
* Includes the Dumper class for formatting output, error classes, and configuration helpers.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Use the dumper service
|
|
7
|
+
* import { Dumper } from '@adonisjs/core/dumper'
|
|
8
|
+
*
|
|
9
|
+
* const dumper = new Dumper(app)
|
|
10
|
+
* const htmlOutput = dumper.dumpToHtml(user, { title: 'User Data' })
|
|
11
|
+
* const ansiOutput = dumper.dumpToAnsi(user, { title: 'Debug User' })
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Configure dumper output
|
|
15
|
+
* import { defineConfig } from '@adonisjs/core/dumper'
|
|
16
|
+
*
|
|
17
|
+
* export default defineConfig({
|
|
18
|
+
* html: { showHidden: true, depth: 5 },
|
|
19
|
+
* console: { collapse: ['Date', 'DateTime'] }
|
|
20
|
+
* })
|
|
21
|
+
*/
|
|
1
22
|
export * as errors from './errors.ts';
|
|
2
23
|
export { Dumper } from './dumper.ts';
|
|
3
24
|
export { defineConfig } from './define_config.ts';
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
export * as errors from "./errors.js";
|
|
10
|
-
export { Dumper } from "./dumper.js";
|
|
11
|
-
export { defineConfig } from "./define_config.js";
|
|
1
|
+
import "../../chunk-B88MteZI.js";
|
|
2
|
+
import { n as errors_exports, t as Dumper } from "../../dumper-BTjb8j4y.js";
|
|
3
|
+
function defineConfig(dumperConfig) {
|
|
4
|
+
return dumperConfig;
|
|
5
|
+
}
|
|
6
|
+
export { Dumper, defineConfig, errors_exports as errors };
|
|
@@ -1,62 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { Template } from 'edge.js';
|
|
10
|
-
/**
|
|
11
|
-
* Returns an edge plugin that integrates with a given
|
|
12
|
-
* dumper instance
|
|
13
|
-
*/
|
|
14
|
-
export function pluginEdgeDumper(dumper) {
|
|
15
|
-
Template.macro('dumper', dumper);
|
|
16
|
-
return (edge) => {
|
|
17
|
-
edge.registerTag({
|
|
18
|
-
tagName: 'dump',
|
|
19
|
-
block: false,
|
|
20
|
-
seekable: true,
|
|
21
|
-
noNewLine: true,
|
|
22
|
-
compile(parser, buffer, token) {
|
|
23
|
-
const parsed = parser.utils.transformAst(parser.utils.generateAST(token.properties.jsArg, token.loc, token.filename), token.filename, parser);
|
|
24
|
-
buffer.writeExpression(`template.stacks.pushOnceTo('dumper', 'dumper_globals', template.dumper.getHeadElements(state.cspNonce))`, token.filename, token.loc.start.line);
|
|
25
|
-
buffer.outputExpression(`template.dumper.dumpToHtml(${parser.utils.stringify(parsed)}, { cspNonce: state.cspNonce, source: { location: $filename, line: $lineNumber } })`, token.filename, token.loc.start.line, true);
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
edge.registerTag({
|
|
29
|
-
tagName: 'dd',
|
|
30
|
-
block: false,
|
|
31
|
-
seekable: true,
|
|
32
|
-
noNewLine: true,
|
|
33
|
-
compile(parser, buffer, token) {
|
|
34
|
-
const parsed = parser.utils.transformAst(parser.utils.generateAST(token.properties.jsArg, token.loc, token.filename), token.filename, parser);
|
|
35
|
-
/**
|
|
36
|
-
* Dump/Die statement to catch error and convert it into
|
|
37
|
-
* an Edge error
|
|
38
|
-
*/
|
|
39
|
-
const ddStatement = [
|
|
40
|
-
'try {',
|
|
41
|
-
` template.dumper.dd(${parser.utils.stringify(parsed)})`,
|
|
42
|
-
'} catch (error) {',
|
|
43
|
-
` if (error.code === 'E_DUMP_DIE_EXCEPTION') {`,
|
|
44
|
-
' const edgeError = template.createError(error.message, $filename, $lineNumber)',
|
|
45
|
-
' error.fileName = $filename',
|
|
46
|
-
' error.lineNumber = $lineNumber',
|
|
47
|
-
' edgeError.handle = function (_, ctx) {',
|
|
48
|
-
' return error.handle(error, ctx)',
|
|
49
|
-
' }',
|
|
50
|
-
' edgeError.report = function () {',
|
|
51
|
-
' return error.report(error)',
|
|
52
|
-
' }',
|
|
53
|
-
' throw edgeError',
|
|
54
|
-
' }',
|
|
55
|
-
' throw error',
|
|
56
|
-
'}',
|
|
57
|
-
].join('\n');
|
|
58
|
-
buffer.writeStatement(ddStatement, token.filename, token.loc.start.line);
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
}
|
|
1
|
+
import { t as pluginEdgeDumper } from "../../../edge-BVYR-Vjr.js";
|
|
2
|
+
export { pluginEdgeDumper };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { type ConfigProvider } from '../../src/types.ts';
|
|
2
|
+
import { type AES256CBCDriverConfig, type AES256GCMDriverConfig, type ChaCha20Poly1305DriverConfig } from '../../types/encryption.ts';
|
|
3
|
+
import { type EncryptionConfig } from '../../types/encryption.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Resolved configuration from the config provider that will be
|
|
6
|
+
* accepted by the encryption manager.
|
|
7
|
+
*
|
|
8
|
+
* This type unwraps ConfigProvider types to their resolved values,
|
|
9
|
+
* ensuring all encryptors in the list are concrete EncryptionConfig
|
|
10
|
+
* objects rather than providers.
|
|
11
|
+
*
|
|
12
|
+
* @template KnownEncryptors - Record of encryptor names to their configurations
|
|
13
|
+
*/
|
|
14
|
+
type ResolvedConfig<KnownEncryptors extends Record<string, EncryptionConfig | ConfigProvider<EncryptionConfig>>> = {
|
|
15
|
+
/**
|
|
16
|
+
* The default encryptor name to use when no specific
|
|
17
|
+
* encryptor is requested
|
|
18
|
+
*/
|
|
19
|
+
default?: keyof KnownEncryptors;
|
|
20
|
+
/**
|
|
21
|
+
* Map of encryptor names to their resolved configurations.
|
|
22
|
+
* ConfigProvider types are unwrapped to their underlying
|
|
23
|
+
* EncryptionConfig values.
|
|
24
|
+
*/
|
|
25
|
+
list: {
|
|
26
|
+
[K in keyof KnownEncryptors]: KnownEncryptors[K] extends ConfigProvider<infer A> ? A : KnownEncryptors[K];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Defines the encryption configuration for the application.
|
|
31
|
+
*
|
|
32
|
+
* This function creates a configuration provider that lazily resolves
|
|
33
|
+
* encryption drivers. It validates that the default encryptor (if specified)
|
|
34
|
+
* exists in the list and resolves any ConfigProvider instances to their
|
|
35
|
+
* concrete values.
|
|
36
|
+
*
|
|
37
|
+
* @template KnownEncryptors - Record of encryptor names to their configurations
|
|
38
|
+
*
|
|
39
|
+
* @param config - The encryption configuration object
|
|
40
|
+
* @param config.default - Optional default encryptor name
|
|
41
|
+
* @param config.list - Map of encryptor names to their configurations or providers
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const encryptionConfig = defineConfig({
|
|
46
|
+
* default: 'app',
|
|
47
|
+
* list: {
|
|
48
|
+
* app: drivers.aes256gcm({
|
|
49
|
+
* id: 'app',
|
|
50
|
+
* keys: [env.get('APP_KEY')]
|
|
51
|
+
* }),
|
|
52
|
+
* backup: drivers.chacha20({
|
|
53
|
+
* id: 'backup',
|
|
54
|
+
* keys: [env.get('BACKUP_KEY')]
|
|
55
|
+
* })
|
|
56
|
+
* }
|
|
57
|
+
* })
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function defineConfig<KnownEncryptors extends Record<string, EncryptionConfig | ConfigProvider<EncryptionConfig>>>(config: {
|
|
61
|
+
default?: keyof KnownEncryptors;
|
|
62
|
+
list: KnownEncryptors;
|
|
63
|
+
}): ConfigProvider<ResolvedConfig<KnownEncryptors>>;
|
|
64
|
+
/**
|
|
65
|
+
* Collection of encryption driver factory functions.
|
|
66
|
+
*
|
|
67
|
+
* Each driver factory creates a ConfigProvider that lazily imports
|
|
68
|
+
* and configures the corresponding encryption driver. This allows
|
|
69
|
+
* for efficient code splitting and on-demand loading of encryption
|
|
70
|
+
* algorithms.
|
|
71
|
+
*/
|
|
72
|
+
export declare const drivers: {
|
|
73
|
+
/**
|
|
74
|
+
* Creates a ChaCha20-Poly1305 encryption driver configuration.
|
|
75
|
+
*
|
|
76
|
+
* ChaCha20-Poly1305 is a modern authenticated encryption algorithm
|
|
77
|
+
* that provides excellent performance on systems without AES hardware
|
|
78
|
+
* acceleration.
|
|
79
|
+
*
|
|
80
|
+
* @param config - The ChaCha20-Poly1305 driver configuration
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* drivers.chacha20({
|
|
85
|
+
* id: 'app',
|
|
86
|
+
* keys: [env.get('APP_KEY')]
|
|
87
|
+
* })
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
chacha20: (config: ChaCha20Poly1305DriverConfig) => ConfigProvider<EncryptionConfig>;
|
|
91
|
+
/**
|
|
92
|
+
* Creates an AES-256-CBC encryption driver configuration.
|
|
93
|
+
*
|
|
94
|
+
* AES-256-CBC is a widely-supported block cipher mode. However,
|
|
95
|
+
* consider using AES-256-GCM for new applications as it provides
|
|
96
|
+
* authenticated encryption.
|
|
97
|
+
*
|
|
98
|
+
* @param config - The AES-256-CBC driver configuration
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* drivers.aes256cbc({
|
|
103
|
+
* id: 'legacy',
|
|
104
|
+
* keys: [env.get('LEGACY_KEY')]
|
|
105
|
+
* })
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
aes256cbc: (config: AES256CBCDriverConfig) => ConfigProvider<EncryptionConfig>;
|
|
109
|
+
/**
|
|
110
|
+
* Creates an AES-256-GCM encryption driver configuration.
|
|
111
|
+
*
|
|
112
|
+
* AES-256-GCM is an authenticated encryption algorithm that provides
|
|
113
|
+
* both confidentiality and integrity. It offers excellent performance
|
|
114
|
+
* on systems with AES hardware acceleration.
|
|
115
|
+
*
|
|
116
|
+
* @param config - The AES-256-GCM driver configuration
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* drivers.aes256gcm({
|
|
121
|
+
* id: 'app',
|
|
122
|
+
* keys: [env.get('APP_KEY')]
|
|
123
|
+
* })
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
aes256gcm: (config: AES256GCMDriverConfig) => ConfigProvider<EncryptionConfig>;
|
|
127
|
+
};
|
|
128
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AES-256-CBC encryption driver implementation.
|
|
3
|
+
*
|
|
4
|
+
* This driver provides encryption and decryption using the AES-256-CBC
|
|
5
|
+
* (Advanced Encryption Standard with 256-bit key in Cipher Block Chaining mode)
|
|
6
|
+
* algorithm. While widely supported, AES-256-CBC does not provide authenticated
|
|
7
|
+
* encryption. Consider using AES-256-GCM for new applications.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const driver = new AES256CBC({
|
|
12
|
+
* id: 'app',
|
|
13
|
+
* key: 'your-256-bit-key-here'
|
|
14
|
+
* })
|
|
15
|
+
*
|
|
16
|
+
* const encrypted = driver.encrypt('sensitive data')
|
|
17
|
+
* const decrypted = driver.decrypt(encrypted)
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export { AES256CBC } from '@boringnode/encryption/drivers/aes_256_cbc';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AES-256-GCM encryption driver implementation.
|
|
3
|
+
*
|
|
4
|
+
* This driver provides authenticated encryption and decryption using the
|
|
5
|
+
* AES-256-GCM (Advanced Encryption Standard with 256-bit key in Galois/Counter Mode)
|
|
6
|
+
* algorithm. GCM mode provides both confidentiality and authenticity, making it
|
|
7
|
+
* the recommended choice for modern applications. It offers excellent performance
|
|
8
|
+
* on systems with AES hardware acceleration.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const driver = new AES256GCM({
|
|
13
|
+
* id: 'app',
|
|
14
|
+
* key: 'your-256-bit-key-here'
|
|
15
|
+
* })
|
|
16
|
+
*
|
|
17
|
+
* const encrypted = driver.encrypt('sensitive data')
|
|
18
|
+
* const decrypted = driver.decrypt(encrypted)
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export { AES256GCM } from '@boringnode/encryption/drivers/aes_256_gcm';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChaCha20-Poly1305 encryption driver implementation.
|
|
3
|
+
*
|
|
4
|
+
* This driver provides authenticated encryption and decryption using the
|
|
5
|
+
* ChaCha20-Poly1305 algorithm. ChaCha20 is a modern stream cipher that
|
|
6
|
+
* provides excellent performance on systems without AES hardware acceleration.
|
|
7
|
+
* Combined with Poly1305 for authentication, it offers both confidentiality
|
|
8
|
+
* and authenticity.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const driver = new ChaCha20Poly1305({
|
|
13
|
+
* id: 'app',
|
|
14
|
+
* key: 'your-256-bit-key-here'
|
|
15
|
+
* })
|
|
16
|
+
*
|
|
17
|
+
* const encrypted = driver.encrypt('sensitive data')
|
|
18
|
+
* const decrypted = driver.decrypt(encrypted)
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export { ChaCha20Poly1305 } from '@boringnode/encryption/drivers/chacha20_poly1305';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main encryption class for encrypting and decrypting values.
|
|
3
|
+
*
|
|
4
|
+
* Provides methods to encrypt strings and objects with optional purpose
|
|
5
|
+
* binding, decrypt values, and manage encryption keys.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const encryption = new Encryption({ key: 'secret-key' })
|
|
10
|
+
* const encrypted = encryption.encrypt('sensitive data')
|
|
11
|
+
* const decrypted = encryption.decrypt(encrypted)
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export { Encryption } from '@boringnode/encryption';
|
|
15
|
+
/**
|
|
16
|
+
* Manager class for handling multiple encryption instances.
|
|
17
|
+
*
|
|
18
|
+
* Allows you to configure and manage multiple encryption drivers,
|
|
19
|
+
* switch between them, and use different encryption keys for
|
|
20
|
+
* different purposes.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const manager = new EncryptionManager({
|
|
25
|
+
* default: 'app',
|
|
26
|
+
* list: {
|
|
27
|
+
* app: {
|
|
28
|
+
* driver: (key) => new AES256GCM({ key }),
|
|
29
|
+
* keys: ['app-key']
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* })
|
|
33
|
+
* const encryptor = manager.use('app')
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export { EncryptionManager } from '@boringnode/encryption';
|
|
37
|
+
/**
|
|
38
|
+
* HMAC (Hash-based Message Authentication Code) class for creating
|
|
39
|
+
* and verifying message authentication codes.
|
|
40
|
+
*
|
|
41
|
+
* Provides methods to generate cryptographic hashes with a secret key
|
|
42
|
+
* and verify them to ensure data integrity and authenticity.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const hmac = new Hmac('secret-key')
|
|
47
|
+
* const signature = hmac.generate('message')
|
|
48
|
+
* const isValid = hmac.verify('message', signature)
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export { Hmac } from '@boringnode/encryption';
|
|
52
|
+
/**
|
|
53
|
+
* Base class for implementing custom encryption drivers.
|
|
54
|
+
*
|
|
55
|
+
* Extend this class to create custom encryption implementations
|
|
56
|
+
* that can be used with the EncryptionManager.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* class CustomDriver extends BaseDriver {
|
|
61
|
+
* encrypt(value: string) {
|
|
62
|
+
* // Custom encryption logic
|
|
63
|
+
* }
|
|
64
|
+
* decrypt(payload: string) {
|
|
65
|
+
* // Custom decryption logic
|
|
66
|
+
* }
|
|
67
|
+
* }
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export { BaseDriver } from '@boringnode/encryption';
|
|
71
|
+
/**
|
|
72
|
+
* Defines the encryption configuration for the application.
|
|
73
|
+
*
|
|
74
|
+
* @see {defineConfig} in define_config.ts for detailed documentation
|
|
75
|
+
*/
|
|
76
|
+
export { defineConfig } from './define_config.ts';
|
|
77
|
+
/**
|
|
78
|
+
* Collection of built-in encryption driver factory functions.
|
|
79
|
+
*
|
|
80
|
+
* Includes factories for ChaCha20-Poly1305, AES-256-CBC, and
|
|
81
|
+
* AES-256-GCM encryption algorithms.
|
|
82
|
+
*
|
|
83
|
+
* @see {drivers} in define_config.ts for detailed documentation
|
|
84
|
+
*/
|
|
85
|
+
export { drivers } from './define_config.ts';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "../../config_provider-DWVFHOQX.js";
|
|
2
|
+
import "../../exceptions-DNMesP42.js";
|
|
3
|
+
import { n as drivers, t as defineConfig } from "../../define_config-CoWy5lbf.js";
|
|
4
|
+
import { i as Hmac, n as Encryption, r as EncryptionManager, t as BaseDriver } from "../../main-Bfnr5tAw.js";
|
|
5
|
+
export { BaseDriver, Encryption, EncryptionManager, Hmac, defineConfig, drivers };
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* (c) AdonisJS
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
export * from '@adonisjs/env/editor';
|
|
1
|
+
export * from "@adonisjs/env/editor";
|
|
2
|
+
export {};
|
|
@@ -1 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment module re-exports all functionality from @adonisjs/env.
|
|
3
|
+
* This includes the Env class, validation schemas, and utilities for managing
|
|
4
|
+
* environment variables with type safety and validation.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // Import the Env class and validation
|
|
8
|
+
* import { Env } from '@adonisjs/core/env'
|
|
9
|
+
*
|
|
10
|
+
* const env = await Env.create(new URL('../', import.meta.url), {
|
|
11
|
+
* NODE_ENV: Env.schema.enum(['development', 'production', 'test'] as const),
|
|
12
|
+
* PORT: Env.schema.number(),
|
|
13
|
+
* HOST: Env.schema.string({ format: 'host' })
|
|
14
|
+
* })
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Import environment types and utilities
|
|
18
|
+
* import type { EnvParser, EnvEditor } from '@adonisjs/core/env'
|
|
19
|
+
*/
|
|
1
20
|
export * from '@adonisjs/env';
|
package/build/modules/events.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
export * from '@adonisjs/events';
|
|
1
|
+
import "../chunk-B88MteZI.js";
|
|
2
|
+
import "../events-C4d0OPUI.js";
|
|
3
|
+
export * from "@adonisjs/events";
|
|
4
|
+
export {};
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* (c) AdonisJS
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
export * from '@adonisjs/hash/drivers/argon';
|
|
1
|
+
export * from "@adonisjs/hash/drivers/argon";
|
|
2
|
+
export {};
|
|
@@ -1 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bcrypt hash driver re-exports from @adonisjs/hash.
|
|
3
|
+
* Provides bcrypt password hashing functionality with configurable rounds.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* import { Bcrypt } from '@adonisjs/core/hash/drivers/bcrypt'
|
|
7
|
+
*
|
|
8
|
+
* const bcrypt = new Bcrypt({ rounds: 12 })
|
|
9
|
+
* const hashed = await bcrypt.make('password')
|
|
10
|
+
* const isValid = await bcrypt.verify(hashed, 'password')
|
|
11
|
+
*/
|
|
1
12
|
export * from '@adonisjs/hash/drivers/bcrypt';
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* (c) AdonisJS
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
export * from '@adonisjs/hash/drivers/bcrypt';
|
|
1
|
+
export * from "@adonisjs/hash/drivers/bcrypt";
|
|
2
|
+
export {};
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* (c) AdonisJS
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
export * from '@adonisjs/hash/drivers/scrypt';
|
|
1
|
+
export * from "@adonisjs/hash/drivers/scrypt";
|
|
2
|
+
export {};
|