aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
2.97k stars 556 forks source link

Export NativeAttributeValue from @aws-sdk/lib-dynamodb #5981

Closed trivikr closed 2 months ago

trivikr commented 2 months ago

Describe the feature

Export NativeAttributeValue from @aws-sdk/lib-dynamodb

Use Case

When working with any types which take NativeAttributeValue in lib-dynamodb, they need to be imported from util-dynamodb

Example:

import { DynamoDB } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";

const ddbClient = new DynamoDB({});
const ddbDocClient = DynamoDBDocument.from(ddbClient);
const key: Record<string, NativeAttributeValue> = {};

Proposed Solution

Re-export NativeAttributeValue from lib-dynamodb so that it can be imported from there

import { DynamoDB } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocument, NativeAttributeValue } from "@aws-sdk/lib-dynamodb";

const ddbClient = new DynamoDB({});
const ddbDocClient = DynamoDBDocument.from(ddbClient);
const key: Record<string, NativeAttributeValue> = {};

Other Information

Noticed in https://github.com/aws/aws-sdk-js-codemod/issues/824

Acknowledgements

SDK version used

3.549.0

Environment details (OS name and version, etc.)

TypeScript on any JavaScript runtime

github-actions[bot] commented 2 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.