serverless-dynamodb-local
Advanced tools
Comparing version 0.2.24 to 0.2.25
@@ -0,0 +0,0 @@ ## How to contribute to serverless-dynamodb-local |
45
index.js
@@ -110,5 +110,11 @@ "use strict"; | ||
get host() { | ||
const config = this.config; | ||
const host = _.get(config, "start.host", "localhost"); | ||
return host; | ||
} | ||
dynamodbOptions() { | ||
const dynamoOptions = { | ||
endpoint: `http://localhost:${this.port}`, | ||
endpoint: `http://${this.host}:${this.port}`, | ||
region: "localhost", | ||
@@ -175,7 +181,16 @@ accessKeyId: "MOCK_ACCESS_KEY_ID", | ||
/** | ||
* Gets the table definitions | ||
*/ | ||
get tables() { | ||
const resources = this.service.resources.Resources; | ||
getDefaultStack() { | ||
return _.get(this.service, "resources"); | ||
} | ||
getAdditionalStacks() { | ||
return _.values(_.get(this.service, "custom.additionalStacks", {})); | ||
} | ||
hasAdditionalStacksPlugin() { | ||
return _.get(this.service, "plugins", []).includes("serverless-plugin-additional-stacks"); | ||
} | ||
getTableDefinitionsFromStack(stack) { | ||
const resources = _.get(stack, "Resources", []); | ||
return Object.keys(resources).map((key) => { | ||
@@ -189,2 +204,20 @@ if (resources[key].Type === "AWS::DynamoDB::Table") { | ||
/** | ||
* Gets the table definitions | ||
*/ | ||
get tables() { | ||
let stacks = []; | ||
const defaultStack = this.getDefaultStack(); | ||
if (defaultStack) { | ||
stacks.push(defaultStack); | ||
} | ||
if (this.hasAdditionalStacksPlugin()) { | ||
stacks = stacks.concat(this.getAdditionalStacks()); | ||
} | ||
return stacks.map((stack) => this.getTableDefinitionsFromStack(stack)).reduce((tables, tablesInStack) => tables.concat(tablesInStack), []); | ||
} | ||
/** | ||
* Gets the seeding sources | ||
@@ -191,0 +224,0 @@ */ |
{ | ||
"name": "serverless-dynamodb-local", | ||
"version": "0.2.24", | ||
"engines": { | ||
"node": ">=4.0" | ||
}, | ||
"description": "Serverless dynamodb local plugin", | ||
"author": "99xtechnology.com", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/99xt/serverless-dynamodb-local" | ||
}, | ||
"keywords": [ | ||
"serverless framework plugin", | ||
"serverless applications", | ||
"serverless plugins", | ||
"api gateway", | ||
"lambda", | ||
"dynamodb", | ||
"dynamodb local", | ||
"aws", | ||
"aws lambda", | ||
"aws dynamodb", | ||
"amazon", | ||
"amazon web services", | ||
"serverless.com" | ||
], | ||
"main": "index.js", | ||
"bin": {}, | ||
"scripts": { | ||
"test": "mocha ./test" | ||
}, | ||
"dependencies": { | ||
"aws-sdk": "^2.7.0", | ||
"bluebird": "^3.4.6", | ||
"dynamodb-localhost": "^0.0.5", | ||
"lodash": "^4.17.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.1.1", | ||
"mocha": "^3.5.0", | ||
"should": "^11.2.1" | ||
} | ||
"name": "serverless-dynamodb-local", | ||
"version": "0.2.25", | ||
"engines": { | ||
"node": ">=4.0" | ||
}, | ||
"description": "Serverless dynamodb local plugin", | ||
"author": "99xtechnology.com", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/99xt/serverless-dynamodb-local" | ||
}, | ||
"keywords": [ | ||
"serverless framework plugin", | ||
"serverless applications", | ||
"serverless plugins", | ||
"api gateway", | ||
"lambda", | ||
"dynamodb", | ||
"dynamodb local", | ||
"aws", | ||
"aws lambda", | ||
"aws dynamodb", | ||
"amazon", | ||
"amazon web services", | ||
"serverless.com" | ||
], | ||
"main": "index.js", | ||
"bin": {}, | ||
"scripts": { | ||
"test": "mocha ./test" | ||
}, | ||
"dependencies": { | ||
"aws-sdk": "^2.7.0", | ||
"bluebird": "^3.4.6", | ||
"dynamodb-localhost": "^0.0.5", | ||
"lodash": "^4.17.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.1.1", | ||
"mocha": "^3.5.0", | ||
"should": "^11.2.1" | ||
} | ||
} |
@@ -0,0 +0,0 @@ serverless-dynamodb-local |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
36235
603
4