2022-07-24 08:36:17 -07:00
|
|
|
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
2021-09-29 17:10:39 -07:00
|
|
|
|
|
|
|
export class GristApi implements ICredentialType {
|
|
|
|
name = 'gristApi';
|
|
|
|
displayName = 'Grist API';
|
|
|
|
documentationUrl = 'grist';
|
|
|
|
properties: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'API Key',
|
|
|
|
name: 'apiKey',
|
|
|
|
type: 'string',
|
2022-11-01 09:41:45 -07:00
|
|
|
typeOptions: { password: true },
|
2021-09-29 17:10:39 -07:00
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Plan Type',
|
|
|
|
name: 'planType',
|
|
|
|
type: 'options',
|
|
|
|
default: 'free',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Free',
|
|
|
|
value: 'free',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Paid',
|
|
|
|
value: 'paid',
|
|
|
|
},
|
2022-02-19 03:29:28 -08:00
|
|
|
{
|
2022-04-13 23:32:27 -07:00
|
|
|
name: 'Self-Hosted',
|
2022-02-19 05:38:16 -08:00
|
|
|
value: 'selfHosted',
|
|
|
|
},
|
2021-09-29 17:10:39 -07:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Custom Subdomain',
|
|
|
|
name: 'customSubdomain',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
description: 'Custom subdomain of your team',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-07-24 08:36:17 -07:00
|
|
|
planType: ['paid'],
|
2021-09-29 17:10:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-02-19 03:29:28 -08:00
|
|
|
{
|
2022-04-13 23:32:27 -07:00
|
|
|
displayName: 'Self-Hosted URL',
|
2022-02-19 03:29:28 -08:00
|
|
|
name: 'selfHostedUrl',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-02-19 05:38:16 -08:00
|
|
|
placeholder: 'http://localhost:8484',
|
2022-02-19 03:29:28 -08:00
|
|
|
required: true,
|
2022-07-24 08:36:17 -07:00
|
|
|
description:
|
|
|
|
'URL of your Grist instance. Include http/https without /api and no trailing slash.',
|
2022-02-19 03:29:28 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-07-24 08:36:17 -07:00
|
|
|
planType: ['selfHosted'],
|
2022-02-19 03:29:28 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-09-29 17:10:39 -07:00
|
|
|
];
|
|
|
|
}
|