@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,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-BvoRgVYO.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,4 +1,4 @@
1
1
  import "../chunk-MjwdjG2f.js";
2
- import "../events-B8hK42QT.js";
2
+ import "../events-BW2flEef.js";
3
3
  export * from "@adonisjs/events";
4
4
  export {};
@@ -1,6 +1,5 @@
1
1
  import "../../chunk-MjwdjG2f.js";
2
- import "../../debug-DURPi9xn.js";
3
- import "../../config_provider-CY-xuo2R.js";
4
- import { n as defineConfig, r as drivers } from "../../main-BrJQ1VAM.js";
2
+ import "../../config_provider-DWVFHOQX.js";
3
+ import { n as defineConfig, r as drivers } from "../../main-BPDqyZic.js";
5
4
  export * from "@adonisjs/hash";
6
5
  export { defineConfig, drivers };
@@ -1,4 +1,4 @@
1
1
  import "../../chunk-MjwdjG2f.js";
2
- import { n as RequestValidator } from "../../main-CFmDHDls.js";
2
+ import { n as RequestValidator } from "../../main-BA5_XHM0.js";
3
3
  export * from "@adonisjs/http-server";
4
4
  export { RequestValidator };
@@ -1,8 +1,6 @@
1
1
  import type { VineValidator } from '@vinejs/vine';
2
2
  import type { Infer, SchemaTypes, ErrorReporterContract, MessagesProviderContact } from '@vinejs/vine/types';
3
3
  import type { HttpContext } from './main.ts';
4
- import type { FeatureFlags } from '../app.ts';
5
- import type { ExperimentalFlagsList } from '../../types/app.ts';
6
4
  import type { RequestValidationOptions } from '../../types/http.ts';
7
5
  /**
8
6
  * Request validator for validating HTTP request data using VineJS validators.
@@ -19,7 +17,7 @@ import type { RequestValidationOptions } from '../../types/http.ts';
19
17
  */
