2022-07-24 08:36:17 -07:00
|
|
|
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
2019-08-21 09:44:10 -07:00
|
|
|
|
|
|
|
export class Postgres implements ICredentialType {
|
|
|
|
name = 'postgres';
|
|
|
|
displayName = 'Postgres';
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'postgres';
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2019-08-21 09:44:10 -07:00
|
|
|
{
|
|
|
|
displayName: 'Host',
|
|
|
|
name: 'host',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2019-08-21 09:44:10 -07:00
|
|
|
default: 'localhost',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Database',
|
|
|
|
name: 'database',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2019-08-21 09:44:10 -07:00
|
|
|
default: 'postgres',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'User',
|
|
|
|
name: 'user',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2019-08-21 09:44:10 -07:00
|
|
|
default: 'postgres',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Password',
|
|
|
|
name: 'password',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2019-08-21 09:44:10 -07:00
|
|
|
typeOptions: {
|
|
|
|
password: true,
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
2020-08-25 08:02:01 -07:00
|
|
|
{
|
|
|
|
displayName: 'Ignore SSL Issues',
|
|
|
|
name: 'allowUnauthorizedCerts',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'boolean',
|
2020-08-25 08:02:01 -07:00
|
|
|
default: false,
|
2022-04-13 23:32:27 -07:00
|
|
|
description: 'Whether to connect even if SSL certificate validation is not possible',
|
2020-08-25 08:02:01 -07:00
|
|
|
},
|
2020-01-10 01:21:45 -08:00
|
|
|
{
|
|
|
|
displayName: 'SSL',
|
|
|
|
name: 'ssl',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'options',
|
2020-08-25 08:02:01 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-07-24 08:36:17 -07:00
|
|
|
allowUnauthorizedCerts: [false],
|
2020-08-25 08:02:01 -07:00
|
|
|
},
|
|
|
|
},
|
2020-01-10 01:21:45 -08:00
|
|
|
options: [
|
2020-01-14 15:26:01 -08:00
|
|
|
{
|
2022-04-13 23:32:27 -07:00
|
|
|
name: 'Allow',
|
|
|
|
value: 'allow',
|
2020-01-14 15:26:01 -08:00
|
|
|
},
|
|
|
|
{
|
2022-04-13 23:32:27 -07:00
|
|
|
name: 'Disable',
|
|
|
|
value: 'disable',
|
2020-01-14 15:26:01 -08:00
|
|
|
},
|
|
|
|
{
|
2022-04-13 23:32:27 -07:00
|
|
|
name: 'Require',
|
2020-01-14 15:26:01 -08:00
|
|
|
value: 'require',
|
|
|
|
},
|
|
|
|
{
|
2022-04-13 23:32:27 -07:00
|
|
|
name: 'Verify (Not Implemented)',
|
2020-01-14 15:26:01 -08:00
|
|
|
value: 'verify',
|
|
|
|
},
|
|
|
|
{
|
2022-04-13 23:32:27 -07:00
|
|
|
name: 'Verify-Full (Not Implemented)',
|
2020-01-14 15:26:01 -08:00
|
|
|
value: 'verify-full',
|
2020-10-22 06:46:03 -07:00
|
|
|
},
|
2020-01-10 01:21:45 -08:00
|
|
|
],
|
|
|
|
default: 'disable',
|
|
|
|
},
|
2019-08-21 09:44:10 -07:00
|
|
|
{
|
|
|
|
displayName: 'Port',
|
|
|
|
name: 'port',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'number',
|
2019-08-21 09:44:10 -07:00
|
|
|
default: 5432,
|
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|