|
|
|
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;
|
|
|
|
}
|