@adonisjs/core 7.0.0-next.8 → 7.0.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.
Files changed (210) hide show
  1. package/README.md +62 -1
  2. package/build/chunk-iKc69rpz.js +26 -0
  3. package/build/commands/add.d.ts +4 -3
  4. package/build/commands/add.js +73 -110
  5. package/build/commands/build.js +51 -107
  6. package/build/commands/commands.json +1 -1
  7. package/build/commands/configure.js +81 -177
  8. package/build/commands/eject.js +17 -60
  9. package/build/commands/env/add.js +55 -134
  10. package/build/commands/generate_key.js +22 -66
  11. package/build/commands/inspect_rcfile.js +27 -55
  12. package/build/commands/list/routes.js +246 -116
  13. package/build/commands/make/command.d.ts +5 -0
  14. package/build/commands/make/command.js +16 -57
  15. package/build/commands/make/controller.d.ts +5 -0
  16. package/build/commands/make/controller.js +44 -120
  17. package/build/commands/make/event.d.ts +5 -0
  18. package/build/commands/make/event.js +17 -62
  19. package/build/commands/make/exception.d.ts +5 -0
  20. package/build/commands/make/exception.js +17 -62
  21. package/build/commands/make/listener.d.ts +5 -0
  22. package/build/commands/make/listener.js +37 -93
  23. package/build/commands/make/middleware.d.ts +5 -0
  24. package/build/commands/make/middleware.js +42 -101
  25. package/build/commands/make/preload.d.ts +5 -0
  26. package/build/commands/make/preload.js +48 -113
  27. package/build/commands/make/provider.d.ts +5 -0
  28. package/build/commands/make/provider.js +48 -112
  29. package/build/commands/make/service.d.ts +5 -0
  30. package/build/commands/make/service.js +17 -55
  31. package/build/commands/make/test.d.ts +5 -0
  32. package/build/commands/make/test.js +48 -132
  33. package/build/commands/make/transformer.d.ts +5 -0
  34. package/build/commands/make/transformer.js +18 -64
  35. package/build/commands/make/validator.d.ts +5 -0
  36. package/build/commands/make/validator.js +21 -80
  37. package/build/commands/make/view.d.ts +5 -0
  38. package/build/commands/make/view.js +16 -56
  39. package/build/commands/repl.js +17 -50
  40. package/build/commands/serve.js +80 -156
  41. package/build/commands/test.js +92 -208
  42. package/build/config_provider-FIAUgvae.js +13 -0
  43. package/build/core-IpCOCkUL.js +146 -0
  44. package/build/create_kernel-B7ILNhuP.js +38 -0
  45. package/build/create_kernel-BD0Iqi8e.js +3 -0
  46. package/build/debug-CGQmxzGt.js +3 -0
  47. package/build/decorate-DmrZA614.js +7 -0
  48. package/build/define_config-0oHaj43l.js +86 -0
  49. package/build/dumper-BBgqFX5a.js +147 -0
  50. package/build/errors-CrCO-k44.js +8 -0
  51. package/build/factories/app.js +2 -9
  52. package/build/factories/bodyparser.js +2 -9
  53. package/build/factories/core/ace.js +22 -45
  54. package/build/factories/core/ignitor.js +74 -180
  55. package/build/factories/core/main.js +18 -11
  56. package/build/factories/core/test_utils.js +19 -42
  57. package/build/factories/encryption.d.ts +1 -1
  58. package/build/factories/encryption.js +2 -9
  59. package/build/factories/events.js +2 -9
  60. package/build/factories/hash.js +2 -9
  61. package/build/factories/http.js +2 -9
  62. package/build/factories/logger.js +2 -9
  63. package/build/factories/stubs.d.ts +1 -6
  64. package/build/factories/stubs.js +24 -91
  65. package/build/index.d.ts +1 -1
  66. package/build/index.js +10 -46
  67. package/build/main--nXd7T-C.js +73 -0
  68. package/build/main-Cxz0TyIw.js +173 -0
  69. package/build/main-DN2qEEg5.js +41 -0
  70. package/build/main-DkNgvceD.js +52 -0
  71. package/build/main-MBAMnmJb.js +81 -0
  72. package/build/main-kn40V-hF.js +2 -0
  73. package/build/{stubs/make → make}/health/controller.stub +5 -2
  74. package/build/modules/ace/codemods.d.ts +74 -22
  75. package/build/modules/ace/codemods.js +295 -476
  76. package/build/modules/ace/main.js +2 -41
  77. package/build/modules/app.js +6 -26
  78. package/build/modules/bodyparser/bodyparser_middleware.js +3 -14
  79. package/build/modules/bodyparser/main.js +6 -9
  80. package/build/modules/config.js +6 -26
  81. package/build/modules/container.js +6 -9
  82. package/build/modules/dumper/main.js +6 -32
  83. package/build/modules/dumper/plugins/edge.js +46 -61
  84. package/build/modules/encryption/define_config.d.ts +161 -0
  85. package/build/modules/encryption/drivers/aes_256_cbc.d.ts +20 -0
  86. package/build/modules/encryption/drivers/aes_256_cbc.js +2 -0
  87. package/build/modules/encryption/drivers/aes_256_gcm.d.ts +21 -0
  88. package/build/modules/encryption/drivers/aes_256_gcm.js +2 -0
  89. package/build/modules/encryption/drivers/aes_siv.d.ts +19 -0
  90. package/build/modules/encryption/drivers/aes_siv.js +2 -0
  91. package/build/modules/encryption/drivers/chacha20_poly1305.d.ts +21 -0
  92. package/build/modules/encryption/drivers/chacha20_poly1305.js +2 -0
  93. package/build/modules/encryption/drivers/legacy.d.ts +84 -0
  94. package/build/modules/encryption/drivers/legacy.js +57 -0
  95. package/build/modules/encryption/errors.d.ts +16 -0
  96. package/build/modules/encryption/main.d.ts +89 -0
  97. package/build/modules/encryption/main.js +6 -0
  98. package/build/modules/env/editor.js +2 -9
  99. package/build/modules/env/main.js +2 -28
  100. package/build/modules/events.js +6 -9
  101. package/build/modules/hash/drivers/argon.js +2 -9
  102. package/build/modules/hash/drivers/bcrypt.js +2 -20
  103. package/build/modules/hash/drivers/scrypt.js +2 -9
  104. package/build/modules/hash/main.js +6 -28
  105. package/build/modules/hash/phc_formatter.js +2 -9
  106. package/build/modules/health.js +2 -9
  107. package/build/modules/http/helpers.d.ts +1 -0
  108. package/build/modules/http/helpers.js +2 -0
  109. package/build/modules/http/main.js +4 -15
  110. package/build/modules/http/request_validator.d.ts +3 -4
  111. package/build/modules/http/url_builder_client.js +2 -9
  112. package/build/modules/logger.d.ts +30 -0
  113. package/build/modules/logger.js +14 -9
  114. package/build/modules/repl.js +6 -9
  115. package/build/modules/transformers/main.js +2 -9
  116. package/build/providers/app_provider.d.ts +14 -21
  117. package/build/providers/app_provider.js +153 -354
  118. package/build/providers/edge_provider.js +98 -164
  119. package/build/providers/hash_provider.js +29 -91
  120. package/build/providers/repl_provider.js +66 -152
  121. package/build/providers/vinejs_provider.d.ts +1 -1
  122. package/build/providers/vinejs_provider.js +21 -65
  123. package/build/services/ace.js +1 -16
  124. package/build/services/app.js +3 -19
  125. package/build/services/config.js +1 -12
  126. package/build/services/dumper.js +4 -20
  127. package/build/services/emitter.js +1 -13
  128. package/build/services/encryption.js +1 -13
  129. package/build/services/hash.js +1 -13
  130. package/build/services/logger.js +1 -13
  131. package/build/services/repl.js +1 -13
  132. package/build/services/router.js +1 -13
  133. package/build/services/server.js +1 -13
  134. package/build/services/test_utils.js +1 -16
  135. package/build/services/url_builder.d.ts +3 -3
  136. package/build/services/url_builder.js +4 -16
  137. package/build/src/assembler_hooks/index_entities.d.ts +34 -1
  138. package/build/src/debug.d.ts +1 -1
  139. package/build/src/exceptions.js +2 -49
  140. package/build/src/helpers/assert.js +2 -55
  141. package/build/src/helpers/http.js +2 -28
  142. package/build/src/helpers/is.js +3 -31
  143. package/build/src/helpers/main.js +5 -52
  144. package/build/src/helpers/string.js +26 -76
  145. package/build/src/helpers/types.js +25 -134
  146. package/build/src/helpers/verification_token.js +46 -120
  147. package/build/src/test_utils/main.js +8 -77
  148. package/build/src/types.d.ts +53 -99
  149. package/build/src/types.js +0 -8
  150. package/build/src/utils.d.ts +1 -1
  151. package/build/src/vine.js +29 -101
  152. package/build/toolkit/main.js +19 -21
  153. package/build/types/ace.js +2 -9
  154. package/build/types/app.js +2 -9
  155. package/build/types/bodyparser.js +2 -9
  156. package/build/types/common.js +2 -9
  157. package/build/types/container.js +2 -9
  158. package/build/types/encryption.d.ts +53 -1
  159. package/build/types/encryption.js +1 -9
  160. package/build/types/events.js +2 -9
  161. package/build/types/hash.js +2 -9
  162. package/build/types/health.js +2 -9
  163. package/build/types/helpers.js +0 -8
  164. package/build/types/http.js +2 -9
  165. package/build/types/logger.js +2 -9
  166. package/build/types/repl.js +2 -9
  167. package/build/types/transformers.js +2 -9
  168. package/build/utils-rRkbAPnP.js +42 -0
  169. package/package.json +117 -62
  170. package/build/modules/ace/commands.js +0 -157
  171. package/build/modules/ace/create_kernel.js +0 -91
  172. package/build/modules/ace/kernel.js +0 -40
  173. package/build/modules/dumper/define_config.js +0 -36
  174. package/build/modules/dumper/dumper.js +0 -266
  175. package/build/modules/dumper/errors.js +0 -119
  176. package/build/modules/encryption.d.ts +0 -18
  177. package/build/modules/encryption.js +0 -26
  178. package/build/modules/hash/define_config.js +0 -125
  179. package/build/modules/http/request_validator.js +0 -100
  180. package/build/src/assembler_hooks/index_entities.js +0 -112
  181. package/build/src/cli_formatters/routes_list.js +0 -397
  182. package/build/src/config_provider.js +0 -71
  183. package/build/src/debug.js +0 -25
  184. package/build/src/ignitor/ace.js +0 -102
  185. package/build/src/ignitor/http.js +0 -159
  186. package/build/src/ignitor/main.js +0 -124
  187. package/build/src/ignitor/test.js +0 -66
  188. package/build/src/test_utils/http.js +0 -82
  189. package/build/src/utils.js +0 -114
  190. package/build/stubs/main.js +0 -9
  191. package/build/toolkit/commands/index_commands.js +0 -30
  192. /package/build/{stubs/make → make}/command/main.stub +0 -0
  193. /package/build/{stubs/make → make}/controller/actions.stub +0 -0
  194. /package/build/{stubs/make → make}/controller/api.stub +0 -0
  195. /package/build/{stubs/make → make}/controller/main.stub +0 -0
  196. /package/build/{stubs/make → make}/controller/resource.stub +0 -0
  197. /package/build/{stubs/make → make}/event/main.stub +0 -0
  198. /package/build/{stubs/make → make}/exception/main.stub +0 -0
  199. /package/build/{stubs/make → make}/health/main.stub +0 -0
  200. /package/build/{stubs/make → make}/listener/for_event.stub +0 -0
  201. /package/build/{stubs/make → make}/listener/main.stub +0 -0
  202. /package/build/{stubs/make → make}/middleware/main.stub +0 -0
  203. /package/build/{stubs/make → make}/preload/main.stub +0 -0
  204. /package/build/{stubs/make → make}/provider/main.stub +0 -0
  205. /package/build/{stubs/make → make}/service/main.stub +0 -0
  206. /package/build/{stubs/make → make}/test/main.stub +0 -0
  207. /package/build/{stubs/make → make}/transformer/main.stub +0 -0
  208. /package/build/{stubs/make → make}/validator/main.stub +0 -0
  209. /package/build/{stubs/make → make}/validator/resource.stub +0 -0
  210. /package/build/{stubs/make → make}/view/main.stub +0 -0
