@nhtio/lucid-resourceful 1.20250718.2 → 1.20250724.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nhtio/lucid-resourceful",
3
- "version": "1.20250718.2",
3
+ "version": "1.20250724.0",
4
4
  "description": "A decorator-driven AdonisJS library that lets you annotate Lucid ORM models with metadata to automatically generate CRUD controllers, validation rules, OpenAPI schemas, and a unified query interface.",
5
5
  "keywords": [],
6
6
  "author": "Jak Giveon <jak@nht.io>",
@@ -1,65 +1,3 @@
1
- import type { Root } from 'joi';
2
- import type { BigIntSchema } from './bigint';
3
- /**
4
- * Extended Joi root interface that includes custom schema types for
5
- * lucid-resourceful validation scenarios.
6
- *
7
- * This interface extends the standard Joi Root interface to include
8
- * additional schema types specifically designed for AdonisJS Lucid
9
- * model validation requirements.
10
- *
11
- * @example
12
- * ```typescript
13
- * import { joi } from '@nhtio/lucid-resourceful/joi'
14
- *
15
- * const schema = joi.object({
16
- * id: joi.bigint().positive().required(),
17
- * balance: joi.bigint().min(0n).optional()
18
- * })
19
- * ```
20
- *
21
- * @public
22
- */
23
- export interface ExtendedJoiRoot extends Root {
24
- /**
25
- * Creates a BigInt schema type for validation
26
- * @returns A new BigInt schema instance
27
- */
28
- bigint(): BigIntSchema;
29
- }
30
- /**
31
- * Extended Joi instance with custom schema types for lucid-resourceful.
32
- *
33
- * This instance includes all standard Joi functionality plus additional
34
- * schema types optimized for AdonisJS Lucid model validation scenarios.
35
- *
36
- * @example
37
- * ```typescript
38
- * import { joi } from '@nhtio/lucid-resourceful/joi'
39
- *
40
- * // Standard Joi usage
41
- * const userSchema = joi.object({
42
- * name: joi.string().required(),
43
- * age: joi.number().min(0),
44
- * balance: joi.bigint().positive() // Custom BigInt type
45
- * })
46
- *
47
- * // Use in resourceful decorators
48
- * @resourceful({
49
- * type: 'bigint',
50
- * validate: {
51
- * create: joi.bigint().positive(),
52
- * update: joi.bigint().min(0n)
53
- * }
54
- * })
55
- * public balance: bigint
56
- * ```
57
- *
58
- * @public
59
- */
60
- export declare const joi: ExtendedJoiRoot;
61
- /**
62
- * Re-export of the BigIntSchema interface for external use
63
- * @public
64
- */
65
- export type { BigIntSchema };
1
+ export * from '@nhtio/validation';
2
+ import { validator } from '@nhtio/validation';
3
+ export { validator as joi };
@@ -280,7 +280,10 @@ export interface ResourcefulModel extends LucidModel {
280
280
  * );
281
281
  * ```
282
282
  */
283
- $onResourcefulIndex<SelectedFields extends Array<keyof ResourcefulModelSerializableAttributes<InstanceType<LucidModel>>>, ReturnType = Pick<ResourcefulModelSerializableAttributes<InstanceType<LucidModel>>, SelectedFields[number]>>(filter: string | null | undefined, page: number, perPage: number, fields: SelectedFields | null | undefined, ctx: HttpContext, app: ApplicationService, hooks?: ResourcefulScopeHooks): Promise<ResourcefulIndexResult<ReturnType>>;
283
+ $onResourcefulIndex<SelectedFields extends Array<keyof ResourcefulModelSerializableAttributes<InstanceType<LucidModel>>>, SelectedSingleField extends keyof ResourcefulModelSerializableAttributes<InstanceType<LucidModel>>, ReturnType = Pick<ResourcefulModelSerializableAttributes<InstanceType<LucidModel>>, SelectedFields[number]>>(filter: string | null | undefined, page: number, perPage: number, fields: SelectedFields | SelectedSingleField | null | undefined, sort: Array<[
284
+ Extract<keyof ResourcefulModelSerializableAttributes<InstanceType<LucidModel>>, string>,
285
+ 'asc' | 'desc'
286
+ ]> | null | undefined, ctx: HttpContext, app: ApplicationService, hooks?: ResourcefulScopeHooks): Promise<ResourcefulIndexResult<ReturnType>>;
284
287
  /**
285
288
  * Retrieves a single model record by its unique identifier with access control.
286
289
  *