@adonisjs/core 7.0.0-next.14 → 7.0.0-next.15

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.
Files changed (110) hide show
  1. package/build/{ace-DDzvaSs_.js → ace-CYvqhV0y.js} +3 -3
  2. package/build/commands/add.d.ts +4 -3
  3. package/build/commands/add.js +52 -16
  4. package/build/commands/build.js +3 -3
  5. package/build/commands/commands.json +1 -1
  6. package/build/commands/configure.js +2 -2
  7. package/build/commands/eject.js +3 -3
  8. package/build/commands/env/add.js +3 -3
  9. package/build/commands/generate_key.js +2 -2
  10. package/build/commands/inspect_rcfile.js +1 -1
  11. package/build/commands/list/routes.js +2 -2
  12. package/build/commands/make/command.js +2 -2
  13. package/build/commands/make/controller.js +2 -2
  14. package/build/commands/make/event.js +2 -2
  15. package/build/commands/make/exception.js +2 -2
  16. package/build/commands/make/listener.js +2 -2
  17. package/build/commands/make/middleware.js +3 -3
  18. package/build/commands/make/preload.js +3 -3
  19. package/build/commands/make/provider.js +3 -3
  20. package/build/commands/make/service.js +2 -2
  21. package/build/commands/make/test.js +2 -2
  22. package/build/commands/make/transformer.js +2 -2
  23. package/build/commands/make/validator.js +2 -2
  24. package/build/commands/make/view.js +2 -2
  25. package/build/commands/repl.js +1 -1
  26. package/build/commands/serve.js +3 -3
  27. package/build/commands/test.js +3 -3
  28. package/build/{config_provider-CY-xuo2R.js → config_provider-DWVFHOQX.js} +3 -1
  29. package/build/{core-CffBtWJW.js → core-BuRVIObK.js} +37 -11
  30. package/build/create_kernel-Cn8zVtvt.js +3 -0
  31. package/build/{create_kernel-B7zWS8Zz.js → create_kernel-Cpqqa931.js} +1 -1
  32. package/build/define_config-BvoRgVYO.js +62 -0
  33. package/build/exceptions-DNMesP42.js +2 -0
  34. package/build/factories/core/ace.js +12 -11
  35. package/build/factories/core/ignitor.js +9 -8
  36. package/build/factories/core/main.js +18 -16
  37. package/build/factories/core/test_utils.js +15 -13
  38. package/build/factories/encryption.d.ts +1 -1
  39. package/build/factories/encryption.js +1 -1
  40. package/build/factories/stubs.js +5 -6
  41. package/build/{ignitor-Dil-rtCo.js → ignitor-BAHDhsmQ.js} +14 -6
  42. package/build/index.d.ts +1 -1
  43. package/build/index.js +5 -6
  44. package/build/{main-BTUXw6He.js → main-B3Y59dQ2.js} +2 -2
  45. package/build/{main-CFmDHDls.js → main-BA5_XHM0.js} +2 -7
  46. package/build/{main-BrJQ1VAM.js → main-BPDqyZic.js} +1 -2
  47. package/build/main-Bfnr5tAw.js +2 -0
  48. package/build/{main-2-nm3TiB.js → main-TtUIT86D.js} +4 -3
  49. package/build/modules/ace/codemods.js +1 -1
  50. package/build/modules/ace/main.js +1 -1
  51. package/build/modules/bodyparser/bodyparser_middleware.js +1 -1
  52. package/build/modules/bodyparser/main.js +1 -1
  53. package/build/modules/config.js +1 -1
  54. package/build/modules/dumper/main.js +1 -1
  55. package/build/modules/dumper/plugins/edge.js +1 -1
  56. package/build/modules/encryption/define_config.d.ts +127 -0
  57. package/build/modules/encryption/drivers/aes_256_cbc.d.ts +20 -0
  58. package/build/modules/encryption/drivers/aes_256_cbc.js +2 -0
  59. package/build/modules/encryption/drivers/aes_256_gcm.d.ts +21 -0
  60. package/build/modules/encryption/drivers/aes_256_gcm.js +2 -0
  61. package/build/modules/encryption/drivers/chacha20_poly1305.d.ts +21 -0
  62. package/build/modules/encryption/drivers/chacha20_poly1305.js +2 -0
  63. package/build/modules/encryption/main.d.ts +85 -0
  64. package/build/modules/encryption/main.js +5 -0
  65. package/build/modules/events.js +1 -1
  66. package/build/modules/hash/main.js +2 -3
  67. package/build/modules/http/main.js +1 -1
  68. package/build/modules/http/request_validator.d.ts +1 -3
  69. package/build/modules/logger.js +1 -1
  70. package/build/modules/repl.js +1 -1
  71. package/build/modules/transformers/main.js +1 -1
  72. package/build/providers/app_provider.d.ts +5 -4
  73. package/build/providers/app_provider.js +22 -14
  74. package/build/providers/edge_provider.js +2 -2
  75. package/build/providers/hash_provider.js +2 -3
  76. package/build/providers/repl_provider.js +1 -1
  77. package/build/providers/vinejs_provider.js +3 -4
  78. package/build/src/debug.d.ts +1 -1
  79. package/build/src/exceptions.js +1 -1
  80. package/build/src/helpers/main.js +1 -1
  81. package/build/src/helpers/string.js +1 -1
  82. package/build/src/helpers/verification_token.js +1 -1
  83. package/build/src/test_utils/main.js +6 -3
  84. package/build/src/types.d.ts +65 -8
  85. package/build/src/vine.js +1 -1
  86. package/build/{test_utils-c_TEaEHW.js → test_utils-DCaos98d.js} +3 -3
  87. package/build/toolkit/main.js +1 -1
  88. package/build/types/encryption.d.ts +39 -1
  89. package/build/types/encryption.js +0 -1
  90. package/build/{utils-Dpa3iJz-.js → utils-CtGytdtt.js} +1 -0
  91. package/package.json +44 -42
  92. package/build/create_kernel-CsTq0pWc.js +0 -3
  93. package/build/debug-DURPi9xn.js +0 -3
  94. package/build/encryption-D2HGu0bU.js +0 -5
  95. package/build/modules/encryption.d.ts +0 -18
  96. package/build/modules/encryption.js +0 -4
  97. /package/build/{bodyparser_middleware-DTW0epKM.js → bodyparser_middleware-BmARtnYe.js} +0 -0
  98. /package/build/{config-B2S2xfmN.js → config-BwupGyeJ.js} +0 -0
  99. /package/build/{decorate-DM0Sx1ye.js → decorate-CJcHOoD-.js} +0 -0
  100. /package/build/{dumper-C_sMcyFb.js → dumper-D29dE_xc.js} +0 -0
  101. /package/build/{edge-LQdCc1L3.js → edge-BVYR-Vjr.js} +0 -0
  102. /package/build/{events-B8hK42QT.js → events-BW2flEef.js} +0 -0
  103. /package/build/{logger-Dha-0hp1.js → logger-C2asB8px.js} +0 -0
  104. /package/build/{main-BWftwyAK.js → main-BlJhxJJ2.js} +0 -0
  105. /package/build/{main-D5xz2ZN1.js → main-CP75MhEW.js} +0 -0
  106. /package/build/{main-q9TMzWUj.js → main-OHZwVYZ4.js} +0 -0
  107. /package/build/{repl-CumYg2V_.js → repl-BF2TbFoO.js} +0 -0
  108. /package/build/{string-CJ7ewUFq.js → string-Cx6q_win.js} +0 -0
  109. /package/build/{verification_token-DXsW81rl.js → verification_token-DrdoU4RH.js} +0 -0
  110. /package/build/{vine-Bt4ymkM0.js → vine-DGint2rk.js} +0 -0
