2020-03-08 19:39:20 -07:00
|
|
|
import {
|
|
|
|
ICredentialType,
|
2021-06-12 09:39:55 -07:00
|
|
|
INodeProperties,
|
2020-03-08 19:39:20 -07:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-09-18 13:18:35 -07:00
|
|
|
const scopes = [
|
2021-12-10 11:28:59 -08:00
|
|
|
'crm.objects.contacts.read',
|
|
|
|
'crm.schemas.contacts.read',
|
|
|
|
'crm.objects.companies.read',
|
|
|
|
'crm.schemas.companies.read',
|
|
|
|
'crm.objects.deals.read',
|
|
|
|
'crm.schemas.deals.read',
|
2021-09-18 13:18:35 -07:00
|
|
|
];
|
|
|
|
|
2020-03-08 19:39:20 -07:00
|
|
|
export class HubspotDeveloperApi implements ICredentialType {
|
|
|
|
name = 'hubspotDeveloperApi';
|
2020-09-22 23:14:24 -07:00
|
|
|
displayName = 'Hubspot Developer API';
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'hubspot';
|
2021-09-18 13:18:35 -07:00
|
|
|
extends = [
|
|
|
|
'oAuth2Api',
|
|
|
|
];
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2020-03-08 19:39:20 -07:00
|
|
|
{
|
2021-09-18 13:18:35 -07:00
|
|
|
displayName: 'Authorization URL',
|
|
|
|
name: 'authUrl',
|
|
|
|
type: 'hidden',
|
|
|
|
default: 'https://app.hubspot.com/oauth/authorize',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Access Token URL',
|
|
|
|
name: 'accessTokenUrl',
|
|
|
|
type: 'hidden',
|
|
|
|
default: 'https://api.hubapi.com/oauth/v1/token',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Auth URI Query Parameters',
|
|
|
|
name: 'authQueryParameters',
|
|
|
|
type: 'hidden',
|
|
|
|
default: 'grant_type=authorization_code',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Authentication',
|
|
|
|
name: 'authentication',
|
|
|
|
type: 'hidden',
|
|
|
|
default: 'body',
|
2020-03-08 19:39:20 -07:00
|
|
|
},
|
|
|
|
{
|
2021-09-18 13:18:35 -07:00
|
|
|
displayName: 'Developer API Key',
|
|
|
|
name: 'apiKey',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2020-03-08 19:39:20 -07:00
|
|
|
default: '',
|
|
|
|
},
|
2021-01-31 23:31:40 -08:00
|
|
|
{
|
2021-09-18 13:18:35 -07:00
|
|
|
displayName: 'APP ID',
|
2021-01-31 23:31:40 -08:00
|
|
|
name: 'appId',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-01-31 23:31:40 -08:00
|
|
|
required: true,
|
|
|
|
default: '',
|
2021-09-18 13:18:35 -07:00
|
|
|
description: 'The APP ID',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Scope',
|
|
|
|
name: 'scope',
|
|
|
|
type: 'hidden',
|
|
|
|
default: scopes.join(' '),
|
2021-01-31 23:31:40 -08:00
|
|
|
},
|
2020-03-08 19:39:20 -07:00
|
|
|
];
|
|
|
|
}
|