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

@aws/dynamodb-data-mapper

Package Overview
Dependencies
Maintainers
12
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws/dynamodb-data-mapper - npm Package Compare versions

Comparing version 0.4.2 to 0.5.0

build/namedParameters/ExecuteUpdateExpressionOptions.d.ts

0

build/asyncIteratorSymbolPolyfill.js

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Schema, ZeroArgumentsConstructor } from '@aws/dynamodb-data-marshaller';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=BatchState.js.map

@@ -0,0 +0,0 @@ export declare const VERSION = "0.4.0";

@@ -0,0 +0,0 @@ "use strict";

import { StringToAnyObjectMap, SyncOrAsyncIterable, WriteType } from './constants';
import { BaseScanOptions, BatchGetOptions, CreateTableOptions, DataMapperConfiguration, DeleteOptions, DeleteParameters, GetOptions, GetParameters, ParallelScanParameters, ParallelScanWorkerOptions, ParallelScanWorkerParameters, PutOptions, PutParameters, QueryOptions, QueryParameters, ScanOptions, ScanParameters, UpdateOptions, UpdateParameters } from './namedParameters';
import { BaseScanOptions, BatchGetOptions, CreateTableOptions, DataMapperConfiguration, DeleteOptions, DeleteParameters, ExecuteUpdateExpressionOptions, GetOptions, GetParameters, ParallelScanParameters, ParallelScanWorkerOptions, ParallelScanWorkerParameters, PutOptions, PutParameters, QueryOptions, QueryParameters, ScanOptions, ScanParameters, UpdateOptions, UpdateParameters } from './namedParameters';
import { ZeroArgumentsConstructor } from "@aws/dynamodb-data-marshaller";
import { ConditionExpression, ConditionExpressionPredicate } from "@aws/dynamodb-expressions";
import { ConditionExpression, ConditionExpressionPredicate, UpdateExpression } from "@aws/dynamodb-expressions";
/**

@@ -239,2 +239,45 @@ * Object mapper for domain object interaction with DynamoDB.

update<T extends StringToAnyObjectMap = StringToAnyObjectMap>(parameters: UpdateParameters<T>): Promise<T>;
/**
* Execute a custom update expression using the schema and table name
* defined on the provided `valueConstructor`.
*
* This method does not support automatic version checking, as the current
* state of a table's version attribute cannot be inferred from an update
* expression object. To perform a version check manually, add a condition
* expression:
*
* ```typescript
* const currentVersion = 1;
* updateExpression.set('nameOfVersionAttribute', currentVersion + 1);
* const condition = {
* type: 'Equals',
* subject: 'nameOfVersionAttribute',
* object: currentVersion
* };
*
* const updated = await mapper.executeUpdateExpression(
* updateExpression,
* itemKey,
* constructor,
* {condition}
* );
* ```
*
* **NB:** Property names and attribute paths in the update expression
* should reflect the names used in the schema.
*
* @param expression The update expression to execute.
* @param key The full key to identify the object being
* updated.
* @param valueConstructor The constructor with which to map the result to
* a domain object.
* @param options Options with which to customize the UpdateItem
* request.
*
* @returns The updated item.
*/
executeUpdateExpression<T extends StringToAnyObjectMap = StringToAnyObjectMap>(expression: UpdateExpression, key: {
[propertyName: string]: any;
}, valueConstructor: ZeroArgumentsConstructor<T>, options?: ExecuteUpdateExpressionOptions): Promise<T>;
private doExecuteUpdateExpression<T>(expression, key, schema, tableName, valueConstructor?, options?);
private buildScanInput(valueConstructor, {filter, indexName, limit, pageSize, projection, readConsistency, segment, startKey, totalSegments});

@@ -241,0 +284,0 @@ private doSequentialScan<T>(req, schema, ctor);

@@ -0,0 +0,0 @@ import { DocumentType, ZeroArgumentsConstructor } from '@aws/dynamodb-data-marshaller';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export * from './constants';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { GetItemInput } from "aws-sdk/clients/dynamodb";

@@ -12,2 +12,3 @@ "use strict";

