Files
maestro/src/modules/inputs/dtos/input.model.ts
T

59 lines
1.1 KiB
TypeScript

import { ApiProperty, ApiPropertyOptional, OmitType } from '@nestjs/swagger';
export class Column {
@ApiProperty()
name: string;
@ApiProperty()
type: string;
}
export class TableColumns {
@ApiProperty()
name: string;
@ApiProperty()
columns: string[];
@ApiProperty()
references: Column[];
@ApiProperty()
type: string;
}
export class AvailableEntity {
@ApiProperty()
name: string;
@ApiProperty()
replication_methods: string[];
}
export class Input {
@ApiProperty()
id: string;
@ApiProperty({ type: [TableColumns] })
tables: TableColumns[];
@ApiProperty()
name: string;
@ApiProperty()
description: string;
@ApiProperty()
plugin: string;
@ApiPropertyOptional()
type?: string;
@ApiProperty()
created_at: string;
@ApiProperty()
updated_at: string;
}
export class GetAvailableEntitiesReq {
@ApiProperty()
plugin: string;
}
export class GetAvailableEntitiesRes {
@ApiProperty({ type: [AvailableEntity] })
entities: AvailableEntity[];
}
export class CreateInputReq extends OmitType(Input, [
'id',
'created_at',
'updated_at',
]) {}