2023-01-27 03:22:44 -08:00
|
|
|
import type {
|
2022-12-01 09:42:33 -08:00
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2020-06-24 06:46:56 -07:00
|
|
|
|
|
|
|
export class PostmarkApi implements ICredentialType {
|
|
|
|
name = 'postmarkApi';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2020-06-24 06:46:56 -07:00
|
|
|
displayName = 'Postmark API';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'postmark';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
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',
|
2023-08-01 04:08:25 -07:00
|
|
|
typeOptions: { password: true },
|
2020-06-24 06:46:56 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2022-12-01 09:42:33 -08:00
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
headers: {
|
|
|
|
'X-Postmark-Server-Token': '={{$credentials.serverToken}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2022-12-01 09:42:33 -08:00
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: 'https://api.postmarkapp.com',
|
|
|
|
url: '/server',
|
|
|
|
method: 'GET',
|
|
|
|
},
|
|
|
|
};
|
2020-06-24 06:46:56 -07:00
|
|
|
}
|