@@ -8,9 +8,10 @@ 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 EncryptionConfig } from '../types/encryption.ts';
14
+ import type { EncryptionManager } from '../modules/encryption/main.ts';
14
15
  import type { ContainerResolveEventData } from '../types/container.ts';
15
16
  import type { LoggerConfig, LoggerManagerConfig } from '../types/logger.ts';
16
17
  /**
@@ -119,6 +120,30 @@ export interface HashersList {
119
120
  export type InferHashers<T extends ConfigProvider<{
120
121
  list: Record<string, ManagerDriverFactory>;
121
122
  }>> = Awaited<ReturnType<T['resolver']>>['list'];
123
+ /**
124
+ * A list of known encryptors inferred from the user config.
125
+ * This interface should be extended in user code to register
126
+ * custom encryptors.
127
+ *
128
+ * @example
129
+ * // Extending EncryptorsList in user code
130
+ * declare module '@adonisjs/core' {
131
+ * interface EncryptorsList {
132
+ * default: EncryptionConfig
133
+ * secondary: EncryptionConfig
134
+ * }
135
+ * }
136
+ */
137
+ export interface EncryptorsList {
138
+ }
139
+ /**
140
+ * Utility type to infer encryptors configurations from a config provider.
141
+ *
142
+ * @template T - The config provider type that resolves to an object with a 'list' property
143
+ */
144
+ export type InferEncryptors<T extends ConfigProvider<{
145
+ list: Record<string, EncryptionConfig>;
146
+ }>> = Awaited<ReturnType<T['resolver']>>['list'];
122
147
  /**
123
148
  * ----------------------------------------------------------------
124
149
  * Container services
@@ -132,77 +157,32 @@ export type InferHashers<T extends ConfigProvider<{
132
157
  * Application service is a singleton resolved from
133
158
  * the container. It provides access to the core application
134
159
  * instance with all registered bindings.
135
- *
136
- * @example
137
- * // Accessing application service in a controller
138
- * export default class HomeController {
139
- * async index({ app }: { app: ApplicationService }) {
140
- * const version = app.version
141
- * const env = app.env.get('NODE_ENV')
142
- * }
143
- * }
144
160
  */
