@adonisjs/core 7.0.0 → 7.1.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/ace-DBm6EcQ-.js +37 -0
- package/build/app-BCcG_oDd.js +7 -0
- package/build/app-CAuSGb2P.js +15 -0
- package/build/bodyparser_middleware-H5FArWkI.js +9 -0
- package/build/{chunk-iKc69rpz.js → chunk-Do49iUES.js} +3 -0
- package/build/commands/add.d.ts +1 -0
- package/build/commands/add.js +64 -10
- package/build/commands/build.js +41 -3
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.js +70 -4
- package/build/commands/eject.js +30 -4
- package/build/commands/env/add.js +62 -4
- package/build/commands/generate_key.js +23 -3
- package/build/commands/inspect_rcfile.js +26 -2
- package/build/commands/list/routes.d.ts +5 -0
- package/build/commands/list/routes.js +242 -3
- package/build/commands/make/command.js +33 -4
- package/build/commands/make/controller.js +46 -4
- package/build/commands/make/event.js +36 -4
- package/build/commands/make/exception.js +36 -4
- package/build/commands/make/listener.js +44 -4
- package/build/commands/make/middleware.js +53 -5
- package/build/commands/make/preload.js +55 -5
- package/build/commands/make/provider.js +54 -5
- package/build/commands/make/service.js +29 -4
- package/build/commands/make/test.js +63 -4
- package/build/commands/make/transformer.js +37 -4
- package/build/commands/make/validator.js +44 -4
- package/build/commands/make/view.js +33 -4
- package/build/commands/repl.js +31 -2
- package/build/commands/serve.js +54 -4
- package/build/commands/test.js +69 -4
- package/build/config-Coti2q6R.js +7 -0
- package/build/config_provider-Do9af1ze.js +35 -0
- package/build/container-CGfEwWof.js +7 -0
- package/build/{core-IpCOCkUL.js → core-XjMm_ipu.js} +51 -2
- package/build/create_kernel-BV3swyCg.js +4 -0
- package/build/{create_kernel-B7ILNhuP.js → create_kernel-D38-0Zbt.js} +41 -1
- package/build/debug-DWofTfIX.js +20 -0
- package/build/{decorate-DmrZA614.js → decorate-B9Uz0anB.js} +2 -0
- package/build/{define_config-0oHaj43l.js → define_config--5euEdi8.js} +54 -3
- package/build/dumper-3R77st8F.js +353 -0
- package/build/edge-BG5ZYp6Z.js +57 -0
- package/build/{errors-CrCO-k44.js → errors-BScZTzBu.js} +9 -1
- package/build/events-DlKX1ZdL.js +7 -0
- package/build/exceptions-B2MzIlHY.js +2 -0
- package/build/factories/app.js +1 -0
- package/build/factories/bodyparser.js +1 -0
- package/build/factories/core/ace.js +16 -22
- package/build/factories/core/ignitor.js +13 -73
- package/build/factories/core/main.js +25 -17
- package/build/factories/core/test_utils.js +22 -19
- package/build/factories/encryption.js +1 -0
- package/build/factories/events.js +1 -0
- package/build/factories/hash.js +1 -0
- package/build/factories/http.js +1 -0
- package/build/factories/logger.js +1 -0
- package/build/factories/stubs.js +75 -7
- package/build/ignitor-Kym3gR-I.js +169 -0
- package/build/index.js +11 -8
- package/build/logger-DIdZPHCe.js +43 -0
- package/build/main-B50zECAi.js +121 -0
- package/build/main-CRnMnrH7.js +184 -0
- package/build/{main-kn40V-hF.js → main-CfTiGsiS.js} +2 -0
- package/build/main-Ck0GqLx4.js +117 -0
- package/build/main-CoZI4Ezs.js +2 -0
- package/build/main-D1MSq4Uu.js +435 -0
- package/build/{main--nXd7T-C.js → main-bRYXIHgD.js} +75 -3
- package/build/main-zxNP7iRl.js +7 -0
- package/build/modules/ace/codemods.d.ts +1 -1
- package/build/modules/ace/codemods.js +303 -8
- package/build/modules/ace/commands.d.ts +5 -0
- package/build/modules/ace/main.js +2 -1
- package/build/modules/app.js +3 -5
- package/build/modules/bodyparser/bodyparser_middleware.js +2 -2
- package/build/modules/bodyparser/main.js +3 -5
- package/build/modules/config.js +3 -5
- package/build/modules/container.js +3 -5
- package/build/modules/dumper/main.js +29 -2
- package/build/modules/dumper/plugins/edge.js +2 -46
- package/build/modules/encryption/drivers/aes_256_cbc.js +1 -0
- package/build/modules/encryption/drivers/aes_256_gcm.js +1 -0
- package/build/modules/encryption/drivers/aes_siv.js +1 -0
- package/build/modules/encryption/drivers/chacha20_poly1305.js +1 -0
- package/build/modules/encryption/drivers/legacy.js +46 -1
- package/build/modules/encryption/main.js +7 -5
- package/build/modules/env/editor.js +1 -0
- package/build/modules/env/main.js +1 -0
- package/build/modules/events.js +3 -5
- package/build/modules/hash/drivers/argon.js +1 -0
- package/build/modules/hash/drivers/bcrypt.js +1 -0
- package/build/modules/hash/drivers/scrypt.js +1 -0
- package/build/modules/hash/main.js +4 -4
- package/build/modules/hash/phc_formatter.js +1 -0
- package/build/modules/health.js +1 -0
- package/build/modules/http/helpers.js +1 -0
- package/build/modules/http/main.js +2 -2
- package/build/modules/http/url_builder_client.js +1 -0
- package/build/modules/logger.js +3 -13
- package/build/modules/repl.js +3 -5
- package/build/modules/transformers/main.js +1 -0
- package/build/providers/app_provider.js +214 -15
- package/build/providers/edge_provider.js +90 -3
- package/build/providers/hash_provider.js +59 -4
- package/build/providers/repl_provider.js +64 -2
- package/build/providers/vinejs_provider.js +44 -3
- package/build/repl-C02Re0Yd.js +7 -0
- package/build/services/ace.js +11 -1
- package/build/services/app.js +2 -4
- package/build/services/config.js +7 -1
- package/build/services/dumper.js +13 -1
- package/build/services/emitter.js +8 -1
- package/build/services/encryption.js +8 -1
- package/build/services/hash.js +8 -1
- package/build/services/logger.js +8 -1
- package/build/services/repl.js +8 -1
- package/build/services/router.js +8 -1
- package/build/services/server.js +8 -1
- package/build/services/test_utils.js +11 -1
- package/build/services/url_builder.js +8 -1
- package/build/src/cli_formatters/routes_list.d.ts +7 -0
- package/build/src/exceptions.js +2 -1
- package/build/src/helpers/assert.js +1 -0
- package/build/src/helpers/http.js +1 -0
- package/build/src/helpers/is.js +24 -0
- package/build/src/helpers/main.js +2 -1
- package/build/src/helpers/string.js +2 -27
- package/build/src/helpers/types.js +18 -0
- package/build/src/helpers/verification_token.js +2 -45
- package/build/src/test_utils/main.js +9 -7
- package/build/src/types.js +1 -0
- package/build/src/vine.js +2 -32
- package/build/string-8_8He-HH.js +46 -0
- package/build/test_utils-DbJS_uEu.js +32 -0
- package/build/toolkit/main.js +13 -1
- package/build/types/ace.js +1 -0
- package/build/types/app.js +1 -0
- package/build/types/bodyparser.js +1 -0
- package/build/types/common.js +1 -0
- package/build/types/container.js +1 -0
- package/build/types/encryption.js +1 -0
- package/build/types/events.js +1 -0
- package/build/types/hash.js +1 -0
- package/build/types/health.js +1 -0
- package/build/types/helpers.js +1 -0
- package/build/types/http.js +1 -0
- package/build/types/logger.js +1 -0
- package/build/types/repl.js +1 -0
- package/build/types/transformers.js +1 -0
- package/build/utils-CKwka7OL.js +105 -0
- package/build/verification_token-WCrZtUgZ.js +108 -0
- package/build/vine-DkIupA3Z.js +97 -0
- package/package.json +12 -12
- package/build/config_provider-FIAUgvae.js +0 -13
- package/build/create_kernel-BD0Iqi8e.js +0 -3
- package/build/debug-CGQmxzGt.js +0 -3
- package/build/dumper-BBgqFX5a.js +0 -147
- package/build/main-Cxz0TyIw.js +0 -173
- package/build/main-DN2qEEg5.js +0 -41
- package/build/main-DkNgvceD.js +0 -52
- package/build/main-MBAMnmJb.js +0 -81
- package/build/utils-rRkbAPnP.js +0 -42
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import vine, { BaseLiteralType, symbols } from "@vinejs/vine";
|
|
2
|
+
//#region src/vine.ts
|
|
3
|
+
const MULTIPART_FILE = symbols.SUBTYPE ?? Symbol.for("subtype");
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the value is an instance of multipart file from bodyparser.
|
|
6
|
+
* Used internally for type guarding in file validation.
|
|
7
|
+
*
|
|
8
|
+
* @param file - The value to check for MultipartFile instance
|
|
9
|
+
*/
|
|
10
|
+
function isBodyParserFile(file) {
|
|
11
|
+
return !!(file && typeof file === "object" && "isMultipartFile" in file);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* VineJS validation rule that validates the file to be an instance of BodyParser
|
|
15
|
+
* MultipartFile class and applies size/extension validation if configured.
|
|
16
|
+
*
|
|
17
|
+
* @param file - The file value to validate
|
|
18
|
+
* @param options - Validation options for file size and extensions
|
|
19
|
+
* @param field - The field context from VineJS validation
|
|
20
|
+
*/
|
|
21
|
+
const isMultipartFile = vine.createRule((file, options, field) => {
|
|
22
|
+
if (!field.isDefined) return false;
|
|
23
|
+
/**
|
|
24
|
+
* Report error when value is not a field multipart
|
|
25
|
+
* file object
|
|
26
|
+
*/
|
|
27
|
+
if (!isBodyParserFile(file)) {
|
|
28
|
+
field.report("The {{ field }} must be a file", "file", field);
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
const validationOptions = typeof options === "function" ? options(field) : options;
|
|
32
|
+
/**
|
|
33
|
+
* Set size when it's defined in the options and missing
|
|
34
|
+
* on the file instance
|
|
35
|
+
*/
|
|
36
|
+
if (file.sizeLimit === void 0 && validationOptions.size) file.sizeLimit = validationOptions.size;
|
|
37
|
+
/**
|
|
38
|
+
* Set extensions when it's defined in the options and missing
|
|
39
|
+
* on the file instance
|
|
40
|
+
*/
|
|
41
|
+
if (file.allowedExtensions === void 0 && validationOptions.extnames) file.allowedExtensions = validationOptions.extnames;
|
|
42
|
+
/**
|
|
43
|
+
* Validate file
|
|
44
|
+
*/
|
|
45
|
+
file.validate();
|
|
46
|
+
/**
|
|
47
|
+
* Report errors
|
|
48
|
+
*/
|
|
49
|
+
file.errors.forEach((error) => {
|
|
50
|
+
field.report(error.message, `file.${error.type}`, field, validationOptions);
|
|
51
|
+
});
|
|
52
|
+
return file.isValid;
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Represents a multipart file uploaded via multipart/form-data HTTP
|
|
56
|
+
* request. This class extends VineJS's BaseLiteralType to provide
|
|
57
|
+
* specialized validation for uploaded files.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* const fileSchema = vine.object({
|
|
61
|
+
* avatar: vine.file({
|
|
62
|
+
* size: '2mb',
|
|
63
|
+
* extnames: ['jpg', 'png']
|
|
64
|
+
* })
|
|
65
|
+
* })
|
|
66
|
+
*/
|
|
67
|
+
var VineMultipartFile = class VineMultipartFile extends BaseLiteralType {
|
|
68
|
+
/**
|
|
69
|
+
* Private validation options for file validation
|
|
70
|
+
*/
|
|
71
|
+
#validationOptions;
|
|
72
|
+
/**
|
|
73
|
+
* Symbol identifier for multipart file subtype
|
|
74
|
+
*/
|
|
75
|
+
[MULTIPART_FILE] = "multipartFile";
|
|
76
|
+
/**
|
|
77
|
+
* Creates a new VineMultipartFile instance
|
|
78
|
+
*
|
|
79
|
+
* @param validationOptions - File validation options like size limits and allowed extensions
|
|
80
|
+
* @param options - Field options from VineJS
|
|
81
|
+
* @param validations - Array of validation functions to apply
|
|
82
|
+
*/
|
|
83
|
+
constructor(validationOptions, options, validations) {
|
|
84
|
+
super(options, validations || []);
|
|
85
|
+
this.#validationOptions = validationOptions;
|
|
86
|
+
this.dataTypeValidator = isMultipartFile(validationOptions || {});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Creates a clone of the current VineMultipartFile instance
|
|
90
|
+
* with the same validation options and configurations
|
|
91
|
+
*/
|
|
92
|
+
clone() {
|
|
93
|
+
return new VineMultipartFile(this.#validationOptions, this.cloneOptions(), this.cloneValidations());
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
//#endregion
|
|
97
|
+
export { VineMultipartFile as t };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/core",
|
|
3
3
|
"description": "Core of AdonisJS",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.1.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.0.0"
|
|
7
7
|
},
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"index:commands": "node --import=@poppinss/ts-exec toolkit/main.js index build/commands"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@adonisjs/assembler": "^8.0.
|
|
85
|
+
"@adonisjs/assembler": "^8.0.1",
|
|
86
86
|
"@adonisjs/eslint-config": "^3.0.0",
|
|
87
87
|
"@adonisjs/prettier-config": "^1.4.5",
|
|
88
88
|
"@adonisjs/tsconfig": "^2.0.0",
|
|
@@ -92,11 +92,11 @@
|
|
|
92
92
|
"@japa/runner": "^5.3.0",
|
|
93
93
|
"@japa/snapshot": "^2.0.10",
|
|
94
94
|
"@poppinss/ts-exec": "^1.4.4",
|
|
95
|
-
"@release-it/conventional-changelog": "^10.0.
|
|
96
|
-
"@types/node": "~25.
|
|
95
|
+
"@release-it/conventional-changelog": "^10.0.6",
|
|
96
|
+
"@types/node": "~25.5.0",
|
|
97
97
|
"@types/pretty-hrtime": "^1.0.3",
|
|
98
98
|
"@types/sinon": "^21.0.0",
|
|
99
|
-
"@types/supertest": "^
|
|
99
|
+
"@types/supertest": "^7.2.0",
|
|
100
100
|
"@types/test-console": "^2.0.3",
|
|
101
101
|
"@vinejs/vine": "^4.3.0",
|
|
102
102
|
"argon2": "^0.44.0",
|
|
@@ -106,17 +106,17 @@
|
|
|
106
106
|
"cross-env": "^10.1.0",
|
|
107
107
|
"del-cli": "^7.0.0",
|
|
108
108
|
"edge.js": "^6.5.0",
|
|
109
|
-
"eslint": "^10.0.
|
|
109
|
+
"eslint": "^10.0.3",
|
|
110
110
|
"execa": "^9.6.1",
|
|
111
111
|
"get-port": "^7.1.0",
|
|
112
112
|
"pino-pretty": "^13.1.3",
|
|
113
113
|
"prettier": "^3.8.1",
|
|
114
114
|
"release-it": "^19.2.4",
|
|
115
|
-
"sinon": "^21.0.
|
|
115
|
+
"sinon": "^21.0.3",
|
|
116
116
|
"supertest": "^7.2.2",
|
|
117
117
|
"test-console": "^2.0.0",
|
|
118
118
|
"timekeeper": "^2.3.1",
|
|
119
|
-
"tsdown": "^0.
|
|
119
|
+
"tsdown": "^0.21.4",
|
|
120
120
|
"typedoc": "^0.28.17",
|
|
121
121
|
"typescript": "^5.9.3",
|
|
122
122
|
"youch": "^4.1.0"
|
|
@@ -132,14 +132,14 @@
|
|
|
132
132
|
"@adonisjs/hash": "^10.0.0",
|
|
133
133
|
"@adonisjs/health": "^3.1.0",
|
|
134
134
|
"@adonisjs/http-server": "^8.0.0",
|
|
135
|
-
"@adonisjs/http-transformers": "^2.3.
|
|
136
|
-
"@adonisjs/logger": "^7.1.
|
|
135
|
+
"@adonisjs/http-transformers": "^2.3.1",
|
|
136
|
+
"@adonisjs/logger": "^7.1.1",
|
|
137
137
|
"@adonisjs/repl": "^5.0.0",
|
|
138
138
|
"@boringnode/encryption": "^1.0.0",
|
|
139
139
|
"@poppinss/colors": "^4.1.6",
|
|
140
140
|
"@poppinss/dumper": "^0.7.0",
|
|
141
|
-
"@poppinss/macroable": "^1.1.
|
|
142
|
-
"@poppinss/utils": "^7.0.
|
|
141
|
+
"@poppinss/macroable": "^1.1.1",
|
|
142
|
+
"@poppinss/utils": "^7.0.1",
|
|
143
143
|
"@sindresorhus/is": "^7.2.0",
|
|
144
144
|
"@types/he": "^1.2.3",
|
|
145
145
|
"error-stack-parser-es": "^1.0.5",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const configProvider = {
|
|
2
|
-
create(resolver) {
|
|
3
|
-
return {
|
|
4
|
-
type: "provider",
|
|
5
|
-
resolver
|
|
6
|
-
};
|
|
7
|
-
},
|
|
8
|
-
async resolve(app, provider) {
|
|
9
|
-
if (provider && typeof provider === "object" && "type" in provider) return provider.resolver(app);
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export { configProvider as t };
|
package/build/debug-CGQmxzGt.js
DELETED
package/build/dumper-BBgqFX5a.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./chunk-iKc69rpz.js";
|
|
2
|
-
import { inspect } from "node:util";
|
|
3
|
-
import { Exception } from "@poppinss/utils/exception";
|
|
4
|
-
import useColors from "@poppinss/colors";
|
|
5
|
-
import { dump } from "@poppinss/dumper/console";
|
|
6
|
-
import { createScript, createStyleSheet, dump as dump$1 } from "@poppinss/dumper/html";
|
|
7
|
-
import { parse } from "error-stack-parser-es";
|
|
8
|
-
var errors_exports = /* @__PURE__ */ __exportAll({ E_DUMP_DIE_EXCEPTION: () => E_DUMP_DIE_EXCEPTION });
|
|
9
|
-
var DumpDieException = class extends Exception {
|
|
10
|
-
static status = 500;
|
|
11
|
-
static code = "E_DUMP_DIE_EXCEPTION";
|
|
12
|
-
#dumper;
|
|
13
|
-
#traceSourceIndex = 1;
|
|
14
|
-
value;
|
|
15
|
-
constructor(value, dumper) {
|
|
16
|
-
super("Dump and Die exception");
|
|
17
|
-
this.#dumper = dumper;
|
|
18
|
-
this.value = value;
|
|
19
|
-
}
|
|
20
|
-
#getErrorSource() {
|
|
21
|
-
if (this.fileName && this.lineNumber) return {
|
|
22
|
-
location: this.fileName,
|
|
23
|
-
line: this.lineNumber
|
|
24
|
-
};
|
|
25
|
-
const source = parse(this)[this.#traceSourceIndex];
|
|
26
|
-
if (!source.fileName || !source.lineNumber) return;
|
|
27
|
-
return {
|
|
28
|
-
location: source.fileName,
|
|
29
|
-
line: source.lineNumber
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
setTraceSourceIndex(index) {
|
|
33
|
-
this.#traceSourceIndex = index;
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
report() {}
|
|
37
|
-
async handle(error, ctx) {
|
|
38
|
-
const source = this.#getErrorSource();
|
|
39
|
-
const cspNonce = "nonce" in ctx.response ? ctx.response.nonce : void 0;
|
|
40
|
-
ctx.response.status(500).send(`<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width">${this.#dumper.getHeadElements(cspNonce)}</head><body>${this.#dumper.dumpToHtml(error.value, {
|
|
41
|
-
cspNonce,
|
|
42
|
-
source,
|
|
43
|
-
title: "DUMP DIE"
|
|
44
|
-
})}</body></html>`);
|
|
45
|
-
}
|
|
46
|
-
async render(error, kernel) {
|
|
47
|
-
const source = this.#getErrorSource();
|
|
48
|
-
kernel.ui.logger.log(this.#dumper.dumpToAnsi(error.value, {
|
|
49
|
-
source,
|
|
50
|
-
title: "DUMP DIE"
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
[inspect.custom]() {
|
|
54
|
-
const source = this.#getErrorSource();
|
|
55
|
-
return this.#dumper.dumpToAnsi(this.value, {
|
|
56
|
-
source,
|
|
57
|
-
title: "DUMP DIE"
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
const E_DUMP_DIE_EXCEPTION = DumpDieException;
|
|
62
|
-
const colors = useColors.ansi();
|
|
63
|
-
const DUMP_TITLE_STYLES = `
|
|
64
|
-
.adonisjs-dump-header {
|
|
65
|
-
font-family: JetBrains Mono, monaspace argon, Menlo, Monaco, Consolas, monospace;
|
|
66
|
-
background: #ff1639;
|
|
67
|
-
border-radius: 4px;
|
|
68
|
-
color: #fff;
|
|
69
|
-
border-bottom-left-radius: 0;
|
|
70
|
-
border-bottom-right-radius: 0;
|
|
71
|
-
padding: 0.4rem 1.2rem;
|
|
72
|
-
font-size: 1em;
|
|
73
|
-
display: flex;
|
|
74
|
-
justify-content: space-between;
|
|
75
|
-
}
|
|
76
|
-
.adonisjs-dump-header .adonisjs-dump-header-title {
|
|
77
|
-
font-weight: bold;
|
|
78
|
-
text-transform: uppercase;
|
|
79
|
-
}
|
|
80
|
-
.adonisjs-dump-header .adonisjs-dump-header-source {
|
|
81
|
-
font-weight: bold;
|
|
82
|
-
color: inherit;
|
|
83
|
-
text-decoration: underline;
|
|
84
|
-
}
|
|
85
|
-
.dumper-dump pre {
|
|
86
|
-
border-radius: 4px;
|
|
87
|
-
border-top-left-radius: 0;
|
|
88
|
-
border-top-right-radius: 0;
|
|
89
|
-
}`;
|
|
90
|
-
const IDE = process.env.ADONIS_IDE ?? process.env.EDITOR ?? "";
|
|
91
|
-
var Dumper = class {
|
|
92
|
-
#app;
|
|
93
|
-
#htmlConfig = {};
|
|
94
|
-
#consoleConfig = { collapse: ["DateTime", "Date"] };
|
|
95
|
-
#editors = {
|
|
96
|
-
textmate: "txmt://open?url=file://%f&line=%l",
|
|
97
|
-
macvim: "mvim://open?url=file://%f&line=%l",
|
|
98
|
-
emacs: "emacs://open?url=file://%f&line=%l",
|
|
99
|
-
sublime: "subl://open?url=file://%f&line=%l",
|
|
100
|
-
phpstorm: "phpstorm://open?file=%f&line=%l",
|
|
101
|
-
atom: "atom://core/open/file?filename=%f&line=%l",
|
|
102
|
-
vscode: "vscode://file/%f:%l"
|
|
103
|
-
};
|
|
104
|
-
constructor(app) {
|
|
105
|
-
this.#app = app;
|
|
106
|
-
}
|
|
107
|
-
#getEditorLink(source) {
|
|
108
|
-
const editorURL = this.#editors[IDE] || IDE;
|
|
109
|
-
if (!editorURL || !source) return;
|
|
110
|
-
return {
|
|
111
|
-
href: editorURL.replace("%f", source.location).replace("%l", String(source.line)),
|
|
112
|
-
text: `${this.#app.relativePath(source.location)}:${source.line}`
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
configureHtmlOutput(config) {
|
|
116
|
-
this.#htmlConfig = config;
|
|
117
|
-
return this;
|
|
118
|
-
}
|
|
119
|
-
configureAnsiOutput(config) {
|
|
120
|
-
this.#consoleConfig = config;
|
|
121
|
-
return this;
|
|
122
|
-
}
|
|
123
|
-
getHeadElements(cspNonce) {
|
|
124
|
-
return `<style id="dumper-styles">` + createStyleSheet() + DUMP_TITLE_STYLES + `</style><script id="dumper-script"${cspNonce ? ` nonce="${cspNonce}"` : ""}>` + createScript() + "<\/script>";
|
|
125
|
-
}
|
|
126
|
-
dumpToHtml(value, options = {}) {
|
|
127
|
-
const link = this.#getEditorLink(options.source) ?? null;
|
|
128
|
-
return `<div class="adonisjs-dump-header"><span class="adonisjs-dump-header-title">${options.title || "DUMP"}</span>` + (link ? `<a href="${link.href}" class="adonisjs-dump-header-source">${link.text}</a>` : "") + "</div>" + dump$1(value, {
|
|
129
|
-
cspNonce: options.cspNonce,
|
|
130
|
-
...this.#htmlConfig
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
dumpToAnsi(value, options = {}) {
|
|
134
|
-
const columns = process.stdout.columns;
|
|
135
|
-
const link = `${this.#getEditorLink(options.source)?.text ?? ""} `;
|
|
136
|
-
const title = ` ${options.title || "DUMP"}`;
|
|
137
|
-
const whiteSpaceLength = columns ? columns - link.length - title.length - 4 : 2;
|
|
138
|
-
const whiteSpace = new Array(whiteSpaceLength <= 0 ? 2 : whiteSpaceLength).join(" ");
|
|
139
|
-
return `${colors.bgRed().bold(`${title}${whiteSpace}${link}`)}\n${dump(value, this.#consoleConfig)}`;
|
|
140
|
-
}
|
|
141
|
-
dd(value, traceSourceIndex = 1) {
|
|
142
|
-
const error = new E_DUMP_DIE_EXCEPTION(value, this);
|
|
143
|
-
error.setTraceSourceIndex(traceSourceIndex);
|
|
144
|
-
throw error;
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
export { errors_exports as n, Dumper as t };
|
package/build/main-Cxz0TyIw.js
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { t as debug_default } from "./debug-CGQmxzGt.js";
|
|
2
|
-
import { setApp } from "./services/app.js";
|
|
3
|
-
import { t as app_exports } from "./modules/app.js";
|
|
4
|
-
import { createServer } from "node:http";
|
|
5
|
-
var AceProcess = class {
|
|
6
|
-
#ignitor;
|
|
7
|
-
#configureCallback = () => {};
|
|
8
|
-
constructor(ignitor) {
|
|
9
|
-
this.#ignitor = ignitor;
|
|
10
|
-
}
|
|
11
|
-
configure(callback) {
|
|
12
|
-
this.#configureCallback = callback;
|
|
13
|
-
return this;
|
|
14
|
-
}
|
|
15
|
-
async handle(argv) {
|
|
16
|
-
const app = this.#ignitor.createApp("console");
|
|
17
|
-
await app.init();
|
|
18
|
-
const { createAceKernel } = await import("./create_kernel-BD0Iqi8e.js");
|
|
19
|
-
const commandName = argv[argv.findIndex((value) => !value.startsWith("-"))];
|
|
20
|
-
const kernel = createAceKernel(app, commandName);
|
|
21
|
-
app.container.bindValue("ace", kernel);
|
|
22
|
-
kernel.loading(async (metaData) => {
|
|
23
|
-
if (metaData.options.startApp && !app.isReady) {
|
|
24
|
-
if (metaData.commandName === "repl") app.setEnvironment("repl");
|
|
25
|
-
await app.boot();
|
|
26
|
-
await app.start(() => {});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
await this.#configureCallback(app);
|
|
30
|
-
app.terminating(() => {
|
|
31
|
-
const mainCommand = kernel.getMainCommand();
|
|
32
|
-
if (mainCommand?.staysAlive) process.exitCode = mainCommand.exitCode;
|
|
33
|
-
});
|
|
34
|
-
await kernel.handle(argv);
|
|
35
|
-
const mainCommand = kernel.getMainCommand();
|
|
36
|
-
if (!mainCommand || !mainCommand.staysAlive) {
|
|
37
|
-
process.exitCode = kernel.exitCode;
|
|
38
|
-
await app.terminate();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
var TestRunnerProcess = class {
|
|
43
|
-
#ignitor;
|
|
44
|
-
#configureCallback = () => {};
|
|
45
|
-
constructor(ignitor) {
|
|
46
|
-
this.#ignitor = ignitor;
|
|
47
|
-
}
|
|
48
|
-
configure(callback) {
|
|
49
|
-
this.#configureCallback = callback;
|
|
50
|
-
return this;
|
|
51
|
-
}
|
|
52
|
-
async run(callback) {
|
|
53
|
-
const app = this.#ignitor.createApp("test");
|
|
54
|
-
await app.init();
|
|
55
|
-
await app.boot();
|
|
56
|
-
await app.start(this.#configureCallback);
|
|
57
|
-
await callback(app);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var HttpServerProcess = class {
|
|
61
|
-
#ignitor;
|
|
62
|
-
constructor(ignitor) {
|
|
63
|
-
this.#ignitor = ignitor;
|
|
64
|
-
}
|
|
65
|
-
#close(nodeHttpServer) {
|
|
66
|
-
return new Promise((resolve) => {
|
|
67
|
-
debug_default("closing http server process");
|
|
68
|
-
nodeHttpServer.close(() => resolve());
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
#monitorAppAndServer(nodeHttpServer, app, logger) {
|
|
72
|
-
app.terminating(async () => {
|
|
73
|
-
debug_default("terminating signal received");
|
|
74
|
-
await this.#close(nodeHttpServer);
|
|
75
|
-
});
|
|
76
|
-
nodeHttpServer.once("error", (error) => {
|
|
77
|
-
debug_default("http server crashed with error \"%O\"", error);
|
|
78
|
-
logger.fatal({ err: error }, error.message);
|
|
79
|
-
process.exitCode = 1;
|
|
80
|
-
app.terminate();
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
#listen(nodeHttpServer) {
|
|
84
|
-
return new Promise((resolve, reject) => {
|
|
85
|
-
const host = process.env.HOST || "0.0.0.0";
|
|
86
|
-
const port = Number(process.env.PORT || "3333");
|
|
87
|
-
nodeHttpServer.listen(port, host);
|
|
88
|
-
nodeHttpServer.once("listening", () => {
|
|
89
|
-
debug_default("listening to http server, host :%s, port: %s", host, port);
|
|
90
|
-
resolve({
|
|
91
|
-
port,
|
|
92
|
-
host
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
nodeHttpServer.once("error", (error) => {
|
|
96
|
-
reject(error);
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
#notifyServerHasStarted(app, logger, emitter, payload) {
|
|
101
|
-
app.notify({
|
|
102
|
-
isAdonisJS: true,
|
|
103
|
-
environment: "web",
|
|
104
|
-
...payload
|
|
105
|
-
});
|
|
106
|
-
logger.info("started HTTP server on %s:%s", payload.host, payload.port);
|
|
107
|
-
emitter.emit("http:server_ready", payload);
|
|
108
|
-
}
|
|
109
|
-
async start(serverCallback) {
|
|
110
|
-
const startTime = process.hrtime();
|
|
111
|
-
const createHTTPServer = serverCallback || createServer;
|
|
112
|
-
const app = this.#ignitor.createApp("web");
|
|
113
|
-
await app.init();
|
|
114
|
-
await app.boot();
|
|
115
|
-
await app.start(async () => {
|
|
116
|
-
const server = await app.container.make("server");
|
|
117
|
-
await server.boot();
|
|
118
|
-
const httpServer = createHTTPServer(server.handle.bind(server));
|
|
119
|
-
server.setNodeServer(httpServer);
|
|
120
|
-
const logger = await app.container.make("logger");
|
|
121
|
-
const emitter = await app.container.make("emitter");
|
|
122
|
-
const payload = await this.#listen(httpServer);
|
|
123
|
-
this.#notifyServerHasStarted(app, logger, emitter, {
|
|
124
|
-
...payload,
|
|
125
|
-
duration: process.hrtime(startTime)
|
|
126
|
-
});
|
|
127
|
-
this.#monitorAppAndServer(httpServer, app, logger);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
var Ignitor = class {
|
|
132
|
-
#options;
|
|
133
|
-
#appRoot;
|
|
134
|
-
#app;
|
|
135
|
-
#tapCallbacks = /* @__PURE__ */ new Set();
|
|
136
|
-
constructor(appRoot, options = {}) {
|
|
137
|
-
this.#appRoot = appRoot;
|
|
138
|
-
this.#options = options;
|
|
139
|
-
}
|
|
140
|
-
#runTapCallbacks(app) {
|
|
141
|
-
this.#tapCallbacks.forEach((tapCallback) => tapCallback(app));
|
|
142
|
-
}
|
|
143
|
-
getApp() {
|
|
144
|
-
return this.#app;
|
|
145
|
-
}
|
|
146
|
-
createApp(environment) {
|
|
147
|
-
debug_default("creating application instance");
|
|
148
|
-
this.#app = new app_exports.Application(this.#appRoot, {
|
|
149
|
-
environment,
|
|
150
|
-
importer: this.#options.importer
|
|
151
|
-
});
|
|
152
|
-
setApp(this.#app);
|
|
153
|
-
this.#runTapCallbacks(this.#app);
|
|
154
|
-
return this.#app;
|
|
155
|
-
}
|
|
156
|
-
tap(callback) {
|
|
157
|
-
this.#tapCallbacks.add(callback);
|
|
158
|
-
return this;
|
|
159
|
-
}
|
|
160
|
-
httpServer() {
|
|
161
|
-
return new HttpServerProcess(this);
|
|
162
|
-
}
|
|
163
|
-
ace() {
|
|
164
|
-
return new AceProcess(this);
|
|
165
|
-
}
|
|
166
|
-
testRunner() {
|
|
167
|
-
return new TestRunnerProcess(this);
|
|
168
|
-
}
|
|
169
|
-
async terminate() {
|
|
170
|
-
await this.#app?.terminate();
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
export { Ignitor as t };
|
package/build/main-DN2qEEg5.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { n as __reExport, t as __exportAll } from "./chunk-iKc69rpz.js";
|
|
2
|
-
import "@adonisjs/bodyparser";
|
|
3
|
-
var RequestValidator = class RequestValidator {
|
|
4
|
-
#ctx;
|
|
5
|
-
constructor(ctx) {
|
|
6
|
-
this.#ctx = ctx;
|
|
7
|
-
}
|
|
8
|
-
static errorReporter;
|
|
9
|
-
static messagesProvider;
|
|
10
|
-
#requestData() {
|
|
11
|
-
return {
|
|
12
|
-
...this.#ctx.request.all(),
|
|
13
|
-
params: this.#ctx.request.params(),
|
|
14
|
-
headers: this.#ctx.request.headers(),
|
|
15
|
-
cookies: this.#ctx.request.cookiesList()
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
#processValidatorOptions(options) {
|
|
19
|
-
const validatorOptions = options || {};
|
|
20
|
-
if (RequestValidator.errorReporter && !validatorOptions.errorReporter) {
|
|
21
|
-
const errorReporter = RequestValidator.errorReporter(this.#ctx);
|
|
22
|
-
validatorOptions.errorReporter = () => errorReporter;
|
|
23
|
-
}
|
|
24
|
-
if (RequestValidator.messagesProvider && !validatorOptions.messagesProvider) validatorOptions.messagesProvider = RequestValidator.messagesProvider(this.#ctx);
|
|
25
|
-
return validatorOptions;
|
|
26
|
-
}
|
|
27
|
-
validateUsing(validator, ...[options]) {
|
|
28
|
-
const validatorOptions = this.#processValidatorOptions(options);
|
|
29
|
-
const data = validatorOptions.data || this.#requestData();
|
|
30
|
-
return validator.validate(data, validatorOptions);
|
|
31
|
-
}
|
|
32
|
-
async tryValidateUsing(validator, ...[options]) {
|
|
33
|
-
const validatorOptions = this.#processValidatorOptions(options);
|
|
34
|
-
const data = validatorOptions.data || this.#requestData();
|
|
35
|
-
return validator.tryValidate(data, validatorOptions);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var main_exports = /* @__PURE__ */ __exportAll({ RequestValidator: () => RequestValidator });
|
|
39
|
-
import * as import__adonisjs_http_server from "@adonisjs/http-server";
|
|
40
|
-
__reExport(main_exports, import__adonisjs_http_server);
|
|
41
|
-
export { RequestValidator as n, main_exports as t };
|
package/build/main-DkNgvceD.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { n as __reExport, t as __exportAll } from "./chunk-iKc69rpz.js";
|
|
2
|
-
import { t as debug_default } from "./debug-CGQmxzGt.js";
|
|
3
|
-
import { t as configProvider } from "./config_provider-FIAUgvae.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__ */ __exportAll({
|
|
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 };
|
package/build/main-MBAMnmJb.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
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 };
|