Mailchimp OAuth2 support

This commit is contained in:
Rupenieks
2020-06-04 15:54:39 +02:00
parent aff24bb1a5
commit 0ab6a70fa1
5 changed files with 178 additions and 22 deletions

View File

@@ -69,9 +69,44 @@ export class Mailchimp implements INodeType {
{
name: 'mailchimpApi',
required: true,
}
displayOptions: {
show: {
authentication: [
'accessToken',
],
},
},
},
{
name: 'mailchimpOAuth2Api',
required: true,
displayOptions: {
show: {
authentication: [
'oAuth2',
],
},
},
},
],
properties: [
{
displayName: 'Authentication',
name: 'authentication',
type: 'options',
options: [
{
name: 'Access Token',
value: 'accessToken',
},
{
name: 'OAuth2',
value: 'oAuth2',
},
],
default: 'accessToken',
description: 'Method of authentication.',
},
{
displayName: 'Resource',
name: 'resource',
@@ -1536,6 +1571,7 @@ export class Mailchimp implements INodeType {
responseData = { success: true };
}
}
if (Array.isArray(responseData)) {
returnData.push.apply(returnData, responseData as IDataObject[]);
} else {