mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
@@ -15,7 +15,9 @@ import {
|
|||||||
awsApiRequestSOAP,
|
awsApiRequestSOAP,
|
||||||
} from './GenericFunctions';
|
} from './GenericFunctions';
|
||||||
|
|
||||||
import { get } from 'lodash';
|
import {
|
||||||
|
get,
|
||||||
|
} from 'lodash';
|
||||||
|
|
||||||
export class AwsSnsTrigger implements INodeType {
|
export class AwsSnsTrigger implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
@@ -36,7 +38,7 @@ export class AwsSnsTrigger implements INodeType {
|
|||||||
{
|
{
|
||||||
name: 'aws',
|
name: 'aws',
|
||||||
required: true,
|
required: true,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
webhooks: [
|
webhooks: [
|
||||||
{
|
{
|
||||||
@@ -108,7 +110,10 @@ export class AwsSnsTrigger implements INodeType {
|
|||||||
'Version=2010-03-31',
|
'Version=2010-03-31',
|
||||||
];
|
];
|
||||||
const data = await awsApiRequestSOAP.call(this, 'sns', 'GET', '/?Action=ListSubscriptionsByTopic&' + params.join('&'));
|
const data = await awsApiRequestSOAP.call(this, 'sns', 'GET', '/?Action=ListSubscriptionsByTopic&' + params.join('&'));
|
||||||
const subscriptions = get(data, 'ListSubscriptionsByTopicResponse.ListSubscriptionsByTopicResult.Subscriptions.member');
|
let subscriptions = get(data, 'ListSubscriptionsByTopicResponse.ListSubscriptionsByTopicResult.Subscriptions.member');
|
||||||
|
if (!Array.isArray(subscriptions)) {
|
||||||
|
subscriptions = [subscriptions];
|
||||||
|
}
|
||||||
for (const subscription of subscriptions) {
|
for (const subscription of subscriptions) {
|
||||||
if (webhookData.webhookId === subscription.SubscriptionArn) {
|
if (webhookData.webhookId === subscription.SubscriptionArn) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user