n8n/packages/nodes-base/credentials/PostmarkApi.credentials.ts

42 lines
752 B
TypeScript
Raw Normal View History

import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
2020-06-24 06:46:56 -07:00
export class PostmarkApi implements ICredentialType {
name = 'postmarkApi';
2020-06-24 06:46:56 -07:00
displayName = 'Postmark API';
documentationUrl = 'postmark';
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',
type: 'string',
typeOptions: { password: true },
2020-06-24 06:46:56 -07:00
default: '',
},
];
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
}