docs: update portal for WRNexusJS 0.2.23
This commit is contained in:
+10
-4
@@ -1,4 +1,4 @@
|
||||
# WRNexusJS documentation 0.2.22
|
||||
# WRNexusJS documentation 0.2.23
|
||||
|
||||
Status: Private Developer Preview. This site documents 26 release-aligned packages.
|
||||
|
||||
@@ -281,7 +281,7 @@ wrnexus eject <component> # copy a Wire UI component's .wrn into app/compone
|
||||
|
||||
# Installed package documentation
|
||||
|
||||
The following README files and declarations come from the installed private 0.2.22 release.
|
||||
The following README files and declarations come from the installed private 0.2.23 release.
|
||||
|
||||
## @wrnexus/ai
|
||||
|
||||
@@ -7569,6 +7569,7 @@ import { v } from "@wrnexus/validation";
|
||||
Every field schema is chainable and shares these base methods:
|
||||
|
||||
- `min(n, message?)` / `max(n, message?)` — for strings, bounds the length; for numbers, bounds the value.
|
||||
- `required(message?)` — require a non-empty value and optionally replace the default `"Required"` message on both server and browser validation.
|
||||
- `optional()` — an empty/missing value passes instead of erroring `"Required"`.
|
||||
- `label(text)` — human label carried into the descriptor.
|
||||
- `default(value)` — value substituted when the field is absent (implies `optional`).
|
||||
@@ -7655,8 +7656,8 @@ Define a schema and validate an API body:
|
||||
import { v, parseBody } from "@wrnexus/validation";
|
||||
|
||||
export const signupSchema = v.object({
|
||||
email: v.string().trim().email(),
|
||||
password: v.string().min(8).max(200),
|
||||
email: v.string().required("Enter your email address").trim().email(),
|
||||
password: v.string().required("Enter your password").min(8).max(200),
|
||||
age: v.number().integer().min(13).max(120).optional(),
|
||||
role: v.string().oneOf(["user", "admin"]).default("user"),
|
||||
agree: v.boolean(),
|
||||
@@ -7773,6 +7774,8 @@ type RuleDescriptor = {
|
||||
interface FieldDescriptor {
|
||||
type: "string" | "number" | "boolean";
|
||||
optional?: boolean;
|
||||
/** Message used when a required field is empty. Defaults to "Required". */
|
||||
requiredMessage?: string;
|
||||
label?: string;
|
||||
/** Trim string input before validating. */
|
||||
trim?: boolean;
|
||||
@@ -7807,11 +7810,14 @@ type Refinement = {
|
||||
declare abstract class FieldSchema {
|
||||
abstract readonly type: "string" | "number" | "boolean";
|
||||
protected _optional: boolean;
|
||||
protected _requiredMessage?: string;
|
||||
protected _label?: string;
|
||||
protected _default?: unknown;
|
||||
protected rules: RuleDescriptor[];
|
||||
protected refinements: Refinement[];
|
||||
optional(): this;
|
||||
/** Require a non-empty value and optionally replace the default message. */
|
||||
required(message?: string): this;
|
||||
label(label: string): this;
|
||||
/** Value used when the field is absent (implies optional). */
|
||||
default(value: unknown): this;
|
||||
|
||||
Reference in New Issue
Block a user