@adonisjs/core 7.0.0-next.10 → 7.0.0-next.12
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-DDzvaSs_.js +16 -0
- package/build/app-B6oge7b3.js +5 -0
- package/build/app-BK0PN3li.js +5 -0
- package/build/bodyparser_middleware-DTW0epKM.js +3 -0
- package/build/chunk-MjwdjG2f.js +32 -0
- package/build/commands/add.js +40 -110
- package/build/commands/build.js +51 -107
- 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 -150
- package/build/commands/test.js +92 -202
- package/build/config-B2S2xfmN.js +5 -0
- package/build/config_provider-CY-xuo2R.js +13 -0
- package/build/container-ClFvcykQ.js +5 -0
- package/build/core-CNNCwlhc.js +95 -0
- package/build/create_kernel-B7zWS8Zz.js +38 -0
- package/build/create_kernel-CsTq0pWc.js +3 -0
- package/build/debug-DURPi9xn.js +3 -0
- package/build/decorate-DM0Sx1ye.js +7 -0
- package/build/dumper-C_sMcyFb.js +147 -0
- package/build/edge-LQdCc1L3.js +47 -0
- package/build/encryption-D2HGu0bU.js +5 -0
- package/build/events-B8hK42QT.js +5 -0
- package/build/factories/app.js +2 -9
- package/build/factories/bodyparser.js +2 -9
- package/build/factories/core/ace.js +15 -46
- package/build/factories/core/ignitor.js +12 -180
- package/build/factories/core/main.js +22 -11
- package/build/factories/core/test_utils.js +19 -43
- 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 +28 -91
- package/build/ignitor-Dil-rtCo.js +63 -0
- package/build/index.js +13 -46
- package/build/logger-Dha-0hp1.js +13 -0
- package/build/main-2-nm3TiB.js +72 -0
- package/build/main-BTUXw6He.js +171 -0
- package/build/main-BWftwyAK.js +81 -0
- package/build/main-BrJQ1VAM.js +52 -0
- package/build/main-CFmDHDls.js +35 -0
- package/build/main-D5xz2ZN1.js +5 -0
- package/build/main-kn40V-hF.js +2 -0
- package/build/main-q9TMzWUj.js +5 -0
- package/build/modules/ace/codemods.js +222 -477
- package/build/modules/ace/main.js +2 -41
- package/build/modules/app.js +4 -26
- package/build/modules/bodyparser/bodyparser_middleware.js +2 -14
- package/build/modules/bodyparser/main.js +4 -9
- package/build/modules/config.js +4 -26
- package/build/modules/container.js +4 -9
- package/build/modules/dumper/main.js +6 -32
- package/build/modules/dumper/plugins/edge.js +2 -62
- package/build/modules/encryption.js +4 -26
- package/build/modules/env/editor.js +2 -9
- package/build/modules/env/main.js +2 -28
- package/build/modules/events.js +4 -9
- package/build/modules/hash/drivers/argon.js +2 -9
- package/build/modules/hash/drivers/bcrypt.js +2 -20
- package/build/modules/hash/drivers/scrypt.js +2 -9
- package/build/modules/hash/main.js +6 -28
- 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/url_builder_client.js +2 -9
- 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.js +147 -359
- package/build/providers/edge_provider.js +97 -165
- package/build/providers/hash_provider.js +29 -91
- package/build/providers/repl_provider.js +61 -152
- package/build/providers/vinejs_provider.d.ts +1 -1
- package/build/providers/vinejs_provider.js +20 -66
- package/build/repl-CumYg2V_.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.js +5 -17
- package/build/src/exceptions.js +2 -49
- package/build/src/helpers/assert.js +2 -55
- package/build/src/helpers/http.js +2 -28
- package/build/src/helpers/is.js +3 -31
- package/build/src/helpers/main.js +5 -52
- package/build/src/helpers/string.js +2 -78
- package/build/src/helpers/types.js +26 -135
- package/build/src/helpers/verification_token.js +2 -120
- package/build/src/test_utils/main.js +5 -77
- package/build/src/types.js +0 -8
- package/build/src/vine.js +2 -105
- package/build/string-CJ7ewUFq.js +28 -0
- package/build/test_utils-c_TEaEHW.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.js +2 -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.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-CNQ4tlGM.js +41 -0
- package/build/verification_token-DXsW81rl.js +46 -0
- package/build/vine-Bt4ymkM0.js +32 -0
- package/package.json +81 -31
- 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 -266
- package/build/modules/dumper/errors.js +0 -119
- 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 -112
- package/build/src/cli_formatters/routes_list.js +0 -397
- 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 -159
- 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 -114
- 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/controller.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
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { BaseCommand, FsLoader, HelpCommand as HelpCommand$1, IndexGenerator as IndexGenerator$1, Kernel, ListCommand, ListLoader as ListLoader$1, Parser, args as args$1, cliHelpers, errors as errors$1, flags, tracingChannels } from "@adonisjs/ace";
|
|
2
|
+
var BaseCommand$1 = class extends BaseCommand {
|
|
3
|
+
static options = {};
|
|
4
|
+
get staysAlive() {
|
|
5
|
+
return this.constructor.options.staysAlive;
|
|
6
|
+
}
|
|
7
|
+
get startApp() {
|
|
8
|
+
return this.constructor.options.startApp;
|
|
9
|
+
}
|
|
10
|
+
constructor(app, kernel, parsed, ui, prompt) {
|
|
11
|
+
super(kernel, parsed, ui, prompt);
|
|
12
|
+
this.app = app;
|
|
13
|
+
this.kernel = kernel;
|
|
14
|
+
}
|
|
15
|
+
async createCodemods() {
|
|
16
|
+
const { Codemods } = await import("./modules/ace/codemods.js");
|
|
17
|
+
const codemods = new Codemods(this.app, this.logger);
|
|
18
|
+
codemods.on("error", () => {
|
|
19
|
+
this.exitCode = 1;
|
|
20
|
+
});
|
|
21
|
+
return codemods;
|
|
22
|
+
}
|
|
23
|
+
async exec() {
|
|
24
|
+
this.hydrate();
|
|
25
|
+
try {
|
|
26
|
+
this.prepare && await this.app.container.call(this, "prepare");
|
|
27
|
+
this.interact && await this.app.container.call(this, "interact");
|
|
28
|
+
const result = await this.app.container.call(this, "run");
|
|
29
|
+
this.result = this.result === void 0 ? result : this.result;
|
|
30
|
+
this.exitCode = this.exitCode ?? 0;
|
|
31
|
+
} catch (error) {
|
|
32
|
+
this.error = error;
|
|
33
|
+
this.exitCode = this.exitCode ?? 1;
|
|
34
|
+
}
|
|
35
|
+
let errorHandled = this.completed ? await this.app.container.call(this, "completed") : false;
|
|
36
|
+
if (this.error && !errorHandled) await this.kernel.errorHandler.render(this.error, this.kernel);
|
|
37
|
+
return this.result;
|
|
38
|
+
}
|
|
39
|
+
async terminate() {
|
|
40
|
+
if (this.kernel.getMainCommand() === this) await this.app.terminate();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var ListCommand$1 = class extends ListCommand {
|
|
44
|
+
static options = {};
|
|
45
|
+
get staysAlive() {
|
|
46
|
+
return this.constructor.options.staysAlive;
|
|
47
|
+
}
|
|
48
|
+
get startApp() {
|
|
49
|
+
return this.constructor.options.startApp;
|
|
50
|
+
}
|
|
51
|
+
constructor(app, kernel, parsed, ui, prompt) {
|
|
52
|
+
super(kernel, parsed, ui, prompt);
|
|
53
|
+
this.app = app;
|
|
54
|
+
this.kernel = kernel;
|
|
55
|
+
}
|
|
56
|
+
async createCodemods() {
|
|
57
|
+
const { Codemods } = await import("./modules/ace/codemods.js");
|
|
58
|
+
return new Codemods(this.app, this.logger);
|
|
59
|
+
}
|
|
60
|
+
async terminate() {
|
|
61
|
+
if (this.kernel.getMainCommand() === this) await this.app.terminate();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var Kernel$1 = class extends Kernel {
|
|
65
|
+
constructor(app) {
|
|
66
|
+
super(ListCommand$1, {
|
|
67
|
+
create: async (command, parsedOutput, $kernel) => {
|
|
68
|
+
return app.container.make(command, [
|
|
69
|
+
app,
|
|
70
|
+
$kernel,
|
|
71
|
+
parsedOutput,
|
|
72
|
+
$kernel.ui,
|
|
73
|
+
$kernel.prompt
|
|
74
|
+
]);
|
|
75
|
+
},
|
|
76
|
+
run: (command) => command.exec()
|
|
77
|
+
});
|
|
78
|
+
this.app = app;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
export { Parser as a, errors$1 as c, Kernel$1 as d, BaseCommand$1 as f, ListLoader$1 as i, flags as l, HelpCommand$1 as n, args$1 as o, ListCommand$1 as p, IndexGenerator$1 as r, cliHelpers as s, FsLoader as t, tracingChannels as u };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { n as __reExport, t as __export } from "./chunk-MjwdjG2f.js";
|
|
2
|
+
import { t as debug_default } from "./debug-DURPi9xn.js";
|
|
3
|
+
import { t as configProvider } from "./config_provider-CY-xuo2R.js";
|
|
4
|
+
import { InvalidArgumentsException } from "@poppinss/utils/exception";
|
|
5
|
+
function defineConfig(config) {
|
|
6
|
+
if (!config.list) throw new InvalidArgumentsException("Missing \"list\" property in hash config");
|
|
7
|
+
if (config.default && !config.list[config.default]) throw new InvalidArgumentsException(`Missing "list.${String(config.default)}" in hash config. It is referenced by the "default" property`);
|
|
8
|
+
return configProvider.create(async (app) => {
|
|
9
|
+
debug_default("resolving hash config");
|
|
10
|
+
const hashersList = Object.keys(config.list);
|
|
11
|
+
const hashers = {};
|
|
12
|
+
for (let hasherName of hashersList) {
|
|
13
|
+
const hasher = config.list[hasherName];
|
|
14
|
+
if (typeof hasher === "function") hashers[hasherName] = hasher;
|
|
15
|
+
else hashers[hasherName] = await hasher.resolver(app);
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
default: config.default,
|
|
19
|
+
list: hashers
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const drivers = {
|
|
24
|
+
argon2: (config) => {
|
|
25
|
+
return configProvider.create(async () => {
|
|
26
|
+
const { Argon } = await import("./modules/hash/drivers/argon.js");
|
|
27
|
+
debug_default("configuring argon driver");
|
|
28
|
+
return () => new Argon(config);
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
bcrypt: (config) => {
|
|
32
|
+
return configProvider.create(async () => {
|
|
33
|
+
const { Bcrypt } = await import("./modules/hash/drivers/bcrypt.js");
|
|
34
|
+
debug_default("configuring bcrypt driver");
|
|
35
|
+
return () => new Bcrypt(config);
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
scrypt: (config) => {
|
|
39
|
+
return configProvider.create(async () => {
|
|
40
|
+
const { Scrypt } = await import("./modules/hash/drivers/scrypt.js");
|
|
41
|
+
debug_default("configuring scrypt driver");
|
|
42
|
+
return () => new Scrypt(config);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var main_exports = /* @__PURE__ */ __export({
|
|
47
|
+
defineConfig: () => defineConfig,
|
|
48
|
+
drivers: () => drivers
|
|
49
|
+
});
|
|
50
|
+
import * as import___adonisjs_hash from "@adonisjs/hash";
|
|
51
|
+
__reExport(main_exports, import___adonisjs_hash);
|
|
52
|
+
export { defineConfig as n, drivers as r, main_exports as t };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { n as __reExport, t as __export } from "./chunk-MjwdjG2f.js";
|
|
2
|
+
import "@adonisjs/bodyparser";
|
|
3
|
+
var RequestValidator = class RequestValidator {
|
|
4
|
+
#ctx;
|
|
5
|
+
#experimentalFlags;
|
|
6
|
+
constructor(ctx, experimentalFlags) {
|
|
7
|
+
this.#ctx = ctx;
|
|
8
|
+
this.#experimentalFlags = experimentalFlags;
|
|
9
|
+
}
|
|
10
|
+
static errorReporter;
|
|
11
|
+
static messagesProvider;
|
|
12
|
+
validateUsing(validator, ...[options]) {
|
|
13
|
+
const validatorOptions = options || {};
|
|
14
|
+
if (RequestValidator.errorReporter && !validatorOptions.errorReporter) {
|
|
15
|
+
const errorReporter = RequestValidator.errorReporter(this.#ctx);
|
|
16
|
+
validatorOptions.errorReporter = () => errorReporter;
|
|
17
|
+
}
|
|
18
|
+
if (RequestValidator.messagesProvider && !validatorOptions.messagesProvider) validatorOptions.messagesProvider = RequestValidator.messagesProvider(this.#ctx);
|
|
19
|
+
const requestBody = this.#experimentalFlags?.enabled("mergeMultipartFieldsAndFiles") ? this.#ctx.request.all() : {
|
|
20
|
+
...this.#ctx.request.all(),
|
|
21
|
+
...this.#ctx.request.allFiles()
|
|
22
|
+
};
|
|
23
|
+
const data = validatorOptions.data || {
|
|
24
|
+
...requestBody,
|
|
25
|
+
params: this.#ctx.request.params(),
|
|
26
|
+
headers: this.#ctx.request.headers(),
|
|
27
|
+
cookies: this.#ctx.request.cookiesList()
|
|
28
|
+
};
|
|
29
|
+
return validator.validate(data, validatorOptions);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var main_exports = /* @__PURE__ */ __export({ RequestValidator: () => RequestValidator });
|
|
33
|
+
import * as import___adonisjs_http_server from "@adonisjs/http-server";
|
|
34
|
+
__reExport(main_exports, import___adonisjs_http_server);
|
|
35
|
+
export { RequestValidator as n, main_exports as t };
|