@c9up/rune 0.1.5 → 0.1.7
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/dist/MessagesProvider.d.ts +40 -0
- package/dist/MessagesProvider.d.ts.map +1 -0
- package/dist/MessagesProvider.js +77 -0
- package/dist/MessagesProvider.js.map +1 -0
- package/dist/Schema.d.ts +226 -27
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +688 -134
- package/dist/Schema.js.map +1 -1
- package/dist/errors.d.ts +32 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +27 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/index.darwin-arm64.node +0 -0
- package/index.darwin-x64.node +0 -0
- package/index.linux-arm64-gnu.node +0 -0
- package/index.linux-x64-gnu.node +0 -0
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +3 -1
- package/src/MessagesProvider.ts +115 -0
- package/src/Schema.ts +965 -154
- package/src/errors.ts +48 -0
- package/src/index.ts +9 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SimpleMessagesProvider — VineJS-compatible message lookup.
|
|
3
|
+
*
|
|
4
|
+
* Resolves an error message for a `(rule, field)` pair using a `'field.rule'`
|
|
5
|
+
* → template map, human-readable field labels, wildcard (`*`) segments for
|
|
6
|
+
* array items, and mustache `{{ field }}` interpolation. Mirrors
|
|
7
|
+
* `@vinejs/vine`'s provider so validators authored against Vine's message
|
|
8
|
+
* conventions behave identically here.
|
|
9
|
+
*/
|
|
10
|
+
/** Rule name → message template, e.g. `{ required: 'The {{ field }} is required' }`. */
|
|
11
|
+
export type ValidationMessages = Record<string, string>;
|
|
12
|
+
/** Field path → human label, e.g. `{ 'user.email': 'Email address' }`. */
|
|
13
|
+
export type ValidationFields = Record<string, string>;
|
|
14
|
+
/** Interpolation values handed to a message template. */
|
|
15
|
+
export type MessageArgs = Record<string, unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Contract any messages provider must satisfy — a single `getMessage` lookup.
|
|
18
|
+
* Keeping it an interface lets consumers swap in their own (e.g. i18n-backed)
|
|
19
|
+
* provider without importing the concrete class.
|
|
20
|
+
*/
|
|
21
|
+
export interface MessagesProviderContract {
|
|
22
|
+
getMessage(rawMessage: string, rule: string, field: string, args?: MessageArgs): string;
|
|
23
|
+
}
|
|
24
|
+
export declare class SimpleMessagesProvider implements MessagesProviderContract {
|
|
25
|
+
#private;
|
|
26
|
+
constructor(messages: ValidationMessages, fields?: ValidationFields);
|
|
27
|
+
/**
|
|
28
|
+
* Resolve a message. Priority (VineJS order):
|
|
29
|
+
* 1. field-specific `user.email.required`
|
|
30
|
+
* 2. wildcard path `*.required` / `tags.*.minLength`
|
|
31
|
+
* 3. generic rule `required`
|
|
32
|
+
* 4. raw rule message (fallback)
|
|
33
|
+
*/
|
|
34
|
+
getMessage(rawMessage: string, rule: string, field: string, args?: MessageArgs): string;
|
|
35
|
+
toJSON(): {
|
|
36
|
+
messages: ValidationMessages;
|
|
37
|
+
fields: ValidationFields;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=MessagesProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessagesProvider.d.ts","sourceRoot":"","sources":["../src/MessagesProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,wFAAwF;AACxF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACxD,0EAA0E;AAC1E,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEtD,yDAAyD;AACzD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAOlD;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACxC,UAAU,CACT,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,WAAW,GAChB,MAAM,CAAC;CACV;AAaD,qBAAa,sBAAuB,YAAW,wBAAwB;;gBAI1D,QAAQ,EAAE,kBAAkB,EAAE,MAAM,CAAC,EAAE,gBAAgB;IAuBnE;;;;;;OAMG;IACH,UAAU,CACT,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,WAAW,GAChB,MAAM;IAwBT,MAAM,IAAI;QAAE,QAAQ,EAAE,kBAAkB,CAAC;QAAC,MAAM,EAAE,gBAAgB,CAAA;KAAE;CAGpE"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SimpleMessagesProvider — VineJS-compatible message lookup.
|
|
3
|
+
*
|
|
4
|
+
* Resolves an error message for a `(rule, field)` pair using a `'field.rule'`
|
|
5
|
+
* → template map, human-readable field labels, wildcard (`*`) segments for
|
|
6
|
+
* array items, and mustache `{{ field }}` interpolation. Mirrors
|
|
7
|
+
* `@vinejs/vine`'s provider so validators authored against Vine's message
|
|
8
|
+
* conventions behave identically here.
|
|
9
|
+
*/
|
|
10
|
+
/** Narrow to a plain record so dotted-path interpolation can index it. */
|
|
11
|
+
function isRecord(value) {
|
|
12
|
+
return typeof value === "object" && value !== null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Replace a dotted field path's numeric segments with `*` so array items share
|
|
16
|
+
* a single wildcard message key — `tags.0.name` → `tags.*.name` (VineJS parity).
|
|
17
|
+
*/
|
|
18
|
+
function toWildcardPath(field) {
|
|
19
|
+
return field
|
|
20
|
+
.split(".")
|
|
21
|
+
.map((segment) => (/^\d+$/.test(segment) ? "*" : segment))
|
|
22
|
+
.join(".");
|
|
23
|
+
}
|
|
24
|
+
export class SimpleMessagesProvider {
|
|
25
|
+
#messages;
|
|
26
|
+
#fields;
|
|
27
|
+
constructor(messages, fields) {
|
|
28
|
+
this.#messages = messages;
|
|
29
|
+
this.#fields = fields ?? {};
|
|
30
|
+
}
|
|
31
|
+
/** Mustache-style `{{ token }}` interpolation with dotted-path lookup. */
|
|
32
|
+
#interpolate(message, data) {
|
|
33
|
+
if (!message.includes("{{")) {
|
|
34
|
+
return message;
|
|
35
|
+
}
|
|
36
|
+
return message.replace(/{{(.*?)}}/g, (_match, rawKey) => {
|
|
37
|
+
const tokens = rawKey.trim().split(".");
|
|
38
|
+
let output = data;
|
|
39
|
+
for (const token of tokens) {
|
|
40
|
+
if (!isRecord(output)) {
|
|
41
|
+
return "";
|
|
42
|
+
}
|
|
43
|
+
output = Object.hasOwn(output, token) ? output[token] : undefined;
|
|
44
|
+
}
|
|
45
|
+
return output === undefined || output === null ? "" : String(output);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Resolve a message. Priority (VineJS order):
|
|
50
|
+
* 1. field-specific `user.email.required`
|
|
51
|
+
* 2. wildcard path `*.required` / `tags.*.minLength`
|
|
52
|
+
* 3. generic rule `required`
|
|
53
|
+
* 4. raw rule message (fallback)
|
|
54
|
+
*/
|
|
55
|
+
getMessage(rawMessage, rule, field, args) {
|
|
56
|
+
const fieldName = this.#fields[field] ?? field;
|
|
57
|
+
const data = { field: fieldName, ...args };
|
|
58
|
+
const fieldMessage = this.#messages[`${field}.${rule}`];
|
|
59
|
+
if (fieldMessage !== undefined) {
|
|
60
|
+
return this.#interpolate(fieldMessage, data);
|
|
61
|
+
}
|
|
62
|
+
const wildcard = toWildcardPath(field);
|
|
63
|
+
const wildcardMessage = wildcard !== field ? this.#messages[`${wildcard}.${rule}`] : undefined;
|
|
64
|
+
if (wildcardMessage !== undefined) {
|
|
65
|
+
return this.#interpolate(wildcardMessage, data);
|
|
66
|
+
}
|
|
67
|
+
const ruleMessage = this.#messages[rule];
|
|
68
|
+
if (ruleMessage !== undefined) {
|
|
69
|
+
return this.#interpolate(ruleMessage, data);
|
|
70
|
+
}
|
|
71
|
+
return this.#interpolate(rawMessage, data);
|
|
72
|
+
}
|
|
73
|
+
toJSON() {
|
|
74
|
+
return { messages: this.#messages, fields: this.#fields };
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=MessagesProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessagesProvider.js","sourceRoot":"","sources":["../src/MessagesProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,0EAA0E;AAC1E,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACpD,CAAC;AAgBD;;;GAGG;AACH,SAAS,cAAc,CAAC,KAAa;IACpC,OAAO,KAAK;SACV,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;SACzD,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,CAAC;AAED,MAAM,OAAO,sBAAsB;IACzB,SAAS,CAAqB;IAC9B,OAAO,CAAmB;IAEnC,YAAY,QAA4B,EAAE,MAAyB;QAClE,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,0EAA0E;IAC1E,YAAY,CAAC,OAAe,EAAE,IAAiB;QAC9C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7B,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAc,EAAE,EA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C;QACxE,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM;QACL,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IAC3D,CAAC;CACD"}
|
package/dist/Schema.d.ts
CHANGED
|
@@ -3,13 +3,67 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @implements FR38, FR39, FR40, FR41
|
|
5
5
|
*/
|
|
6
|
+
import type { MessagesProviderContract } from "./MessagesProvider.js";
|
|
6
7
|
export type ValidationMessageParams = Record<string, string | number | boolean>;
|
|
7
8
|
export type ValidationTranslator = (key: string, params?: ValidationMessageParams) => string | undefined;
|
|
8
9
|
export interface ValidationError {
|
|
9
10
|
field: string;
|
|
10
11
|
rule: string;
|
|
11
12
|
message: string;
|
|
13
|
+
/** Array index when the field is an array item (VineJS parity). */
|
|
14
|
+
index?: number;
|
|
15
|
+
/** Rule metadata carried for reporters/i18n (e.g. `{ min: 3 }`). */
|
|
16
|
+
meta?: Record<string, unknown>;
|
|
12
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Field context handed to `.use()` rules — mirrors VineJS's field context. It
|
|
20
|
+
* exposes the value plus the surrounding data so a rule can validate across
|
|
21
|
+
* fields (e.g. `password === passwordConfirmation`), and a `report()` sink to
|
|
22
|
+
* raise errors (VineJS reports instead of returning a boolean).
|
|
23
|
+
*/
|
|
24
|
+
export interface FieldContext {
|
|
25
|
+
/** The current field value (post-transform). */
|
|
26
|
+
value: unknown;
|
|
27
|
+
/** The root object being validated. Shared across fields — do NOT mutate. */
|
|
28
|
+
data: Record<string, unknown>;
|
|
29
|
+
/** The immediate parent container of this field (object or array). */
|
|
30
|
+
parent: Record<string, unknown> | unknown[];
|
|
31
|
+
/** Dotted path to the field, e.g. `address.city` or `tags.0`. */
|
|
32
|
+
field: string;
|
|
33
|
+
/** Runtime metadata passed to `validate(data, { meta })`. */
|
|
34
|
+
meta: Record<string, unknown>;
|
|
35
|
+
/** `true` while no error has been reported for this field yet. */
|
|
36
|
+
isValid: boolean;
|
|
37
|
+
/** Report a validation failure for this field. */
|
|
38
|
+
report(message: string, rule: string): void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A `.use()` rule validator — VineJS shape `(value, options, field)`. Report
|
|
42
|
+
* failures via `field.report(...)`; the return value is ignored.
|
|
43
|
+
*/
|
|
44
|
+
export type RuleValidator<Options = undefined> = (value: unknown, options: Options, field: FieldContext) => void;
|
|
45
|
+
/** A compiled `.use()` rule produced by {@link createRule}. */
|
|
46
|
+
export interface CompiledRule {
|
|
47
|
+
readonly __rune: "rule";
|
|
48
|
+
run(value: unknown, field: FieldContext): void;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Turn a validator function into a reusable `.use()` rule — VineJS's
|
|
52
|
+
* `createRule`. Returns a factory: call it with the rule's options to get a
|
|
53
|
+
* `CompiledRule`, then attach it with `chain.use(rule(options))`.
|
|
54
|
+
*
|
|
55
|
+
* const sameAs = createRule<string>((value, other, field) => {
|
|
56
|
+
* if (value !== field.data[other]) {
|
|
57
|
+
* field.report(`Must match ${other}`, 'sameAs')
|
|
58
|
+
* }
|
|
59
|
+
* })
|
|
60
|
+
* schema({
|
|
61
|
+
* password: rules.string().min(8),
|
|
62
|
+
* passwordConfirmation: rules.string().use(sameAs('password')),
|
|
63
|
+
* })
|
|
64
|
+
*/
|
|
65
|
+
export declare function createRule(validator: RuleValidator<undefined>): () => CompiledRule;
|
|
66
|
+
export declare function createRule<Options>(validator: RuleValidator<Options>): (options: Options) => CompiledRule;
|
|
13
67
|
/**
|
|
14
68
|
* Validation result — discriminated union that narrows `data` to the schema's
|
|
15
69
|
* `T` when `valid` is `true`, removing the need for callers to cast or guard
|
|
@@ -24,26 +78,73 @@ export type ValidationResult<T = Record<string, unknown>> = {
|
|
|
24
78
|
errors: ValidationError[];
|
|
25
79
|
data?: undefined;
|
|
26
80
|
};
|
|
81
|
+
/** Options for {@link ValidationSchema.validate}. */
|
|
82
|
+
export interface ValidateOptions {
|
|
83
|
+
/** Runtime metadata exposed to `.use()` rules via `field.meta` (VineJS parity). */
|
|
84
|
+
meta?: Record<string, unknown>;
|
|
85
|
+
/**
|
|
86
|
+
* VineJS-style messages provider. When supplied, default rule messages are
|
|
87
|
+
* resolved through it (custom `.message()` overrides still win, and the
|
|
88
|
+
* provider takes precedence over a globally bound translator).
|
|
89
|
+
*/
|
|
90
|
+
messagesProvider?: MessagesProviderContract;
|
|
91
|
+
}
|
|
27
92
|
export interface ValidationSchema<T = Record<string, unknown>> {
|
|
28
93
|
fields: Record<string, RuleChain>;
|
|
29
|
-
|
|
94
|
+
/** Result-based validation (superset) — never throws. */
|
|
95
|
+
validate(data: unknown, options?: ValidateOptions): ValidationResult<T>;
|
|
96
|
+
/**
|
|
97
|
+
* Throwing validation (VineJS/Adonis parity). Returns the validated data on
|
|
98
|
+
* success; throws {@link RuneValidationError} (`E_VALIDATION_ERROR`, HTTP 422)
|
|
99
|
+
* with a structured `.messages` array on failure.
|
|
100
|
+
*/
|
|
101
|
+
validateOrThrow(data: unknown, options?: ValidateOptions): T;
|
|
102
|
+
}
|
|
103
|
+
/** Context threaded through validation so field rules can reach root/parent/meta. */
|
|
104
|
+
interface RunContext {
|
|
105
|
+
data: Record<string, unknown>;
|
|
106
|
+
parent: Record<string, unknown> | unknown[];
|
|
107
|
+
meta: Record<string, unknown>;
|
|
108
|
+
messagesProvider?: MessagesProviderContract;
|
|
30
109
|
}
|
|
110
|
+
/** Extract the phantom output type of a chain. */
|
|
111
|
+
type OutputOf<C> = C extends RuleChain<infer O> ? O : never;
|
|
112
|
+
/** Keys whose output includes `undefined` become optional in the inferred shape. */
|
|
113
|
+
type OptionalKeys<S> = {
|
|
114
|
+
[K in keyof S]: undefined extends OutputOf<S[K]> ? K : never;
|
|
115
|
+
}[keyof S];
|
|
116
|
+
/** Flatten an intersection into a single readable object type. */
|
|
117
|
+
type Prettify<T> = {
|
|
118
|
+
[K in keyof T]: T[K];
|
|
119
|
+
} & unknown;
|
|
120
|
+
/**
|
|
121
|
+
* Infer the validated data shape from a schema's field map — the type
|
|
122
|
+
* `result.data` carries once `result.valid === true`. `rules.string()` →
|
|
123
|
+
* `string`, `.optional()` → an optional key, `.nullable()` → `T | null`,
|
|
124
|
+
* `.object(shape)`/`.array(item)` recurse.
|
|
125
|
+
*/
|
|
126
|
+
export type Infer<S> = Prettify<{
|
|
127
|
+
[K in Exclude<keyof S, OptionalKeys<S>>]: OutputOf<S[K]>;
|
|
128
|
+
} & {
|
|
129
|
+
[K in OptionalKeys<S>]?: Exclude<OutputOf<S[K]>, undefined>;
|
|
130
|
+
}>;
|
|
31
131
|
/**
|
|
32
132
|
* Create a validation schema.
|
|
33
133
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
134
|
+
* The field map's rule chains are phantom-typed, so `result.data` is inferred
|
|
135
|
+
* automatically — `schema({ email: rules.string(), age: rules.number() })`
|
|
136
|
+
* types `data` as `{ email: string; age: number }` with no manual generic.
|
|
37
137
|
*
|
|
38
|
-
* const RegisterValidator = schema
|
|
138
|
+
* const RegisterValidator = schema({
|
|
39
139
|
* email: rules.string().email(),
|
|
40
|
-
*
|
|
140
|
+
* age: rules.number().optional(),
|
|
41
141
|
* });
|
|
142
|
+
* // Infer<typeof RegisterValidator> not needed — result.data is typed.
|
|
42
143
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* own narrowing continue to compile.
|
|
144
|
+
* An explicit generic is still accepted for back-compat
|
|
145
|
+
* (`schema<MyType>({ ... })`), overriding inference.
|
|
46
146
|
*/
|
|
147
|
+
export declare function schema<S extends Record<string, RuleChain>>(fields: S): ValidationSchema<Infer<S>>;
|
|
47
148
|
export declare function schema<T = Record<string, unknown>>(fields: Record<string, RuleChain>): ValidationSchema<T>;
|
|
48
149
|
export declare function setValidationTranslator(translator?: ValidationTranslator): void;
|
|
49
150
|
export declare function bindRosetta(rosetta: {
|
|
@@ -53,47 +154,138 @@ export declare function bindRosetta(rosetta: {
|
|
|
53
154
|
export interface RuleDef {
|
|
54
155
|
name: string;
|
|
55
156
|
param?: number;
|
|
157
|
+
/** Interpolation args exposed to i18n/messages providers (e.g. `{ min: 3 }`). */
|
|
158
|
+
args?: Record<string, unknown>;
|
|
56
159
|
validate: (value: unknown) => boolean;
|
|
57
160
|
message: string;
|
|
161
|
+
/** Set when `.message()` overrode this rule's default text. */
|
|
162
|
+
hasCustomMessage?: boolean;
|
|
163
|
+
}
|
|
164
|
+
/** A conditional-required condition (VineJS `requiredWhen` family). */
|
|
165
|
+
interface RequiredCondition {
|
|
166
|
+
kind: "exists" | "missing" | "when";
|
|
167
|
+
otherField: string;
|
|
168
|
+
operator?: "=" | "!=" | ">" | "<" | ">=" | "<=" | "in" | "notIn";
|
|
169
|
+
value?: unknown;
|
|
58
170
|
}
|
|
59
|
-
/**
|
|
60
|
-
|
|
171
|
+
/** Phantom brand carrying the inferred output type (never assigned at runtime). */
|
|
172
|
+
declare const OUTPUT: unique symbol;
|
|
173
|
+
/** Rule chain — fluent, phantom-typed validation builder. */
|
|
174
|
+
export declare class RuleChain<Output = unknown> {
|
|
61
175
|
#private;
|
|
176
|
+
/** Phantom output type — drives {@link Infer}; never read at runtime. */
|
|
177
|
+
readonly [OUTPUT]: Output;
|
|
62
178
|
/** Public read access to rules (for OpenAPI generation, Rust bridge). */
|
|
63
179
|
get rules(): readonly RuleDef[];
|
|
64
180
|
get isOptionalField(): boolean;
|
|
181
|
+
/** Public read access to the `.nullable()` flag (keeps such schemas off the native path). */
|
|
182
|
+
get isNullable(): boolean;
|
|
65
183
|
get transforms(): ReadonlyArray<{
|
|
66
184
|
name: string;
|
|
67
|
-
fn: (value: unknown) => unknown;
|
|
185
|
+
fn: (value: unknown, field: FieldContext) => unknown;
|
|
68
186
|
}>;
|
|
69
|
-
/**
|
|
70
|
-
|
|
187
|
+
/** Public read access to `.use()` rules (used to keep such schemas off the native path). */
|
|
188
|
+
get useRules(): readonly CompiledRule[];
|
|
189
|
+
/** Public read access to `.parse()` pre-transforms (kept off the native path). */
|
|
190
|
+
get preTransforms(): ReadonlyArray<(value: unknown) => unknown>;
|
|
191
|
+
/** Whether this chain carries a `requiredWhen`-family condition. */
|
|
192
|
+
get hasConditionalRequired(): boolean;
|
|
193
|
+
/** Mark field as optional (absent / `undefined` allowed). */
|
|
194
|
+
optional(): RuleChain<Output | undefined>;
|
|
195
|
+
/** Mark field as nullable (`null` allowed, kept in the output). */
|
|
196
|
+
nullable(): RuleChain<Output | null>;
|
|
197
|
+
/** Mark field as both optional and nullable. */
|
|
198
|
+
nullish(): RuleChain<Output | null | undefined>;
|
|
199
|
+
/** Stop at the first failing rule for this field (VineJS bail). */
|
|
200
|
+
bail(enabled?: boolean): this;
|
|
71
201
|
/** Must be an object matching a nested schema. */
|
|
72
|
-
object
|
|
202
|
+
object<Sh extends Record<string, RuleChain>>(shape: Sh): RuleChain<Infer<Sh>>;
|
|
73
203
|
/** Must be an array. Items validated by the provided chain. */
|
|
74
|
-
array(itemChain?:
|
|
204
|
+
array<Item extends RuleChain>(itemChain?: Item): RuleChain<OutputOf<Item>[]>;
|
|
75
205
|
/** Must be a string. */
|
|
76
|
-
string():
|
|
206
|
+
string(): RuleChain<string>;
|
|
77
207
|
/** Must be a number. */
|
|
78
|
-
number():
|
|
208
|
+
number(): RuleChain<number>;
|
|
79
209
|
/** Must be a boolean. */
|
|
80
|
-
boolean():
|
|
81
|
-
/**
|
|
210
|
+
boolean(): RuleChain<boolean>;
|
|
211
|
+
/** Must equal one of `values` (enum). Narrows the output to the union. */
|
|
212
|
+
enum<const V extends readonly (string | number | boolean)[]>(values: V): RuleChain<V[number]>;
|
|
213
|
+
/** Must equal a literal value. */
|
|
214
|
+
literal<V extends string | number | boolean>(value: V): RuleChain<V>;
|
|
215
|
+
/** Minimum length (string) or minimum value (number). Alias of min/minLength. */
|
|
82
216
|
min(n: number): this;
|
|
83
|
-
/** Maximum length (string) or maximum value (number). */
|
|
217
|
+
/** Maximum length (string) or maximum value (number). Alias of max/maxLength. */
|
|
84
218
|
max(n: number): this;
|
|
219
|
+
/** Minimum length for a string or array (VineJS `minLength`). */
|
|
220
|
+
minLength(n: number): this;
|
|
221
|
+
/** Maximum length for a string or array (VineJS `maxLength`). */
|
|
222
|
+
maxLength(n: number): this;
|
|
223
|
+
/** Exact length for a string or array (VineJS `fixedLength`). */
|
|
224
|
+
fixedLength(n: number): this;
|
|
85
225
|
/** Must be a valid email. */
|
|
86
226
|
email(): this;
|
|
87
|
-
/** Must
|
|
227
|
+
/** Must match a regular expression (TS-only — never dispatched to Rust). */
|
|
228
|
+
regex(pattern: RegExp): this;
|
|
229
|
+
/** Must be a valid URL (TS-only — uses the WHATWG URL parser). */
|
|
230
|
+
url(): this;
|
|
231
|
+
/** Must be a valid UUID. */
|
|
232
|
+
uuid(): this;
|
|
233
|
+
/** Must contain only ASCII letters. */
|
|
234
|
+
alpha(): this;
|
|
235
|
+
/** Must contain only ASCII letters and digits. */
|
|
236
|
+
alphaNumeric(): this;
|
|
237
|
+
/** String must start with `substring`. */
|
|
238
|
+
startsWith(substring: string): this;
|
|
239
|
+
/** String must end with `substring`. */
|
|
240
|
+
endsWith(substring: string): this;
|
|
241
|
+
/** Value must be one of `values`. */
|
|
242
|
+
in(values: ReadonlyArray<string | number | boolean>): this;
|
|
243
|
+
/** Value must NOT be one of `values`. */
|
|
244
|
+
notIn(values: ReadonlyArray<string | number | boolean>): this;
|
|
245
|
+
/** Number must be positive (> 0) and finite. */
|
|
88
246
|
positive(): this;
|
|
247
|
+
/** Number must be negative (< 0) and finite. */
|
|
248
|
+
negative(): this;
|
|
249
|
+
/** Number must be >= 0 and finite. */
|
|
250
|
+
nonNegative(): this;
|
|
251
|
+
/** Number must fall within `[min, max]` (inclusive). */
|
|
252
|
+
range(min: number, max: number): this;
|
|
253
|
+
/** Number must have at most `digits` decimal places (TS-only). */
|
|
254
|
+
decimal(digits: number): this;
|
|
255
|
+
/** Must equal a sibling field (VineJS `sameAs`). Cross-field → TS-only. */
|
|
256
|
+
sameAs(otherField: string): this;
|
|
257
|
+
/** Must equal its `<field>_confirmation` sibling (VineJS `confirmed`). */
|
|
258
|
+
confirmed(options?: {
|
|
259
|
+
confirmationField?: string;
|
|
260
|
+
}): this;
|
|
261
|
+
/** Required only when `otherField` is present (non-null) — else optional. */
|
|
262
|
+
requiredIfExists(otherField: string): this;
|
|
263
|
+
/** Required only when `otherField` is absent/null — else optional. */
|
|
264
|
+
requiredIfMissing(otherField: string): this;
|
|
265
|
+
/** Required only when `otherField <op> value` holds — else optional. */
|
|
266
|
+
requiredWhen(otherField: string, operator: RequiredCondition["operator"], value: unknown): this;
|
|
89
267
|
/** Trim whitespace (transform). */
|
|
90
268
|
trim(): this;
|
|
269
|
+
/**
|
|
270
|
+
* Post-validation transform changing the output type (VineJS `transform`).
|
|
271
|
+
* `value` is `unknown` — narrow it in the callback (the no-cast rule forbids
|
|
272
|
+
* lying about a dynamically-produced value's static type).
|
|
273
|
+
*/
|
|
274
|
+
transform<U>(fn: (value: unknown, field: FieldContext) => U): RuleChain<U>;
|
|
275
|
+
/** Pre-validation transform of the raw input (VineJS `parse`). */
|
|
276
|
+
parse(fn: (value: unknown) => unknown): this;
|
|
91
277
|
/** Custom validation rule. */
|
|
92
278
|
custom(name: string, validate: (value: unknown) => boolean, message?: string): this;
|
|
279
|
+
/**
|
|
280
|
+
* Attach a `.use()` rule (from {@link createRule}). Unlike `custom`, the rule
|
|
281
|
+
* receives a {@link FieldContext} with the root `data` and `parent`, so it can
|
|
282
|
+
* validate across fields. Runs after this field's type/value rules.
|
|
283
|
+
*/
|
|
284
|
+
use(rule: CompiledRule): this;
|
|
93
285
|
/** Set custom error message for the last rule. */
|
|
94
286
|
message(msg: string): this;
|
|
95
287
|
/** Internal: validate a field value and return errors + transformed value. */
|
|
96
|
-
_validateWithTransform(field: string,
|
|
288
|
+
_validateWithTransform(field: string, rawValue: unknown, ctx?: RunContext): {
|
|
97
289
|
errors: ValidationError[];
|
|
98
290
|
transformed: unknown;
|
|
99
291
|
};
|
|
@@ -102,11 +294,18 @@ export declare class RuleChain {
|
|
|
102
294
|
/** Internal: apply transforms. */
|
|
103
295
|
_transform(value: unknown): unknown;
|
|
104
296
|
}
|
|
297
|
+
/** No-op alias of {@link schema} — VineJS `vine.compile()` API parity. */
|
|
298
|
+
export declare function compile<T extends ValidationSchema>(s: T): T;
|
|
105
299
|
/** Entry point for building rules. */
|
|
106
300
|
export declare const rules: {
|
|
107
|
-
string: () => RuleChain
|
|
108
|
-
number: () => RuleChain
|
|
109
|
-
boolean: () => RuleChain
|
|
110
|
-
any: () => RuleChain
|
|
301
|
+
string: () => RuleChain<string>;
|
|
302
|
+
number: () => RuleChain<number>;
|
|
303
|
+
boolean: () => RuleChain<boolean>;
|
|
304
|
+
any: () => RuleChain<unknown>;
|
|
305
|
+
object: <Sh extends Record<string, RuleChain>>(shape: Sh) => RuleChain<Infer<Sh>>;
|
|
306
|
+
array: <Item extends RuleChain>(item?: Item) => RuleChain<OutputOf<Item>[]>;
|
|
307
|
+
enum: <const V extends readonly (string | number | boolean)[]>(values: V) => RuleChain<V[number]>;
|
|
308
|
+
literal: <V extends string | number | boolean>(value: V) => RuleChain<V>;
|
|
111
309
|
};
|
|
310
|
+
export {};
|
|
112
311
|
//# sourceMappingURL=Schema.d.ts.map
|
package/dist/Schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../src/Schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../src/Schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAOtE,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,CAClC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,uBAAuB,KAC5B,MAAM,GAAG,SAAS,CAAC;AAExB,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B,gDAAgD;IAChD,KAAK,EAAE,OAAO,CAAC;IACf,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,CAAC;IAC5C,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,kEAAkE;IAClE,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAA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