module import * as DynamoDB from 'aws-sdk/clients/dynamodb' ; import { createKeyAttributes } from '../../mapper/mapper' ; import { ModelConstructor } from '../../model/model-constructor' ; import { prepareAndAddUpdateExpressions } from '../expression/prepare-and-add-update-expressions.function' ; import { addUpdate } from '../expression/request-expression-builder' ; import { RequestUpdateFunction } from '../expression/type/update-expression-definition-chain' ; import { UpdateExpressionDefinitionFunction } from '../expression/type/update-expression-definition-function' ; import { TransactBaseOperation } from './transact-base-operation' ; /**
 * TransactOperation class for transactional update items.
 */ export class TransactUpdate < T > extends TransactBaseOperation < T , DynamoDB . Update , TransactUpdate < T > > { constructor ( modelClazz , partitionKey , sortKey ? ) { super ( modelClazz ) ; this . params . Key = createKeyAttributes ( this . metadata , partitionKey , sortKey ) ; } example updateAttribute < K extends keyof T > ( attributePath ) { return addUpdate ( attributePath , this , this . metadata ) ; } example operations ( ... updateDefFns ) { prepareAndAddUpdateExpressions ( this . metadata , this . params , updateDefFns ) ; return this ; } get transactItem ( ) { return { Update : { ... this . params } , } ; } }