@nhtio/lucid-resourceful 1.20250718.2 → 1.20250724.1
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/{definitions-B66EPk0H.js → definitions-B88XBTUF.js} +119 -119
- package/{definitions-B66EPk0H.js.map → definitions-B88XBTUF.js.map} +1 -1
- package/{definitions-BrN-oCRI.cjs → definitions-DgI468dW.cjs} +119 -119
- package/{definitions-BrN-oCRI.cjs.map → definitions-DgI468dW.cjs.map} +1 -1
- package/definitions.cjs +1 -1
- package/definitions.mjs +1 -1
- package/index.cjs +304 -290
- package/index.cjs.map +1 -1
- package/index.mjs +291 -277
- package/index.mjs.map +1 -1
- package/joi.cjs +12389 -2
- package/joi.cjs.map +1 -1
- package/joi.mjs +12391 -2
- package/joi.mjs.map +1 -1
- package/package.json +1 -1
- package/private/joi/index.d.ts +3 -65
- package/private/mixin.d.ts +4 -1
- package/index-Cv6KC1rC.cjs +0 -670
- package/index-Cv6KC1rC.cjs.map +0 -1
- package/index-DDaZ2qr2.js +0 -671
- package/index-DDaZ2qr2.js.map +0 -1
- package/private/joi/bigint.d.ts +0 -85
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nhtio/lucid-resourceful",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20250724.1",
|
|
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>",
|
package/private/joi/index.d.ts
CHANGED
|
@@ -1,65 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
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 };
|
package/private/mixin.d.ts
CHANGED
|
@@ -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,
|
|
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
|
*
|