function ItemNotFoundException(itemSought, message) {
if (message === void 0) { message = defaultErrorMessage(itemSought); }
var _this = _super.call(this, message) || this;

@@ -21,2 +22,5 @@ _this.itemSought = itemSought;

exports.ItemNotFoundException = ItemNotFoundException;
function defaultErrorMessage(itemSought) {
return "No item with the key " + JSON.stringify(itemSought.Key) + " found in the " + itemSought.TableName + " table.";
}
//# sourceMappingURL=ItemNotFoundException.js.map

@@ -0,0 +0,0 @@ import { GetOptions } from './GetOptions';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=BatchGetOptions.js.map

@@ -0,0 +0,0 @@ import { ProvisionedThroughput } from './ProvisionedThroughput';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CreateTableOptions.js.map

@@ -0,0 +0,0 @@ import DynamoDB = require("aws-sdk/clients/dynamodb");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=DataMapperConfiguration.js.map

@@ -0,0 +0,0 @@ import { StringToAnyObjectMap } from '../constants';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=DeleteOptions.js.map

@@ -0,0 +0,0 @@ import { ReadConsistencyConfiguration } from './ReadConsistencyConfiguration';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=GetOptions.js.map

@@ -5,2 +5,3 @@ export * from './BatchGetOptions';

export * from './DeleteOptions';
export * from './ExecuteUpdateExpressionOptions';
export * from './GetOptions';

@@ -7,0 +8,0 @@ export * from './ProvisionedThroughput';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=index.js.map

@@ -0,0 +0,0 @@ export interface ProvisionedThroughput {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ProvisionedThroughput.js.map

@@ -0,0 +0,0 @@ import { StringToAnyObjectMap } from '../constants';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=PutOptions.js.map

@@ -0,0 +0,0 @@ import { ReadConsistencyConfiguration } from './ReadConsistencyConfiguration';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=QueryOptions.js.map

@@ -0,0 +0,0 @@ import { ReadConsistency } from '../constants';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ReadConsistencyConfiguration.js.map

@@ -0,0 +0,0 @@ import { ReadConsistencyConfiguration } from './ReadConsistencyConfiguration';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ScanOptions.js.map

@@ -0,0 +0,0 @@ import { ProvisionedThroughput } from './ProvisionedThroughput';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=SecondaryIndexOptions.js.map

@@ -0,0 +0,0 @@ import { OnMissingStrategy, StringToAnyObjectMap } from '../constants';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=UpdateOptions.js.map

@@ -0,0 +0,0 @@ import { Schema } from '@aws/dynamodb-data-marshaller';

@@ -0,0 +0,0 @@ "use strict";

@@ -7,2 +7,10 @@ # Changelog

## [0.5.0]
### Fixed
- Add default message to `ItemNotFoundException`
- Ensure options provided are used when `query` is called with a named
parameter bag.
### Added
- Add support for executing custom update expressions.
## [0.4.2]

@@ -9,0 +17,0 @@ ### Fixed

@@ -0,0 +0,0 @@ module.exports = {

13

package.json
{
"name": "@aws/dynamodb-data-mapper",
"version": "0.4.2",
"version": "0.5.0",
"description": "A schema-based data mapper for Amazon DynamoDB",

@@ -33,6 +33,6 @@ "keywords": [

"devDependencies": {
"@types/jest": "^21",
"@types/jest": "^22",
"@types/node": "^8.0.4",
"aws-sdk": "^2.7.0",
"jest": "^21",
"jest": "^22",
"typedoc": "^0.11.0",

@@ -42,5 +42,6 @@ "typescript": "^2.7"

"dependencies": {
"@aws/dynamodb-batch-iterator": "^0.4.1",
"@aws/dynamodb-data-marshaller": "^0.4.1",
"@aws/dynamodb-expressions": "^0.4.1",
"@aws/dynamodb-auto-marshaller": "^0.5.0",
"@aws/dynamodb-batch-iterator": "^0.5.0",
"@aws/dynamodb-data-marshaller": "^0.5.0",
"@aws/dynamodb-expressions": "^0.5.0",
"tslib": "^1.8.1"

@@ -47,0 +48,0 @@ },

@@ -0,0 +0,0 @@ # Amazon DynamoDB DataMapper

@@ -0,0 +0,0 @@ {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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