@nhtio/lucid-resourceful 1.20250718.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/LICENSE.md +9 -0
- package/README.md +5 -0
- package/decorator_utils-1yWqd_Gg.cjs +6792 -0
- package/decorator_utils-1yWqd_Gg.cjs.map +1 -0
- package/decorator_utils-BUuBwQYK.js +6793 -0
- package/decorator_utils-BUuBwQYK.js.map +1 -0
- package/definitions-B66EPk0H.js +381 -0
- package/definitions-B66EPk0H.js.map +1 -0
- package/definitions-BrN-oCRI.cjs +380 -0
- package/definitions-BrN-oCRI.cjs.map +1 -0
- package/definitions.cjs +15 -0
- package/definitions.cjs.map +1 -0
- package/definitions.d.ts +5 -0
- package/definitions.mjs +15 -0
- package/definitions.mjs.map +1 -0
- package/errors-B1rr67uM.js +3004 -0
- package/errors-B1rr67uM.js.map +1 -0
- package/errors-D8jb9VxY.cjs +3000 -0
- package/errors-D8jb9VxY.cjs.map +1 -0
- package/errors.cjs +22 -0
- package/errors.cjs.map +1 -0
- package/errors.d.ts +94 -0
- package/errors.mjs +22 -0
- package/errors.mjs.map +1 -0
- package/index-Cv6KC1rC.cjs +670 -0
- package/index-Cv6KC1rC.cjs.map +1 -0
- package/index-DDaZ2qr2.js +671 -0
- package/index-DDaZ2qr2.js.map +1 -0
- package/index.cjs +12706 -0
- package/index.cjs.map +1 -0
- package/index.d.ts +14 -0
- package/index.mjs +12708 -0
- package/index.mjs.map +1 -0
- package/joi.cjs +5 -0
- package/joi.cjs.map +1 -0
- package/joi.d.ts +5 -0
- package/joi.mjs +5 -0
- package/joi.mjs.map +1 -0
- package/package.json +65 -0
- package/private/constants.d.ts +11 -0
- package/private/controller_factory.d.ts +1 -0
- package/private/data_type_schemas.d.ts +12 -0
- package/private/data_types.d.ts +437 -0
- package/private/decorator_schemas.d.ts +34 -0
- package/private/decorator_utils.d.ts +305 -0
- package/private/decorators.d.ts +209 -0
- package/private/helpers.d.ts +34 -0
- package/private/joi/bigint.d.ts +85 -0
- package/private/joi/index.d.ts +65 -0
- package/private/lucene_to_lucid_translator.d.ts +201 -0
- package/private/mixin.d.ts +563 -0
- package/private/schema_types.d.ts +157 -0
- package/private/type_guards.d.ts +42 -0
- package/private/types.d.ts +102 -0
- package/private/utils.d.ts +10 -0
- package/types.cjs +2 -0
- package/types.cjs.map +1 -0
- package/types.d.ts +28 -0
- package/types.mjs +2 -0
- package/types.mjs.map +1 -0
- package/utils/casters.d.ts +1 -0
- package/utils/consumers.d.ts +1 -0
- package/utils/preparers.d.ts +1 -0
- package/utils.cjs +50 -0
- package/utils.cjs.map +1 -0
- package/utils.d.ts +20 -0
- package/utils.mjs +51 -0
- package/utils.mjs.map +1 -0
package/joi.cjs
ADDED
package/joi.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joi.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/joi.d.ts
ADDED
package/joi.mjs
ADDED
package/joi.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joi.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nhtio/lucid-resourceful",
|
|
3
|
+
"version": "1.20250718.0",
|
|
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
|
+
"keywords": [],
|
|
6
|
+
"author": "Jak Giveon <jak@nht.io>",
|
|
7
|
+
"copyright": "© 2025-present New Horizon Technology LTD",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"peerDependencies": {
|
|
10
|
+
"@adonisjs/core": "^6.19.0",
|
|
11
|
+
"@adonisjs/lucid": "^21.7.0",
|
|
12
|
+
"better-sqlite3": "^12.2.0",
|
|
13
|
+
"luxon": "^3.6.1",
|
|
14
|
+
"mysql": "^2.18.1",
|
|
15
|
+
"mysql2": "^3.14.2",
|
|
16
|
+
"oracledb": "^6.8.0",
|
|
17
|
+
"pg": "^8.16.3",
|
|
18
|
+
"pg-native": "^3.5.2",
|
|
19
|
+
"sqlite3": "^5.1.7",
|
|
20
|
+
"tedious": "^18.6.1"
|
|
21
|
+
},
|
|
22
|
+
"type": "module",
|
|
23
|
+
"module": "./index.mjs",
|
|
24
|
+
"main": "./index.cjs",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"import": "./index.mjs",
|
|
28
|
+
"require": "./index.cjs",
|
|
29
|
+
"types": "./index.d.ts"
|
|
30
|
+
},
|
|
31
|
+
"./definitions": {
|
|
32
|
+
"import": "./definitions.mjs",
|
|
33
|
+
"require": "./definitions.cjs",
|
|
34
|
+
"types": "./definitions.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./errors": {
|
|
37
|
+
"import": "./errors.mjs",
|
|
38
|
+
"require": "./errors.cjs",
|
|
39
|
+
"types": "./errors.d.ts"
|
|
40
|
+
},
|
|
41
|
+
"./joi": {
|
|
42
|
+
"import": "./joi.mjs",
|
|
43
|
+
"require": "./joi.cjs",
|
|
44
|
+
"types": "./joi.d.ts"
|
|
45
|
+
},
|
|
46
|
+
"./types": {
|
|
47
|
+
"import": "./types.mjs",
|
|
48
|
+
"require": "./types.cjs",
|
|
49
|
+
"types": "./types.d.ts"
|
|
50
|
+
},
|
|
51
|
+
"./utils": {
|
|
52
|
+
"import": "./utils.mjs",
|
|
53
|
+
"require": "./utils.cjs",
|
|
54
|
+
"types": "./utils.d.ts"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"imports": {
|
|
58
|
+
"#tests/*": "./tests/*.ts"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"joi": "^17.13.3",
|
|
62
|
+
"liqe": "^3.8.3"
|
|
63
|
+
},
|
|
64
|
+
"packageManager": "pnpm@10.8.0+sha512.0e82714d1b5b43c74610193cb20734897c1d00de89d0e18420aebc5977fa13d780a9cb05734624e81ebd81cc876cd464794850641c48b9544326b5622ca29971"
|
|
65
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ResourcefulStringTypeOptions, ResourcefulDateTypeOptions, ResourcefulDateTimeTypeOptions, ResourcefulBinaryTypeOptions, ResourcefulNumberTypeOptions, ResourcefulIntegerTypeOptions, ResourcefulBigintTypeOptions, ResourcefulUnsignedIntegerTypeOptions, ResourcefulBooleanTypeOptions, ResourcefulObjectTypeOptions, ResourcefulArrayTypeOptions } from './data_types';
|
|
2
|
+
export declare const ResourcefulStringTypeSchema: () => import("joi").ObjectSchema<ResourcefulStringTypeOptions>;
|
|
3
|
+
export declare const ResourcefulDateTypeSchema: () => import("joi").ObjectSchema<ResourcefulDateTypeOptions>;
|
|
4
|
+
export declare const ResourcefulDateTimeTypeSchema: () => import("joi").ObjectSchema<ResourcefulDateTimeTypeOptions>;
|
|
5
|
+
export declare const ResourcefulBinaryTypeSchema: () => import("joi").ObjectSchema<ResourcefulBinaryTypeOptions>;
|
|
6
|
+
export declare const ResourcefulNumberTypeSchema: () => import("joi").ObjectSchema<ResourcefulNumberTypeOptions>;
|
|
7
|
+
export declare const ResourcefulIntegerTypeSchema: () => import("joi").ObjectSchema<ResourcefulIntegerTypeOptions>;
|
|
8
|
+
export declare const ResourcefulBigintTypeSchema: () => import("joi").ObjectSchema<ResourcefulBigintTypeOptions>;
|
|
9
|
+
export declare const ResourcefulUnsignedIntegerTypeSchema: () => import("joi").ObjectSchema<ResourcefulUnsignedIntegerTypeOptions>;
|
|
10
|
+
export declare const ResourcefulBooleanTypeSchema: () => import("joi").ObjectSchema<ResourcefulBooleanTypeOptions>;
|
|
11
|
+
export declare const ResourcefulObjectTypeSchema: () => import("joi").ObjectSchema<ResourcefulObjectTypeOptions>;
|
|
12
|
+
export declare const ResourcefulArrayTypeSchema: () => import("joi").ObjectSchema<ResourcefulArrayTypeOptions>;
|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import type { ObjectSchema } from 'joi';
|
|
2
|
+
/**
|
|
3
|
+
* Base interface for all Resourceful data type options.
|
|
4
|
+
* Includes common modifier properties that apply to all data types.
|
|
5
|
+
*/
|
|
6
|
+
export interface BaseInterface {
|
|
7
|
+
/** Whether the value can be null */
|
|
8
|
+
nullable?: boolean;
|
|
9
|
+
/** Whether the property is read-only (not included in create/update operations) */
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
/** Whether the property is write-only (not included in response serialization) */
|
|
12
|
+
writeOnly?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Base type constraint for abstract constructor functions used in data type generation.
|
|
16
|
+
*/
|
|
17
|
+
export type BaseClass = abstract new (...args: any[]) => any;
|
|
18
|
+
/**
|
|
19
|
+
* A hybrid type that represents a constructor function which can be called both with and without the `new` keyword.
|
|
20
|
+
* This type enables creating data type classes that work as both constructors and factory functions.
|
|
21
|
+
*
|
|
22
|
+
* @typeParam ClassConstructorOptions - The interface defining the constructor options for the class
|
|
23
|
+
* @typeParam C - The abstract constructor type constraint
|
|
24
|
+
*/
|
|
25
|
+
export type CallableNewable<ClassConstructorOptions extends BaseInterface, C extends BaseClass = BaseClass> = {
|
|
26
|
+
readonly schema: ObjectSchema<ClassConstructorOptions>;
|
|
27
|
+
new (...args: ConstructorParameters<C>): InstanceType<C>;
|
|
28
|
+
} & {
|
|
29
|
+
(...args: ConstructorParameters<C>): InstanceType<C>;
|
|
30
|
+
} & {
|
|
31
|
+
prototype: InstanceType<C>;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Supported string formats for ResourcefulStringType, excluding OpenAPI reserved formats.
|
|
35
|
+
* These formats provide additional validation and documentation for string fields.
|
|
36
|
+
*
|
|
37
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
38
|
+
*/
|
|
39
|
+
export declare const ResourcefulStringFormat: readonly ["password", "byte"];
|
|
40
|
+
/**
|
|
41
|
+
* Union type of supported string formats for ResourcefulStringType.
|
|
42
|
+
* Used to provide type safety when specifying string field formats.
|
|
43
|
+
*
|
|
44
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
45
|
+
*/
|
|
46
|
+
export type ResourcefulStringFormat = (typeof ResourcefulStringFormat)[number];
|
|
47
|
+
/**
|
|
48
|
+
* Configuration options for ResourcefulStringType instances.
|
|
49
|
+
* Defines validation rules and constraints for string-based fields in OpenAPI schemas.
|
|
50
|
+
*
|
|
51
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
52
|
+
*/
|
|
53
|
+
export interface ResourcefulStringTypeOptions extends BaseInterface {
|
|
54
|
+
/** Minimum length constraint for the string value */
|
|
55
|
+
minLength: number;
|
|
56
|
+
/** Maximum length constraint for the string value */
|
|
57
|
+
maxLength: number;
|
|
58
|
+
/** Regular expression pattern that the string value must match */
|
|
59
|
+
pattern?: string;
|
|
60
|
+
/** String format specification, excluding OpenAPI reserved formats like date, date-time, and binary */
|
|
61
|
+
format?: ResourcefulStringFormat | Exclude<string, 'date' | 'date-time' | 'password' | 'byte' | 'binary'>;
|
|
62
|
+
/** Array of allowed string values for enumeration validation */
|
|
63
|
+
enum?: string[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Callable constructor for creating validated string type instances.
|
|
67
|
+
* Supports both constructor and function call patterns for flexible usage.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const stringType = new ResourcefulStringType({ minLength: 1, maxLength: 100 })
|
|
72
|
+
* const stringType2 = ResourcefulStringType({ pattern: '^[a-zA-Z]+$' })
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
76
|
+
*/
|
|
77
|
+
export declare const ResourcefulStringType: CallableNewable<ResourcefulStringTypeOptions, BaseClass>;
|
|
78
|
+
/**
|
|
79
|
+
* Instance type for ResourcefulStringType with validated properties.
|
|
80
|
+
* Represents a string data type with validation constraints as defined in the OpenAPI 3.0 specification.
|
|
81
|
+
*
|
|
82
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
83
|
+
*/
|
|
84
|
+
export interface ResourcefulStringType extends ResourcefulStringTypeOptions {
|
|
85
|
+
type: 'string';
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Configuration options for ResourcefulDateType instances.
|
|
89
|
+
* Represents date-only values formatted as ISO 8601 date strings.
|
|
90
|
+
*
|
|
91
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
92
|
+
*/
|
|
93
|
+
export interface ResourcefulDateTypeOptions extends BaseInterface {
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Callable constructor for creating validated date type instances.
|
|
97
|
+
* Automatically sets the OpenAPI format to 'date' for ISO 8601 date strings.
|
|
98
|
+
*
|
|
99
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
100
|
+
*/
|
|
101
|
+
export declare const ResourcefulDateType: CallableNewable<ResourcefulDateTypeOptions, BaseClass>;
|
|
102
|
+
/**
|
|
103
|
+
* Instance type for ResourcefulDateType with validated properties.
|
|
104
|
+
* Represents a date-only value formatted as ISO 8601 date string as defined in the OpenAPI 3.0 specification.
|
|
105
|
+
*
|
|
106
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
107
|
+
*/
|
|
108
|
+
export interface ResourcefulDateType extends ResourcefulDateTypeOptions {
|
|
109
|
+
type: 'string';
|
|
110
|
+
format: 'date';
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Configuration options for ResourcefulDateTimeType instances.
|
|
114
|
+
* Represents date-time values formatted as ISO 8601 date-time strings.
|
|
115
|
+
*
|
|
116
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
117
|
+
*/
|
|
118
|
+
export interface ResourcefulDateTimeTypeOptions extends BaseInterface {
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Callable constructor for creating validated date-time type instances.
|
|
122
|
+
* Automatically sets the OpenAPI format to 'date-time' for ISO 8601 date-time strings.
|
|
123
|
+
*
|
|
124
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
125
|
+
*/
|
|
126
|
+
export declare const ResourcefulDateTimeType: CallableNewable<ResourcefulDateTimeTypeOptions, BaseClass>;
|
|
127
|
+
/**
|
|
128
|
+
* Instance type for ResourcefulDateTimeType with validated properties.
|
|
129
|
+
* Represents a date-time value formatted as ISO 8601 date-time string as defined in the OpenAPI 3.0 specification.
|
|
130
|
+
*
|
|
131
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
132
|
+
*/
|
|
133
|
+
export interface ResourcefulDateTimeType extends ResourcefulDateTimeTypeOptions {
|
|
134
|
+
type: 'string';
|
|
135
|
+
format: 'date-time';
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Configuration options for ResourcefulBinaryType instances.
|
|
139
|
+
* Defines constraints for binary data represented as base64-encoded strings.
|
|
140
|
+
*
|
|
141
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
142
|
+
*/
|
|
143
|
+
export interface ResourcefulBinaryTypeOptions extends BaseInterface {
|
|
144
|
+
/** Minimum length constraint for the base64-encoded binary data */
|
|
145
|
+
minLength: number;
|
|
146
|
+
/** Maximum length constraint for the base64-encoded binary data */
|
|
147
|
+
maxLength: number;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Callable constructor for creating validated binary type instances.
|
|
151
|
+
* Automatically sets the OpenAPI format to 'binary' for base64-encoded binary data.
|
|
152
|
+
*
|
|
153
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
154
|
+
*/
|
|
155
|
+
export declare const ResourcefulBinaryType: CallableNewable<ResourcefulBinaryTypeOptions, BaseClass>;
|
|
156
|
+
/**
|
|
157
|
+
* Instance type for ResourcefulBinaryType with validated properties.
|
|
158
|
+
* Represents binary data as base64-encoded string as defined in the OpenAPI 3.0 specification.
|
|
159
|
+
*
|
|
160
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#string | OpenAPI 3.0 String Type}
|
|
161
|
+
*/
|
|
162
|
+
export interface ResourcefulBinaryType extends ResourcefulBinaryTypeOptions {
|
|
163
|
+
type: 'string';
|
|
164
|
+
format: 'binary';
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Supported number formats for ResourcefulNumberType, following OpenAPI 3.0 specification.
|
|
168
|
+
* These formats provide additional precision and validation for numeric fields.
|
|
169
|
+
*
|
|
170
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Number Type}
|
|
171
|
+
*/
|
|
172
|
+
export declare const ResourcefulNumberFormat: readonly ["float", "double"];
|
|
173
|
+
/**
|
|
174
|
+
* Union type of supported number formats for ResourcefulNumberType.
|
|
175
|
+
* Used to provide type safety when specifying numeric field formats.
|
|
176
|
+
*
|
|
177
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Number Type}
|
|
178
|
+
*/
|
|
179
|
+
export type ResourcefulNumberFormat = (typeof ResourcefulNumberFormat)[number];
|
|
180
|
+
/**
|
|
181
|
+
* Configuration options for ResourcefulNumberType instances.
|
|
182
|
+
* Defines validation rules and constraints for numeric fields in OpenAPI schemas.
|
|
183
|
+
*
|
|
184
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Number Type}
|
|
185
|
+
*/
|
|
186
|
+
export interface ResourcefulNumberTypeOptions extends BaseInterface {
|
|
187
|
+
/** Minimum value constraint for the number */
|
|
188
|
+
minimum: number;
|
|
189
|
+
/** Whether the minimum value is exclusive (value must be greater than minimum) */
|
|
190
|
+
exclusiveMinimum: boolean;
|
|
191
|
+
/** Maximum value constraint for the number */
|
|
192
|
+
maximum: number;
|
|
193
|
+
/** Whether the maximum value is exclusive (value must be less than maximum) */
|
|
194
|
+
exclusiveMaximum: boolean;
|
|
195
|
+
/** Number format specification for precision (float or double) */
|
|
196
|
+
format: ResourcefulNumberFormat;
|
|
197
|
+
/** Value must be a multiple of this number */
|
|
198
|
+
multipleOf: number;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Callable constructor for creating validated number type instances.
|
|
202
|
+
* Supports floating-point numbers with configurable precision and range constraints.
|
|
203
|
+
*
|
|
204
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Number Type}
|
|
205
|
+
*/
|
|
206
|
+
export declare const ResourcefulNumberType: CallableNewable<ResourcefulNumberTypeOptions, BaseClass>;
|
|
207
|
+
/**
|
|
208
|
+
* Instance type for ResourcefulNumberType with validated properties.
|
|
209
|
+
* Represents floating-point numbers as defined in the OpenAPI 3.0 specification.
|
|
210
|
+
*
|
|
211
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Number Type}
|
|
212
|
+
*/
|
|
213
|
+
export interface ResourcefulNumberType extends ResourcefulNumberTypeOptions {
|
|
214
|
+
type: 'number';
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Configuration options for ResourcefulIntegerType instances.
|
|
218
|
+
* Defines validation rules and constraints for 32-bit integer fields in OpenAPI schemas.
|
|
219
|
+
*
|
|
220
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Integer Type}
|
|
221
|
+
*/
|
|
222
|
+
export interface ResourcefulIntegerTypeOptions extends BaseInterface {
|
|
223
|
+
/** Minimum value constraint for the integer */
|
|
224
|
+
minimum: number;
|
|
225
|
+
/** Whether the minimum value is exclusive (value must be greater than minimum) */
|
|
226
|
+
exclusiveMinimum: boolean;
|
|
227
|
+
/** Maximum value constraint for the integer */
|
|
228
|
+
maximum: number;
|
|
229
|
+
/** Whether the maximum value is exclusive (value must be less than maximum) */
|
|
230
|
+
exclusiveMaximum: boolean;
|
|
231
|
+
/** Value must be a multiple of this number */
|
|
232
|
+
multipleOf: number;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Callable constructor for creating validated integer type instances.
|
|
236
|
+
* Automatically sets the OpenAPI format to 'int32' for 32-bit signed integers.
|
|
237
|
+
*
|
|
238
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Integer Type}
|
|
239
|
+
*/
|
|
240
|
+
export declare const ResourcefulIntegerType: CallableNewable<ResourcefulIntegerTypeOptions, BaseClass>;
|
|
241
|
+
/**
|
|
242
|
+
* Instance type for ResourcefulIntegerType with validated properties.
|
|
243
|
+
* Represents 32-bit signed integers as defined in the OpenAPI 3.0 specification.
|
|
244
|
+
*
|
|
245
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Integer Type}
|
|
246
|
+
*/
|
|
247
|
+
export interface ResourcefulIntegerType extends ResourcefulIntegerTypeOptions {
|
|
248
|
+
type: 'integer';
|
|
249
|
+
format: 'int32';
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Configuration options for ResourcefulBigintType instances.
|
|
253
|
+
* Defines validation rules and constraints for 64-bit integer fields in OpenAPI schemas.
|
|
254
|
+
*
|
|
255
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Integer Type}
|
|
256
|
+
*/
|
|
257
|
+
export interface ResourcefulBigintTypeOptions extends BaseInterface {
|
|
258
|
+
/** Minimum value constraint for the 64-bit integer */
|
|
259
|
+
minimum: bigint;
|
|
260
|
+
/** Whether the minimum value is exclusive (value must be greater than minimum) */
|
|
261
|
+
exclusiveMinimum: boolean;
|
|
262
|
+
/** Maximum value constraint for the 64-bit integer */
|
|
263
|
+
maximum: bigint;
|
|
264
|
+
/** Whether the maximum value is exclusive (value must be less than maximum) */
|
|
265
|
+
exclusiveMaximum: boolean;
|
|
266
|
+
/** Value must be a multiple of this number */
|
|
267
|
+
multipleOf: bigint;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Callable constructor for creating validated bigint type instances.
|
|
271
|
+
* Automatically sets the OpenAPI format to 'int64' for 64-bit signed integers.
|
|
272
|
+
*
|
|
273
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Integer Type}
|
|
274
|
+
*/
|
|
275
|
+
export declare const ResourcefulBigintType: CallableNewable<ResourcefulBigintTypeOptions, BaseClass>;
|
|
276
|
+
/**
|
|
277
|
+
* Instance type for ResourcefulBigintType with validated properties.
|
|
278
|
+
* Represents 64-bit signed integers as defined in the OpenAPI 3.0 specification.
|
|
279
|
+
*
|
|
280
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Integer Type}
|
|
281
|
+
*/
|
|
282
|
+
export interface ResourcefulBigintType extends ResourcefulBigintTypeOptions {
|
|
283
|
+
type: 'integer';
|
|
284
|
+
format: 'int64';
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Configuration options for ResourcefulUnsignedIntegerType instances.
|
|
288
|
+
* Defines validation rules and constraints for unsigned integer fields in OpenAPI schemas.
|
|
289
|
+
*
|
|
290
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Integer Type}
|
|
291
|
+
*/
|
|
292
|
+
export interface ResourcefulUnsignedIntegerTypeOptions extends BaseInterface {
|
|
293
|
+
/** Minimum value constraint for the unsigned integer */
|
|
294
|
+
minimum: number;
|
|
295
|
+
/** Whether the minimum value is exclusive (value must be greater than minimum) */
|
|
296
|
+
exclusiveMinimum: boolean;
|
|
297
|
+
/** Maximum value constraint for the unsigned integer */
|
|
298
|
+
maximum: number;
|
|
299
|
+
/** Whether the maximum value is exclusive (value must be less than maximum) */
|
|
300
|
+
exclusiveMaximum: boolean;
|
|
301
|
+
/** Value must be a multiple of this number */
|
|
302
|
+
multipleOf: number;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Callable constructor for creating validated unsigned integer type instances.
|
|
306
|
+
* Represents unsigned integers without a specific OpenAPI format constraint.
|
|
307
|
+
*
|
|
308
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Integer Type}
|
|
309
|
+
*/
|
|
310
|
+
export declare const ResourcefulUnsignedIntegerType: CallableNewable<ResourcefulUnsignedIntegerTypeOptions, BaseClass>;
|
|
311
|
+
/**
|
|
312
|
+
* Instance type for ResourcefulUnsignedIntegerType with validated properties.
|
|
313
|
+
* Represents unsigned integers as defined in the OpenAPI 3.0 specification.
|
|
314
|
+
*
|
|
315
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#numbers | OpenAPI 3.0 Integer Type}
|
|
316
|
+
*/
|
|
317
|
+
export interface ResourcefulUnsignedIntegerType extends ResourcefulUnsignedIntegerTypeOptions {
|
|
318
|
+
type: 'integer';
|
|
319
|
+
format: never;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Configuration options for ResourcefulBooleanType instances.
|
|
323
|
+
* Currently has no specific configuration options as boolean types are straightforward.
|
|
324
|
+
*
|
|
325
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#boolean | OpenAPI 3.0 Boolean Type}
|
|
326
|
+
*/
|
|
327
|
+
export interface ResourcefulBooleanTypeOptions extends BaseInterface {
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Callable constructor for creating validated boolean type instances.
|
|
331
|
+
* Represents simple true/false values in OpenAPI schemas.
|
|
332
|
+
*
|
|
333
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#boolean | OpenAPI 3.0 Boolean Type}
|
|
334
|
+
*/
|
|
335
|
+
export declare const ResourcefulBooleanType: CallableNewable<ResourcefulBooleanTypeOptions, BaseClass>;
|
|
336
|
+
/**
|
|
337
|
+
* Instance type for ResourcefulBooleanType with validated properties.
|
|
338
|
+
* Represents boolean true/false values as defined in the OpenAPI 3.0 specification.
|
|
339
|
+
*
|
|
340
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#boolean | OpenAPI 3.0 Boolean Type}
|
|
341
|
+
*/
|
|
342
|
+
export interface ResourcefulBooleanType extends ResourcefulBooleanTypeOptions {
|
|
343
|
+
type: 'boolean';
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Configuration options for ResourcefulObjectType instances.
|
|
347
|
+
* Defines complex object schemas with typed properties and validation rules.
|
|
348
|
+
* Supports advanced OpenAPI features like oneOf, allOf, anyOf, and not operators.
|
|
349
|
+
*
|
|
350
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#object | OpenAPI 3.0 Object Type}
|
|
351
|
+
*/
|
|
352
|
+
export interface ResourcefulObjectTypeOptions extends BaseInterface {
|
|
353
|
+
/** Object properties definition supporting direct data types and composition patterns */
|
|
354
|
+
properties: {
|
|
355
|
+
[key: string]: ResourcefulDataType | {
|
|
356
|
+
oneOf: Array<ResourcefulDataType>;
|
|
357
|
+
} | {
|
|
358
|
+
allOf: Array<ResourcefulDataType>;
|
|
359
|
+
} | {
|
|
360
|
+
anyOf: Array<ResourcefulDataType>;
|
|
361
|
+
} | {
|
|
362
|
+
not: Array<ResourcefulDataType>;
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
/** Array of property names that are required for object validation */
|
|
366
|
+
required?: string[];
|
|
367
|
+
/** Whether additional properties beyond those defined are allowed, or direct data type for additional properties */
|
|
368
|
+
additionalProperties?: boolean | ResourcefulDataType;
|
|
369
|
+
/** Minimum number of properties required in the object */
|
|
370
|
+
minProperties?: number;
|
|
371
|
+
/** Maximum number of properties allowed in the object */
|
|
372
|
+
maxProperties?: number;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Callable constructor for creating validated object type instances.
|
|
376
|
+
* Supports complex nested object schemas with property validation and constraints.
|
|
377
|
+
*
|
|
378
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#object | OpenAPI 3.0 Object Type}
|
|
379
|
+
*/
|
|
380
|
+
export declare const ResourcefulObjectType: CallableNewable<ResourcefulObjectTypeOptions, BaseClass>;
|
|
381
|
+
/**
|
|
382
|
+
* Instance type for ResourcefulObjectType with validated properties.
|
|
383
|
+
* Represents complex object schemas with typed properties as defined in the OpenAPI 3.0 specification.
|
|
384
|
+
*
|
|
385
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#object | OpenAPI 3.0 Object Type}
|
|
386
|
+
*/
|
|
387
|
+
export interface ResourcefulObjectType extends ResourcefulObjectTypeOptions {
|
|
388
|
+
type: 'object';
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Configuration options for ResourcefulArrayType instances.
|
|
392
|
+
* Defines array schemas with typed items and validation constraints.
|
|
393
|
+
* Supports complex item types including nested objects and arrays.
|
|
394
|
+
*
|
|
395
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#array | OpenAPI 3.0 Array Type}
|
|
396
|
+
*/
|
|
397
|
+
export interface ResourcefulArrayTypeOptions extends BaseInterface {
|
|
398
|
+
/** Type specification for array items, supporting all resourceful data types and composition patterns */
|
|
399
|
+
items: ResourcefulDataType | {
|
|
400
|
+
oneOf: Array<ResourcefulDataType>;
|
|
401
|
+
} | {
|
|
402
|
+
allOf: Array<ResourcefulDataType>;
|
|
403
|
+
} | {
|
|
404
|
+
anyOf: Array<ResourcefulDataType>;
|
|
405
|
+
} | {
|
|
406
|
+
not: Array<ResourcefulDataType>;
|
|
407
|
+
};
|
|
408
|
+
/** Minimum number of items required in the array */
|
|
409
|
+
minItems?: number;
|
|
410
|
+
/** Maximum number of items allowed in the array */
|
|
411
|
+
maxItems?: number;
|
|
412
|
+
/** Whether all items in the array must be unique */
|
|
413
|
+
uniqueItems?: boolean;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Callable constructor for creating validated array type instances.
|
|
417
|
+
* Supports arrays with typed items and validation constraints like minimum/maximum length.
|
|
418
|
+
*
|
|
419
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#array | OpenAPI 3.0 Array Type}
|
|
420
|
+
*/
|
|
421
|
+
export declare const ResourcefulArrayType: CallableNewable<ResourcefulArrayTypeOptions, BaseClass>;
|
|
422
|
+
/**
|
|
423
|
+
* Instance type for ResourcefulArrayType with validated properties.
|
|
424
|
+
* Represents arrays with typed items and validation constraints as defined in the OpenAPI 3.0 specification.
|
|
425
|
+
*
|
|
426
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/#array | OpenAPI 3.0 Array Type}
|
|
427
|
+
*/
|
|
428
|
+
export interface ResourcefulArrayType extends ResourcefulArrayTypeOptions {
|
|
429
|
+
type: 'array';
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Union type representing all available resourceful data types.
|
|
433
|
+
* Provides a comprehensive type for working with any resourceful data type instance.
|
|
434
|
+
*
|
|
435
|
+
* @see {@link https://swagger.io/docs/specification/v3_0/data-models/data-types/ | OpenAPI 3.0 Data Types}
|
|
436
|
+
*/
|
|
437
|
+
export type ResourcefulDataType = ResourcefulStringType | ResourcefulDateType | ResourcefulDateTimeType | ResourcefulBinaryType | ResourcefulNumberType | ResourcefulIntegerType | ResourcefulBigintType | ResourcefulUnsignedIntegerType | ResourcefulBooleanType | ResourcefulObjectType | ResourcefulArrayType;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ObjectSchema } from 'joi';
|
|
2
|
+
export declare const validateNormalizeAndCastDecoratorOptions: <InputType, OutputType>(fieldName: string, decoratorName: string, schema: ObjectSchema, input: InputType) => OutputType;
|
|
3
|
+
export declare const resourcefulColumnDefinitionSchema: ObjectSchema<any>;
|
|
4
|
+
export declare const resourcefulColumnOptionsSchema: ObjectSchema<any>;
|
|
5
|
+
export declare const dataTypeColumnOptionsSchema: ObjectSchema<any>;
|
|
6
|
+
export declare const stringColumnOptionsSchema: ObjectSchema<any>;
|
|
7
|
+
export declare const dateColumnOptionsSchema: ObjectSchema<any>;
|
|
8
|
+
export declare const dateTimeColumnOptionsSchema: ObjectSchema<any>;
|
|
9
|
+
export declare const binaryColumnOptionsSchema: ObjectSchema<any>;
|
|
10
|
+
export declare const numberColumnOptionsSchema: ObjectSchema<any>;
|
|
11
|
+
export declare const integerColumnOptionsSchema: ObjectSchema<any>;
|
|
12
|
+
export declare const bigintColumnOptionsSchema: ObjectSchema<any>;
|
|
13
|
+
export declare const unsignedIntegerColumnOptionsSchema: ObjectSchema<any>;
|
|
14
|
+
export declare const booleanColumnOptionsSchema: ObjectSchema<any>;
|
|
15
|
+
export declare const objectColumnOptionsSchema: ObjectSchema<any>;
|
|
16
|
+
export declare const arrayColumnOptionsSchema: ObjectSchema<any>;
|
|
17
|
+
export declare const resourcefulComputedDefinitionSchema: ObjectSchema<any>;
|
|
18
|
+
export declare const resourcefulComputedOptionsSchema: ObjectSchema<any>;
|
|
19
|
+
export declare const dataTypeComputedOptionsSchema: ObjectSchema<any>;
|
|
20
|
+
export declare const stringComputedOptionsSchema: ObjectSchema<any>;
|
|
21
|
+
export declare const dateComputedOptionsSchema: ObjectSchema<any>;
|
|
22
|
+
export declare const dateTimeComputedOptionsSchema: ObjectSchema<any>;
|
|
23
|
+
export declare const binaryComputedOptionsSchema: ObjectSchema<any>;
|
|
24
|
+
export declare const numberComputedOptionsSchema: ObjectSchema<any>;
|
|
25
|
+
export declare const integerComputedOptionsSchema: ObjectSchema<any>;
|
|
26
|
+
export declare const bigintComputedOptionsSchema: ObjectSchema<any>;
|
|
27
|
+
export declare const unsignedIntegerComputedOptionsSchema: ObjectSchema<any>;
|
|
28
|
+
export declare const booleanComputedOptionsSchema: ObjectSchema<any>;
|
|
29
|
+
export declare const objectComputedOptionsSchema: ObjectSchema<any>;
|
|
30
|
+
export declare const arrayComputedOptionsSchema: ObjectSchema<any>;
|
|
31
|
+
export declare const resourcefulRelationshipOptionsSchema: ObjectSchema<any>;
|
|
32
|
+
export declare const relationOptionsSchema: ObjectSchema<any>;
|
|
33
|
+
export declare const manyToManyRelationOptionsSchema: ObjectSchema<any>;
|
|
34
|
+
export declare const hasManyThroughRelationOptionsSchema: ObjectSchema<any>;
|