mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
⚡ Small changes to Facebook Trigger Node
This commit is contained in:
@@ -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: '',
|
||||||
@@ -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']) {
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user