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

41 lines
726 B
TypeScript
Raw Normal View History

import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class TwakeCloudApi implements ICredentialType {
name = 'twakeCloudApi';
2021-08-21 05:22:42 -07:00
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',
},
};
}