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

serverless-leo

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-leo - npm Package Compare versions

Comparing version 1.3.15 to 1.3.16

migrateToServerless.js

6

lib/leo.js

@@ -59,2 +59,3 @@ 'use strict'

const prefix = config && config.prefix ? `${config.prefix}` : undefined
const suffix = config && config.suffix ? `${config.suffix}` : undefined
const botPrefix = prefix ? `${prefix}-` : ''

@@ -65,3 +66,3 @@ const sourceQueue = config ? config.queue : leoEvent.leo

let botId
let botSuffix = botNumber > 0 ? '-' + botNumber : ''
let botSuffix = suffix ? `-${suffix}` : botNumber > 0 ? '-' + botNumber : ''
// If there is no botPrefix, no source queue and multiple bots: add the eventIndex to the botSuffix (botId ultimately)

@@ -81,3 +82,4 @@ if (!botPrefix && !sourceQueue && leoEvents.length > 1) {

botNumber,
prefix
prefix,
suffix
},

@@ -84,0 +86,0 @@ lambdaName: {

{
"name": "serverless-leo",
"version": "1.3.15",
"version": "1.3.16",
"description": "Serverless plugin for leo microservices",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,2 +18,9 @@ # serverless-leo

## Migrate an existing leo microservice to serverless
Copy the migrateToServerless.js file into your existing microservice directory.
```
node migrateToServerless.js
```
See additional notes within the migrateToServerless.js script.
## Create a new NodeJS Leo Microservice and Bot

@@ -20,0 +27,0 @@ ```

@@ -187,2 +187,26 @@ 'use strict'

})
it('names the bot using the suffix in config in events', async () => {
const sls = testServerless()
const lambda = cloneDeep(helloNodeWorldLambda)
lambda.events = [
{
'leo': {
'queue': 'test_hello',
'suffix': 'dest_queue'
}
},
{
'leo': {
'cron': '* * * * * *',
'prefix': 'prename2'
}
}
]
sls.serverless.service.functions.helloNodeWorld = lambda
await sls.compileLeo()
expect(sls.serverless.service.provider.compiledCloudFormationTemplate.Resources['LeoRegister0']
.Properties).to.haveOwnProperty('hello-serverless-leo-world-dev-test_hello-helloNodeWorld-dest_queue')
expect(sls.serverless.service.provider.compiledCloudFormationTemplate.Resources['LeoRegister0']
.Properties['hello-serverless-leo-world-dev-prename2-helloNodeWorld'].name).to.equal('prename2-helloNodeWorld')
})
it('names the bot using lambda name if there is only one cron event', async () => {

@@ -189,0 +213,0 @@ const sls = testServerless()

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