@@ -0,0 +1,62 @@
1
+ import { n as debug_default, t as configProvider } from "./config_provider-DWVFHOQX.js";
2
+ import { n as InvalidArgumentsException } from "./exceptions-DNMesP42.js";
3
+ function defineConfig(config) {
4
+ if (!config.list) throw new InvalidArgumentsException("Missing \"list\" property in encryption config");
5
+ if (config.default && !config.list[config.default]) throw new InvalidArgumentsException(`Missing "list.${String(config.default)}" in encryption config. It is referenced by the "default" property`);
6
+ return configProvider.create(async (app) => {
7
+ debug_default("resolving encryption config");
8
+ const encryptorsList = Object.keys(config.list);
9
+ const encryptors = {};
10
+ for (let encryptorName of encryptorsList) {
11
+ const encryptor = config.list[encryptorName];
12
+ if ("resolver" in encryptor) encryptors[encryptorName] = await encryptor.resolver(app);
13
+ else encryptors[encryptorName] = encryptor;
14
+ }
15
+ return {
16
+ default: config.default,
17
+ list: encryptors
18
+ };
19
+ });
20
+ }
21
+ const drivers = {
22
+ chacha20: (config) => {
23
+ return configProvider.create(async () => {
24
+ const { ChaCha20Poly1305 } = await import("./modules/encryption/drivers/chacha20_poly1305.js");
25
+ debug_default("configuring chacha20 encryption driver");
26
+ return {
27
+ driver: (key) => new ChaCha20Poly1305({
28
+ id: config.id,
29
+ key
30
+ }),
31
+ keys: config.keys
32
+ };
33
+ });
34
+ },
35
+ aes256cbc: (config) => {
36
+ return configProvider.create(async () => {
37
+ const { AES256CBC } = await import("./modules/encryption/drivers/aes_256_cbc.js");
38
+ debug_default("configuring chacha20 encryption driver");
39
+ return {
40
+ driver: (key) => new AES256CBC({
41
+ id: config.id,
42
+ key
43
+ }),
44
+ keys: config.keys
45
+ };
46
+ });
47
+ },
48
+ aes256gcm: (config) => {
49
+ return configProvider.create(async () => {
50
+ const { AES256GCM } = await import("./modules/encryption/drivers/aes_256_gcm.js");
51
+ debug_default("configuring chacha20 encryption driver");
52
+ return {
53
+ driver: (key) => new AES256GCM({
54
+ id: config.id,
55
+ key
56
+ }),
57
+ keys: config.keys
58
+ };
59
+ });
60
+ }
61
+ };
62
+ export { drivers as n, defineConfig as t };
@@ -0,0 +1,2 @@
1
+ import { Exception as Exception$1, InvalidArgumentsException as InvalidArgumentsException$1, RuntimeException as RuntimeException$1, createError } from "@poppinss/utils/exception";
2
+ export { createError as i, InvalidArgumentsException$1 as n, RuntimeException$1 as r, Exception$1 as t };
@@ -1,15 +1,16 @@
1
1
  import "../../chunk-MjwdjG2f.js";
2
- import "../../debug-DURPi9xn.js";
3
- import "../../main-BTUXw6He.js";
2
+ import "../../config_provider-DWVFHOQX.js";
3
+ import "../../main-B3Y59dQ2.js";
4
4
  import "../../app-B6oge7b3.js";
5
5
  import "../../app-BK0PN3li.js";
6
- import "../../config_provider-CY-xuo2R.js";
7
- import "../../main-BWftwyAK.js";
8
- import "../../logger-Dha-0hp1.js";
9
- import "../../main-CFmDHDls.js";
10
- import "../../main-BrJQ1VAM.js";
11
- import "../../main-q9TMzWUj.js";
12
- import "../../ignitor-Dil-rtCo.js";
13
- import "../../create_kernel-B7zWS8Zz.js";
14
- import { t as AceFactory } from "../../ace-DDzvaSs_.js";
6
+ import "../../main-BlJhxJJ2.js";
7
+ import "../../logger-C2asB8px.js";
8
+ import "../../main-BA5_XHM0.js";
9
+ import "../../exceptions-DNMesP42.js";
10
+ import "../../define_config-BvoRgVYO.js";
11
+ import "../../main-BPDqyZic.js";
12
+ import "../../main-OHZwVYZ4.js";
13
+ import "../../ignitor-BAHDhsmQ.js";
14
+ import "../../create_kernel-Cpqqa931.js";
15
+ import { t as AceFactory } from "../../ace-CYvqhV0y.js";
15
16
  export { AceFactory };
@@ -1,12 +1,13 @@
1
1
  import "../../chunk-MjwdjG2f.js";
2
- import "../../debug-DURPi9xn.js";
3
- import "../../main-BTUXw6He.js";
2
+ import "../../config_provider-DWVFHOQX.js";
3
+ import "../../main-B3Y59dQ2.js";
4
4
  import "../../app-B6oge7b3.js";
5
5
  import "../../app-BK0PN3li.js";
6
- import "../../config_provider-CY-xuo2R.js";
7
- import "../../logger-Dha-0hp1.js";
8
- import "../../main-CFmDHDls.js";
9
- import "../../main-BrJQ1VAM.js";
10
- import "../../main-q9TMzWUj.js";
11
- import { t as IgnitorFactory } from "../../ignitor-Dil-rtCo.js";
6
+ import "../../logger-C2asB8px.js";
7
+ import "../../main-BA5_XHM0.js";
8
+ import "../../exceptions-DNMesP42.js";
9
+ import "../../define_config-BvoRgVYO.js";
10
+ import "../../main-BPDqyZic.js";
11
+ import "../../main-OHZwVYZ4.js";
12
+ import { t as IgnitorFactory } from "../../ignitor-BAHDhsmQ.js";
12
13
  export { IgnitorFactory };
@@ -1,22 +1,24 @@
1
1
  import "../../chunk-MjwdjG2f.js";
2
2
  import "../../main-kn40V-hF.js";
3
3
  import "../../container-ClFvcykQ.js";
4
- import "../../debug-DURPi9xn.js";
5
- import "../../main-BTUXw6He.js";
4
+ import "../../config_provider-DWVFHOQX.js";
5
+ import "../../main-B3Y59dQ2.js";
6
6
  import "../../app-B6oge7b3.js";
7
7
  import "../../app-BK0PN3li.js";
8
- import "../../config_provider-CY-xuo2R.js";
9
- import "../../string-CJ7ewUFq.js";
10
- import "../../utils-Dpa3iJz-.js";
11
- import "../../core-CffBtWJW.js";
12
- import "../../main-BWftwyAK.js";
13
- import "../../logger-Dha-0hp1.js";
14
- import "../../main-CFmDHDls.js";
15
- import "../../main-BrJQ1VAM.js";
16
- import "../../main-q9TMzWUj.js";
17
- import { t as IgnitorFactory } from "../../ignitor-Dil-rtCo.js";
18
- import "../../create_kernel-B7zWS8Zz.js";
19
- import { t as AceFactory } from "../../ace-DDzvaSs_.js";
20
- import "../../main-2-nm3TiB.js";
21
- import { t as TestUtilsFactory } from "../../test_utils-c_TEaEHW.js";
8
+ import "../../string-Cx6q_win.js";
9
+ import "../../utils-CtGytdtt.js";
10
+ import "../../core-BuRVIObK.js";
11
+ import "../../main-BlJhxJJ2.js";
12
+ import "../../logger-C2asB8px.js";
13
+ import "../../main-BA5_XHM0.js";
14
+ import "../../exceptions-DNMesP42.js";
15
+ import "../../define_config-BvoRgVYO.js";
16
+ import "../../main-Bfnr5tAw.js";
17
+ import "../../main-BPDqyZic.js";
18
+ import "../../main-OHZwVYZ4.js";
19
+ import { t as IgnitorFactory } from "../../ignitor-BAHDhsmQ.js";
20
+ import "../../create_kernel-Cpqqa931.js";
21
+ import { t as AceFactory } from "../../ace-CYvqhV0y.js";
22
+ import "../../main-TtUIT86D.js";
23
+ import { t as TestUtilsFactory } from "../../test_utils-DCaos98d.js";
22
24
  export { AceFactory, IgnitorFactory, TestUtilsFactory };
@@ -1,19 +1,21 @@
1
1
  import "../../chunk-MjwdjG2f.js";
2
2
  import "../../main-kn40V-hF.js";
3
3
  import "../../container-ClFvcykQ.js";
4
- import "../../debug-DURPi9xn.js";
5
- import "../../main-BTUXw6He.js";
4
+ import "../../config_provider-DWVFHOQX.js";
5
+ import "../../main-B3Y59dQ2.js";
6
6
  import "../../app-B6oge7b3.js";
7
7
  import "../../app-BK0PN3li.js";
8
- import "../../config_provider-CY-xuo2R.js";
9
- import "../../string-CJ7ewUFq.js";
10
- import "../../utils-Dpa3iJz-.js";
11
- import "../../core-CffBtWJW.js";
12
- import "../../logger-Dha-0hp1.js";
13
- import "../../main-CFmDHDls.js";
14
- import "../../main-BrJQ1VAM.js";
15
- import "../../main-q9TMzWUj.js";
16
- import "../../ignitor-Dil-rtCo.js";
17
- import "../../main-2-nm3TiB.js";
18
- import { t as TestUtilsFactory } from "../../test_utils-c_TEaEHW.js";
8
+ import "../../string-Cx6q_win.js";
9
+ import "../../utils-CtGytdtt.js";
10
+ import "../../core-BuRVIObK.js";
11
+ import "../../logger-C2asB8px.js";
12
+ import "../../main-BA5_XHM0.js";
13
+ import "../../exceptions-DNMesP42.js";
14
+ import "../../define_config-BvoRgVYO.js";
15
+ import "../../main-Bfnr5tAw.js";
16
+ import "../../main-BPDqyZic.js";
17
+ import "../../main-OHZwVYZ4.js";
18
+ import "../../ignitor-BAHDhsmQ.js";
19
+ import "../../main-TtUIT86D.js";
20
+ import { t as TestUtilsFactory } from "../../test_utils-DCaos98d.js";
19
21
  export { TestUtilsFactory };
@@ -1 +1 @@
1
- export * from '@adonisjs/encryption/factories';
1
+ export * from '@boringnode/encryption/factories';
@@ -1,2 +1,2 @@
1
- export * from "@adonisjs/encryption/factories";
1
+ export * from "@boringnode/encryption/factories";
2
2
  export {};
@@ -1,14 +1,13 @@
1
1
  import "../chunk-MjwdjG2f.js";
2
2
  import { t as stubsRoot } from "../main-kn40V-hF.js";
3
3
  import "../container-ClFvcykQ.js";
4
- import "../debug-DURPi9xn.js";
5
- import "../main-BTUXw6He.js";
4
+ import "../config_provider-DWVFHOQX.js";
5
+ import "../main-B3Y59dQ2.js";
6
6
  import "../app-B6oge7b3.js";
7
7
  import "../app-BK0PN3li.js";
8
- import "../config_provider-CY-xuo2R.js";
9
- import "../string-CJ7ewUFq.js";
10
- import "../utils-Dpa3iJz-.js";
11
- import "../core-CffBtWJW.js";
8
+ import "../string-Cx6q_win.js";
9
+ import "../utils-CtGytdtt.js";
10
+ import "../core-BuRVIObK.js";
12
11
  import { AppFactory } from "@adonisjs/application/factories";
