2024-09-28 03:56:55 -07:00
|
|
|
import type {
|
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2020-12-02 23:05:54 -08:00
|
|
|
|
|
|
|
export class IterableApi implements ICredentialType {
|
|
|
|
name = 'iterableApi';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2020-12-02 23:05:54 -08:00
|
|
|
displayName = 'Iterable API';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2020-12-02 23:05:54 -08:00
|
|
|
documentationUrl = 'iterable';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2020-12-02 23:05:54 -08:00
|
|
|
{
|
|
|
|
displayName: 'API Key',
|
|
|
|
name: 'apiKey',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2022-11-01 09:41:45 -07:00
|
|
|
typeOptions: { password: true },
|
2020-12-02 23:05:54 -08:00
|
|
|
default: '',
|
|
|
|
},
|
2024-09-28 03:56:55 -07:00
|
|
|
{
|
|
|
|
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',
|
|
|
|
},
|
2020-12-02 23:05:54 -08:00
|
|
|
];
|
2024-09-28 03:56:55 -07:00
|
|
|
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
headers: {
|
|
|
|
Api_Key: '={{$credentials.apiKey}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: '={{$credentials?.region}}',
|
|
|
|
url: '/api/webhooks',
|
|
|
|
method: 'GET',
|
|
|
|
},
|
|
|
|
};
|
2020-12-02 23:05:54 -08:00
|
|
|
}
|