UNPKG

claire-framework

Version:

- được viết bằng TypeScript - hỗ trợ websocket và HTTP request - hỗ trợ CLI để generate base project (claire-cli)

100 lines 2.81 kB
import { DataType } from "../enum/DataType"; export declare class FieldValidationMetadata { /** * The name of the field used in business logic (controllers, services). */ fieldLogicName?: string; /** * Mark the field as auto-generated. This field cannot be manually supplied in the creation process (POST create). */ isAutoGen?: boolean; /** * The data type of the field. This will help in case the type inferring does not finely work. */ dataType?: DataType; /** * The description for this field. */ description?: string; /** * The value of this field must be in this numerical range. */ inRange?: { from: number; to: number; }; /** * The set of values of this field. */ inSet?: any[]; /** * The value of this field must match this regex. */ match?: string; /** * Whether the value of the field is integral. */ isInteger?: boolean; /** * The value of the field must be greater than this constraint value. */ greaterThan?: number; /** * The value of the field must be less than this constraint value. */ lessThan?: number; /** * The set of value of which the value of this field is subset. */ subSet?: any[]; /** * Name of the field stored in database. */ fieldDataName?: string; /** * Whether the field can be null. */ nullable?: boolean; /** * Whether the field is primary key. Primary key cannot be null and will throw error if not correctly configured. */ isPrimaryKey?: boolean; /** * Whether this primary key is auto incremental. */ isAutoIncrement?: boolean; /** * Whether the field is a foreign key to an other table. * Foreign key can not be at the same time primary key, we suggest using surrogate primary key instead. */ isForeignKey?: boolean; /** * Name of the model being referred in case this field is a foreign key. */ referModel?: string; /** * Whether the value of this field is unique. Sparse is always true. */ isUnique?: boolean; /** * The default value of the field. */ defaultValue?: string | number | ((...args: any[]) => string | number); /** * Whether allow the empty array as value. */ allowEmptyArray?: boolean; /** * Whether this field has getter/setter. */ getSetField?: string; /** * The data type of the field for database in case there is setter / getter for this field. */ innerDataType?: DataType; /** * Whether the field can accept file at creation and update. */ isFile?: boolean; } //# sourceMappingURL=FieldValidationMetadata.d.ts.map