13
12
  var StubsFactory = class {
14
13
  #parameters = {};
@@ -1,8 +1,9 @@
1
- import { t as Ignitor } from "./main-BTUXw6He.js";
2
- import { t as logger_exports } from "./logger-Dha-0hp1.js";
3
- import { t as main_exports } from "./main-CFmDHDls.js";
4
- import { n as defineConfig, r as drivers } from "./main-BrJQ1VAM.js";
5
- import { t as main_exports$1 } from "./main-q9TMzWUj.js";
1
+ import { t as Ignitor } from "./main-B3Y59dQ2.js";
2
+ import { t as logger_exports } from "./logger-C2asB8px.js";
3
+ import { t as main_exports } from "./main-BA5_XHM0.js";
4
+ import { n as drivers$1, t as defineConfig$1 } from "./define_config-BvoRgVYO.js";
5
+ import { n as defineConfig, r as drivers } from "./main-BPDqyZic.js";
6
+ import { t as main_exports$1 } from "./main-OHZwVYZ4.js";
6
7
  var IgnitorFactory = class {
7
8
  #preloadActions = [];
8
9
  #parameters = {};
@@ -30,10 +31,17 @@ var IgnitorFactory = class {
30
31
  withCoreConfig() {
31
32
  this.merge({ config: {
32
33
  app: {
33
- appKey: "averylongrandomsecretkey",
34
+ appUrl: "http://localhost:3333",
34
35
  http: (0, main_exports.defineConfig)({})
35
36
  },
36
37
  validator: {},
38
+ encryption: defineConfig$1({
39
+ default: "gcm",
40
+ list: { gcm: drivers$1.aes256gcm({
41
+ id: "gcm",
42
+ keys: ["averylongrandomsecretkey"]
43
+ }) }
44
+ }),
37
45
  bodyparser: (0, main_exports$1.defineConfig)({}),
38
46
  hash: defineConfig({
39
47
  default: "scrypt",
package/build/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { errors as aceErrors } from '@adonisjs/ace';
2
2
  import { errors as envErrors } from '@adonisjs/env';
3
3
  import { errors as appErrors } from '@adonisjs/application';
4
- import { errors as encryptionErrors } from '@adonisjs/encryption';
4
+ import { errors as encryptionErrors } from '@boringnode/encryption';
5
5
  import { errors as httpServerErrors } from '@adonisjs/http-server';
6
6
  export { stubsRoot } from './stubs/main.ts';
7
7
  export { inject } from './modules/container.ts';
package/build/index.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import "./chunk-MjwdjG2f.js";
2
2
  import { t as stubsRoot } from "./main-kn40V-hF.js";
3
3
  import { t as container_exports } from "./container-ClFvcykQ.js";
4
- import "./debug-DURPi9xn.js";
5
- import { t as Ignitor } from "./main-BTUXw6He.js";
4
+ import { t as configProvider } from "./config_provider-DWVFHOQX.js";
5
+ import { t as Ignitor } from "./main-B3Y59dQ2.js";
6
6
  import "./app-B6oge7b3.js";
7
7
  import "./app-BK0PN3li.js";
8
- import { t as configProvider } from "./config_provider-CY-xuo2R.js";
9
- import "./string-CJ7ewUFq.js";
10
- import "./utils-Dpa3iJz-.js";
11
- import { n as prettyPrintError, r as indexEntities, t as errors } from "./core-CffBtWJW.js";
8
+ import "./string-Cx6q_win.js";
9
+ import "./utils-CtGytdtt.js";
10
+ import { n as prettyPrintError, r as indexEntities, t as errors } from "./core-BuRVIObK.js";
12
11
  var inject = container_exports.inject;
13
12
  export { Ignitor, configProvider, errors, indexEntities, inject, prettyPrintError, stubsRoot };
@@ -1,4 +1,4 @@
1
- import { t as debug_default } from "./debug-DURPi9xn.js";
1
+ import { n as debug_default } from "./config_provider-DWVFHOQX.js";
2
2
  import { n as setApp } from "./app-B6oge7b3.js";
3
3
  import { t as app_exports } from "./app-BK0PN3li.js";
4
4
  import { createServer } from "node:http";
@@ -15,7 +15,7 @@ var AceProcess = class {
15
15
  async handle(argv) {
16
16
  const app = this.#ignitor.createApp("console");
17
17
  await app.init();
18
- const { createAceKernel } = await import("./create_kernel-CsTq0pWc.js");
18
+ const { createAceKernel } = await import("./create_kernel-Cn8zVtvt.js");
19
19
  const commandName = argv[argv.findIndex((value) => !value.startsWith("-"))];
20
20
  const kernel = createAceKernel(app, commandName);
21
21
  app.container.bindValue("ace", kernel);
@@ -2,10 +2,8 @@ import { n as __reExport, t as __export } from "./chunk-MjwdjG2f.js";
2
2
  import "@adonisjs/bodyparser";
3
3
  var RequestValidator = class RequestValidator {
4
4
  #ctx;
5
- #experimentalFlags;
6
- constructor(ctx, experimentalFlags) {
5
+ constructor(ctx) {
7
6
  this.#ctx = ctx;
8
- this.#experimentalFlags = experimentalFlags;
9
7
  }
10
8
  static errorReporter;
11
9
  static messagesProvider;
@@ -16,10 +14,7 @@ var RequestValidator = class RequestValidator {
16
14
  validatorOptions.errorReporter = () => errorReporter;
17
15
  }
18
16
  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
- };
17
+ const requestBody = this.#ctx.request.all();
23
18
  const data = validatorOptions.data || {
24
19
  ...requestBody,
25
20
  params: this.#ctx.request.params(),
@@ -1,6 +1,5 @@
1
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";
2
+ import { n as debug_default, t as configProvider } from "./config_provider-DWVFHOQX.js";
4
3
  import { InvalidArgumentsException } from "@poppinss/utils/exception";
5
4
  function defineConfig(config) {
6
5
  if (!config.list) throw new InvalidArgumentsException("Missing \"list\" property in hash config");
@@ -0,0 +1,2 @@
1
+ import { BaseDriver, Encryption, EncryptionManager, Hmac } from "@boringnode/encryption";
2
+ export { Hmac as i, Encryption as n, EncryptionManager as r, BaseDriver as t };
@@ -1,5 +1,6 @@
1
- import { t as debug_default } from "./debug-DURPi9xn.js";
2
- import { t as main_exports } from "./main-CFmDHDls.js";
1
+ import { n as debug_default } from "./config_provider-DWVFHOQX.js";
2
+ import { t as main_exports } from "./main-BA5_XHM0.js";
3
+ import { n as Encryption } from "./main-Bfnr5tAw.js";
3
4
  import { IncomingMessage, ServerResponse, createServer } from "node:http";
4
5
  import { Socket } from "node:net";
5
6
  import Macroable from "@poppinss/macroable";
@@ -54,7 +55,7 @@ var TestUtils = class extends Macroable {
54
55
  async boot() {
55
56
  if (!this.isBooted) {
56
57
  this.#booted = true;
57
- this.cookies = new main_exports.CookieClient(await this.app.container.make("encryption"));
58
+ this.cookies = new main_exports.CookieClient(await this.app.container.make(Encryption));
58
59
  }
59
60
  }
60
61
  httpServer() {
@@ -1,4 +1,4 @@
1
- import { t as string_default } from "../../string-CJ7ewUFq.js";
1
+ import { t as string_default } from "../../string-Cx6q_win.js";
2
2
  import { EnvEditor } from "@adonisjs/env/editor";
3
3
  import { EventEmitter } from "node:events";
4
4
  var Codemods = class extends EventEmitter {
@@ -1,2 +1,2 @@
1
- import { a as Parser, c as errors, d as Kernel, f as BaseCommand, i as ListLoader, l as flags, n as HelpCommand, o as args, p as ListCommand, r as IndexGenerator, s as cliHelpers, t as FsLoader, u as tracingChannels } from "../../main-BWftwyAK.js";
1
+ import { a as Parser, c as errors, d as Kernel, f as BaseCommand, i as ListLoader, l as flags, n as HelpCommand, o as args, p as ListCommand, r as IndexGenerator, s as cliHelpers, t as FsLoader, u as tracingChannels } from "../../main-BlJhxJJ2.js";
2
2
  export { BaseCommand, FsLoader, HelpCommand, IndexGenerator, Kernel, ListCommand, ListLoader, Parser, args, cliHelpers, errors, flags, tracingChannels };
@@ -1,2 +1,2 @@
1
- import { t as bodyparser_middleware_default } from "../../bodyparser_middleware-DTW0epKM.js";
1
+ import { t as bodyparser_middleware_default } from "../../bodyparser_middleware-BmARtnYe.js";
2
2
  export { bodyparser_middleware_default as default };
@@ -1,4 +1,4 @@
1
1
  import "../../chunk-MjwdjG2f.js";
2
- import "../../main-q9TMzWUj.js";
2
+ import "../../main-OHZwVYZ4.js";
3
3
  export * from "@adonisjs/bodyparser";
4
4
  export {};
@@ -1,4 +1,4 @@
1
1
  import "../chunk-MjwdjG2f.js";
2
- import "../config-B2S2xfmN.js";
2
+ import "../config-BwupGyeJ.js";
3
3
  export * from "@adonisjs/config";
4
4
  export {};
@@ -1,5 +1,5 @@
1
1
  import "../../chunk-MjwdjG2f.js";
2
- import { n as errors_exports, t as Dumper } from "../../dumper-C_sMcyFb.js";
2
+ import { n as errors_exports, t as Dumper } from "../../dumper-D29dE_xc.js";
3
3
  function defineConfig(dumperConfig) {
4
4
  return dumperConfig;
5
5
  }
@@ -1,2 +1,2 @@
1
- import { t as pluginEdgeDumper } from "../../../edge-LQdCc1L3.js";
1
+ import { t as pluginEdgeDumper } from "../../../edge-BVYR-Vjr.js";
2
2
  export { pluginEdgeDumper };
@@ -0,0 +1,127 @@
1
+ import { type EncryptionConfig, type ConfigProvider } from '../../src/types.ts';
2
+ import { type AES256CBCDriverConfig, type AES256GCMDriverConfig, type ChaCha20Poly1305DriverConfig } from '../../types/encryption.ts';
3
+ /**
4
+ * Resolved configuration from the config provider that will be
5
+ * accepted by the encryption manager.
6
+ *
7
+ * This type unwraps ConfigProvider types to their resolved values,
8
+ * ensuring all encryptors in the list are concrete EncryptionConfig
9
+ * objects rather than providers.
10
+ *
11
+ * @template KnownEncryptors - Record of encryptor names to their configurations
12
+ */
13
+ type ResolvedConfig<KnownEncryptors extends Record<string, EncryptionConfig | ConfigProvider<EncryptionConfig>>> = {
14
+ /**
15
+ * The default encryptor name to use when no specific
16
+ * encryptor is requested
17
+ */
18
+ default?: keyof KnownEncryptors;
19
+ /**
20
+ * Map of encryptor names to their resolved configurations.
21
+ * ConfigProvider types are unwrapped to their underlying
22
+ * EncryptionConfig values.
23
+ */
24
+ list: {
25
+ [K in keyof KnownEncryptors]: KnownEncryptors[K] extends ConfigProvider<infer A> ? A : KnownEncryptors[K];
26
+ };
27
+ };
28
+ /**
29
+ * Defines the encryption configuration for the application.
30
+ *
31
+ * This function creates a configuration provider that lazily resolves
32
+ * encryption drivers. It validates that the default encryptor (if specified)
33
+ * exists in the list and resolves any ConfigProvider instances to their
34
+ * concrete values.
35
+ *
36
+ * @template KnownEncryptors - Record of encryptor names to their configurations
37
+ *
38
+ * @param config - The encryption configuration object
39
+ * @param config.default - Optional default encryptor name
40
+ * @param config.list - Map of encryptor names to their configurations or providers
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const encryptionConfig = defineConfig({
45
+ * default: 'app',
46
+ * list: {
47
+ * app: drivers.aes256gcm({
48
+ * id: 'app',
49
+ * keys: [env.get('APP_KEY')]
50
+ * }),
51
+ * backup: drivers.chacha20({
52
+ * id: 'backup',
53
+ * keys: [env.get('BACKUP_KEY')]
54
+ * })
55
+ * }
56
+ * })
57
+ * ```
58
+ */
59
+ export declare function defineConfig<KnownEncryptors extends Record<string, EncryptionConfig | ConfigProvider<EncryptionConfig>>>(config: {
60
+ default?: keyof KnownEncryptors;
61
+ list: KnownEncryptors;
62
+ }): ConfigProvider<ResolvedConfig<KnownEncryptors>>;
63
+ /**
64
+ * Collection of encryption driver factory functions.
65
+ *
66
+ * Each driver factory creates a ConfigProvider that lazily imports
67
+ * and configures the corresponding encryption driver. This allows
68
+ * for efficient code splitting and on-demand loading of encryption
69
+ * algorithms.
70
+ */
71
+ export declare const drivers: {
72
+ /**
73
+ * Creates a ChaCha20-Poly1305 encryption driver configuration.
74
+ *
75
+ * ChaCha20-Poly1305 is a modern authenticated encryption algorithm
76
+ * that provides excellent performance on systems without AES hardware
77
+ * acceleration.
78
+ *
79
+ * @param config - The ChaCha20-Poly1305 driver configuration
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * drivers.chacha20({
84
+ * id: 'app',
85
+ * keys: [env.get('APP_KEY')]
86
+ * })
87
+ * ```
88
+ */
89
+ chacha20: (config: ChaCha20Poly1305DriverConfig) => ConfigProvider<EncryptionConfig>;
90
+ /**
91
+ * Creates an AES-256-CBC encryption driver configuration.
92
+ *
93
+ * AES-256-CBC is a widely-supported block cipher mode. However,
94
+ * consider using AES-256-GCM for new applications as it provides
95
+ * authenticated encryption.
96
+ *
97
+ * @param config - The AES-256-CBC driver configuration
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * drivers.aes256cbc({
102
+ * id: 'legacy',
103
+ * keys: [env.get('LEGACY_KEY')]
104
+ * })
105
+ * ```
106
+ */
107
+ aes256cbc: (config: AES256CBCDriverConfig) => ConfigProvider<EncryptionConfig>;
108
+ /**
109
+ * Creates an AES-256-GCM encryption driver configuration.
110
+ *
111
+ * AES-256-GCM is an authenticated encryption algorithm that provides
112
+ * both confidentiality and integrity. It offers excellent performance
113
+ * on systems with AES hardware acceleration.
114
+ *
115
+ * @param config - The AES-256-GCM driver configuration
116
+ *
117
+ * @example
118
+ * ```ts
119
+ * drivers.aes256gcm({
120
+ * id: 'app',
121
+ * keys: [env.get('APP_KEY')]
122
+ * })
123
+ * ```
124
+ */
125
+ aes256gcm: (config: AES256GCMDriverConfig) => ConfigProvider<EncryptionConfig>;
126
+ };
127
+ 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,2 @@
1
+ import { AES256CBC } from "@boringnode/encryption/drivers/aes_256_cbc";
2
+ export { AES256CBC };
@@ -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,2 @@
1
+ import { AES256GCM } from "@boringnode/encryption/drivers/aes_256_gcm";
2
+ export { AES256GCM };
@@ -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,2 @@
1
+ import { ChaCha20Poly1305 } from "@boringnode/encryption/drivers/chacha20_poly1305";
2
+ export { ChaCha20Poly1305 };