145
161
  export interface ApplicationService extends Application<ContainerBindings extends Record<any, any> ? ContainerBindings : never> {
146
162
  }
147
163
  /**
148
164
  * Logger service is a singleton logger instance registered
149
165
  * to the container. It provides access to configured loggers.
150
- *
151
- * @example
152
- * // Using logger service in a controller
153
- * export default class UserController {
154
- * async store({ logger }: { logger: LoggerService }) {
155
- * logger.info('Creating new user')
156
- * logger.use('file').error('Failed to create user')
157
- * }
158
- * }
159
166
  */
160
167
  export interface LoggerService extends LoggerManager<LoggersList extends Record<string, LoggerConfig> ? LoggersList : never> {
161
168
  }
162
169
  /**
163
170
  * Emitter service is a singleton emitter instance registered
164
171
  * to the container. It provides type-safe event emission and listening.
165
- *
166
- * @example
167
- * // Using emitter service to emit events
168
- * export default class UserController {
169
- * async store({ emitter }: { emitter: EmitterService }) {
170
- * const user = await User.create(data)
171
- * emitter.emit('user:created', { user })
172
- * }
173
- * }
174
172
  */
175
173
  export interface EmitterService extends Emitter<EventsList> {
176
174
  }
177
175
  /**
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.
181
- *
182
- * @example
183
- * // Using encryption service
184
- * export default class PaymentController {
185
- * async process({ encryption }: { encryption: EncryptionService }) {
186
- * const encrypted = encryption.encrypt('sensitive-data')
187
- * const decrypted = encryption.decrypt(encrypted)
188
- * }
189
- * }
176
+ * Encryption service is a singleton instance of the EncryptionManager
177
+ * registered in the container. It provides encryption and decryption
178
+ * functionality with support for multiple encryptors.
190
179
  */
