n8n/packages/nodes-base/credentials/IterableApi.credentials.ts
Jon 0ca9c076ca
Some checks failed
Test Master / install-and-build (push) Has been cancelled
Test Master / Unit tests (18.x) (push) Has been cancelled
Test Master / Unit tests (20.x) (push) Has been cancelled
Test Master / Unit tests (22.4) (push) Has been cancelled
Test Master / Lint (push) Has been cancelled
Test Master / Notify Slack on failure (push) Has been cancelled
feat(Iterable Node): Add support for EDC and USDC selection (#10908)
2024-09-28 11:56:55 +01:00

58 lines
999 B
TypeScript

import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class IterableApi implements ICredentialType {
name = 'iterableApi';
displayName = 'Iterable API';
documentationUrl = 'iterable';
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: { password: true },
default: '',
},
{
displayName: 'Region',
name: 'region',
type: 'options',
options: [
{
name: 'EDC',
value: 'https://api.eu.iterable.com',
},
{
name: 'USDC',
value: 'https://api.iterable.com',
},
],
default: 'https://api.iterable.com',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
Api_Key: '={{$credentials.apiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials?.region}}',
url: '/api/webhooks',
method: 'GET',
},
};
}