Small changes to Facebook Trigger Node

This commit is contained in:
Jan Oberhauser 2020-11-04 12:26:09 +01:00
parent ff9964e10b
commit d80d486e59
4 changed files with 8 additions and 8 deletions

View file

@ -3,15 +3,15 @@ import {
NodePropertyTypes,
} from 'n8n-workflow';
export class FacebookGraphSubscriptionApi implements ICredentialType {
name = 'facebookGraphSubscriptionApi';
displayName = 'Facebook Graph API';
export class FacebookGraphAppApi implements ICredentialType {
name = 'facebookGraphAppApi';
displayName = 'Facebook Graph API (App)';
extends = [
'facebookGraphApi',
];
properties = [
{
displayName: 'APP Secret',
displayName: 'App Secret',
name: 'appSecret',
type: 'string' as NodePropertyTypes,
default: '',

View file

@ -41,7 +41,7 @@ export class FacebookTrigger implements INodeType {
outputs: ['main'],
credentials: [
{
name: 'facebookGraphSubscriptionApi',
name: 'facebookGraphAppApi',
required: true,
},
],
@ -216,7 +216,7 @@ export class FacebookTrigger implements INodeType {
const res = this.getResponseObject();
const req = this.getRequestObject();
const headerData = this.getHeaderData() as IDataObject;
const credentials = this.getCredentials('facebookGraphSubscriptionApi') as IDataObject;
const credentials = this.getCredentials('facebookGraphAppApi') as IDataObject;
// Check if we're getting facebook's challenge request (https://developers.facebook.com/docs/graph-api/webhooks/getting-started)
if (this.getWebhookName() === 'setup') {
if (query['hub.challenge']) {

View file

@ -19,7 +19,7 @@ export async function facebookApiRequest(this: IHookFunctions | IExecuteFunction
let credentials;
if (this.getNode().name.includes('Trigger')) {
credentials = this.getCredentials('facebookGraphSubscriptionApi') as IDataObject;
credentials = this.getCredentials('facebookGraphAppApi') as IDataObject;
} else {
credentials = this.getCredentials('facebookGraphApi') as IDataObject;
}

View file

@ -66,7 +66,7 @@
"dist/credentials/EventbriteApi.credentials.js",
"dist/credentials/EventbriteOAuth2Api.credentials.js",
"dist/credentials/FacebookGraphApi.credentials.js",
"dist/credentials/FacebookGraphSubscriptionApi.credentials.js",
"dist/credentials/FacebookGraphAppApi.credentials.js",
"dist/credentials/FreshdeskApi.credentials.js",
"dist/credentials/FileMaker.credentials.js",
"dist/credentials/FlowApi.credentials.js",