New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

serverless-sam

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-sam - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

34

lib/sam/SamBuilder.js

@@ -26,2 +26,4 @@ /*

this.outputs = null;
this.conditions = null;
this.parameters = null;
}

@@ -87,2 +89,26 @@

addParameter(logicalId, obj){
if (!this.parameters) {
this.parameters = {};
}
if (this.parameters[logicalId]){
throw new Error("Parameter " + logicalId + " is already defined");
}
this.parameters[logicalId] = obj;
}
addCondition(logicalId, obj) {
if (!this.conditions) {
this.conditions = {};
}
if(this.outputs[logicalId]){
throw new Error("Condition " + logicalId + " is already defined");
}
this.conditions[logicalId] = obj;
}
getResources(skipNulls) {

@@ -110,2 +136,10 @@ return JSON.parse(JSON.stringify(this.resources, function(key, value) {

if (this.parameters) {
templateObject["Parameters"] = this.parameters;
}
if (this.conditions) {
templateObject["Conditions"] = this.conditions;
}
return templateObject;

@@ -112,0 +146,0 @@ }

27

lib/SamGenerator.js

@@ -51,6 +51,12 @@ /*

// 3. read functions
// 3. read parameters if any
this.readParameters(this.serverless.service);
// 4. read conditions if any
this.readConditions(this.serverless.service);
// 5. read functions
this.readFunctions(this.serverless.service);
// 4. create yaml
// 6. create yaml
return this.dumpYamlTemplate();

@@ -83,2 +89,19 @@ }

readConditions(service){
this.serverless.cli.log("Exporting conditions");
if (service.resources && service.resources.Conditions) {
Object.keys(service.resources.Conditions).forEach((id,idx) => {
this.samBuilder.addCondition(id, service.resources.Conditions[id]);
});
}
}
readParameters(service){
this.serverless.cli.log("Exporting parameters");
if (service.resources && service.resources.Parameters) {
Object.keys(service.resources.Parameters).forEach((id,idx) => {
this.samBuilder.addParameter(id, service.resources.Parameters[id]);
});
}
}
readFunctions(service) {

@@ -85,0 +108,0 @@ this.serverless.cli.log("Exporting functions");

2

package.json
{
"name": "serverless-sam",
"version": "0.0.3",
"version": "0.0.4",
"description": "Serverless framework plugin to export AWS SAM templates for a service",

@@ -5,0 +5,0 @@ "main": "index.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