@nhtio/validation 0.1.0-master-952eca46 → 0.1.0-master-b4207fd6
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/index.cjs +85585 -84041
- package/index.cjs.map +1 -1
- package/index.d.mts +13349 -0
- package/index.mjs +85599 -84051
- package/index.mjs.map +1 -1
- package/package.json +5 -3
- package/index.d.ts +0 -36
- package/private/core/errors.d.ts +0 -4
- package/private/core/manifest.d.ts +0 -1
- package/private/core/root.d.ts +0 -56
- package/private/guards.d.ts +0 -67
- package/private/index.d.ts +0 -245
- package/private/libs/knex/client.d.ts +0 -62
- package/private/libs/knex/index.d.ts +0 -10
- package/private/libs/knex/logger.d.ts +0 -15
- package/private/libs/knex/make_knex.d.ts +0 -2
- package/private/libs/knex/transaction.d.ts +0 -37
- package/private/patches/fqdn.d.ts +0 -5
- package/private/patches/i18n.d.ts +0 -51
- package/private/patches/index.d.ts +0 -3
- package/private/patches/json.d.ts +0 -2
- package/private/patches/knex.d.ts +0 -16
- package/private/schemas/bigint.d.ts +0 -95
- package/private/schemas/datetime.d.ts +0 -654
- package/private/schemas/phone.d.ts +0 -199
- package/private/schemas.d.ts +0 -840
- package/private/types.d.ts +0 -69
- package/private/utils.d.ts +0 -186
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { AnySchema } from '../schemas';
|
|
2
|
-
import type { ExtensionFactory, Reference } from 'joi';
|
|
3
|
-
export declare const messages: {
|
|
4
|
-
'bigint.base': string;
|
|
5
|
-
'bigint.greater': string;
|
|
6
|
-
'bigint.less': string;
|
|
7
|
-
'bigint.max': string;
|
|
8
|
-
'bigint.min': string;
|
|
9
|
-
'bigint.multiple': string;
|
|
10
|
-
'bigint.negative': string;
|
|
11
|
-
'bigint.positive': string;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* A Joi extension that adds support for BigInt validation with comprehensive
|
|
15
|
-
* comparison operations and type coercion.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* import { validator } from '@nhtio/validation'
|
|
20
|
-
*
|
|
21
|
-
* const schema = validator.bigint()
|
|
22
|
-
* .min(0n)
|
|
23
|
-
* .max(1000n)
|
|
24
|
-
* .required()
|
|
25
|
-
*
|
|
26
|
-
* // Validates and converts to BigInt
|
|
27
|
-
* const result = schema.validate("123") // Returns { value: 123n }
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```typescript
|
|
32
|
-
* // Works with all standard Joi methods
|
|
33
|
-
* const optionalSchema = validator.bigint()
|
|
34
|
-
* .positive()
|
|
35
|
-
* .optional()
|
|
36
|
-
* .allow(null)
|
|
37
|
-
* .default(0n)
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @public
|
|
41
|
-
*/
|
|
42
|
-
export declare const bigint: ExtensionFactory;
|
|
43
|
-
/**
|
|
44
|
-
* Schema type for BigInt validation with comprehensive comparison operations.
|
|
45
|
-
*
|
|
46
|
-
* This interface extends the base Joi AnySchema to provide BigInt-specific
|
|
47
|
-
* validation methods including range checks, sign validation, and multiple checks.
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```typescript
|
|
51
|
-
* import { validator } from '@nhtio/validation'
|
|
52
|
-
*
|
|
53
|
-
* const schema: BigIntSchema = validator.bigint()
|
|
54
|
-
* .min(0n)
|
|
55
|
-
* .max(1000n)
|
|
56
|
-
* .positive()
|
|
57
|
-
* ```
|
|
58
|
-
*
|
|
59
|
-
* @public
|
|
60
|
-
*/
|
|
61
|
-
export interface BigIntSchema<TSchema = bigint> extends AnySchema<TSchema> {
|
|
62
|
-
/**
|
|
63
|
-
* Validates that the BigInt is greater than the specified threshold
|
|
64
|
-
* @param limit - The threshold value to compare against
|
|
65
|
-
*/
|
|
66
|
-
greater(limit: bigint | Reference): this;
|
|
67
|
-
/**
|
|
68
|
-
* Validates that the BigInt is less than the specified threshold
|
|
69
|
-
* @param limit - The threshold value to compare against
|
|
70
|
-
*/
|
|
71
|
-
less(limit: bigint | Reference): this;
|
|
72
|
-
/**
|
|
73
|
-
* Validates that the BigInt is less than or equal to the specified maximum
|
|
74
|
-
* @param limit - The maximum allowed value
|
|
75
|
-
*/
|
|
76
|
-
max(limit: bigint | Reference): this;
|
|
77
|
-
/**
|
|
78
|
-
* Validates that the BigInt is greater than or equal to the specified minimum
|
|
79
|
-
* @param limit - The minimum allowed value
|
|
80
|
-
*/
|
|
81
|
-
min(limit: bigint | Reference): this;
|
|
82
|
-
/**
|
|
83
|
-
* Validates that the BigInt is a multiple of the specified factor
|
|
84
|
-
* @param limit - The factor that the value must be a multiple of
|
|
85
|
-
*/
|
|
86
|
-
multiple(limit: bigint | Reference): this;
|
|
87
|
-
/**
|
|
88
|
-
* Validates that the BigInt is negative (less than zero)
|
|
89
|
-
*/
|
|
90
|
-
negative(): this;
|
|
91
|
-
/**
|
|
92
|
-
* Validates that the BigInt is positive (greater than zero)
|
|
93
|
-
*/
|
|
94
|
-
positive(): this;
|
|
95
|
-
}
|