2020-02-10 12:55:28 -08:00
|
|
|
import {
|
|
|
|
ICredentialType,
|
2021-06-12 09:39:55 -07:00
|
|
|
INodeProperties,
|
2020-02-10 12:55:28 -08:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
export class SalesforceOAuth2Api implements ICredentialType {
|
|
|
|
name = 'salesforceOAuth2Api';
|
|
|
|
extends = [
|
|
|
|
'oAuth2Api',
|
|
|
|
];
|
|
|
|
displayName = 'Salesforce OAuth2 API';
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'salesforce';
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2021-07-14 09:51:51 -07:00
|
|
|
{
|
|
|
|
displayName: 'Environment Type',
|
|
|
|
name: 'environment',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Production',
|
|
|
|
value: 'production',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Sandbox',
|
|
|
|
value: 'sandbox',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'production',
|
|
|
|
},
|
2020-02-10 12:55:28 -08:00
|
|
|
{
|
|
|
|
displayName: 'Authorization URL',
|
|
|
|
name: 'authUrl',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-02-10 12:55:28 -08:00
|
|
|
required: true,
|
2021-07-14 09:51:51 -07:00
|
|
|
default: '={{ $self["environment"] === "sandbox" ? "https://test.salesforce.com/services/oauth2/authorize" : "https://login.salesforce.com/services/oauth2/authorize" }}',
|
2020-02-10 12:55:28 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Access Token URL',
|
|
|
|
name: 'accessTokenUrl',
|
2021-07-14 09:51:51 -07:00
|
|
|
type: 'hidden',
|
2020-02-10 12:55:28 -08:00
|
|
|
required: true,
|
2021-07-14 09:51:51 -07:00
|
|
|
default: '={{ $self["environment"] === "sandbox" ? "https://test.salesforce.com/services/oauth2/token" : "https://login.salesforce.com/services/oauth2/token" }}',
|
2020-02-10 12:55:28 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Scope',
|
|
|
|
name: 'scope',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-02-14 17:30:45 -08:00
|
|
|
default: 'full refresh_token',
|
2020-02-10 12:55:28 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Auth URI Query Parameters',
|
|
|
|
name: 'authQueryParameters',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-02-10 12:55:28 -08:00
|
|
|
default: '',
|
|
|
|
},
|
2020-09-06 12:31:55 -07:00
|
|
|
{
|
|
|
|
displayName: 'Authentication',
|
|
|
|
name: 'authentication',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-09-06 12:31:55 -07:00
|
|
|
default: 'header',
|
|
|
|
},
|
2020-02-10 12:55:28 -08:00
|
|
|
];
|
|
|
|
}
|