UNPKG

@adocasts.com/dto

Version:

Easily make and generate DTOs from Lucid Models

31 lines (30 loc) 805 B
import { ApplicationService } from '@adonisjs/core/types'; import type { ModelInfo, ModelPropertyType } from './model_service.js'; export type ValidatorInfo = { entity: { path: string; name: string; }; variable: string; className: string; fileName: string; exportPath: string; properties: ValidatorProperty[]; }; export type ValidatorProperty = { name: string; type: string; typeRaw: ModelPropertyType[]; validationRule: string; }; export default class ValidatorService { #private; protected app: ApplicationService; constructor(app: ApplicationService); /** * Get validator file, class, and property info * @param name * @param model */ getValidatorInfo(name: string, model: ModelInfo): ValidatorInfo; }