n8n/packages/nodes-base/credentials/TwakeCloudApi.credentials.ts
Jan Oberhauser 86721fc496
feat(core) Simplify authentication type (#3578)
*  Add generic auth type

*  Remove queryAuth

*  Remove bearer

*  Remove headerAuth

*  Remove basicAuth

*  Adjust tests

*  Small improvements

* 👕 Fix lint issue
2022-06-26 15:55:51 -07:00

38 lines
718 B
TypeScript

import {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class TwakeCloudApi implements ICredentialType {
name = 'twakeCloudApi';
displayName = 'Twake Cloud API';
documentationUrl = 'twake';
properties: INodeProperties[] = [
{
displayName: 'Workspace Key',
name: 'workspaceKey',
type: 'string',
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
Authorization: '=Bearer {{$credentials.workspaceKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://plugins.twake.app/plugins/n8n',
url: '/channel',
method: 'POST',
},
};
}