mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 04:47:29 -08:00
⚡ Simplify more property types in credentials classes (#2211)
* ⚡ Simplify more property types * 👕 Fix lint
This commit is contained in:
parent
d3a312cc6b
commit
fa05d7557b
|
@ -1,24 +1,24 @@
|
|||
import { ICredentialType, NodePropertyTypes } from 'n8n-workflow';
|
||||
import { ICredentialType, NodePropertyTypes, INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export class ClassNameReplace implements ICredentialType {
|
||||
name = 'N8nNameReplace';
|
||||
|
||||
displayName = 'DisplayNameReplace';
|
||||
|
||||
properties = [
|
||||
properties: INodeProperties[] = [
|
||||
// The credentials to get from user and save encrypted.
|
||||
// Properties can be defined exactly in the same way
|
||||
// as node properties.
|
||||
{
|
||||
displayName: 'User',
|
||||
name: 'user',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Access Token',
|
||||
name: 'accessToken',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
NodePropertyTypes,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class ActionNetworkApi implements ICredentialType {
|
||||
name = 'actionNetworkApi';
|
||||
displayName = 'Action Network API';
|
||||
documentationUrl = 'actionNetwork';
|
||||
properties = [
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'API Key',
|
||||
name: 'apiKey',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
NodePropertyTypes,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class CiscoWebexOAuth2Api implements ICredentialType {
|
||||
|
@ -9,37 +9,37 @@ export class CiscoWebexOAuth2Api implements ICredentialType {
|
|||
'oAuth2Api',
|
||||
];
|
||||
displayName = 'Cisco Webex OAuth2 API';
|
||||
properties = [
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Authorization URL',
|
||||
name: 'authUrl',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: 'https://webexapis.com/v1/authorize',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Access Token URL',
|
||||
name: 'accessTokenUrl',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: 'https://webexapis.com/v1/access_token',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Scope',
|
||||
name: 'scope',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: 'spark:memberships_read meeting:recordings_read spark:kms meeting:schedules_read spark:rooms_read spark:messages_write spark:memberships_write meeting:recordings_write meeting:preferences_read spark:messages_read meeting:schedules_write',
|
||||
},
|
||||
{
|
||||
displayName: 'Auth URI Query Parameters',
|
||||
name: 'authQueryParameters',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Authentication',
|
||||
name: 'authentication',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: 'body',
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
NodePropertyTypes,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class FormIoApi implements ICredentialType {
|
||||
|
@ -42,13 +41,13 @@ export class FormIoApi implements ICredentialType {
|
|||
{
|
||||
displayName: 'Email',
|
||||
name: 'email',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Password',
|
||||
name: 'password',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
password: true,
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
NodePropertyTypes,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
|
||||
|
@ -8,11 +8,11 @@ export class FormstackApi implements ICredentialType {
|
|||
name = 'formstackApi';
|
||||
displayName = 'Formstack API';
|
||||
documentationUrl = 'formstackTrigger';
|
||||
properties = [
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Access Token',
|
||||
name: 'accessToken',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
NodePropertyTypes,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
const scopes: string[] = [];
|
||||
|
@ -12,37 +12,37 @@ export class FormstackOAuth2Api implements ICredentialType {
|
|||
];
|
||||
displayName = 'Formstack OAuth2 API';
|
||||
documentationUrl = 'formstackTrigger';
|
||||
properties = [
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Authorization URL',
|
||||
name: 'authUrl',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: 'https://www.formstack.com/api/v2/oauth2/authorize',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Access Token URL',
|
||||
name: 'accessTokenUrl',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: 'https://www.formstack.com/api/v2/oauth2/token',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Scope',
|
||||
name: 'scope',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: scopes.join(' '),
|
||||
},
|
||||
{
|
||||
displayName: 'Auth URI Query Parameters',
|
||||
name: 'authQueryParameters',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Authentication',
|
||||
name: 'authentication',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: 'header',
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
NodePropertyTypes,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
const scopes = [
|
||||
|
@ -16,11 +16,11 @@ export class GoogleDocsOAuth2Api implements ICredentialType {
|
|||
];
|
||||
displayName = 'Google Docs OAuth2 API';
|
||||
documentationUrl = 'google';
|
||||
properties = [
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Scope',
|
||||
name: 'scope',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: scopes.join(' '),
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
NodePropertyTypes,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
const scopes = [
|
||||
|
@ -14,11 +14,11 @@ export class GooglePerspectiveOAuth2Api implements ICredentialType {
|
|||
];
|
||||
displayName = 'Google Perspective OAuth2 API';
|
||||
documentationUrl = 'google';
|
||||
properties = [
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Scope',
|
||||
name: 'scope',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: scopes.join(' '),
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
NodePropertyTypes,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class HomeAssistantApi implements ICredentialType {
|
||||
name = 'homeAssistantApi';
|
||||
displayName = 'Home Assistant API';
|
||||
documentationUrl = 'homeAssistant';
|
||||
properties = [
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Host',
|
||||
name: 'host',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Port',
|
||||
name: 'port',
|
||||
type: 'number' as NodePropertyTypes,
|
||||
type: 'number',
|
||||
default: 8123,
|
||||
},
|
||||
{
|
||||
displayName: 'SSL',
|
||||
name: 'ssl',
|
||||
type: 'boolean' as NodePropertyTypes,
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
displayName: 'Access Token',
|
||||
name: 'accessToken',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
NodePropertyTypes,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class Magento2Api implements ICredentialType {
|
||||
name = 'magento2Api';
|
||||
displayName = 'Magento 2 API';
|
||||
documentationUrl = 'magento2';
|
||||
properties = [
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Host',
|
||||
name: 'host',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Access Token',
|
||||
name: 'accessToken',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
NodePropertyTypes,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class MarketstackApi implements ICredentialType {
|
||||
name = 'marketstackApi';
|
||||
displayName = 'Marketstack API';
|
||||
documentationUrl = 'marketstack';
|
||||
properties = [
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'API Key',
|
||||
name: 'apiKey',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Use HTTPS',
|
||||
name: 'useHttps',
|
||||
type: 'boolean' as NodePropertyTypes,
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Use HTTPS (paid plans only).',
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
NodePropertyTypes,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class ServiceNowOAuth2Api implements ICredentialType {
|
||||
|
@ -10,11 +10,11 @@ export class ServiceNowOAuth2Api implements ICredentialType {
|
|||
];
|
||||
displayName = 'ServiceNow OAuth2 API';
|
||||
documentationUrl = 'serviceNow';
|
||||
properties = [
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Subdomain',
|
||||
name: 'subdomain',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'n8n',
|
||||
description: 'The subdomain of your ServiceNow environment',
|
||||
|
@ -23,39 +23,39 @@ export class ServiceNowOAuth2Api implements ICredentialType {
|
|||
{
|
||||
displayName: 'Authorization URL',
|
||||
name: 'authUrl',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: '=https://{{$self["subdomain"]}}.service-now.com/oauth_auth.do',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Access Token URL',
|
||||
name: 'accessTokenUrl',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: '=https://{{$self["subdomain"]}}.service-now.com/oauth_token.do',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Scope',
|
||||
name: 'scope',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: 'useraccount',
|
||||
},
|
||||
{
|
||||
displayName: 'Auth URI Query Parameters',
|
||||
name: 'authQueryParameters',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: 'response_type=code',
|
||||
},
|
||||
{
|
||||
displayName: 'Auth URI Query Parameters',
|
||||
name: 'authQueryParameters',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: 'grant_type=authorization_code',
|
||||
},
|
||||
{
|
||||
displayName: 'Authentication',
|
||||
name: 'authentication',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
type: 'hidden',
|
||||
default: 'header',
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue