2022-07-24 08:36:17 -07:00
|
|
|
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
2020-06-10 14:37:01 -07:00
|
|
|
|
|
|
|
export class MauticOAuth2Api implements ICredentialType {
|
|
|
|
name = 'mauticOAuth2Api';
|
2022-07-24 08:36:17 -07:00
|
|
|
extends = ['oAuth2Api'];
|
2020-06-10 14:37:01 -07:00
|
|
|
displayName = 'Mautic OAuth2 API';
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'mautic';
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2022-06-13 22:27:19 -07:00
|
|
|
{
|
|
|
|
displayName: 'Grant Type',
|
|
|
|
name: 'grantType',
|
|
|
|
type: 'hidden',
|
|
|
|
default: 'authorizationCode',
|
|
|
|
},
|
2020-06-10 14:37:01 -07:00
|
|
|
{
|
|
|
|
displayName: 'URL',
|
|
|
|
name: 'url',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2020-06-10 14:37:01 -07:00
|
|
|
default: '',
|
|
|
|
placeholder: 'https://name.mautic.net',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Authorization URL',
|
|
|
|
name: 'authUrl',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2022-07-24 08:36:17 -07:00
|
|
|
default:
|
|
|
|
'={{$self["url"].endsWith("/") ? $self["url"].slice(0, -1) : $self["url"]}}/oauth/v2/authorize',
|
2020-06-10 14:37:01 -07:00
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Access Token URL',
|
|
|
|
name: 'accessTokenUrl',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2022-07-24 08:36:17 -07:00
|
|
|
default:
|
|
|
|
'={{$self["url"].endsWith("/") ? $self["url"].slice(0, -1) : $self["url"]}}/oauth/v2/token',
|
2020-06-10 14:37:01 -07:00
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Scope',
|
|
|
|
name: 'scope',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-06-10 14:37:01 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Auth URI Query Parameters',
|
|
|
|
name: 'authQueryParameters',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-06-10 14:37:01 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Authentication',
|
|
|
|
name: 'authentication',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-12-12 08:00:57 -08:00
|
|
|
default: 'body',
|
2020-06-10 14:37:01 -07:00
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|