帆软决策平台数据连接界面库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

276 lines
5.5 KiB

export interface CrudParams {
[key: string]: string | number | { [key: string]: any };
}
export interface CrudReqOpts {
url?: string;
type?: 'GET' | 'POST' | 'DELETE' | 'PUT';
data?: any;
headers?: {
[key: string]: string;
};
noProgress?: boolean;
params?: CrudParams;
}
export interface ConnectionLicInfo {
currentConnectionNum: number;
maxConnectionNum: number;
}
export interface ConnectionPoolType {
maxActive: number;
maxIdle: number;
numActive: number;
numIdle: number;
}
type ConnectionDataOfSSH = {
usingSsh: boolean; // 使用SSH通道
sshIp: string; // 主机
sshPort: number; // 端口
sshUser: string; // 用户名
redirectPort: number;
redirectIp: string;
sshTimeOut: number;
sshKeepAlive: number;
} & (
| {
sshType: 'NORMAL'; // 验证方法:密码
sshPrivateKeyPath: ''; // 没啥意义,该验证方法下为空字符串
sshSecret: string; // 密码
}
| {
sshType: 'KEY'; // 验证方法:公钥
sshPrivateKeyPath: string; // 私钥
sshSecret: string; // 密码短语
}
);
type ConnectionDataOfSSL = {
usingSsl: boolean; // 使用SSL通道
sslType: 'NORMAL'; // SSL类型,只有NORMAL一种
caCertificate: string; // CA证书
verifyCa: boolean; // 验证针对CA的服务器证书
sslClientPrivateKey: string; // 客户端密钥
sslClientCertificate: string; // 客户端证书
};
export interface ConnectionPoolJDBC {
/**
*
*/
initialSize?: number;
/**
*
*/
maxActive?: number;
/**
*
*/
maxIdle?: number;
/**
*
*/
minIdle?: number;
/**
*
*/
maxWait?: number;
/**
* sql查询
*/
validationQuery?: string;
/**
*
*/
testOnBorrow?: boolean;
/**
*
*/
testOnReturn?: boolean;
/**
*
*/
testWhileIdle?: boolean;
/**
* 线
*/
timeBetweenEvictionRunsMillis?: number;
/**
*
*/
numTestsPerEvictionRun?: number;
/**
*
*/
minEvictableIdleTimeMillis?: number;
}
export type ConnectionJDBC ={
/**
*
*/
database: string;
/**
*
*/
connectionName: string;
/**
*
*/
driver: string;
/**
*
*/
driverSource: 'default' | 'custom';
/**
* url
*/
url: string;
/**
*
*/
user?: string;
/**
*
*/
password?: string;
/**
*
*/
queryType?: string;
/**
*
*/
newCharsetName?: any;
/**
*
*/
originalCharsetName?: any;
/**
*
*/
schema?: string;
/**
* ()
*/
testOnBorrow?: boolean;
/**
* ()
*/
maxActive?: number;
/**
*
*/
options?: string;
/**
*
*/
port?: number | '';
/**
*
*/
host?: string;
/**
*
*/
authType?: string;
/**
*
*/
creator?: string;
/**
* principal
*/
principal?: string;
/**
*
*/
keyPath?: string;
/**
* krb5.conf文件
*/
krb5Path?: string;
/**
* fetchSize
*/
fetchSize?: number;
/**
* id
*/
identity?: string;
connectionPoolAttr: ConnectionPoolJDBC;
}& ConnectionDataOfSSH &
ConnectionDataOfSSL
export interface ContextHashtable {
'java.naming.factory.initial': string;
'java.naming.provider.url': string;
'java.naming.factory.object': string;
'java.naming.factory.state': string;
'java.naming.factory.url.pkgs': string;
'java.naming.dns.url': string;
'java.naming.authoritative': string;
'java.naming.batchsize': string;
'java.naming.referral': string;
'java.naming.security.protocol': string;
'java.naming.security.authentication': string;
'java.naming.security.principal': string;
'java.naming.security.credentials': string;
'java.naming.language': string;
'java.naming.applet': string;
}
export interface ConnectionJNDI {
jndiName: string;
/**
*
*/
originalCharsetName: string;
newCharsetName: string;
creator?: string;
contextHashtable: ContextHashtable;
}
export interface ConnectionPlugin {
pluginType: 'json';
creator: '';
pluginData: any;
}
export interface Connection {
connectionId: string;
connectionType: string;
connectionName: string;
creator?: string;
connectionData: ConnectionJDBC | ConnectionJNDI | ConnectionPlugin | string;
privilegeDetailBeanList?: {
privilegeType: number;
privilegeValue: number;
}[];
}
export interface TestRequest {
data?: string[];
errorCode?: string;
errorMsg?: string;
}
export interface SocketResult {
data?: string;
errorCode?: string;
errorMsg?: string;
}
export interface ResultType {
data?: any;
errorCode?: string;
errorMsg?: string;
}