191
- export interface EncryptionService extends Encryption {
180
+ export interface EncryptionService extends EncryptionManager<EncryptorsList extends Record<string, EncryptionConfig> ? EncryptorsList : never> {
192
181
  }
193
182
  /**
194
183
  * Http server service added to the container as a singleton.
195
184
  * It provides access to the HTTP server instance for handling
196
185
  * requests and responses.
197
- *
198
- * @example
199
- * // Accessing server service in middleware
200
- * export default class CustomMiddleware {
201
- * async handle({ server }: { server: HttpServerService }, next: NextFn) {
202
- * console.log('Server listening on:', server.getPort())
203
- * return next()
204
- * }
205
- * }
206
186
  */
207
187
  export interface HttpServerService extends Server {
208
188
  }
@@ -210,14 +190,6 @@ export interface HttpServerService extends Server {
210
190
  * Http router service added to the container as a singleton.
211
191
  * It provides access to the application's router for defining
212
192
  * and managing routes.
213
- *
214
- * @example
215
- * // Using router service to define routes programmatically
216
- * export default class RouteProvider {
217
- * boot({ router }: { router: HttpRouterService }) {
218
- * router.get('/api/health', () => ({ status: 'ok' }))
219
- * }
220
- * }
221
193
  */
222
194
  export interface HttpRouterService extends Router {
223
195
  }
@@ -225,49 +197,20 @@ export interface HttpRouterService extends Router {
225
197
  * Url builder service offers a type-safe API for creating URLs
226
198
  * for pre-registered routes. It ensures type safety when building
227
199
  * URLs with parameters.
228
- *
229
- * @example
230
- * // Using URL builder service
231
- * export default class PostController {
232
- * async show({ urlBuilder }: { urlBuilder: UrlBuilderService }) {
233
- * const postUrl = urlBuilder.make('posts.show', { id: 1 })
234
- * const userUrl = urlBuilder.make('users.profile', { username: 'john' })
235
- * }
236
- * }
237
200
  */
238
- export interface UrlBuilderService extends UrlFor<RoutesList extends LookupList ? RoutesList : never, URLOptions> {
201
+ export interface UrlBuilderUrlFor extends UrlFor<RoutesList extends LookupList ? RoutesList : never, URLOptions> {
239
202
  }
240
203
  /**
241
204
  * Url builder service offers a type-safe API for creating signed URLs
242
205
  * for pre-registered routes. Signed URLs include a signature that prevents
243
206
  * tampering and can have expiration times.
244
- *
245
- * @example
246
- * // Using signed URL builder service
247
- * export default class FileController {
248
- * async getDownloadUrl({ signedUrlBuilder }: { signedUrlBuilder: SignedUrlBuilderService }) {
249
- * const signedUrl = signedUrlBuilder.make('files.download',
250
- * { id: 1 },
251
- * { expiresIn: '1h' }
252
- * )
253
- * }
254
- * }
255
207
  */
256
- export interface SignedUrlBuilderService extends UrlFor<RoutesList extends LookupList ? RoutesList : never, SignedURLOptions> {
208
+ export interface UrlBuilderSignedUrlFor extends UrlFor<RoutesList extends LookupList ? RoutesList : never, SignedURLOptions> {
257
209
  }
258
210
  /**
259
211
  * Hash service is a singleton instance of the HashManager
260
212
  * registered in the container. It provides password hashing
261
213
  * and verification functionality.
262
- *
263
- * @example
264
- * // Using hash service for password management
265
- * export default class AuthController {
266
- * async register({ hash }: { hash: HashService }) {
267
- * const hashedPassword = await hash.make('user-password')
268
- * const isValid = await hash.verify(hashedPassword, 'user-password')
269
- * }
270
- * }
271
214
  */
272
215
  export interface HashService extends HashManager<HashersList extends Record<string, ManagerDriverFactory> ? HashersList : never> {
273
216
  }
@@ -275,16 +218,6 @@ export interface HashService extends HashManager<HashersList extends Record<stri
275
218
  * A list of known container bindings. This interface defines
276
219
  * all the services that are registered in the IoC container
277
220
  * and available for dependency injection.
278
- *
279
- * @example
280
- * // Accessing container bindings in a service
281
- * export default class UserService {
282
- * constructor(
283
- * private logger: LoggerService,
284
- * private hash: HashService,
285
- * private emitter: EmitterService
286
- * ) {}
287
- * }
288
221
  */
289
222
  export interface ContainerBindings {
290
223
  /** Ace command-line kernel */
@@ -349,6 +282,8 @@ export type IndexEntitiesConfig = {
349
282
  importAlias?: string;
350
283
  /** Glob patterns for matching controller files */
351
284
  glob?: string[];
285
+ /** Path segments to skip from generated keys. Defaults to ['controllers'] */
286
+ skipSegments?: string[];
352
287
  };
353
288
  /** Configuration for listeners indexing */
354
289
  listeners?: {
@@ -360,6 +295,8 @@ export type IndexEntitiesConfig = {
360
295
  importAlias?: string;
361
296
  /** Glob patterns for matching listener files */
362
297
  glob?: string[];
298
+ /** Path segments to skip from generated keys. Defaults to ['listeners'] */
299
+ skipSegments?: string[];
363
300
  };
364
301
  /** Configuration for events indexing */
365
302
  events?: {
@@ -371,12 +308,29 @@ export type IndexEntitiesConfig = {
371
308
  importAlias?: string;
372
309
  /** Glob patterns for matching event files */
373
310
  glob?: string[];
311
+ /** Path segments to skip from generated keys. Defaults to ['events'] */
312
+ skipSegments?: string[];
374
313
  };
314
+ /** Configuration for transformers indexing */
375
315
  transformers?: {
316
+ /** Whether to enable transformers indexing */
376
317
  enabled?: boolean;
318
+ /** Whether to include shared props in transformers */
377
319
  withSharedProps?: boolean;
320
+ inertiaMiddlewareImportPath?: string;
321
+ /** Source directory for transformers */
378
322
  source?: string;
323
+ /** Import alias for transformers */
379
324
  importAlias?: string;
325
+ /** Glob patterns for matching transformer files */
380
326
  glob?: string[];
327
+ /** Path segments to skip from generated keys. Defaults to ['transformers'] */
328
+ skipSegments?: string[];
329
+ };
330
+ /** Configuration for manifest generation */
331
+ manifest?: {
332
+ /** Whether to enable manifest generation */
333
+ enabled?: boolean;
334
+ exclude?: string[];
381
335
  };
382
336
  };
@@ -1,9 +1 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
1
  export {};
@@ -57,4 +57,4 @@ export declare function importTypeScript(app: ApplicationService): Promise<typeo
57
57
  * // }
58
58
  * // }
59
59
  */
60
- export declare function outputTransformerDataObjects(transformersList: RecursiveFileTree, buffer: Assembler.FileBuffer, withSharedProps: boolean): Promise<void>;
60
+ export declare function outputTransformerDataObjects(transformersList: RecursiveFileTree, buffer: Assembler.FileBuffer, withSharedProps: boolean, inertiaMiddlewareImportPath?: string): Promise<void>;
package/build/src/vine.js CHANGED
@@ -1,105 +1,33 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- import vine, { symbols, BaseLiteralType } from '@vinejs/vine';
10
- const MULTIPART_FILE = symbols.SUBTYPE ?? Symbol.for('subtype');
11
- /**
12
- * Checks if the value is an instance of multipart file from bodyparser.
13
- * Used internally for type guarding in file validation.
14
- *
15
- * @param file - The value to check for MultipartFile instance
16
- */
1
+ import vine, { BaseLiteralType, symbols } from "@vinejs/vine";
2
+ const MULTIPART_FILE = symbols.SUBTYPE ?? Symbol.for("subtype");
17
3
  function isBodyParserFile(file) {
18
- return !!(file && typeof file === 'object' && 'isMultipartFile' in file);
4
+ return !!(file && typeof file === "object" && "isMultipartFile" in file);
19
5
  }
20
- /**
21
- * VineJS validation rule that validates the file to be an instance of BodyParser
22
- * MultipartFile class and applies size/extension validation if configured.
23
- *
24
- * @param file - The file value to validate
25
- * @param options - Validation options for file size and extensions
26
- * @param field - The field context from VineJS validation
27
- */
28
6
  const isMultipartFile = vine.createRule((file, options, field) => {
29
- /**
30
- * Report error when value is not a field multipart
31
- * file object
32
- */
33
- if (!isBodyParserFile(file)) {
34
- field.report('The {{ field }} must be a file', 'file', field);
35
- return false;
36
- }
37
- const validationOptions = typeof options === 'function' ? options(field) : options;
38
- /**
39
- * Set size when it's defined in the options and missing
40
- * on the file instance
41
- */
42
- if (file.sizeLimit === undefined && validationOptions.size) {
43
- file.sizeLimit = validationOptions.size;
44
- }
45
- /**
46
- * Set extensions when it's defined in the options and missing
47
- * on the file instance
48
- */
49
- if (file.allowedExtensions === undefined && validationOptions.extnames) {
50
- file.allowedExtensions = validationOptions.extnames;
51
- }
52
- /**
53
- * Validate file
54
- */
55
- file.validate();
56
- /**
57
- * Report errors
58
- */
59
- file.errors.forEach((error) => {
60
- field.report(error.message, `file.${error.type}`, field, validationOptions);
61
- });
62
- return file.isValid;
7
+ if (!field.isDefined) return false;
8
+ if (!isBodyParserFile(file)) {
9
+ field.report("The {{ field }} must be a file", "file", field);
10
+ return false;
11
+ }
12
+ const validationOptions = typeof options === "function" ? options(field) : options;
13
+ if (file.sizeLimit === void 0 && validationOptions.size) file.sizeLimit = validationOptions.size;
14
+ if (file.allowedExtensions === void 0 && validationOptions.extnames) file.allowedExtensions = validationOptions.extnames;
15
+ file.validate();
16
+ file.errors.forEach((error) => {
17
+ field.report(error.message, `file.${error.type}`, field, validationOptions);
18
+ });
19
+ return file.isValid;
63
20
  });
64
- /**
65
- * Represents a multipart file uploaded via multipart/form-data HTTP
66
- * request. This class extends VineJS's BaseLiteralType to provide
67
- * specialized validation for uploaded files.
68
- *
69
- * @example
70
- * const fileSchema = vine.object({
71
- * avatar: vine.file({
72
- * size: '2mb',
73
- * extnames: ['jpg', 'png']
74
- * })
75
- * })
76
- */
77
- export class VineMultipartFile extends BaseLiteralType {
78
- /**
79
- * Private validation options for file validation
80
- */
81
- #validationOptions;
82
- /**
83
- * Symbol identifier for multipart file subtype
84
- */
85
- [MULTIPART_FILE] = 'multipartFile';
86
- /**
87
- * Creates a new VineMultipartFile instance
88
- *
89
- * @param validationOptions - File validation options like size limits and allowed extensions
90
- * @param options - Field options from VineJS
91
- * @param validations - Array of validation functions to apply
92
- */
93
- constructor(validationOptions, options, validations) {
94
- super(options, validations || []);
95
- this.#validationOptions = validationOptions;
96
- this.dataTypeValidator = isMultipartFile(validationOptions || {});
97
- }
98
- /**
99
- * Creates a clone of the current VineMultipartFile instance
100
- * with the same validation options and configurations
101
- */
102
- clone() {
103
- return new VineMultipartFile(this.#validationOptions, this.cloneOptions(), this.cloneValidations());
104
- }
105
- }
21
+ var VineMultipartFile = class VineMultipartFile extends BaseLiteralType {
22
+ #validationOptions;
23
+ [MULTIPART_FILE] = "multipartFile";
24
+ constructor(validationOptions, options, validations) {
25
+ super(options, validations || []);
26
+ this.#validationOptions = validationOptions;
27
+ this.dataTypeValidator = isMultipartFile(validationOptions || {});
28
+ }
29
+ clone() {
30
+ return new VineMultipartFile(this.#validationOptions, this.cloneOptions(), this.cloneValidations());
31
+ }
32
+ };
33
+ export { VineMultipartFile };
@@ -1,27 +1,25 @@
1
1
  #!/usr/bin/env node
2
- /*
3
- * @adonisjs/core
4
- *
5
- * (c) AdonisJS
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- import { Kernel, ListLoader, HelpCommand } from '@adonisjs/ace';
11
- import IndexCommand from "./commands/index_commands.js";
2
+ import { t as __decorate } from "../decorate-DmrZA614.js";
3
+ import { BaseCommand, HelpCommand, IndexGenerator, Kernel, ListLoader, args } from "@adonisjs/ace";
4
+ import { join } from "node:path";
5
+ var IndexCommand = class extends BaseCommand {
6
+ static commandName = "index";
7
+ static description = "Create an index of commands along with a lazy loader";
8
+ async run() {
9
+ await new IndexGenerator(join(process.cwd(), this.commandsDir)).generate();
10
+ }
11
+ };
12
+ __decorate([args.string({ description: "Relative path from cwd to the commands directory" })], IndexCommand.prototype, "commandsDir", void 0);
12
13
  const kernel = Kernel.create();
13
14
  kernel.addLoader(new ListLoader([IndexCommand]));
14
- kernel.defineFlag('help', {
15
- type: 'boolean',
16
- description: HelpCommand.description,
15
+ kernel.defineFlag("help", {
16
+ type: "boolean",
17
+ description: HelpCommand.description
17
18
  });
18
- /**
19
- * Flag listener to display the help
20
- */
21
- kernel.on('help', async (command, $kernel, parsed) => {
22
- parsed.args.unshift(command.commandName);
23
- const help = new HelpCommand($kernel, parsed, kernel.ui, kernel.prompt);
24
- await help.exec();
25
- return $kernel.shortcircuit();
19
+ kernel.on("help", async (command, $kernel, parsed) => {
20
+ parsed.args.unshift(command.commandName);
21
+ await new HelpCommand($kernel, parsed, kernel.ui, kernel.prompt).exec();
22
+ return $kernel.shortcircuit();
26
23
  });
27
24
  await kernel.handle(process.argv.splice(2));
25
+ export {};
@@ -1,9 +1,2 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@adonisjs/ace/types';
1
+ export * from "@adonisjs/ace/types";
2
+ export {};
@@ -1,9 +1,2 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@adonisjs/application/types';
1
+ export * from "@adonisjs/application/types";
2
+ export {};
@@ -1,9 +1,2 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@adonisjs/bodyparser/types';
1
+ export * from "@adonisjs/bodyparser/types";
2
+ export {};
@@ -1,9 +1,2 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@poppinss/utils/types';
1
+ export * from "@poppinss/utils/types";
2
+ export {};
@@ -1,9 +1,2 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@adonisjs/fold/types';
1
+ export * from "@adonisjs/fold/types";
2
+ export {};
@@ -1 +1,53 @@
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, EncryptionConfig } 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 AES-SIV encryption driver.
34
+ *
35
+ * Includes the driver identifier and a single encryption key.
36
+ */
37
+ export type { AESSIVDriverConfig } from '@boringnode/encryption/drivers/aes_siv';
38
+ /**
39
+ * Configuration options for the ChaCha20-Poly1305 encryption driver.
40
+ *
41
+ * Includes the driver identifier and a list of encryption keys.
42
+ * The first key is used for encryption, while all keys are tried
43
+ * for decryption (allowing for key rotation).
44
+ */
45
+ export type { ChaCha20Poly1305DriverConfig } from '@boringnode/encryption/drivers/chacha20_poly1305';
46
+ /**
47
+ * Configuration options for the Legacy encryption driver.
48
+ *
49
+ * The Legacy driver maintains compatibility with the old AdonisJS v6
50
+ * encryption format. It does not require a driver identifier since
51
+ * the legacy format doesn't include one.
52
+ */
53
+ export type { LegacyDriverConfig } from '../modules/encryption/drivers/legacy.ts';
@@ -1,9 +1 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@adonisjs/encryption/types';
1
+ export {};
@@ -1,9 +1,2 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@adonisjs/events/types';
1
+ export * from "@adonisjs/events/types";
2
+ export {};
@@ -1,9 +1,2 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@adonisjs/hash/types';
1
+ export * from "@adonisjs/hash/types";
2
+ export {};
@@ -1,9 +1,2 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@adonisjs/health/types';
1
+ export * from "@adonisjs/health/types";
2
+ export {};
@@ -1,9 +1 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
1
  export {};
@@ -1,9 +1,2 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@adonisjs/http-server/types';
1
+ export * from "@adonisjs/http-server/types";
2
+ export {};
@@ -1,9 +1,2 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@adonisjs/logger/types';
1
+ export * from "@adonisjs/logger/types";
2
+ export {};