mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
parent
46ccff98cf
commit
ecb77926a4
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue