UNPKG

@avonjs/avonjs

Version:

A fluent Node.js API generator.

48 lines (47 loc) 1.45 kB
import Joi from 'joi'; import type { Filter } from '../Filters'; import type AvonRequest from '../Http/Requests/AvonRequest'; import { type AnyValue, type DefaultCallback, type FilterableCallback, type OpenApiSchema } from '../Contracts'; import Field from './Field'; export default class Binary extends Field { /** * The callback to be used for the field's default value. */ defaultCallback: DefaultCallback; /** * The validation rules callback for creation and updates. */ protected rulesSchema: Joi.BooleanSchema<boolean>; /** * The validation rules callback for creation. */ protected creationRulesSchema: Joi.BooleanSchema<boolean>; /** * The validation rules callback for updates. */ protected updateRulesSchema: Joi.BooleanSchema<boolean>; /** * Mutate the field value for response. */ getMutatedValue(request: AvonRequest, value: AnyValue): boolean; /** * Determine field is filterable or not. */ isFilterable(): boolean; /** * Determine field is orderable or not. */ isOrderable(): boolean; /** * Make the field filter. */ makeFilter(request: AvonRequest): Filter; /** * Define the default filterable callback. */ defaultFilterableCallback(): FilterableCallback; /** * Get the swagger-ui schema. */ protected baseSchema(request: AvonRequest): OpenApiSchema; }