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, NodePropertyTypes,
} from 'n8n-workflow'; } from 'n8n-workflow';
export class FacebookGraphSubscriptionApi implements ICredentialType { export class FacebookGraphAppApi implements ICredentialType {
name = 'facebookGraphSubscriptionApi'; name = 'facebookGraphAppApi';
displayName = 'Facebook Graph API'; displayName = 'Facebook Graph API (App)';
extends = [ extends = [
'facebookGraphApi', 'facebookGraphApi',
]; ];
properties = [ properties = [
{ {
displayName: 'APP Secret', displayName: 'App Secret',
name: 'appSecret', name: 'appSecret',
type: 'string' as NodePropertyTypes, type: 'string' as NodePropertyTypes,
default: '', default: '',

View File

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

View File

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

View File

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