mirror of
https://github.com/dadosfera/maestro.git
synced 2026-09-15 08:24:47 +00:00
59 lines
1.1 KiB
TypeScript
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',
|
|
]) {}
|