aws-core-utils
Advanced tools
Comparing version 6.0.9 to 6.0.10
@@ -17,10 +17,9 @@ 'use strict'; | ||
* Gets the item with the given key from the named DynamoDB table. | ||
* @template K - the type of the key object | ||
* @template I - the type of data returned in the DynamoDB result's `Item` property | ||
* @param {string} tableName - the name of the DynamoDB table from which to load | ||
* @param {K} key - the key of the item to get | ||
* @param {DynamoDBGetOpts|undefined} [opts] - optional DynamoDB `get` parameter options to use | ||
* @param {DynamoGetOpts|undefined} [opts] - optional DynamoDB `get` parameter options to use | ||
* @param {string} desc - a description of the item being requested for logging purposes | ||
* @param {StandardContext} context - the context to use | ||
* @return {Promise.<DynamoDBGetResult.<I>>} a promise that will resolve with the result or reject with an error | ||
* @return {Promise.<DynamoGetResult.<I>>} a promise that will resolve with the result or reject with an error | ||
* @template I,K | ||
*/ | ||
@@ -27,0 +26,0 @@ function getItem(tableName, key, opts, desc, context) { |
{ | ||
"name": "aws-core-utils", | ||
"version": "6.0.9", | ||
"version": "6.0.10", | ||
"description": "Core utilities for working with Amazon Web Services (AWS), including ARNs, regions, stages, Lambdas, AWS errors, stream events, Kinesis, DynamoDB.DocumentClients, etc.", | ||
@@ -14,4 +14,4 @@ "author": "Byron du Preez", | ||
"dependencies": { | ||
"core-functions": "3.0.5", | ||
"logging-utils": "4.0.4", | ||
"core-functions": "3.0.6", | ||
"logging-utils": "4.0.5", | ||
"deep-equal": "1.0.1" | ||
@@ -18,0 +18,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
# aws-core-utils v6.0.9 | ||
# aws-core-utils v6.0.10 | ||
@@ -393,2 +393,16 @@ Core utilities for working with Amazon Web Services (AWS), including ARNs, regions, stages, Lambdas, AWS errors, stream events, Kinesis, DynamoDB.DocumentClients, etc. | ||
### 6.0.10 | ||
- Changes to `type-defs` module - added more detail to type definitions: | ||
- Renamed `DynamoDBGetOpts` type definition to `DynamoGetOpts` | ||
- Renamed `DynamoDBQueryOpts` type definition to `DynamoQueryOpts` & added key `K` template | ||
- Renamed `DynamoDBGetResult` type definition to `DynamoGetResult` | ||
- Renamed `DynamoDBQueryResult` type definition to `DynamoQueryResult` & added extra key `K` template | ||
- Added new `DynamoBatchGetResult` type definition with item `I` & key `K` templates | ||
- Added new `DynamoScanResult` type definition with item `I` & key `K` templates | ||
- Added new `UnprocessedKeysMap` & `CapacityUnitsMap` type definitions | ||
- Added details & properties to `ConsumedCapacity` type definition | ||
- Upgraded `aws-core-test-utils` test dependency to 2.0.6 | ||
- Updated `core-functions` dependency to version 3.0.6 | ||
- Updated `logging-utils` dependency to version 4.0.5 | ||
### 6.0.9 | ||
@@ -395,0 +409,0 @@ - Upgraded `aws-core-test-utils` test dependency to 2.0.5 |
@@ -37,3 +37,3 @@ 'use strict'; | ||
context.dynamoDBDocClient = mockDynamoDBDocClient(t, 'dynamodb-utils.test', 1, | ||
{get: {result: result, validateParams: validateGetParams}}); | ||
{get: {result: result, validateArgs: validateGetParams}}); | ||
@@ -70,3 +70,3 @@ getItem(tableName, key, opts, `country (${key.country})`, context) | ||
context.dynamoDBDocClient = mockDynamoDBDocClient(t, 'dynamodb-utils.test', 1, | ||
{get: {result: result, validateParams: validateGetParams}}); | ||
{get: {result: result, validateArgs: validateGetParams}}); | ||
@@ -105,3 +105,3 @@ getItem(tableName, key, opts, `country (${key.country})`, context) | ||
context.dynamoDBDocClient = mockDynamoDBDocClient(t, 'dynamodb-utils.test', 1, | ||
{get: {result: result, validateParams: validateGetParams}}); | ||
{get: {result: result, validateArgs: validateGetParams}}); | ||
@@ -138,3 +138,3 @@ getItem(tableName, key, opts, `country (${key.country})`, context) | ||
context.dynamoDBDocClient = mockDynamoDBDocClient(t, 'dynamodb-utils.test', 1, | ||
{get: {error: fatalError, validateParams: validateGetParams}}); | ||
{get: {error: fatalError, validateArgs: validateGetParams}}); | ||
@@ -141,0 +141,0 @@ getItem(tableName, key, opts, `country (${key.country})`, context) |
{ | ||
"name": "aws-core-utils-tests", | ||
"description": "Unit tests for aws-core-utils modules", | ||
"version": "6.0.9", | ||
"version": "6.0.10", | ||
"author": "Byron du Preez", | ||
@@ -15,3 +15,3 @@ "license": "Apache-2.0", | ||
"devDependencies": { | ||
"aws-core-test-utils": "2.0.5", | ||
"aws-core-test-utils": "2.0.6", | ||
"tape": "^4.6.3", | ||
@@ -18,0 +18,0 @@ "uuid": "^3.0.1" |
@@ -373,3 +373,3 @@ 'use strict'; | ||
/** | ||
* @typedef {Object} DynamoDBGetOpts - a selection of DynamoDB.DocumentClient `get` method param options to use (other than TableName & Key & legacy parameters) | ||
* @typedef {Object} DynamoGetOpts - a selection of DynamoDB.DocumentClient `get` method param options to use (other than TableName & Key & legacy parameters) | ||
* @property {boolean|undefined} [ConsistentRead] - whether to do a consistent read to obtain a strongly consistent result or not (NB: GSIs ONLY support eventually consistent reads) | ||
@@ -382,4 +382,4 @@ * @property {string|undefined} [ProjectionExpression] - an optional string that identifies one or more attributes to retrieve from the table | ||
/** | ||
* @typedef {Object} DynamoDBQueryOpts - a selection of DynamoDB Query options to use (other than TableName, [IndexName], KeyConditionExpression, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues & legacy parameters) | ||
* @property {Object|undefined} [ExclusiveStartKey] - the optional exclusive start key from which to continue a previous query | ||
* @typedef {Object} DynamoQueryOpts.<K> - a selection of DynamoDB Query options to use (other than TableName, [IndexName], KeyConditionExpression, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues & legacy parameters) | ||
* @property {K|Object|undefined} [ExclusiveStartKey] - the optional exclusive start key from which to continue a previous query | ||
* @property {number|undefined} [Limit] - the optional number of results to which to limit the query | ||
@@ -394,23 +394,61 @@ * @property {boolean|undefined} [ConsistentRead] - whether to do a consistent read to obtain a strongly consistent result or not (NB: GSIs ONLY support eventually consistent reads) | ||
* @property {Object|undefined} [ExpressionAttributeValues] - optional one or more substitution tokens for attribute names in an expression | ||
* @template K | ||
*/ | ||
/** | ||
* @typedef {Object} DynamoDBGetResult.<I> - a DynamoDB.DocumentClient `get` result (or DynamoDB `getItem` result) | ||
* @property {I|undefined} [Item] - the returned item (if found) or undefined (if not) | ||
* @typedef {Object} DynamoBatchGetResult.<I,K> - a DynamoDB.DocumentClient `batchGet` result (or DynamoDB `batchGetItem` result) | ||
* @property {Object.<string, Array.<I|Object>>} Responses - a map of table name to a list of items | ||
* @property {UnprocessedKeysMap.<K>|undefined} [UnprocessedKeys] - a map of tables and their respective keys that were not processed with the current response (map<Array<map>>) | ||
* @property {Array.<ConsumedCapacity>|undefined} [ConsumedCapacity] - The read capacity units consumed by the entire operation | ||
* @template I,K | ||
*/ | ||
/** | ||
* @typedef {Object} DynamoGetResult.<I> - a DynamoDB.DocumentClient `get` result (or DynamoDB `getItem` result) | ||
* @property {I|Object|undefined} [Item] - the returned item (if found) or undefined (if not) | ||
* @property {ConsumedCapacity|undefined} [ConsumedCapacity] - the capacity units consumed by the get operation (if requested) | ||
* @template I - the type of item returned in the `Item` property of the `get` result | ||
* @template I | ||
*/ | ||
/** | ||
* @typedef {Object} DynamoDBQueryResult.<I> - a DynamoDB.DocumentClient `query` result (or DynamoDB `query` result) | ||
* @property {Array.<I>} Items - the returned items | ||
* @typedef {Object} DynamoQueryResult.<I,K> - a DynamoDB.DocumentClient `query` result (or DynamoDB `query` result) | ||
* @property {Array.<I|Object>} Items - the returned items | ||
* @property {number} Count - the number of items returned | ||
* @property {number} ScannedCount - the number of items scanned before applying any filter | ||
* @property {Object|undefined} [LastEvaluatedKey] - the last evaluated key (if any) to be used to get next "page" | ||
* @property {K|Object|undefined} [LastEvaluatedKey] - the last evaluated key (if any) to be used to get next "page" | ||
* @property {ConsumedCapacity|undefined} [ConsumedCapacity] - the capacity units consumed by the query operation (if requested) | ||
* @template I - the type of items returned in the `Items` property of the `query` result | ||
* @template I,K | ||
*/ | ||
/** | ||
* @typedef {Object} DynamoScanResult.<I,K> - a DynamoDB.DocumentClient `scan` result (or DynamoDB `scan` result) | ||
* @property {Array.<I|Object>} Items - the returned items | ||
* @property {number} Count - the number of items returned | ||
* @property {number} ScannedCount - the number of items scanned before applying any filter | ||
* @property {K|Object|undefined} [LastEvaluatedKey] - the last evaluated key (if any) to be used to get next "page" | ||
* @property {ConsumedCapacity|undefined} [ConsumedCapacity] - the capacity units consumed by the query operation (if requested) | ||
* @template I,K | ||
*/ | ||
/** | ||
* @typedef {Object} UnprocessedKeysMap.<K> - A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. | ||
* @property {Array.<K|Object>} Keys - An array of primary key attribute values that define specific items in the table | ||
* @property {string|undefined} [ProjectionExpression] - One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result. | ||
* @property {boolean|undefined} [ConsistentRead] - The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used. | ||
* @property {Object.<string, string>|undefined} [ExpressionAttributeNames] - One or more substitution tokens for attribute names in an expression. | ||
* @template K | ||
*/ | ||
/** | ||
* @typedef {Object} ConsumedCapacity - the capacity units consumed by an operation | ||
* @property {string} TableName | ||
* @property {number} CapacityUnits | ||
* @property {CapacityUnitsMap} Table | ||
* @property {Object.<string, CapacityUnitsMap>} LocalSecondaryIndexes | ||
* @property {Object.<string, CapacityUnitsMap>} GlobalSecondaryIndexes | ||
*/ | ||
/** | ||
* @typedef {Object} CapacityUnitsMap | ||
* @property {number} CapacityUnits | ||
*/ |
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
457977
6565
744
+ Addedcore-functions@3.0.6(transitive)
+ Addedlogging-utils@4.0.5(transitive)
- Removedcore-functions@3.0.5(transitive)
- Removedlogging-utils@4.0.4(transitive)
Updatedcore-functions@3.0.6
Updatedlogging-utils@4.0.5