20
18
  export declare class RequestValidator {
21
19
  #private;
22
- constructor(ctx: HttpContext, experimentalFlags?: FeatureFlags<ExperimentalFlagsList>);
20
+ constructor(ctx: HttpContext);
23
21
  /**
24
22
  * The error reporter method returns the error reporter
25
23
  * to use for reporting errors.
@@ -1,4 +1,4 @@
1
1
  import "../chunk-MjwdjG2f.js";
2
- import { n as syncDestination } from "../logger-Dha-0hp1.js";
2
+ import { n as syncDestination } from "../logger-C2asB8px.js";
3
3
  export * from "@adonisjs/logger";
4
4
  export { syncDestination };
@@ -1,4 +1,4 @@
1
1
  import "../chunk-MjwdjG2f.js";
2
- import "../repl-CumYg2V_.js";
2
+ import "../repl-BF2TbFoO.js";
3
3
  export * from "@adonisjs/repl";
4
4
  export {};
@@ -1,4 +1,4 @@
1
1
  import "../../chunk-MjwdjG2f.js";
2
- import "../../main-D5xz2ZN1.js";
2
+ import "../../main-CP75MhEW.js";
3
3
  export * from "@adonisjs/http-transformers";
4
4
  export {};
@@ -116,14 +116,15 @@ export default class AppServiceProvider {
116
116
  */
117
117
  protected registerEmitter(): void;
118
118
  /**
119
- * Register the encryption service to the container
119
+ * Registers the encryption service with the container
120
120
  *
121
- * Creates a singleton binding for the encryption service using
122
- * the app key from configuration for encryption/decryption operations.
121
+ * Creates singleton bindings for both the encryption manager and
122
+ * the default encryption instance. Resolves configuration from
123
+ * config/encryption.ts file.
123
124
  *
124
125
  * @example
125
126
  * const encryption = await container.make('encryption')
126
- * const encrypted = encryption.encrypt('sensitive data')
127
+ * const encrypted = encryption.encrypt('secret-data')
127
128
  */
128
129
  protected registerEncryption(): void;
129
130
  /**
@@ -1,13 +1,16 @@
1
1
  import "../chunk-MjwdjG2f.js";
2
+ import { t as configProvider } from "../config_provider-DWVFHOQX.js";
2
3
  import { t as app_exports } from "../app-BK0PN3li.js";
3
- import { t as config_exports } from "../config-B2S2xfmN.js";
4
- import { t as encryption_exports } from "../encryption-D2HGu0bU.js";
5
- import { t as events_exports } from "../events-B8hK42QT.js";
6
- import { t as logger_exports } from "../logger-Dha-0hp1.js";
7
- import { t as Dumper } from "../dumper-C_sMcyFb.js";
8
- import { t as main_exports } from "../main-CFmDHDls.js";
9
- import { t as main_exports$1 } from "../main-D5xz2ZN1.js";
10
- import { t as bodyparser_middleware_default } from "../bodyparser_middleware-DTW0epKM.js";
4
+ import { t as config_exports } from "../config-BwupGyeJ.js";
5
+ import { t as events_exports } from "../events-BW2flEef.js";
6
+ import { t as logger_exports } from "../logger-C2asB8px.js";
7
+ import { t as Dumper } from "../dumper-D29dE_xc.js";
8
+ import { t as main_exports } from "../main-BA5_XHM0.js";
9
+ import { r as RuntimeException } from "../exceptions-DNMesP42.js";
10
+ import "../define_config-BvoRgVYO.js";
11
+ import { n as Encryption } from "../main-Bfnr5tAw.js";
12
+ import { t as main_exports$1 } from "../main-CP75MhEW.js";
13
+ import { t as bodyparser_middleware_default } from "../bodyparser_middleware-BmARtnYe.js";
11
14
  import { dirname } from "node:path";
12
15
  import { mkdir, writeFile } from "node:fs/promises";
13
16
  var AppServiceProvider = class {
@@ -22,7 +25,7 @@ var AppServiceProvider = class {
22
25
  }
23
26
  registerAce() {
24
27
  this.app.container.singleton("ace", async () => {
25
- const { createAceKernel } = await import("../create_kernel-CsTq0pWc.js");
28
+ const { createAceKernel } = await import("../create_kernel-Cn8zVtvt.js");
26
29
  return createAceKernel(this.app);
27
30
  });
28
31
  }
@@ -52,15 +55,20 @@ var AppServiceProvider = class {
52
55
  this.app.container.alias("emitter", events_exports.Emitter);
53
56
  }
54
57
  registerEncryption() {
55
- this.app.container.singleton(encryption_exports.Encryption, () => {
56
- const appKey = this.app.config.get("app.appKey");
57
- return new encryption_exports.Encryption({ secret: appKey });
58
+ this.app.container.singleton("encryption", async () => {
59
+ const encryptionConfigProvider = this.app.config.get("encryption");
60
+ const config = await configProvider.resolve(this.app, encryptionConfigProvider);
61
+ if (!config) throw new RuntimeException("Invalid \"config/encryption.ts\" file. Make sure you are using the \"defineConfig\" method");
62
+ const { EncryptionManager } = await import("../modules/encryption/main.js");
63
+ return new EncryptionManager(config);
64
+ });
65
+ this.app.container.singleton(Encryption, async (resolver) => {
66
+ return (await resolver.make("encryption")).use();
58
67
  });
59
- this.app.container.alias("encryption", encryption_exports.Encryption);
60
68
  }
61
69
  registerServer() {
62
70
  this.app.container.singleton(main_exports.Server, async (resolver) => {
63
- const encryption = await resolver.make("encryption");
71
+ const encryption = await resolver.make(Encryption);
64
72
  const emitter = await resolver.make("emitter");
65
73
  const logger = await resolver.make("logger");
66
74
  const config = this.app.config.get("app.http");
@@ -1,6 +1,6 @@
1
1
  import "../chunk-MjwdjG2f.js";
2
- import { t as main_exports } from "../main-CFmDHDls.js";
3
- import { t as pluginEdgeDumper } from "../edge-LQdCc1L3.js";
2
+ import { t as main_exports } from "../main-BA5_XHM0.js";
3
+ import { t as pluginEdgeDumper } from "../edge-BVYR-Vjr.js";
4
4
  import edge from "edge.js";
5
5
  var EdgeServiceProvider = class {
6
6
  constructor(app) {
@@ -1,7 +1,6 @@
1
1
  import "../chunk-MjwdjG2f.js";
2
- import "../debug-DURPi9xn.js";
3
- import { t as configProvider } from "../config_provider-CY-xuo2R.js";
4
- import { t as main_exports } from "../main-BrJQ1VAM.js";
2
+ import { t as configProvider } from "../config_provider-DWVFHOQX.js";
3
+ import { t as main_exports } from "../main-BPDqyZic.js";
5
4
  import { RuntimeException } from "@poppinss/utils/exception";
6
5
  var HashServiceProvider = class {
7
6
  constructor(app) {
@@ -1,5 +1,5 @@
1
1
  import "../chunk-MjwdjG2f.js";
2
- import { t as repl_exports } from "../repl-CumYg2V_.js";
2
+ import { t as repl_exports } from "../repl-BF2TbFoO.js";
3
3
  import { join } from "node:path";
4
4
  import { homedir } from "node:os";
5
5
  import { fsImportAll } from "@poppinss/utils/fs";
@@ -1,6 +1,6 @@
1
1
  import "../chunk-MjwdjG2f.js";
2
- import { n as RequestValidator, t as main_exports } from "../main-CFmDHDls.js";
3
- import { t as VineMultipartFile } from "../vine-Bt4ymkM0.js";
2
+ import { n as RequestValidator, t as main_exports } from "../main-BA5_XHM0.js";
3
+ import { t as VineMultipartFile } from "../vine-DGint2rk.js";
4
4
  import { Vine } from "@vinejs/vine";
5
5
  var VineJSServiceProvider = class {
6
6
  constructor(app) {
@@ -8,12 +8,11 @@ var VineJSServiceProvider = class {
8
8
  this.app.usingVineJS = true;
9
9
  }
10
10
  boot() {
11
- const experimentalFlags = this.app.experimentalFlags;
12
11
  Vine.macro("file", function(options) {
13
12
  return new VineMultipartFile(options);
14
13
  });
15
14
  main_exports.HttpRequest.macro("validateUsing", function(...args) {
16
- return new RequestValidator(this.ctx, experimentalFlags).validateUsing(...args);
15
+ return new RequestValidator(this.ctx).validateUsing(...args);
17
16
  });
18
17
  }
19
18
  };
@@ -13,5 +13,5 @@
13
13
  * debug('Application started')
14
14
  * debug('Processing request: %s', req.url)
15
15
  */
16
- declare const _default: import("util").DebugLogger;
16
+ declare const _default: import("node:util").DebugLogger;
17
17
  export default _default;
@@ -1,2 +1,2 @@
1
- import { Exception, InvalidArgumentsException, RuntimeException, createError } from "@poppinss/utils/exception";
1
+ import { i as createError, n as InvalidArgumentsException, r as RuntimeException, t as Exception } from "../exceptions-DNMesP42.js";
2
2
  export { Exception, InvalidArgumentsException, RuntimeException, createError };
@@ -1,4 +1,4 @@
1
- import { t as VerificationToken } from "../../verification_token-DXsW81rl.js";
1
+ import { t as VerificationToken } from "../../verification_token-DrdoU4RH.js";
2
2
  import { fsImportAll, fsReadAll } from "@poppinss/utils/fs";
3
3
  import base64 from "@poppinss/utils/base64";
4
4
  import { MessageBuilder, Secret, compose, defineStaticProperty, safeEqual } from "@poppinss/utils";
@@ -1,2 +1,2 @@
1
- import { t as string_default } from "../../string-CJ7ewUFq.js";
1
+ import { t as string_default } from "../../string-Cx6q_win.js";
2
2
  export { string_default as default };
@@ -1,2 +1,2 @@
1
- import { t as VerificationToken } from "../../verification_token-DXsW81rl.js";
1
+ import { t as VerificationToken } from "../../verification_token-DrdoU4RH.js";
2
2
  export { VerificationToken };
@@ -1,5 +1,8 @@
1
1
  import "../../chunk-MjwdjG2f.js";
2
- import "../../debug-DURPi9xn.js";
3
- import "../../main-CFmDHDls.js";
4
- import { t as TestUtils } from "../../main-2-nm3TiB.js";
2
+ import "../../config_provider-DWVFHOQX.js";
3
+ import "../../main-BA5_XHM0.js";
4
+ import "../../exceptions-DNMesP42.js";
5
+ import "../../define_config-BvoRgVYO.js";
6
+ import "../../main-Bfnr5tAw.js";
7
+ import { t as TestUtils } from "../../main-TtUIT86D.js";
5
8
  export { TestUtils };
@@ -8,11 +8,12 @@ import type { HttpServerEvents, LookupList, RoutesList, SignedURLOptions, UrlFor
8
8
  import type { Dumper } from '../modules/dumper/dumper.ts';
9
9
  import type { LoggerManager } from '../modules/logger.ts';
10
10
  import type { HashManager } from '../modules/hash/main.ts';
11
- import type { Encryption } from '../modules/encryption.ts';
12
11
  import type { ManagerDriverFactory } from '../types/hash.ts';
13
12
  import type { Router, Server } from '../modules/http/main.ts';
13
+ import type { EncryptionManager } from '../modules/encryption/main.ts';
14
14
  import type { ContainerResolveEventData } from '../types/container.ts';
15
15
  import type { LoggerConfig, LoggerManagerConfig } from '../types/logger.ts';
16
+ import { type EncryptionDriverContract } from '../types/encryption.ts';
16
17
  /**
17
18
  * A config provider waits for the application to get booted
18
19
  * and then resolves the config. It receives an instance
@@ -175,20 +176,64 @@ export interface LoggerService extends LoggerManager<LoggersList extends Record<
175
176
  export interface EmitterService extends Emitter<EventsList> {
176
177
  }
177
178
  /**
178
- * Encryption service is a singleton Encryption class instance
179
- * registered to the container. It provides encryption and decryption
180
- * functionality using the application's secret key.
179
+ * A list of known encryptors inferred from the user config.
180
+ * This interface should be extended in user code to register
181
+ * custom encryptors.
182
+ *
183
+ * @example
184
+ * // Extending EncryptorsList in user code
185
+ * declare module '@adonisjs/core' {
186
+ * interface EncryptorsList {
187
+ * default: EncryptionConfig
188
+ * secondary: EncryptionConfig
189
+ * }
190
+ * }
191
+ */
192
+ export interface EncryptorsList {
193
+ }
194
+ /**
195
+ * Configuration object for encryption drivers. Defines how encryption
196
+ * and decryption should be performed with support for key rotation.
181
197
  *
182
198
  * @example
183
- * // Using encryption service
184
- * export default class PaymentController {
185
- * async process({ encryption }: { encryption: EncryptionService }) {
199
+ * const config: EncryptionConfig = {
200
+ * driver: (key) => new SecureEncryptor(key),
201
+ * keys: [
202
+ * 'new-encryption-key', // Used for encryption
203
+ * 'old-encryption-key' // Used only for decryption
204
+ * ]
205
+ * }
206
+ */
207
+ export interface EncryptionConfig {
208
+ /**
209
+ * Factory function that creates a driver instance for a given key
210
+ * @param key - The encryption key to use
211
+ */
212
+ driver: (key: string) => EncryptionDriverContract;
213
+ /**
214
+ * List of keys to use for encryption/decryption.
215
+ * The first key is used for encryption, all keys are tried for decryption.
216
+ */
217
+ keys: string[];
218
+ }
219
+ /**
220
+ * Encryption service is a singleton instance of the EncryptionManager
221
+ * registered in the container. It provides encryption and decryption
222
+ * functionality with support for multiple encryptors.
223
+ *
224
+ * @example
225
+ * // Using encryption service in a controller
226
+ * export default class TokenController {
227
+ * async generate({ encryption }: { encryption: EncryptionService }) {
186
228
  * const encrypted = encryption.encrypt('sensitive-data')
187
229
  * const decrypted = encryption.decrypt(encrypted)
230
+ *
231
+ * // Using a specific encryptor
232
+ * const secondaryEncrypted = encryption.use('secondary').encrypt('data')
188
233
  * }
189
234
  * }
190
235
  */
191
- export interface EncryptionService extends Encryption {
236
+ export interface EncryptionService extends EncryptionManager<EncryptorsList extends Record<string, EncryptionConfig> ? EncryptorsList : never> {
192
237
  }
193
238
  /**
194
239
  * Http server service added to the container as a singleton.
@@ -378,13 +423,25 @@ export type IndexEntitiesConfig = {
378
423
  /** Path segments to skip from generated keys. Defaults to ['events'] */
379
424
  skipSegments?: string[];
380
425
  };
426
+ /** Configuration for transformers indexing */
381
427
  transformers?: {
428
+ /** Whether to enable transformers indexing */
382
429
  enabled?: boolean;
430
+ /** Whether to include shared props in transformers */
383
431
  withSharedProps?: boolean;
432
+ /** Source directory for transformers */
384
433
  source?: string;
434
+ /** Import alias for transformers */
385
435
  importAlias?: string;
436
+ /** Glob patterns for matching transformer files */
386
437
  glob?: string[];
387
438
  /** Path segments to skip from generated keys. Defaults to ['transformers'] */
388
439
  skipSegments?: string[];
389
440
  };
441
+ /** Configuration for manifest generation */
442
+ manifest?: {
443
+ /** Whether to enable manifest generation */
444
+ enabled?: boolean;
445
+ include?: string[];
446
+ };
390
447
  };
package/build/src/vine.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as VineMultipartFile } from "../vine-Bt4ymkM0.js";
1
+ import { t as VineMultipartFile } from "../vine-DGint2rk.js";
2
2
  export { VineMultipartFile };
@@ -1,6 +1,6 @@
1
- import { t as Ignitor } from "./main-BTUXw6He.js";
2
- import { t as IgnitorFactory } from "./ignitor-Dil-rtCo.js";
3
- import { t as TestUtils } from "./main-2-nm3TiB.js";
1
+ import { t as Ignitor } from "./main-B3Y59dQ2.js";
2
+ import { t as IgnitorFactory } from "./ignitor-BAHDhsmQ.js";
3
+ import { t as TestUtils } from "./main-TtUIT86D.js";
4
4
  var TestUtilsFactory = class {
5
5
  create(ignitorOrAppRoot, options) {
6
6
  if (ignitorOrAppRoot instanceof Ignitor) return new TestUtils(ignitorOrAppRoot.createApp("test"));
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as __decorate } from "../decorate-DM0Sx1ye.js";
2
+ import { t as __decorate } from "../decorate-CJcHOoD-.js";
3
3
  import { BaseCommand, HelpCommand, IndexGenerator, Kernel, ListLoader, args } from "@adonisjs/ace";
4
4
  import { join } from "node:path";
5
5
  var IndexCommand = class extends BaseCommand {
@@ -1 +1,39 @@
1
- export * from '@adonisjs/encryption/types';
1
+ /**
2
+ * Contract that all encryption drivers must implement.
3
+ *
4
+ * Defines the interface for encrypting and decrypting values, including
5
+ * support for optional purpose binding and child key derivation.
6
+ */
7
+ export type { EncryptionDriverContract } from '@boringnode/encryption/types';
8
+ /**
9
+ * Factory function signature for creating encryption driver instances.
10
+ *
11
+ * The factory receives an encryption key and returns a configured
12
+ * driver instance. This pattern allows the manager to create drivers
13
+ * on-demand with different keys.
14
+ */
15
+ export type { ManagerDriverFactory } from '@boringnode/encryption/types';
16
+ /**
17
+ * Configuration options for the AES-256-CBC encryption driver.
18
+ *
19
+ * Includes the driver identifier and a list of encryption keys.
20
+ * The first key is used for encryption, while all keys are tried
21
+ * for decryption (allowing for key rotation).
22
+ */
23
+ export type { AES256CBCDriverConfig } from '@boringnode/encryption/drivers/aes_256_cbc';
24
+ /**
25
+ * Configuration options for the AES-256-GCM encryption driver.
26
+ *
27
+ * Includes the driver identifier and a list of encryption keys.
28
+ * The first key is used for encryption, while all keys are tried
29
+ * for decryption (allowing for key rotation).
30
+ */
31
+ export type { AES256GCMDriverConfig } from '@boringnode/encryption/drivers/aes_256_gcm';
32
+ /**
33
+ * Configuration options for the ChaCha20-Poly1305 encryption driver.
34
+ *
35
+ * Includes the driver identifier and a list of encryption keys.
36
+ * The first key is used for encryption, while all keys are tried
37
+ * for decryption (allowing for key rotation).
38
+ */
39
+ export type { ChaCha20Poly1305DriverConfig } from '@boringnode/encryption/drivers/chacha20_poly1305';
@@ -1,2 +1 @@
1
- export * from "@adonisjs/encryption/types";
2
1
  export {};
@@ -10,6 +10,7 @@ async function importTypeScript(app) {
10
10
  }
11
11
  async function outputTransformerDataObjects(transformersList, buffer, withSharedProps) {
12
12
  const importsBuffer = buffer.create();
13
+ importsBuffer.write(`/// <reference path="./manifest.d.ts" />`);
13
14
  importsBuffer.write(`import type { InferData, InferVariants } from '@adonisjs/core/types/transformers'`);
14
15
  if (withSharedProps) importsBuffer.write(`import type { InferSharedProps } from '@adonisjs/inertia/types'`);
15
16
  buffer.writeLine(importsBuffer);