Comparing version 0.7.2 to 0.7.3
@@ -13,6 +13,6 @@ // Copyright 2013. The Obvious Corporation. | ||
Error.captureStackTrace(this) | ||
this.data = data | ||
this.data = data || {} | ||
this.message = 'The conditional request failed' | ||
this.details = msg | ||
this.table = data.TableName | ||
this.table = data.TableName || 'unknown' | ||
} | ||
@@ -33,6 +33,6 @@ util.inherits(ConditionalError, Error) | ||
Error.captureStackTrace(this) | ||
this.data = data | ||
this.data = data || {} | ||
this.message = 'The level of configured provisioned throughput for the table was exceeded' | ||
this.details = msg | ||
this.table = data.TableName | ||
this.table = data.TableName || 'unknown' | ||
this.isWrite = isWrite | ||
@@ -54,4 +54,5 @@ } | ||
Error.captureStackTrace(this) | ||
this.data = data | ||
this.data = data || {} | ||
this.message = msg | ||
this.table = data.TableName || 'unknown' | ||
this.isWrite = isWrite | ||
@@ -58,0 +59,0 @@ } |
@@ -158,5 +158,5 @@ var common = require('./common') | ||
.fail(this.emptyResults) | ||
.failBound(this.convertErrors, null, {attributes: queryData, isWrite: false}) | ||
.failBound(this.convertErrors, null, {data: queryData, isWrite: false}) | ||
} | ||
module.exports = QueryBuilder |
@@ -156,2 +156,10 @@ // Copyright 2013 The Obvious Corporation | ||
return Number(obj.N) | ||
case 'M': | ||
var mapped = {}; | ||
for (var k in obj.M) { | ||
mapped[k] = objectToValue(obj.M[k]); | ||
} | ||
return mapped; | ||
case 'L': | ||
return obj.L.map(objectToValue); | ||
default: | ||
@@ -158,0 +166,0 @@ throw new Error('Unexpected key: ' + objectToType(obj) + ' for attribute: ' + obj) |
{ | ||
"name": "dynamite", | ||
"description": "promise-based DynamoDB client", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"homepage": "https://github.com/Medium/dynamite", | ||
@@ -6,0 +6,0 @@ "license": "Apache-2.0", |
@@ -12,11 +12,2 @@ # Dynamite [![Build Status](https://travis-ci.org/Medium/dynamite.svg?branch=master)](https://travis-ci.org/Medium/dynamite) | ||
Currently, Dynamite runs tests against the [Fake | ||
Dynamo](https://github.com/ananthakumaran/fake_dynamo) Ruby gem. To install the gem: | ||
$ gem install fake_dynamo | ||
To run the service, with an optional log level of `debug` (show everything) on port 4567, run the following in a different terminal window or as a background process: | ||
$ fake_dynamo -l debug -p 4567 | ||
Ensure that all of the required node modules are installed in the Dynamite directory by first running: | ||
@@ -26,3 +17,3 @@ | ||
The tests will be run against the `fake_dynamo` service running on port `4567`. Currently, there is no way to change the port without modifying the connection code in `test/utils/TestUtils.js`. To run the tests: | ||
The tests will be run against a `LocalDynamo` service. Currently, there is no way to change the port without modifying the connection code in `test/utils/TestUtils.js`. To run the tests: | ||
@@ -29,0 +20,0 @@ $ npm test |
@@ -335,1 +335,15 @@ // Copyright 2013 The Obvious Corporation. | ||
}) | ||
builder.add(function testValidationError(test) { | ||
var client = this.client | ||
return client.newQueryBuilder('comments') | ||
.setHashKey('garbage', 'postId') | ||
.execute() | ||
.then(function (x) { | ||
test.fail('Expected validation exception') | ||
}) | ||
.fail(function (e) { | ||
if (!client.isValidationError(e)) throw e | ||
test.equal('comments', e.table) | ||
}) | ||
}) |
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
215536
5541
460