mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
86721fc496
* ⚡ Add generic auth type * ⚡ Remove queryAuth * ⚡ Remove bearer * ⚡ Remove headerAuth * ⚡ Remove basicAuth * ⚡ Adjust tests * ⚡ Small improvements * 👕 Fix lint issue
38 lines
718 B
TypeScript
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',
|
|
},
|
|
};
|
|
}
|