2023-01-27 03:22:44 -08:00
|
|
|
import type {
|
2022-11-22 03:44:35 -08:00
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2022-03-13 03:49:15 -07:00
|
|
|
|
|
|
|
export class HubspotAppToken implements ICredentialType {
|
|
|
|
name = 'hubspotAppToken';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2022-05-24 02:36:19 -07:00
|
|
|
displayName = 'HubSpot App Token';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2022-03-13 03:49:15 -07:00
|
|
|
documentationUrl = 'hubspot';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2022-03-13 03:49:15 -07:00
|
|
|
properties: INodeProperties[] = [
|
|
|
|
{
|
2022-03-13 03:52:47 -07:00
|
|
|
displayName: 'APP Token',
|
2022-03-13 03:49:15 -07:00
|
|
|
name: 'appToken',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2022-10-17 04:13:59 -07:00
|
|
|
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
headers: {
|
|
|
|
Authorization: '=Bearer {{$credentials.appToken}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: 'https://api.hubapi.com',
|
|
|
|
url: '/account-info/v3/details',
|
|
|
|
},
|
|
|
|
};
|
2022-03-13 03:49:15 -07:00
|
|
|
}
|