Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@agiledigital/serverless-sns-sqs-lambda

Package Overview
Dependencies
Maintainers
8
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agiledigital/serverless-sns-sqs-lambda - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

15

lib/serverless-sns-sqs-lambda.js

@@ -132,8 +132,11 @@ "use strict";

validateConfig(funcName, stage, config) {
if (!config.topicArn) {
if (!config.topicArn || !config.name) {
throw new Error(`Error:
When creating an snsSqs handler, you must define the topicArn.
In function [${funcName}] the topicArn was [${config.topicArn}].
When creating an snsSqs handler, you must define the name and topicArn.
In function [${funcName}]:
- name was [${config.name}]
- topicArn was [${config.topicArn}].
e.g.
Usage
-----

@@ -145,3 +148,3 @@ functions:

- snsSqs:
name: Event # optional - default is last part of arn
name: Event # required
topicArn: !Ref TopicArn # required

@@ -161,3 +164,3 @@ maxRetryCount: 2 # optional - default is 5

...config,
name: config.name || config.topicArn.replace(/.*:/, ""),
name: config.name,
funcName: funcNamePascalCase,

@@ -164,0 +167,0 @@ prefix:

@@ -49,2 +49,22 @@ "use strict";

}));
it("should fail if name is not passed", () => {
expect.assertions(1);
expect(() => {
serverlessSnsSqsLambda.validateConfig("func-name", "stage", {
topicArn: "topicArn",
name: undefined
});
}).toThrow(/name was \[undefined\]/);
});
it("should fail if topicArn is not passed", () => {
expect.assertions(1);
expect(() => {
serverlessSnsSqsLambda.validateConfig("func-name", "stage", {
topicArn: undefined,
name: "name"
});
}).toThrow(/topicArn was \[undefined\]/);
});
});

2

package.json
{
"name": "@agiledigital/serverless-sns-sqs-lambda",
"version": "0.1.3",
"version": "0.1.4",
"description": "serverless plugin to make serverless-sns-sqs-lambda events",

@@ -5,0 +5,0 @@ "main": "lib/serverless-sns-sqs-lambda.js",

@@ -42,3 +42,3 @@ # Serverless Sns Sqs Lambda

- snsSqs:
name: TestEvent # Optional - choose a name for the event queue
name: TestEvent # Required - choose a name prefix for the event queue
topicArn: !Ref Topic # Required - SNS topic to subscribe to

@@ -45,0 +45,0 @@ batchSize: 2 # Optional - default value is 10

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc