2022-12-01 09:42:33 -08:00
|
|
|
import {
|
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2020-06-24 06:46:56 -07:00
|
|
|
|
|
|
|
export class PostmarkApi implements ICredentialType {
|
|
|
|
name = 'postmarkApi';
|
|
|
|
displayName = 'Postmark API';
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'postmark';
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2020-06-24 06:46:56 -07:00
|
|
|
{
|
2020-07-07 01:48:56 -07:00
|
|
|
displayName: 'Server API Token',
|
2020-06-24 06:46:56 -07:00
|
|
|
name: 'serverToken',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2020-06-24 06:46:56 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2022-12-01 09:42:33 -08:00
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
headers: {
|
|
|
|
'X-Postmark-Server-Token': '={{$credentials.serverToken}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: 'https://api.postmarkapp.com',
|
|
|
|
url: '/server',
|
|
|
|
method: 'GET',
|
|
|
|
},
|
|
|
|
};
|
2020-06-24 06:46:56 -07:00
|
|
|
}
|