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

node-aws-utils

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-aws-utils - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

16

lib/index.d.ts

@@ -1,8 +0,18 @@

import { ResultOK, ResultFAIL } from 'node-result';
import { ReturningResultAsync } from 'node-result';
import { DynamoDB } from 'aws-sdk';
export declare class DynamoDocumentClient {
static get(client: DynamoDB.DocumentClient, tableName: DynamoDB.DocumentClient.TableName, where: DynamoDB.DocumentClient.Key): Promise<ResultOK<DynamoDB.DocumentClient.AttributeMap | null> | ResultFAIL<Error>>;
static get(client: DynamoDB.DocumentClient, tableName: DynamoDB.DocumentClient.TableName, where: DynamoDB.DocumentClient.Key): ReturningResultAsync<DynamoDB.DocumentClient.AttributeMap | null, Error>;
static getFromIndex(client: DynamoDB.DocumentClient, tableName: DynamoDB.DocumentClient.TableName, indexName: DynamoDB.DocumentClient.IndexName, where: {
pk: {
name: DynamoDB.DocumentClient.AttributeName;
value: DynamoDB.DocumentClient.AttributeValue;
};
sk?: {
name: DynamoDB.DocumentClient.AttributeName;
value: DynamoDB.DocumentClient.AttributeValue;
};
}): ReturningResultAsync<DynamoDB.DocumentClient.ItemList | null, Error>;
static update(client: DynamoDB.DocumentClient, tableName: DynamoDB.DocumentClient.TableName, where: DynamoDB.DocumentClient.Key, data: {
[key: string]: unknown;
}): Promise<ResultOK<DynamoDB.DocumentClient.AttributeMap> | ResultFAIL<Error>>;
}): ReturningResultAsync<DynamoDB.DocumentClient.AttributeMap, Error>;
}

@@ -20,2 +20,22 @@ "use strict";

}
static async getFromIndex(client, tableName, indexName, where) {
const params = {
TableName: tableName,
IndexName: indexName,
KeyConditionExpression: '#PK = :pk',
ExpressionAttributeNames: {
'#PK': where.pk.name
},
ExpressionAttributeValues: {
':pk': where.pk.value
}
};
if (where.sk) {
params.KeyConditionExpression += ` AND #SK = :sk`;
params.ExpressionAttributeNames['#SK'] = where.sk.name;
params.ExpressionAttributeValues[':sk'] = where.sk.value;
}
const { Items } = await client.query(params).promise();
return node_result_1.ResultOk(Items || null);
}
static async update(client, tableName, where, data) {

@@ -58,3 +78,6 @@ const params = {

node_result_1.tryCatchWrapperAsync
], DynamoDocumentClient, "getFromIndex", null);
__decorate([
node_result_1.tryCatchWrapperAsync
], DynamoDocumentClient, "update", null);
exports.DynamoDocumentClient = DynamoDocumentClient;

4

package.json
{
"name": "node-aws-utils",
"version": "1.4.0",
"version": "1.5.0",
"description": "aws utils",

@@ -32,3 +32,3 @@ "keywords": [

"aws-sdk": "^2.822.0",
"node-result": "^6.0.1"
"node-result": "^8.0.0"
},

@@ -35,0 +35,0 @@ "devDependencies": {

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