2022-07-24 08:36:17 -07:00
|
|
|
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
2019-11-13 19:32:26 -08:00
|
|
|
|
2019-12-12 18:24:55 -08:00
|
|
|
export class MySql implements ICredentialType {
|
|
|
|
name = 'mySql';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2019-11-13 19:32:26 -08:00
|
|
|
displayName = 'MySQL';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'mySql';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2019-11-13 19:32:26 -08:00
|
|
|
{
|
|
|
|
displayName: 'Host',
|
|
|
|
name: 'host',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2019-11-13 19:32:26 -08:00
|
|
|
default: 'localhost',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Database',
|
|
|
|
name: 'database',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2019-11-13 19:32:26 -08:00
|
|
|
default: 'mysql',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'User',
|
|
|
|
name: 'user',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2019-11-13 19:32:26 -08:00
|
|
|
default: 'mysql',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Password',
|
|
|
|
name: 'password',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2019-11-13 19:32:26 -08:00
|
|
|
typeOptions: {
|
|
|
|
password: true,
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Port',
|
|
|
|
name: 'port',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'number',
|
2019-11-13 19:32:26 -08:00
|
|
|
default: 3306,
|
|
|
|
},
|
2021-02-04 01:13:48 -08:00
|
|
|
{
|
|
|
|
displayName: 'Connect Timeout',
|
|
|
|
name: 'connectTimeout',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'number',
|
2021-02-04 01:13:48 -08:00
|
|
|
default: 10000,
|
2022-07-24 08:36:17 -07:00
|
|
|
description:
|
|
|
|
'The milliseconds before a timeout occurs during the initial connection to the MySQL server',
|
2021-04-14 04:43:12 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'SSL',
|
|
|
|
name: 'ssl',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'boolean',
|
2021-04-14 04:43:12 -07:00
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'CA Certificate',
|
|
|
|
name: 'caCertificate',
|
|
|
|
typeOptions: {
|
|
|
|
password: true,
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-07-24 08:36:17 -07:00
|
|
|
ssl: [true],
|
2021-04-14 04:43:12 -07:00
|
|
|
},
|
|
|
|
},
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-04-14 04:43:12 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Client Private Key',
|
|
|
|
name: 'clientPrivateKey',
|
|
|
|
typeOptions: {
|
|
|
|
password: true,
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-07-24 08:36:17 -07:00
|
|
|
ssl: [true],
|
2021-04-14 04:43:12 -07:00
|
|
|
},
|
|
|
|
},
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-04-14 04:43:12 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Client Certificate',
|
|
|
|
name: 'clientCertificate',
|
|
|
|
typeOptions: {
|
|
|
|
password: true,
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-07-24 08:36:17 -07:00
|
|
|
ssl: [true],
|
2021-04-14 04:43:12 -07:00
|
|
|
},
|
|
|
|
},
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-04-14 04:43:12 -07:00
|
|
|
default: '',
|
|
|
|
},
|
2019-11-13 19:32:26 -08:00
|
|
|
];
|
|
|
|
}
|