mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
⚡ Small changes to Facebook Trigger Node
This commit is contained in:
parent
ff9964e10b
commit
d80d486e59
|
@ -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: '',
|
|
@ -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']) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue