136 lines
2.9 KiB
TypeScript
136 lines
2.9 KiB
TypeScript
import { DataTableRecord } from '../../../../shared/components/data-table/data-table.types';
|
|
|
|
export type DbConnectionModalMode = 'create' | 'edit' | 'view';
|
|
|
|
export type DbEngine = 'postgresql' | 'mysql' | 'sqlserver';
|
|
|
|
export type SslMode = 'Disable' | 'Allow' | 'Prefer' | 'Require' | 'VerifyFull';
|
|
|
|
export type DbRegion = 'IN' | 'ME' | 'EU' | 'US';
|
|
|
|
export enum DbConnectionStatus {
|
|
Provisioning = 0,
|
|
Active = 1,
|
|
Degraded = 2,
|
|
Offline = 3,
|
|
Retired = 4
|
|
}
|
|
|
|
export interface DbConnectionDto {
|
|
id: string;
|
|
connectionCode: string;
|
|
connectionName: string;
|
|
tenantId?: string | null;
|
|
tenantName?: string | null;
|
|
dbEngine: string;
|
|
host: string;
|
|
port?: number;
|
|
hostPort: string;
|
|
databaseName: string;
|
|
username: string;
|
|
passwordSecretRef: string;
|
|
sslMode: number | string;
|
|
region: string;
|
|
isReadReplica: boolean;
|
|
isActive: boolean;
|
|
status?: DbConnectionStatus | number | string;
|
|
createdOn?: string;
|
|
modifiedOn?: string | null;
|
|
}
|
|
|
|
export interface DbConnectionTableRow extends DataTableRecord {
|
|
id: string;
|
|
connectionCode: string;
|
|
connectionName: string;
|
|
tenantId?: string | null;
|
|
tenantName?: string | null;
|
|
dbEngine: string;
|
|
host: string;
|
|
port?: number;
|
|
hostPort: string;
|
|
databaseName: string;
|
|
username: string;
|
|
passwordSecretRef: string;
|
|
sslMode: number | string;
|
|
region: string;
|
|
isReadReplica: boolean;
|
|
isActive: boolean;
|
|
status?: DbConnectionStatus | number | string;
|
|
serialNumber: number;
|
|
createdOn?: string;
|
|
modifiedOn?: string | null;
|
|
}
|
|
|
|
export interface CreateDbConnectionRequest {
|
|
tenantId?: string | null;
|
|
connectionName: string;
|
|
dbEngine: string;
|
|
host: string;
|
|
port: number;
|
|
hostPort: string;
|
|
databaseName: string;
|
|
username: string;
|
|
passwordSecretRef: string;
|
|
sslMode: number;
|
|
region: string;
|
|
isReadReplica: boolean;
|
|
}
|
|
|
|
export interface UpdateDbConnectionRequest {
|
|
tenantId?: string | null;
|
|
connectionName: string;
|
|
dbEngine: string;
|
|
host: string;
|
|
port: number;
|
|
hostPort: string;
|
|
databaseName: string;
|
|
username: string;
|
|
passwordSecretRef: string;
|
|
sslMode: number;
|
|
region: string;
|
|
isReadReplica: boolean;
|
|
isActive: boolean;
|
|
}
|
|
|
|
export interface UpdateDbConnectionStatusRequest {
|
|
isActive: boolean;
|
|
status?: DbConnectionStatus | number;
|
|
}
|
|
|
|
export interface TestDbConnectionRequest {
|
|
tenantId?: string | null;
|
|
dbEngine: string;
|
|
host: string;
|
|
port: number;
|
|
hostPort: string;
|
|
databaseName: string;
|
|
username: string;
|
|
passwordSecretRef: string;
|
|
sslMode: number;
|
|
}
|
|
|
|
export interface TestDbConnectionResult {
|
|
success?: boolean;
|
|
isSuccess?: boolean;
|
|
message?: string;
|
|
detail?: string;
|
|
error?: string;
|
|
}
|
|
|
|
export interface DbConnectionLookupDto {
|
|
id: string;
|
|
connectionCode: string;
|
|
connectionName: string;
|
|
databaseName: string;
|
|
isReadReplica?: boolean;
|
|
isActive?: boolean;
|
|
}
|
|
|
|
export interface DbConnectionCodePreviewDto {
|
|
code?: string | null;
|
|
connectionCode?: string | null;
|
|
nextCode?: string | null;
|
|
value?: string | null;
|
|
}
|
|
|