2020-06-10 03:48:21 -07:00
|
|
|
import {
|
|
|
|
ICredentialType,
|
|
|
|
NodePropertyTypes,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2020-06-14 13:30:24 -07:00
|
|
|
const scopes = [
|
|
|
|
'surveys_read',
|
|
|
|
'collectors_read',
|
|
|
|
'responses_read',
|
|
|
|
'responses_read_detail',
|
|
|
|
'webhooks_write',
|
|
|
|
'webhooks_read',
|
|
|
|
];
|
2020-06-10 03:48:21 -07:00
|
|
|
|
|
|
|
export class SurveyMonkeyOAuth2Api implements ICredentialType {
|
|
|
|
name = 'surveyMonkeyOAuth2Api';
|
|
|
|
extends = [
|
|
|
|
'oAuth2Api',
|
|
|
|
];
|
|
|
|
displayName = 'SurveyMonkey OAuth2 API';
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'surveyMonkey';
|
2020-06-10 03:48:21 -07:00
|
|
|
properties = [
|
|
|
|
{
|
|
|
|
displayName: 'Authorization URL',
|
|
|
|
name: 'authUrl',
|
|
|
|
type: 'hidden' as NodePropertyTypes,
|
|
|
|
default: 'https://api.surveymonkey.com/oauth/authorize',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Access Token URL',
|
|
|
|
name: 'accessTokenUrl',
|
|
|
|
type: 'hidden' as NodePropertyTypes,
|
|
|
|
default: 'https://api.surveymonkey.com/oauth/token',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Scope',
|
|
|
|
name: 'scope',
|
2020-06-14 13:30:24 -07:00
|
|
|
type: 'hidden' as NodePropertyTypes,
|
|
|
|
default: scopes.join(','),
|
2020-06-10 03:48:21 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Auth URI Query Parameters',
|
|
|
|
name: 'authQueryParameters',
|
|
|
|
type: 'hidden' as NodePropertyTypes,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Authentication',
|
|
|
|
name: 'authentication',
|
|
|
|
type: 'hidden' as NodePropertyTypes,
|
2020-10-22 06:46:03 -07:00
|
|
|
default: 'body',
|
2020-06-10 03:48:21 -07:00
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|