@upv/ushi-shared
Version:
Shared DTOs, types, and utilities for the USHI platform (LMS, Trials, Social, Wallet).
35 lines (34 loc) • 1.01 kB
TypeScript
/** @deprecated Use Zod schema + validateBody() instead. */
import { APIGatewayProxyEvent } from 'aws-lambda';
type ErrorDetail = {
field: string;
message: string;
};
declare class CheckRules {
private _values;
private _value?;
private _property?;
private _label?;
private _errors;
private _finalValues;
private _dataSource?;
body(event: APIGatewayProxyEvent): this;
params(event: APIGatewayProxyEvent): this;
queries(event: APIGatewayProxyEvent): this;
payload(payload: unknown): this;
data(data: unknown): this;
check(property: string): this;
label(label: string): this;
and(func: (_this: this) => this): this;
isRequired(): this;
isString(): this;
isEmail(): this;
matches(regex: RegExp): this;
toCamelCase(): this;
toLowerCase(): this;
validate(): boolean;
get errors(): ErrorDetail[];
get values(): Record<string, any>;
get errorSummary(): Record<string, string>;
}
export default CheckRules;