mirror of
https://github.com/dadosfera/maestro.git
synced 2026-09-11 15:24:48 +00:00
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
68 lines
1.4 KiB
TypeScript
68 lines
1.4 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[];
|
|
@ApiPropertyOptional({ type: [Column] })
|
|
references: Column[];
|
|
@ApiProperty()
|
|
destination: Record<'raw' | 'qualify', {
|
|
table_name: string;
|
|
table_schema: string;
|
|
}> | null;
|
|
@ApiProperty()
|
|
type: string;
|
|
@ApiPropertyOptional({ type: [String] })
|
|
identifier_columns?: string[];
|
|
@ApiPropertyOptional({ type: Column })
|
|
reference_column?: Column;
|
|
}
|
|
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',
|
|
]) {}
|