|
| 1 | +import { ConnectionType, FileFormat, FileFormatCsv, FileFormatJsonLine, PaginationRequest } from '@shared/types'; |
| 2 | + |
| 3 | +export interface Transfer { |
| 4 | + id: number; |
| 5 | + group_id: number; |
| 6 | + name: string; |
| 7 | + source_connection_id: number; |
| 8 | + target_connection_id: number; |
| 9 | + description: string; |
| 10 | + is_scheduled: boolean; |
| 11 | + schedule: string; |
| 12 | + queue_id: number; |
| 13 | + source_params: |
| 14 | + | TransferParamsHive |
| 15 | + | TransferParamsOracle |
| 16 | + | TransferParamsPostgres |
| 17 | + | TransferSourceParamsHdfs |
| 18 | + | TransferSourceParamsS3; |
| 19 | + target_params: |
| 20 | + | TransferParamsHive |
| 21 | + | TransferParamsOracle |
| 22 | + | TransferParamsPostgres |
| 23 | + | TransferTargetParamsHdfs |
| 24 | + | TransferTargetParamsS3; |
| 25 | + strategy_params: TransferStrategyParams; |
| 26 | +} |
| 27 | + |
| 28 | +interface TransferStrategyParams { |
| 29 | + type: 'full' | 'incremental'; |
| 30 | +} |
| 31 | + |
| 32 | +interface TransferParamsHive { |
| 33 | + type: ConnectionType.HIVE; |
| 34 | + table_name: string; |
| 35 | +} |
| 36 | + |
| 37 | +interface TransferParamsOracle { |
| 38 | + type: ConnectionType.ORACLE; |
| 39 | + table_name: string; |
| 40 | +} |
| 41 | + |
| 42 | +interface TransferParamsPostgres { |
| 43 | + type: ConnectionType.POSTGRES; |
| 44 | + table_name: string; |
| 45 | +} |
| 46 | + |
| 47 | +interface TransferParamsHdfs { |
| 48 | + type: ConnectionType.HDFS; |
| 49 | + directory_path: string; |
| 50 | + options: object; |
| 51 | +} |
| 52 | + |
| 53 | +interface TransferSourceParamsHdfs extends TransferParamsHdfs { |
| 54 | + file_format: FileFormat; |
| 55 | +} |
| 56 | + |
| 57 | +interface TransferTargetParamsHdfs extends TransferParamsHdfs { |
| 58 | + file_format: FileFormatCsv | FileFormatJsonLine; |
| 59 | +} |
| 60 | + |
| 61 | +interface TransferParamsS3 { |
| 62 | + type: ConnectionType.S3; |
| 63 | + directory_path: string; |
| 64 | + options: object; |
| 65 | +} |
| 66 | + |
| 67 | +interface TransferSourceParamsS3 extends TransferParamsS3 { |
| 68 | + file_format: FileFormat; |
| 69 | +} |
| 70 | + |
| 71 | +interface TransferTargetParamsS3 extends TransferParamsS3 { |
| 72 | + file_format: FileFormatCsv | FileFormatJsonLine; |
| 73 | +} |
| 74 | + |
| 75 | +export interface GetTransfersRequest extends PaginationRequest { |
| 76 | + group_id: number; |
| 77 | +} |
| 78 | + |
| 79 | +export interface GetTransferRequest { |
| 80 | + id: number; |
| 81 | +} |
0 commit comments