Skip to content

feat(lib-dynamodb): expose transact write item types#7852

Open
lucianlature-endava wants to merge 5 commits intoaws:mainfrom
lucianlature-endava:fix/client-dynamodb-7830
Open

feat(lib-dynamodb): expose transact write item types#7852
lucianlature-endava wants to merge 5 commits intoaws:mainfrom
lucianlature-endava:fix/client-dynamodb-7830

Conversation

@lucianlature-endava
Copy link
Copy Markdown

Issue

#7830

Description

Exposes document-client types for TransactWriteItems so consumers can type transaction items instead of using inline shapes.

Changes:

  • Codegen: Updated DocumentClientCommandGenerator.java to handle the TransactWriteItems operation.
  • New types: TransactWriteConditionCheck, TransactWritePut, TransactWriteDelete, TransactWriteUpdate, and TransactWriteItem.
  • Input type: TransactWriteCommandInput now uses TransactWriteItem[] for TransactItems instead of an inline type.
  • These types use NativeAttributeValue instead of AttributeValue, matching the document client’s native JS API.

Testing

  1. Type-check: cd lib/lib-dynamodb && yarn build:types
  2. Unit tests: cd lib/lib-dynamodb && yarn test

Checklist

  • If the PR is a feature, add integration tests (*.integ.spec.ts) or E2E tests.
  • It's not a feature.
  • My E2E tests are resilient to concurrent i/o.
  • I didn't write any E2E tests.
  • I added access level annotations e.g. @public, @internal tags and enabled doc generation on the package. Remember that access level annotations go below the description, not above.
  • I didn't add any public functions.
  • Streams - how do they work?? My WebStream readers/locks are properly lifecycled. Node.js stream backpressure is handled. Error handling.
  • No streams here.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@lucianlature-endava lucianlature-endava requested a review from a team as a code owner March 17, 2026 11:31
@lucianlature-endava lucianlature-endava marked this pull request as draft March 18, 2026 16:19
@lucianlature-endava lucianlature-endava marked this pull request as ready for review March 25, 2026 12:22
| undefined
;
export type BatchExecuteStatementCommandInput = Omit<__BatchExecuteStatementCommandInput, "Statements"> & {
Statements: BatchExecuteStatementBatchStatementRequest[] | undefined;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just use the type BatchExecuteStatementCommandInput["Statements"]?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would hit a self-reference: BatchExecuteStatementCommandInput["Statements"] will expand to "the type of the Statements property on BatchExecuteStatementCommandInput". But BatchExecuteStatementCommandInput itself is currently being defined, and its Statements property’s type is exactly what we’re trying to specify, so we'll end up with a circular definition, and TypeScript generally can't resolve that as a meaningful alias.

A non-circular DRY version would look like:

export type BatchExecuteStatementStatements = BatchExecuteStatementBatchStatementRequest[] | undefined;
export type BatchExecuteStatementCommandInput = Omit<__BatchExecuteStatementCommandInput, "Statements"> & {
  Statements: BatchExecuteStatementStatements;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants