
declare namespace SCHEDULE {
  namespace API {
    interface Detail {
      serviceName: string,
      serviceId: string,
      serviceDesc: string,
      requestMethod: string,
      permanentToken: string,
      groupKey: string,
      serviceType: string,
      sourceName: string,
      targetName: string,
      title: string,
      url: string,
      method: 'GET' | 'POST' | 'PUT' | 'DELETE',
      contentType: 'JSON',
      retry: number,
      authType: string,
      basicUsername: string,
      basicPassword: string,
      jwtMethod: 'HS256',
      jwtKey: string,
      enableCustomInput: boolean,
      customInputMerge: boolean,
      inputMap: [],
      enableCustomQuery: boolean,
      customQueryMerge: boolean,
      queryMap: [],
      enableCustomHeader: boolean,
      customHeaderMerge: boolean,
      headerMap: [],
      isDownload: boolean,
      transformMerge: boolean,
      enableCustomOutput: boolean,
      outputTransform: [],
      enableResponseAdaptor: boolean,
      responseAdaptor: string,
      enableCustomCa: boolean,
      httpsKey: string,
      httpsCert: string,
      reqParam: [],
      respParam: [],
    }
  }

  namespace SOURCE {

    type DataSourceType = 'MYSQL' | 'PGSQL' | 'DM' | 'ORACLE' | 'DORIS'

    // 区别
    // ORACLE 数据库增加一些参数
    // connectType：”“ //连接类型 值有 ORACLE_SERVICE_NAME，ORACLE_SID

    interface DataSourceConnectParam {
      dataSourceType: DataSourceType // 数据源类型
      username: string // 用户名
      password: string // 密码
      address: string // 连接地址
      port: number // 端口int
      database: string // 数据库
      driverClassName: string // 驱动class 名称
      validateQuery: string // 校验sql
      minimumIdle: nunber
      'maximumPoolSize': number,
      'otherParameters': Record<string, string>[]
      'connectType'?: 'ORACLE_SERVICE_NAM' | 'ORACLE_SID'
    }

    interface Detail {
      'id'?: string // id
      'label': string // 数据源名称，字符串，必须填写
      'description': string // 描述， 字符串，必须填写
      'dataSourceConnectParam': DataSourceConnectParam // 数据源连接参数，根据不同的数据源 连接参数可能不同
      }

  }
}
