From d0d0c6a2e1105c2afbb69a508a984eca4282c53f Mon Sep 17 00:00:00 2001 From: Benjamin Hutchins Date: Thu, 16 Nov 2023 16:28:33 -0500 Subject: [PATCH] feat: expose a way to get the Transaction write items This can be helpful for when you want to manipulate the transaction request directly, or debug/log the requested transact items. --- src/transaction.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/transaction.ts b/src/transaction.ts index ef9700fe..687285d6 100644 --- a/src/transaction.ts +++ b/src/transaction.ts @@ -129,6 +129,16 @@ export class Transaction { return this } + /** + * Get the list of pending transact items. + */ + public getTransactItems(): TransactWriteItem[] { + return this.list + } + + /** + * Commit all the pending transact items to DynamoDB. + */ public async commit(): Promise { return await transactWrite(this.dynamo, this.list) }