Skip to content

Commit a5e1c50

Browse files
Merge pull request #330 from dialedai/increase-transact-write-items-limit
Increase transact write items limit
2 parents ac4e476 + 34cc3de commit a5e1c50

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"tsutils": "^3.17.1",
7979
"typedoc": "0.14.0",
8080
"typedoc-plugin-external-module-name": "^2.1.0",
81-
"typescript": ">=2.9.1"
81+
"typescript": ">=2.9.1 <4.0.0"
8282
},
8383
"peerDependencies": {
8484
"aws-sdk": "^2.401.0",

src/dynamo/transactwrite/transact-write.request.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { DynamoDbWrapper } from '../dynamo-db-wrapper'
66
import { TransactOperation } from './transact-operation.type'
77

88
/**
9-
* Request class for the TransactWriteItems operation. Write up to 10 items to one or many tables in a transaction.
9+
* Request class for the TransactWriteItems operation. Write up to 25 items to one or many tables in a transaction.
1010
*/
1111
export class TransactWriteRequest {
1212
get dynamoDB(): DynamoDB {
@@ -40,16 +40,16 @@ export class TransactWriteRequest {
4040
}
4141

4242
/**
43-
* add up to 10 transaction operations
43+
* add up to 25 transaction operations
4444
* create the operations with:
4545
* {@link TransactConditionCheck}, {@link TransactDelete}, {@link TransactPut}, {@link TransactUpdate}
4646
*/
4747
transact(...writeOperations: TransactOperation[]): this {
4848
if (!writeOperations || writeOperations.length === 0) {
4949
throw new Error('at least one transaction operation must be added')
5050
}
51-
if (this.params.TransactItems.length + writeOperations.length > 10) {
52-
throw new Error(`Each transaction can include up to 10 unique items, including conditions.\
51+
if (this.params.TransactItems.length + writeOperations.length > 25) {
52+
throw new Error(`Each transaction can include up to 25 unique items, including conditions.\
5353
Given operations count: ${this.params.TransactItems.length + writeOperations.length}`)
5454
}
5555
this.params.TransactItems.push(...writeOperations.map((wo) => wo.transactItem))

test/models/model-with-custom-mapper-for-sort-key.model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ export class CustomId {
2020
}
2121

2222
static unparse(customId: CustomId): string {
23-
const yyyy = customId.date.getFullYear()
24-
const mm = (<any>(customId.date.getMonth() + 1).toString()).padStart(2, '0')
25-
const dd = (<any>customId.date.getDate().toString()).padStart(2, '0')
23+
const yyyy = customId.date.getUTCFullYear()
24+
const mm = (<any>(customId.date.getUTCMonth() + 1).toString()).padStart(2, '0')
25+
const dd = (<any>customId.date.getUTCDate().toString()).padStart(2, '0')
2626
return `${yyyy}${mm}${dd}${(<any>customId.id.toString()).padStart(CustomId.MULTIPLIER_E, '0')}`
2727
}
2828

0 commit comments

Comments
 (0)