dynamodb-admin
Advanced tools
Comparing version 1.11.1 to 1.12.0
56
index.js
@@ -77,21 +77,41 @@ const express = require('express') | ||
app.post('/create-table', bodyParser.urlencoded({extended: false}), (req, res, next) => { | ||
dynamodb.createTable({ | ||
TableName: req.body.TableName, | ||
ProvisionedThroughput: { | ||
ReadCapacityUnits: req.body.ReadCapacityUnits, | ||
WriteCapacityUnits: req.body.WriteCapacityUnits | ||
}, | ||
KeySchema: [{ | ||
AttributeName: 'id', | ||
KeyType: 'HASH' | ||
}], | ||
AttributeDefinitions: [{ | ||
AttributeName: 'id', | ||
AttributeType: 'S' | ||
}] | ||
}).promise().then((response) => { | ||
res.redirect('/') | ||
}).catch(next) | ||
}) | ||
let attributeDefinitions = [ | ||
{ | ||
AttributeName: req.body.HashAttributeName, | ||
AttributeType: req.body.HashAttributeType, | ||
} | ||
]; | ||
let keySchema = [ | ||
{ | ||
AttributeName: req.body.HashAttributeName, | ||
KeyType: 'HASH', | ||
} | ||
]; | ||
if (req.body.RangeAttributeName) { | ||
attributeDefinitions.push({ | ||
AttributeName: req.body.RangeAttributeName, | ||
AttributeType: req.body.RangeAttributeType, | ||
}); | ||
keySchema.push({ | ||
AttributeName: req.body.RangeAttributeName, | ||
KeyType: 'RANGE', | ||
}); | ||
} | ||
dynamodb.createTable({ | ||
TableName: req.body.TableName, | ||
ProvisionedThroughput: { | ||
ReadCapacityUnits: req.body.ReadCapacityUnits, | ||
WriteCapacityUnits: req.body.WriteCapacityUnits, | ||
}, | ||
KeySchema: keySchema, | ||
AttributeDefinitions: attributeDefinitions, | ||
}).promise().then((response) => { | ||
res.redirect('/') | ||
}).catch(next) | ||
}); | ||
app.delete('/tables/:TableName', (req, res, next) => { | ||
@@ -98,0 +118,0 @@ const TableName = req.params.TableName |
{ | ||
"name": "dynamodb-admin", | ||
"version": "1.11.1", | ||
"version": "1.12.0", | ||
"description": "GUI for DynamoDB. Useful for local development.", | ||
"main": "index.js", | ||
"bin": "./bin/dynamodb-admin.js", | ||
"engines": { | ||
"node": "6.4.0", | ||
"npm": "3.10.3" | ||
}, | ||
"scripts": { | ||
@@ -12,0 +8,0 @@ "test": "jest" |
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
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
132806
793