mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-28 22:19:41 -08:00
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
58 lines
999 B
TypeScript
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',
|
|
},
|
|
};
|
|
}
|