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

sls-helper-plugin-janis

Package Overview
Dependencies
Maintainers
2
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sls-helper-plugin-janis - npm Package Compare versions

Comparing version 2.8.0 to 2.9.0-alpha.0

21

lib/api/api.js

@@ -19,2 +19,15 @@ 'use strict';

const apiPathPartToName = apiPathPart => apiPathPart
.replace(/-/g, 'Dash')
.replace(/\{(.+)\}/, '$1Var')
.replace(/[^0-9A-Za-z]/g, '')
.replace(/^./, firstChar => firstChar.toUpperCase());
const apiPathToName = apiPath => apiPath
.split('/')
.map(apiPathPart => apiPathPartToName(apiPathPart))
.join('');
const getFunctionName = (method, apiPath) => `${startcase(method)}${apiPathToName(apiPath)}`;
const apiBase = ({

@@ -68,3 +81,6 @@ path,

const functionName = getFunctionName(methodName, normalizedPath);
const functionConfiguration = {
name: `API-\${self:custom.serviceName}-${functionName}-\${self:custom.stage}`,
handler: handler || 'src/lambda/RestApi/index.handler',

@@ -92,7 +108,4 @@ description,

const apiName = startcase(`${fileDir}-${methodName}-api`).replace(/ /g, '');
return {
[apiName]:
functionConfiguration
[`API-${functionName}`]: functionConfiguration
};

@@ -99,0 +112,0 @@ };

@@ -13,2 +13,13 @@ 'use strict';

const getFunctionNamePrefix = methodName => {
switch(methodName.toLowerCase()) {
case 'post':
return 'Create';
case 'put':
return 'Update';
default:
return startcase(methodName);
}
};
const apiBase = ({

@@ -66,2 +77,3 @@ entityName,

const functionConfiguration = {
name: `API${getFunctionNamePrefix(methodName)}-\${self:custom.serviceName}-${entityNameAsTitle.replace(/ /g, '')}-\${self:custom.stage}`,
handler: handler || 'src/lambda/RestApi/index.handler',

@@ -90,3 +102,5 @@ description: `${entityNameAsTitle} ${startcase(methodName)} API`,

return { [`${entityNameAsTitle.replace(/ /g, '')}${startcase(methodName)}Api`]: functionConfiguration };
return {
[`API${getFunctionNamePrefix(methodName)}-${entityNameAsTitle.replace(/ /g, '')}`]: functionConfiguration
};
};

@@ -93,0 +107,0 @@

5

lib/event-listener/index.js

@@ -31,5 +31,6 @@ 'use strict';

const listenerName = `${serviceNameAsTitle}${entityNameAsTitle}${eventNameAsTitle}Listener`.replace(/ /g, '');
const listenerCode = `${serviceNameAsTitle}${entityNameAsTitle}${eventNameAsTitle}`.replace(/ /g, '');
const functionConfiguration = {
name: `EL-\${self:custom.serviceName}-${listenerCode}-\${self:custom.stage}`,
handler: `src/${listenersDirName}/${serviceAsKebab}/${entityNameAsKebab}/${eventNameAsKebab}.handler`,

@@ -58,3 +59,3 @@ description: `${serviceNameAsTitle} ${entityNameAsTitle} ${eventNameAsTitle} Listener`,

return {
[listenerName]: functionConfiguration
[`EL-${listenerCode}`]: functionConfiguration
};

@@ -61,0 +62,0 @@ };

{
"name": "sls-helper-plugin-janis",
"version": "2.8.0",
"version": "2.9.0-alpha.0",
"description": "A Serverless Helper plugin to add custom helpers for JANIS Commerce",

@@ -5,0 +5,0 @@ "main": "lib/plugin.js",

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