dynamodb-admin
Advanced tools
Comparing version 2.0.2 to 2.0.3
26
index.js
const express = require('express') | ||
const _ = require('lodash') | ||
const AWS = require('aws-sdk') | ||
const promisify = require('es6-promisify') | ||
const {promisify} = require('es6-promisify') | ||
const path = require('path') | ||
const errorhandler = require('errorhandler') | ||
const { extractKey, parseKey } = require('./util') | ||
const { extractKey, extractKeysForItems, parseKey } = require('./util') | ||
const bodyParser = require('body-parser') | ||
const pickBy = require('lodash/pickBy') | ||
const omit = require('lodash/omit') | ||
const yaml = require('js-yaml') | ||
const querystring = require('querystring') | ||
@@ -365,5 +364,11 @@ const clc = require('cli-color') | ||
const Items = pageItems.map(item => { | ||
return Object.assign({}, item, { | ||
__key: extractKey(item, description.Table.KeySchema) | ||
}) | ||
}); | ||
const UniqueKeys = extractKeysForItems(Items); | ||
const data = Object.assign({}, description, { | ||
query: req.query, | ||
yaml, | ||
omit, | ||
@@ -374,7 +379,4 @@ filters, | ||
filterQueryString: querystring.stringify(filters), | ||
Items: pageItems.map(item => { | ||
return Object.assign({}, item, { | ||
__key: extractKey(item, description.Table.KeySchema) | ||
}) | ||
}) | ||
Items, | ||
UniqueKeys, | ||
}) | ||
@@ -516,4 +518,6 @@ res.render('scan', data) | ||
const port = process.env.PORT || 8001 | ||
app.listen(port, () => { | ||
console.log(` listening on port ${port}`) | ||
const server = app.listen(port, '127.0.0.1'); | ||
server.on('listening', () => { | ||
const address = server.address(); | ||
console.log(` listening on http://${address.address}:${address.port}`); | ||
}) |
{ | ||
"name": "dynamodb-admin", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "GUI for DynamoDB. Useful for local development.", | ||
@@ -8,2 +8,3 @@ "main": "index.js", | ||
"scripts": { | ||
"start": "node bin/dynamodb-admin.js", | ||
"test": "jest" | ||
@@ -26,16 +27,15 @@ }, | ||
"dependencies": { | ||
"aws-sdk": "^2.7.27", | ||
"body-parser": "^1.15.2", | ||
"aws-sdk": "^2.273.1", | ||
"body-parser": "^1.18.3", | ||
"cli-color": "^1.2.0", | ||
"ejs": "^2.5.1", | ||
"ejs": "^2.6.1", | ||
"errorhandler": "^1.4.3", | ||
"es6-promisify": "^4.1.0", | ||
"es7-object-polyfill": "0.0.1", | ||
"express": "^4.14.0", | ||
"js-yaml": "^3.6.1", | ||
"lodash": "^4.16.4" | ||
"es6-promisify": "^6.0.0", | ||
"es7-object-polyfill": "0.0.7", | ||
"express": "^4.16.3", | ||
"lodash": "^4.17.10" | ||
}, | ||
"devDependencies": { | ||
"jest-cli": "^15.0.2" | ||
"jest-cli": "^23.4.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
GUI for DynamoDB Local. | ||
GUI for [DynamoDB Local](https://aws.amazon.com/blogs/aws/dynamodb-local-for-desktop-development/) or [dynalite](https://github.com/mhart/dynalite). | ||
@@ -3,0 +3,0 @@ ## Usage |
12
util.js
@@ -23,2 +23,14 @@ exports.extractKey = function(item, KeySchema) { | ||
exports.extractKeysForItems = function(Items) { | ||
const keys = new Set(); | ||
for (const item of Items) { | ||
for (const key of Object.keys(item)) { | ||
if (!keys.has(key)) { | ||
keys.add(key); | ||
} | ||
} | ||
} | ||
return Array.from(keys); | ||
} | ||
function typecastKey(keyName, keyValue, table) { | ||
@@ -25,0 +37,0 @@ const definition = table.AttributeDefinitions.find(attribute => { |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9
2476
548948
21
1
+ Addedes6-promisify@6.1.1(transitive)
+ Addedes7-object-polyfill@0.0.7(transitive)
- Removedjs-yaml@^3.6.1
- Removedargparse@1.0.10(transitive)
- Removedes6-promise@3.3.1(transitive)
- Removedes6-promisify@4.1.0(transitive)
- Removedes7-object-polyfill@0.0.1(transitive)
- Removedesprima@4.0.1(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedsprintf-js@1.0.3(transitive)
Updatedaws-sdk@^2.273.1
Updatedbody-parser@^1.18.3
Updatedejs@^2.6.1
Updatedes6-promisify@^6.0.0
Updatedes7-object-polyfill@0.0.7
Updatedexpress@^4.16.3
Updatedlodash@^4.17.10