Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-core-utils

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-core-utils - npm Package Compare versions

Comparing version 5.0.21 to 5.0.22

4

dynamodb-doc-client-utils.js

@@ -20,6 +20,6 @@ 'use strict';

* @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
*/

@@ -26,0 +26,0 @@ function getItem(tableName, key, opts, desc, context) {

{
"name": "aws-core-utils",
"version": "5.0.21",
"version": "5.0.22",
"description": "Core utilities for working with Amazon Web Services (AWS), including ARNs, regions, stages, Lambdas, AWS errors, stream events, Kinesis, DynamoDB.DocumentClients, etc.",

@@ -5,0 +5,0 @@ "author": "Byron du Preez",

@@ -1,2 +0,2 @@

# aws-core-utils v5.0.21
# aws-core-utils v5.0.22

@@ -137,2 +137,3 @@ Core utilities for working with Amazon Web Services (AWS), including ARNs, regions, stages, Lambdas, AWS errors, stream events, Kinesis, DynamoDB.DocumentClients, etc.

const myCustomSettings = {myCustomSetting1: 1, myCustomSetting2: 2, myCustomFunction: () => {}}; //
console.log(`Irrelevant logging - only added to avoid unused function warning - ${myCustomSettings.myCustomFunction()}`);
const myCustomOptions = require('my-custom-options.json');

@@ -394,2 +395,14 @@ contexts.configureCustomSettings(context, myCustomSettings, myCustomOptions);

### 5.0.22
- BACKPORT of 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 1.0.4
### 5.0.21

@@ -396,0 +409,0 @@ - Backport: Upgraded `aws-core-test-utils` test dependency to 1.0.3

@@ -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": "5.0.21",
"version": "5.0.22",
"author": "Byron du Preez",
"license": "Apache-2.0",
"private": true,
"engines": {

@@ -14,3 +15,3 @@ "node": ">=4.3.2"

"devDependencies": {
"aws-core-test-utils": "1.0.3",
"aws-core-test-utils": "1.0.4",
"tape": "^4.6.3",

@@ -17,0 +18,0 @@ "uuid": "^3.0.1"

@@ -189,6 +189,8 @@ 'use strict';

// Back-ported type definitions
// ---------------------------------------------------------------------------------------------------------------------
// Start of BACKPORT copy from latest `aws-core-utils/type-defs`
// ---------------------------------------------------------------------------------------------------------------------
/**
* @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)

@@ -201,4 +203,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

@@ -213,23 +215,65 @@ * @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
*/
// ---------------------------------------------------------------------------------------------------------------------
// End of BACKPORT copy from latest `aws-core-utils/type-defs`
// ---------------------------------------------------------------------------------------------------------------------
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc