@aws-sdk/lib-dynamodb 3.1104.0 → 3.1105.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-cjs/index.js CHANGED
@@ -5,7 +5,7 @@ const { setFeature } = require("@aws-sdk/core/client");
5
5
  const { marshall, unmarshall } = require("@aws-sdk/util-dynamodb");
6
6
  const { NumberValueImpl: NumberValue } = require("@aws-sdk/util-dynamodb");
7
7
  exports.NumberValue = NumberValue;
8
- const { BatchExecuteStatementCommand: BatchExecuteStatementCommand$1, BatchGetItemCommand, BatchWriteItemCommand, DeleteItemCommand, ExecuteStatementCommand: ExecuteStatementCommand$1, ExecuteTransactionCommand: ExecuteTransactionCommand$1, GetItemCommand, PutItemCommand, QueryCommand: QueryCommand$1, ScanCommand: ScanCommand$1, SearchVectorsCommand: SearchVectorsCommand$1, TransactGetItemsCommand, TransactWriteItemsCommand, UpdateItemCommand } = require("@aws-sdk/client-dynamodb");
8
+ const { BatchExecuteStatementCommand: BatchExecuteStatementCommand$1, BatchGetItemCommand, BatchWriteItemCommand, DeleteItemCommand, ExecuteStatementCommand: ExecuteStatementCommand$1, ExecuteTransactionCommand: ExecuteTransactionCommand$1, GetItemCommand, PutItemCommand, QueryCommand: QueryCommand$1, ScanCommand: ScanCommand$1, SearchVectorsCommand: SearchVectorsCommand$1, TransactGetItemsCommand, TransactWriteItemsCommand, UpdateItemCommand, DynamoDBClient } = require("@aws-sdk/client-dynamodb");
9
9
  const { createPaginator } = require("@smithy/core");
10
10
 
11
11
  const SELF = null;
@@ -631,6 +631,34 @@ class DynamoDBDocumentClient extends Client {
631
631
  throw new Error("@aws-sdk/lib-dynamodb - cacheMiddleware=true is not compatible with the" +
632
632
  " DynamoDBDocumentClient. This option must be set to false.");
633
633
  }
634
+ const middlewares = client.middlewareStack.identify?.() ?? [];
635
+ const hasSerializer = middlewares.some((m) => m.includes?.("serializerMiddleware"));
636
+ if (!hasSerializer) {
637
+ const configuredLogger = this.config.logger;
638
+ const logger = configuredLogger && !configuredLogger.constructor?.name.includes("NoOp")
639
+ ? configuredLogger
640
+ : console;
641
+ const substituteClient = new DynamoDBClient(Object.assign({}, this.config, {
642
+ defaultUserAgentProvider: undefined,
643
+ retryStrategy: undefined,
644
+ extensions: undefined
645
+ }));
646
+ const substituteClientHasSerializer = substituteClient.middlewareStack
647
+ .identify?.()
648
+ .some((m) => m.includes?.("serializerMiddleware"));
649
+ if (!substituteClientHasSerializer) {
650
+ throw new Error("@aws-sdk/lib-dynamodb - ERROR: incompatible version of DynamoDBClient given to DynamoDBDocumentClient. " +
651
+ "Check @aws-sdk/lib-dynamodb package.json requirements.");
652
+ }
653
+ else {
654
+ this.middlewareStack = substituteClient.middlewareStack;
655
+ this.config = substituteClient.config;
656
+ this.config.translateConfig = translateConfig;
657
+ logger.warn("@aws-sdk/lib-dynamodb - WARN: incompatible version of DynamoDBClient given to DynamoDBDocumentClient. " +
658
+ "We have forwarded your client's configuration to a newer version of DynamoDBClient in " +
659
+ "the dependency closure to instantiate DynamoDBDocumentClient.");
660
+ }
661
+ }
634
662
  }
635
663
  static from(client, translateConfig) {
636
664
  return new DynamoDBDocumentClient(client, translateConfig);
@@ -1,4 +1,5 @@
1
1
  import { Client as __Client } from "@smithy/core/client";
2
+ import { DynamoDBClient, } from "@aws-sdk/client-dynamodb";
2
3
  export { __Client };
3
4
  export class DynamoDBDocumentClient extends __Client {
4
5
  config;
@@ -11,6 +12,34 @@ export class DynamoDBDocumentClient extends __Client {
11
12
  throw new Error("@aws-sdk/lib-dynamodb - cacheMiddleware=true is not compatible with the" +
12
13
  " DynamoDBDocumentClient. This option must be set to false.");
13
14
  }
15
+ const middlewares = client.middlewareStack.identify?.() ?? [];
16
+ const hasSerializer = middlewares.some((m) => m.includes?.("serializerMiddleware"));
17
+ if (!hasSerializer) {
18
+ const configuredLogger = this.config.logger;
19
+ const logger = configuredLogger && !configuredLogger.constructor?.name.includes("NoOp")
20
+ ? configuredLogger
21
+ : console;
22
+ const substituteClient = new DynamoDBClient(Object.assign({}, this.config, {
23
+ defaultUserAgentProvider: undefined,
24
+ retryStrategy: undefined,
25
+ extensions: undefined
26
+ }));
27
+ const substituteClientHasSerializer = substituteClient.middlewareStack
28
+ .identify?.()
29
+ .some((m) => m.includes?.("serializerMiddleware"));
30
+ if (!substituteClientHasSerializer) {
31
+ throw new Error("@aws-sdk/lib-dynamodb - ERROR: incompatible version of DynamoDBClient given to DynamoDBDocumentClient. " +
32
+ "Check @aws-sdk/lib-dynamodb package.json requirements.");
33
+ }
34
+ else {
35
+ this.middlewareStack = substituteClient.middlewareStack;
36
+ this.config = substituteClient.config;
37
+ this.config.translateConfig = translateConfig;
38
+ logger.warn("@aws-sdk/lib-dynamodb - WARN: incompatible version of DynamoDBClient given to DynamoDBDocumentClient. " +
39
+ "We have forwarded your client's configuration to a newer version of DynamoDBClient in " +
40
+ "the dependency closure to instantiate DynamoDBDocumentClient.");
41
+ }
42
+ }
14
43
  }
15
44
  static from(client, translateConfig) {
16
45
  return new DynamoDBDocumentClient(client, translateConfig);
@@ -14,7 +14,7 @@ import type { SearchVectorsCommandInput, SearchVectorsCommandOutput } from "./co
14
14
  import type { TransactGetCommandInput, TransactGetCommandOutput } from "./commands/TransactGetCommand";
15
15
  import type { TransactWriteCommandInput, TransactWriteCommandOutput } from "./commands/TransactWriteCommand";
16
16
  import type { UpdateCommandInput, UpdateCommandOutput } from "./commands/UpdateCommand";
17
- import type { DynamoDBClient, DynamoDBClientResolvedConfig, ServiceInputTypes as __ServiceInputTypes, ServiceOutputTypes as __ServiceOutputTypes } from "@aws-sdk/client-dynamodb";
17
+ import { DynamoDBClient, type DynamoDBClientResolvedConfig, type ServiceInputTypes as __ServiceInputTypes, type ServiceOutputTypes as __ServiceOutputTypes } from "@aws-sdk/client-dynamodb";
18
18
  import type { marshallOptions, unmarshallOptions } from "@aws-sdk/util-dynamodb";
19
19
  /**
20
20
  * @public
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/lib-dynamodb",
3
- "version": "3.1104.0",
3
+ "version": "3.1105.0",
4
4
  "description": "The document client simplifies working with items in Amazon DynamoDB by abstracting away the notion of attribute values.",
5
5
  "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/lib/lib-dynamodb",
6
6
  "license": "Apache-2.0",
@@ -50,7 +50,7 @@
50
50
  "tslib": "^2.6.2"
51
51
  },
52
52
  "devDependencies": {
53
- "@aws-sdk/client-dynamodb": "3.1104.0",
53
+ "@aws-sdk/client-dynamodb": "3.1105.0",
54
54
  "@tsconfig/recommended": "1.0.1",
55
55
  "@types/node": "^20.14.8",
56
56
  "concurrently": "7.0.0",
@@ -59,7 +59,7 @@
59
59
  "typescript": "~5.8.3"
60
60
  },
61
61
  "peerDependencies": {
62
- "@aws-sdk/client-dynamodb": "^3.1104.0"
62
+ "@aws-sdk/client-dynamodb": "^3.1105.0"
63
63
  },
64
64
  "engines": {
65
65
  "node": ">=20.0.0"