2023-01-27 03:22:44 -08:00
|
|
|
import type {
|
2022-06-26 15:55:51 -07:00
|
|
|
IAuthenticateGeneric,
|
2022-06-18 20:10:08 -07:00
|
|
|
ICredentialTestRequest,
|
2020-08-04 08:23:06 -07:00
|
|
|
ICredentialType,
|
2021-06-12 09:39:55 -07:00
|
|
|
INodeProperties,
|
2020-08-04 08:23:06 -07:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
export class TwakeCloudApi implements ICredentialType {
|
|
|
|
name = 'twakeCloudApi';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-08-21 05:22:42 -07:00
|
|
|
displayName = 'Twake Cloud API';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'twake';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2020-08-04 08:23:06 -07:00
|
|
|
{
|
|
|
|
displayName: 'Workspace Key',
|
|
|
|
name: 'workspaceKey',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2020-08-04 08:23:06 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2022-06-26 15:55:51 -07:00
|
|
|
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
2022-06-18 20:10:08 -07:00
|
|
|
properties: {
|
2022-06-26 15:55:51 -07:00
|
|
|
headers: {
|
|
|
|
Authorization: '=Bearer {{$credentials.workspaceKey}}',
|
|
|
|
},
|
2022-06-18 20:10:08 -07:00
|
|
|
},
|
2022-06-26 15:55:51 -07:00
|
|
|
};
|
2022-06-18 20:10:08 -07:00
|
|
|
|
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: 'https://plugins.twake.app/plugins/n8n',
|
|
|
|
url: '/channel',
|
|
|
|
method: 'POST',
|
|
|
|
},
|
|
|
|
};
|
2020-08-04 08:23:06 -07:00
|
|
|
}
|