@aws-sdk/lib-dynamodb 3.34.0 → 3.37.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.
Files changed (109) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist-cjs/DynamoDBDocument.js +205 -0
  3. package/dist-cjs/DynamoDBDocumentClient.js +18 -0
  4. package/dist-cjs/commands/BatchExecuteStatementCommand.js +27 -0
  5. package/dist-cjs/commands/BatchGetCommand.js +42 -0
  6. package/dist-cjs/commands/BatchWriteCommand.js +53 -0
  7. package/dist-cjs/commands/DeleteCommand.js +39 -0
  8. package/dist-cjs/commands/ExecuteStatementCommand.js +27 -0
  9. package/dist-cjs/commands/ExecuteTransactionCommand.js +27 -0
  10. package/dist-cjs/commands/GetCommand.js +27 -0
  11. package/dist-cjs/commands/PutCommand.js +39 -0
  12. package/dist-cjs/commands/QueryCommand.js +42 -0
  13. package/dist-cjs/commands/ScanCommand.js +36 -0
  14. package/dist-cjs/commands/TransactGetCommand.js +27 -0
  15. package/dist-cjs/commands/TransactWriteCommand.js +44 -0
  16. package/dist-cjs/commands/UpdateCommand.js +45 -0
  17. package/dist-cjs/commands/utils.js +44 -0
  18. package/dist-cjs/index.js +18 -0
  19. package/dist-es/DynamoDBDocument.js +208 -0
  20. package/dist-es/DynamoDBDocumentClient.js +19 -0
  21. package/dist-es/commands/BatchExecuteStatementCommand.js +33 -0
  22. package/dist-es/commands/BatchGetCommand.js +48 -0
  23. package/dist-es/commands/BatchWriteCommand.js +59 -0
  24. package/dist-es/commands/DeleteCommand.js +45 -0
  25. package/dist-es/commands/ExecuteStatementCommand.js +33 -0
  26. package/dist-es/commands/ExecuteTransactionCommand.js +33 -0
  27. package/dist-es/commands/GetCommand.js +33 -0
  28. package/dist-es/commands/PutCommand.js +45 -0
  29. package/dist-es/commands/QueryCommand.js +48 -0
  30. package/dist-es/commands/ScanCommand.js +42 -0
  31. package/dist-es/commands/TransactGetCommand.js +33 -0
  32. package/dist-es/commands/TransactWriteCommand.js +50 -0
  33. package/dist-es/commands/UpdateCommand.js +51 -0
  34. package/dist-es/commands/utils.js +46 -0
  35. package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
  36. package/{dist/types → dist-types}/DynamoDBDocument.d.ts +3 -3
  37. package/{dist/types → dist-types}/DynamoDBDocumentClient.d.ts +4 -4
  38. package/{dist/types → dist-types}/commands/BatchExecuteStatementCommand.d.ts +3 -3
  39. package/{dist/types → dist-types}/commands/BatchGetCommand.d.ts +3 -3
  40. package/{dist/types → dist-types}/commands/BatchWriteCommand.d.ts +3 -3
  41. package/{dist/types → dist-types}/commands/DeleteCommand.d.ts +3 -3
  42. package/{dist/types → dist-types}/commands/ExecuteStatementCommand.d.ts +2 -2
  43. package/{dist/types → dist-types}/commands/ExecuteTransactionCommand.d.ts +3 -3
  44. package/{dist/types → dist-types}/commands/GetCommand.d.ts +2 -2
  45. package/{dist/types → dist-types}/commands/PutCommand.d.ts +2 -2
  46. package/{dist/types → dist-types}/commands/QueryCommand.d.ts +2 -2
  47. package/{dist/types → dist-types}/commands/ScanCommand.d.ts +2 -2
  48. package/{dist/types → dist-types}/commands/TransactGetCommand.d.ts +2 -2
  49. package/{dist/types → dist-types}/commands/TransactWriteCommand.d.ts +3 -3
  50. package/{dist/types → dist-types}/commands/UpdateCommand.d.ts +2 -2
  51. package/{dist/types → dist-types}/commands/utils.d.ts +0 -0
  52. package/dist-types/index.d.ts +15 -0
  53. package/dist-types/ts3.4/DynamoDBDocument.d.ts +72 -0
  54. package/{dist/types → dist-types}/ts3.4/DynamoDBDocumentClient.d.ts +5 -50
  55. package/{dist/types → dist-types}/ts3.4/commands/BatchExecuteStatementCommand.d.ts +5 -13
  56. package/{dist/types → dist-types}/ts3.4/commands/BatchGetCommand.d.ts +5 -13
  57. package/{dist/types → dist-types}/ts3.4/commands/BatchWriteCommand.d.ts +5 -13
  58. package/{dist/types → dist-types}/ts3.4/commands/DeleteCommand.d.ts +5 -13
  59. package/{dist/types → dist-types}/ts3.4/commands/ExecuteStatementCommand.d.ts +4 -12
  60. package/{dist/types → dist-types}/ts3.4/commands/ExecuteTransactionCommand.d.ts +5 -13
  61. package/{dist/types → dist-types}/ts3.4/commands/GetCommand.d.ts +4 -12
  62. package/{dist/types → dist-types}/ts3.4/commands/PutCommand.d.ts +4 -12
  63. package/{dist/types → dist-types}/ts3.4/commands/QueryCommand.d.ts +4 -12
  64. package/{dist/types → dist-types}/ts3.4/commands/ScanCommand.d.ts +4 -12
  65. package/{dist/types → dist-types}/ts3.4/commands/TransactGetCommand.d.ts +4 -12
  66. package/{dist/types → dist-types}/ts3.4/commands/TransactWriteCommand.d.ts +5 -13
  67. package/{dist/types → dist-types}/ts3.4/commands/UpdateCommand.d.ts +4 -12
  68. package/{dist/types → dist-types}/ts3.4/commands/utils.d.ts +0 -0
  69. package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
  70. package/package.json +14 -11
  71. package/dist/cjs/DynamoDBDocument.js +0 -206
  72. package/dist/cjs/DynamoDBDocumentClient.js +0 -19
  73. package/dist/cjs/commands/BatchExecuteStatementCommand.js +0 -28
  74. package/dist/cjs/commands/BatchGetCommand.js +0 -43
  75. package/dist/cjs/commands/BatchWriteCommand.js +0 -54
  76. package/dist/cjs/commands/DeleteCommand.js +0 -40
  77. package/dist/cjs/commands/ExecuteStatementCommand.js +0 -28
  78. package/dist/cjs/commands/ExecuteTransactionCommand.js +0 -28
  79. package/dist/cjs/commands/GetCommand.js +0 -28
  80. package/dist/cjs/commands/PutCommand.js +0 -40
  81. package/dist/cjs/commands/QueryCommand.js +0 -43
  82. package/dist/cjs/commands/ScanCommand.js +0 -37
  83. package/dist/cjs/commands/TransactGetCommand.js +0 -28
  84. package/dist/cjs/commands/TransactWriteCommand.js +0 -45
  85. package/dist/cjs/commands/UpdateCommand.js +0 -46
  86. package/dist/cjs/commands/utils.js +0 -45
  87. package/dist/cjs/index.js +0 -19
  88. package/dist/es/DynamoDBDocument.js +0 -255
  89. package/dist/es/DynamoDBDocumentClient.js +0 -67
  90. package/dist/es/commands/BatchExecuteStatementCommand.js +0 -44
  91. package/dist/es/commands/BatchGetCommand.js +0 -59
  92. package/dist/es/commands/BatchWriteCommand.js +0 -70
  93. package/dist/es/commands/DeleteCommand.js +0 -56
  94. package/dist/es/commands/ExecuteStatementCommand.js +0 -44
  95. package/dist/es/commands/ExecuteTransactionCommand.js +0 -44
  96. package/dist/es/commands/GetCommand.js +0 -44
  97. package/dist/es/commands/PutCommand.js +0 -56
  98. package/dist/es/commands/QueryCommand.js +0 -59
  99. package/dist/es/commands/ScanCommand.js +0 -53
  100. package/dist/es/commands/TransactGetCommand.js +0 -44
  101. package/dist/es/commands/TransactWriteCommand.js +0 -61
  102. package/dist/es/commands/UpdateCommand.js +0 -62
  103. package/dist/es/commands/utils.js +0 -51
  104. package/dist/es/index.js +0 -16
  105. package/dist/types/ts3.4/DynamoDBDocument.d.ts +0 -195
  106. package/jest.config.js +0 -5
  107. package/tsconfig.cjs.json +0 -9
  108. package/tsconfig.es.json +0 -10
  109. package/tsconfig.types.json +0 -9
@@ -0,0 +1,33 @@
1
+ import { __assign, __awaiter, __extends, __generator } from "tslib";
2
+ import { GetItemCommand as __GetItemCommand, } from "@aws-sdk/client-dynamodb";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { marshallInput, unmarshallOutput } from "../commands/utils";
5
+ var GetCommand = (function (_super) {
6
+ __extends(GetCommand, _super);
7
+ function GetCommand(input) {
8
+ var _this = _super.call(this) || this;
9
+ _this.input = input;
10
+ _this.inputKeyNodes = [{ key: "Key" }];
11
+ _this.outputKeyNodes = [{ key: "Item" }];
12
+ return _this;
13
+ }
14
+ GetCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
15
+ var _this = this;
16
+ var _a = configuration.translateConfig || {}, marshallOptions = _a.marshallOptions, unmarshallOptions = _a.unmarshallOptions;
17
+ var command = new __GetItemCommand(marshallInput(this.input, this.inputKeyNodes, marshallOptions));
18
+ var handler = command.resolveMiddleware(clientStack, configuration, options);
19
+ return function () { return __awaiter(_this, void 0, void 0, function () {
20
+ var data;
21
+ return __generator(this, function (_a) {
22
+ switch (_a.label) {
23
+ case 0: return [4, handler(command)];
24
+ case 1:
25
+ data = _a.sent();
26
+ return [2, __assign(__assign({}, data), { output: unmarshallOutput(data.output, this.outputKeyNodes, unmarshallOptions) })];
27
+ }
28
+ });
29
+ }); };
30
+ };
31
+ return GetCommand;
32
+ }($Command));
33
+ export { GetCommand };
@@ -0,0 +1,45 @@
1
+ import { __assign, __awaiter, __extends, __generator } from "tslib";
2
+ import { PutItemCommand as __PutItemCommand, } from "@aws-sdk/client-dynamodb";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { marshallInput, unmarshallOutput } from "../commands/utils";
5
+ var PutCommand = (function (_super) {
6
+ __extends(PutCommand, _super);
7
+ function PutCommand(input) {
8
+ var _this = _super.call(this) || this;
9
+ _this.input = input;
10
+ _this.inputKeyNodes = [
11
+ { key: "Item" },
12
+ {
13
+ key: "Expected",
14
+ children: {
15
+ children: [{ key: "Value" }, { key: "AttributeValueList" }],
16
+ },
17
+ },
18
+ { key: "ExpressionAttributeValues" },
19
+ ];
20
+ _this.outputKeyNodes = [
21
+ { key: "Attributes" },
22
+ { key: "ItemCollectionMetrics", children: [{ key: "ItemCollectionKey" }] },
23
+ ];
24
+ return _this;
25
+ }
26
+ PutCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
27
+ var _this = this;
28
+ var _a = configuration.translateConfig || {}, marshallOptions = _a.marshallOptions, unmarshallOptions = _a.unmarshallOptions;
29
+ var command = new __PutItemCommand(marshallInput(this.input, this.inputKeyNodes, marshallOptions));
30
+ var handler = command.resolveMiddleware(clientStack, configuration, options);
31
+ return function () { return __awaiter(_this, void 0, void 0, function () {
32
+ var data;
33
+ return __generator(this, function (_a) {
34
+ switch (_a.label) {
35
+ case 0: return [4, handler(command)];
36
+ case 1:
37
+ data = _a.sent();
38
+ return [2, __assign(__assign({}, data), { output: unmarshallOutput(data.output, this.outputKeyNodes, unmarshallOptions) })];
39
+ }
40
+ });
41
+ }); };
42
+ };
43
+ return PutCommand;
44
+ }($Command));
45
+ export { PutCommand };
@@ -0,0 +1,48 @@
1
+ import { __assign, __awaiter, __extends, __generator } from "tslib";
2
+ import { QueryCommand as __QueryCommand, } from "@aws-sdk/client-dynamodb";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { marshallInput, unmarshallOutput } from "../commands/utils";
5
+ var QueryCommand = (function (_super) {
6
+ __extends(QueryCommand, _super);
7
+ function QueryCommand(input) {
8
+ var _this = _super.call(this) || this;
9
+ _this.input = input;
10
+ _this.inputKeyNodes = [
11
+ {
12
+ key: "KeyConditions",
13
+ children: {
14
+ children: [{ key: "AttributeValueList" }],
15
+ },
16
+ },
17
+ {
18
+ key: "QueryFilter",
19
+ children: {
20
+ children: [{ key: "AttributeValueList" }],
21
+ },
22
+ },
23
+ { key: "ExclusiveStartKey" },
24
+ { key: "ExpressionAttributeValues" },
25
+ ];
26
+ _this.outputKeyNodes = [{ key: "Items" }, { key: "LastEvaluatedKey" }];
27
+ return _this;
28
+ }
29
+ QueryCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
30
+ var _this = this;
31
+ var _a = configuration.translateConfig || {}, marshallOptions = _a.marshallOptions, unmarshallOptions = _a.unmarshallOptions;
32
+ var command = new __QueryCommand(marshallInput(this.input, this.inputKeyNodes, marshallOptions));
33
+ var handler = command.resolveMiddleware(clientStack, configuration, options);
34
+ return function () { return __awaiter(_this, void 0, void 0, function () {
35
+ var data;
36
+ return __generator(this, function (_a) {
37
+ switch (_a.label) {
38
+ case 0: return [4, handler(command)];
39
+ case 1:
40
+ data = _a.sent();
41
+ return [2, __assign(__assign({}, data), { output: unmarshallOutput(data.output, this.outputKeyNodes, unmarshallOptions) })];
42
+ }
43
+ });
44
+ }); };
45
+ };
46
+ return QueryCommand;
47
+ }($Command));
48
+ export { QueryCommand };
@@ -0,0 +1,42 @@
1
+ import { __assign, __awaiter, __extends, __generator } from "tslib";
2
+ import { ScanCommand as __ScanCommand, } from "@aws-sdk/client-dynamodb";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { marshallInput, unmarshallOutput } from "../commands/utils";
5
+ var ScanCommand = (function (_super) {
6
+ __extends(ScanCommand, _super);
7
+ function ScanCommand(input) {
8
+ var _this = _super.call(this) || this;
9
+ _this.input = input;
10
+ _this.inputKeyNodes = [
11
+ {
12
+ key: "ScanFilter",
13
+ children: {
14
+ children: [{ key: "AttributeValueList" }],
15
+ },
16
+ },
17
+ { key: "ExclusiveStartKey" },
18
+ { key: "ExpressionAttributeValues" },
19
+ ];
20
+ _this.outputKeyNodes = [{ key: "Items" }, { key: "LastEvaluatedKey" }];
21
+ return _this;
22
+ }
23
+ ScanCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
24
+ var _this = this;
25
+ var _a = configuration.translateConfig || {}, marshallOptions = _a.marshallOptions, unmarshallOptions = _a.unmarshallOptions;
26
+ var command = new __ScanCommand(marshallInput(this.input, this.inputKeyNodes, marshallOptions));
27
+ var handler = command.resolveMiddleware(clientStack, configuration, options);
28
+ return function () { return __awaiter(_this, void 0, void 0, function () {
29
+ var data;
30
+ return __generator(this, function (_a) {
31
+ switch (_a.label) {
32
+ case 0: return [4, handler(command)];
33
+ case 1:
34
+ data = _a.sent();
35
+ return [2, __assign(__assign({}, data), { output: unmarshallOutput(data.output, this.outputKeyNodes, unmarshallOptions) })];
36
+ }
37
+ });
38
+ }); };
39
+ };
40
+ return ScanCommand;
41
+ }($Command));
42
+ export { ScanCommand };
@@ -0,0 +1,33 @@
1
+ import { __assign, __awaiter, __extends, __generator } from "tslib";
2
+ import { TransactGetItemsCommand as __TransactGetItemsCommand, } from "@aws-sdk/client-dynamodb";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { marshallInput, unmarshallOutput } from "../commands/utils";
5
+ var TransactGetCommand = (function (_super) {
6
+ __extends(TransactGetCommand, _super);
7
+ function TransactGetCommand(input) {
8
+ var _this = _super.call(this) || this;
9
+ _this.input = input;
10
+ _this.inputKeyNodes = [{ key: "TransactItems", children: [{ key: "Get", children: [{ key: "Key" }] }] }];
11
+ _this.outputKeyNodes = [{ key: "Responses", children: [{ key: "Item" }] }];
12
+ return _this;
13
+ }
14
+ TransactGetCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
15
+ var _this = this;
16
+ var _a = configuration.translateConfig || {}, marshallOptions = _a.marshallOptions, unmarshallOptions = _a.unmarshallOptions;
17
+ var command = new __TransactGetItemsCommand(marshallInput(this.input, this.inputKeyNodes, marshallOptions));
18
+ var handler = command.resolveMiddleware(clientStack, configuration, options);
19
+ return function () { return __awaiter(_this, void 0, void 0, function () {
20
+ var data;
21
+ return __generator(this, function (_a) {
22
+ switch (_a.label) {
23
+ case 0: return [4, handler(command)];
24
+ case 1:
25
+ data = _a.sent();
26
+ return [2, __assign(__assign({}, data), { output: unmarshallOutput(data.output, this.outputKeyNodes, unmarshallOptions) })];
27
+ }
28
+ });
29
+ }); };
30
+ };
31
+ return TransactGetCommand;
32
+ }($Command));
33
+ export { TransactGetCommand };
@@ -0,0 +1,50 @@
1
+ import { __assign, __awaiter, __extends, __generator } from "tslib";
2
+ import { TransactWriteItemsCommand as __TransactWriteItemsCommand, } from "@aws-sdk/client-dynamodb";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { marshallInput, unmarshallOutput } from "../commands/utils";
5
+ var TransactWriteCommand = (function (_super) {
6
+ __extends(TransactWriteCommand, _super);
7
+ function TransactWriteCommand(input) {
8
+ var _this = _super.call(this) || this;
9
+ _this.input = input;
10
+ _this.inputKeyNodes = [
11
+ {
12
+ key: "TransactItems",
13
+ children: [
14
+ { key: "ConditionCheck", children: [{ key: "Key" }, { key: "ExpressionAttributeValues" }] },
15
+ { key: "Put", children: [{ key: "Item" }, { key: "ExpressionAttributeValues" }] },
16
+ { key: "Delete", children: [{ key: "Key" }, { key: "ExpressionAttributeValues" }] },
17
+ { key: "Update", children: [{ key: "Key" }, { key: "ExpressionAttributeValues" }] },
18
+ ],
19
+ },
20
+ ];
21
+ _this.outputKeyNodes = [
22
+ {
23
+ key: "ItemCollectionMetrics",
24
+ children: {
25
+ children: [{ key: "ItemCollectionKey" }],
26
+ },
27
+ },
28
+ ];
29
+ return _this;
30
+ }
31
+ TransactWriteCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
32
+ var _this = this;
33
+ var _a = configuration.translateConfig || {}, marshallOptions = _a.marshallOptions, unmarshallOptions = _a.unmarshallOptions;
34
+ var command = new __TransactWriteItemsCommand(marshallInput(this.input, this.inputKeyNodes, marshallOptions));
35
+ var handler = command.resolveMiddleware(clientStack, configuration, options);
36
+ return function () { return __awaiter(_this, void 0, void 0, function () {
37
+ var data;
38
+ return __generator(this, function (_a) {
39
+ switch (_a.label) {
40
+ case 0: return [4, handler(command)];
41
+ case 1:
42
+ data = _a.sent();
43
+ return [2, __assign(__assign({}, data), { output: unmarshallOutput(data.output, this.outputKeyNodes, unmarshallOptions) })];
44
+ }
45
+ });
46
+ }); };
47
+ };
48
+ return TransactWriteCommand;
49
+ }($Command));
50
+ export { TransactWriteCommand };
@@ -0,0 +1,51 @@
1
+ import { __assign, __awaiter, __extends, __generator } from "tslib";
2
+ import { UpdateItemCommand as __UpdateItemCommand, } from "@aws-sdk/client-dynamodb";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { marshallInput, unmarshallOutput } from "../commands/utils";
5
+ var UpdateCommand = (function (_super) {
6
+ __extends(UpdateCommand, _super);
7
+ function UpdateCommand(input) {
8
+ var _this = _super.call(this) || this;
9
+ _this.input = input;
10
+ _this.inputKeyNodes = [
11
+ { key: "Key" },
12
+ {
13
+ key: "AttributeUpdates",
14
+ children: {
15
+ children: [{ key: "Value" }],
16
+ },
17
+ },
18
+ {
19
+ key: "Expected",
20
+ children: {
21
+ children: [{ key: "Value" }, { key: "AttributeValueList" }],
22
+ },
23
+ },
24
+ { key: "ExpressionAttributeValues" },
25
+ ];
26
+ _this.outputKeyNodes = [
27
+ { key: "Attributes" },
28
+ { key: "ItemCollectionMetrics", children: [{ key: "ItemCollectionKey" }] },
29
+ ];
30
+ return _this;
31
+ }
32
+ UpdateCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
33
+ var _this = this;
34
+ var _a = configuration.translateConfig || {}, marshallOptions = _a.marshallOptions, unmarshallOptions = _a.unmarshallOptions;
35
+ var command = new __UpdateItemCommand(marshallInput(this.input, this.inputKeyNodes, marshallOptions));
36
+ var handler = command.resolveMiddleware(clientStack, configuration, options);
37
+ return function () { return __awaiter(_this, void 0, void 0, function () {
38
+ var data;
39
+ return __generator(this, function (_a) {
40
+ switch (_a.label) {
41
+ case 0: return [4, handler(command)];
42
+ case 1:
43
+ data = _a.sent();
44
+ return [2, __assign(__assign({}, data), { output: unmarshallOutput(data.output, this.outputKeyNodes, unmarshallOptions) })];
45
+ }
46
+ });
47
+ }); };
48
+ };
49
+ return UpdateCommand;
50
+ }($Command));
51
+ export { UpdateCommand };
@@ -0,0 +1,46 @@
1
+ import { __assign, __read } from "tslib";
2
+ import { marshall, unmarshall } from "@aws-sdk/util-dynamodb";
3
+ var processObj = function (obj, processFunc, children) {
4
+ if (obj) {
5
+ if (!children || (Array.isArray(children) && children.length === 0)) {
6
+ return processFunc(obj);
7
+ }
8
+ else {
9
+ if (Array.isArray(children)) {
10
+ return processKeysInObj(obj, processFunc, children);
11
+ }
12
+ else {
13
+ return processAllKeysInObj(obj, processFunc, children.children);
14
+ }
15
+ }
16
+ }
17
+ return undefined;
18
+ };
19
+ var processKeyInObj = function (obj, processFunc, children) {
20
+ if (Array.isArray(obj)) {
21
+ return obj.map(function (item) { return processObj(item, processFunc, children); });
22
+ }
23
+ return processObj(obj, processFunc, children);
24
+ };
25
+ var processKeysInObj = function (obj, processFunc, keyNodes) {
26
+ return keyNodes.reduce(function (acc, _a) {
27
+ var _b;
28
+ var key = _a.key, children = _a.children;
29
+ return (__assign(__assign({}, acc), (_b = {}, _b[key] = processKeyInObj(acc[key], processFunc, children), _b)));
30
+ }, obj);
31
+ };
32
+ var processAllKeysInObj = function (obj, processFunc, children) {
33
+ return Object.entries(obj).reduce(function (acc, _a) {
34
+ var _b;
35
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
36
+ return (__assign(__assign({}, acc), (_b = {}, _b[key] = processKeyInObj(value, processFunc, children), _b)));
37
+ }, {});
38
+ };
39
+ export var marshallInput = function (obj, keyNodes, options) {
40
+ var marshallFunc = function (toMarshall) { return marshall(toMarshall, options); };
41
+ return processKeysInObj(obj, marshallFunc, keyNodes);
42
+ };
43
+ export var unmarshallOutput = function (obj, keyNodes, options) {
44
+ var unmarshallFunc = function (toMarshall) { return unmarshall(toMarshall, options); };
45
+ return processKeysInObj(obj, unmarshallFunc, keyNodes);
46
+ };
File without changes
@@ -1,4 +1,5 @@
1
- import { DynamoDBDocumentClient, TranslateConfig } from "./DynamoDBDocumentClient";
1
+ import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
2
+ import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
2
3
  import { BatchExecuteStatementCommandInput, BatchExecuteStatementCommandOutput } from "./commands/BatchExecuteStatementCommand";
3
4
  import { BatchGetCommandInput, BatchGetCommandOutput } from "./commands/BatchGetCommand";
4
5
  import { BatchWriteCommandInput, BatchWriteCommandOutput } from "./commands/BatchWriteCommand";
@@ -12,8 +13,7 @@ import { ScanCommandInput, ScanCommandOutput } from "./commands/ScanCommand";
12
13
  import { TransactGetCommandInput, TransactGetCommandOutput } from "./commands/TransactGetCommand";
13
14
  import { TransactWriteCommandInput, TransactWriteCommandOutput } from "./commands/TransactWriteCommand";
14
15
  import { UpdateCommandInput, UpdateCommandOutput } from "./commands/UpdateCommand";
15
- import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
16
- import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
16
+ import { DynamoDBDocumentClient, TranslateConfig } from "./DynamoDBDocumentClient";
17
17
  /**
18
18
  * The document client simplifies working with items in Amazon DynamoDB by
19
19
  * abstracting away the notion of attribute values. This abstraction annotates native
@@ -1,3 +1,7 @@
1
+ import { DynamoDBClient, DynamoDBClientResolvedConfig, ServiceInputTypes as __ServiceInputTypes, ServiceOutputTypes as __ServiceOutputTypes } from "@aws-sdk/client-dynamodb";
2
+ import { Client as __Client } from "@aws-sdk/smithy-client";
3
+ import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
4
+ import { marshallOptions, unmarshallOptions } from "@aws-sdk/util-dynamodb";
1
5
  import { BatchExecuteStatementCommandInput, BatchExecuteStatementCommandOutput } from "./commands/BatchExecuteStatementCommand";
2
6
  import { BatchGetCommandInput, BatchGetCommandOutput } from "./commands/BatchGetCommand";
3
7
  import { BatchWriteCommandInput, BatchWriteCommandOutput } from "./commands/BatchWriteCommand";
@@ -11,10 +15,6 @@ import { ScanCommandInput, ScanCommandOutput } from "./commands/ScanCommand";
11
15
  import { TransactGetCommandInput, TransactGetCommandOutput } from "./commands/TransactGetCommand";
12
16
  import { TransactWriteCommandInput, TransactWriteCommandOutput } from "./commands/TransactWriteCommand";
13
17
  import { UpdateCommandInput, UpdateCommandOutput } from "./commands/UpdateCommand";
14
- import { DynamoDBClient, DynamoDBClientResolvedConfig, ServiceInputTypes as __ServiceInputTypes, ServiceOutputTypes as __ServiceOutputTypes } from "@aws-sdk/client-dynamodb";
15
- import { Client as __Client } from "@aws-sdk/smithy-client";
16
- import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
17
- import { marshallOptions, unmarshallOptions } from "@aws-sdk/util-dynamodb";
18
18
  export declare type ServiceInputTypes = __ServiceInputTypes | BatchExecuteStatementCommandInput | BatchGetCommandInput | BatchWriteCommandInput | DeleteCommandInput | ExecuteStatementCommandInput | ExecuteTransactionCommandInput | GetCommandInput | PutCommandInput | QueryCommandInput | ScanCommandInput | TransactGetCommandInput | TransactWriteCommandInput | UpdateCommandInput;
19
19
  export declare type ServiceOutputTypes = __ServiceOutputTypes | BatchExecuteStatementCommandOutput | BatchGetCommandOutput | BatchWriteCommandOutput | DeleteCommandOutput | ExecuteStatementCommandOutput | ExecuteTransactionCommandOutput | GetCommandOutput | PutCommandOutput | QueryCommandOutput | ScanCommandOutput | TransactGetCommandOutput | TransactWriteCommandOutput | UpdateCommandOutput;
20
20
  export declare type TranslateConfig = {
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
- import { BatchStatementRequest, BatchStatementResponse, BatchExecuteStatementCommandInput as __BatchExecuteStatementCommandInput, BatchExecuteStatementCommandOutput as __BatchExecuteStatementCommandOutput } from "@aws-sdk/client-dynamodb";
1
+ import { BatchExecuteStatementCommandInput as __BatchExecuteStatementCommandInput, BatchExecuteStatementCommandOutput as __BatchExecuteStatementCommandOutput, BatchStatementRequest, BatchStatementResponse } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type BatchExecuteStatementCommandInput = Omit<__BatchExecuteStatementCommandInput, "Statements"> & {
7
7
  Statements: (Omit<BatchStatementRequest, "Parameters"> & {
8
8
  Parameters?: NativeAttributeValue[];
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
- import { KeysAndAttributes, BatchGetItemCommandInput as __BatchGetItemCommandInput, BatchGetItemCommandOutput as __BatchGetItemCommandOutput } from "@aws-sdk/client-dynamodb";
1
+ import { BatchGetItemCommandInput as __BatchGetItemCommandInput, BatchGetItemCommandOutput as __BatchGetItemCommandOutput, KeysAndAttributes } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type BatchGetCommandInput = Omit<__BatchGetItemCommandInput, "RequestItems"> & {
7
7
  RequestItems: {
8
8
  [key: string]: Omit<KeysAndAttributes, "Keys"> & {
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
- import { DeleteRequest, ItemCollectionMetrics, PutRequest, WriteRequest, BatchWriteItemCommandInput as __BatchWriteItemCommandInput, BatchWriteItemCommandOutput as __BatchWriteItemCommandOutput } from "@aws-sdk/client-dynamodb";
1
+ import { BatchWriteItemCommandInput as __BatchWriteItemCommandInput, BatchWriteItemCommandOutput as __BatchWriteItemCommandOutput, DeleteRequest, ItemCollectionMetrics, PutRequest, WriteRequest } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type BatchWriteCommandInput = Omit<__BatchWriteItemCommandInput, "RequestItems"> & {
7
7
  RequestItems: {
8
8
  [key: string]: (Omit<WriteRequest, "PutRequest" | "DeleteRequest"> & {
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
- import { ExpectedAttributeValue, ItemCollectionMetrics, DeleteItemCommandInput as __DeleteItemCommandInput, DeleteItemCommandOutput as __DeleteItemCommandOutput } from "@aws-sdk/client-dynamodb";
1
+ import { DeleteItemCommandInput as __DeleteItemCommandInput, DeleteItemCommandOutput as __DeleteItemCommandOutput, ExpectedAttributeValue, ItemCollectionMetrics } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type DeleteCommandInput = Omit<__DeleteItemCommandInput, "Key" | "Expected" | "ExpressionAttributeValues"> & {
7
7
  Key: {
8
8
  [key: string]: NativeAttributeValue;
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
1
  import { ExecuteStatementCommandInput as __ExecuteStatementCommandInput, ExecuteStatementCommandOutput as __ExecuteStatementCommandOutput } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type ExecuteStatementCommandInput = Omit<__ExecuteStatementCommandInput, "Parameters"> & {
7
7
  Parameters?: NativeAttributeValue[];
8
8
  };
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
- import { ItemResponse, ParameterizedStatement, ExecuteTransactionCommandInput as __ExecuteTransactionCommandInput, ExecuteTransactionCommandOutput as __ExecuteTransactionCommandOutput } from "@aws-sdk/client-dynamodb";
1
+ import { ExecuteTransactionCommandInput as __ExecuteTransactionCommandInput, ExecuteTransactionCommandOutput as __ExecuteTransactionCommandOutput, ItemResponse, ParameterizedStatement } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type ExecuteTransactionCommandInput = Omit<__ExecuteTransactionCommandInput, "TransactStatements"> & {
7
7
  TransactStatements: (Omit<ParameterizedStatement, "Parameters"> & {
8
8
  Parameters?: NativeAttributeValue[];
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
1
  import { GetItemCommandInput as __GetItemCommandInput, GetItemCommandOutput as __GetItemCommandOutput } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type GetCommandInput = Omit<__GetItemCommandInput, "Key"> & {
7
7
  Key: {
8
8
  [key: string]: NativeAttributeValue;
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
1
  import { ExpectedAttributeValue, ItemCollectionMetrics, PutItemCommandInput as __PutItemCommandInput, PutItemCommandOutput as __PutItemCommandOutput } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type PutCommandInput = Omit<__PutItemCommandInput, "Item" | "Expected" | "ExpressionAttributeValues"> & {
7
7
  Item: {
8
8
  [key: string]: NativeAttributeValue;
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
1
  import { Condition, QueryCommandInput as __QueryCommandInput, QueryCommandOutput as __QueryCommandOutput } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type QueryCommandInput = Omit<__QueryCommandInput, "KeyConditions" | "QueryFilter" | "ExclusiveStartKey" | "ExpressionAttributeValues"> & {
7
7
  KeyConditions?: {
8
8
  [key: string]: Omit<Condition, "AttributeValueList"> & {
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
1
  import { Condition, ScanCommandInput as __ScanCommandInput, ScanCommandOutput as __ScanCommandOutput } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type ScanCommandInput = Omit<__ScanCommandInput, "ScanFilter" | "ExclusiveStartKey" | "ExpressionAttributeValues"> & {
7
7
  ScanFilter?: {
8
8
  [key: string]: Omit<Condition, "AttributeValueList"> & {
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
1
  import { Get, ItemResponse, TransactGetItem, TransactGetItemsCommandInput as __TransactGetItemsCommandInput, TransactGetItemsCommandOutput as __TransactGetItemsCommandOutput } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type TransactGetCommandInput = Omit<__TransactGetItemsCommandInput, "TransactItems"> & {
7
7
  TransactItems: (Omit<TransactGetItem, "Get"> & {
8
8
  Get: (Omit<Get, "Key"> & {
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
- import { ConditionCheck, Delete, ItemCollectionMetrics, Put, TransactWriteItem, Update, TransactWriteItemsCommandInput as __TransactWriteItemsCommandInput, TransactWriteItemsCommandOutput as __TransactWriteItemsCommandOutput } from "@aws-sdk/client-dynamodb";
1
+ import { ConditionCheck, Delete, ItemCollectionMetrics, Put, TransactWriteItem, TransactWriteItemsCommandInput as __TransactWriteItemsCommandInput, TransactWriteItemsCommandOutput as __TransactWriteItemsCommandOutput, Update } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type TransactWriteCommandInput = Omit<__TransactWriteItemsCommandInput, "TransactItems"> & {
7
7
  TransactItems: (Omit<TransactWriteItem, "ConditionCheck" | "Put" | "Delete" | "Update"> & {
8
8
  ConditionCheck?: Omit<ConditionCheck, "Key" | "ExpressionAttributeValues"> & {
@@ -1,8 +1,8 @@
1
- import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
2
1
  import { AttributeValueUpdate, ExpectedAttributeValue, ItemCollectionMetrics, UpdateItemCommandInput as __UpdateItemCommandInput, UpdateItemCommandOutput as __UpdateItemCommandOutput } from "@aws-sdk/client-dynamodb";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { Handler, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MiddlewareStack } from "@aws-sdk/types";
5
4
  import { NativeAttributeValue } from "@aws-sdk/util-dynamodb";
5
+ import { DynamoDBDocumentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DynamoDBDocumentClient";
6
6
  export declare type UpdateCommandInput = Omit<__UpdateItemCommandInput, "Key" | "AttributeUpdates" | "Expected" | "ExpressionAttributeValues"> & {
7
7
  Key: {
8
8
  [key: string]: NativeAttributeValue;
File without changes
@@ -0,0 +1,15 @@
1
+ export * from "./commands/BatchExecuteStatementCommand";
2
+ export * from "./commands/BatchGetCommand";
3
+ export * from "./commands/BatchWriteCommand";
4
+ export * from "./commands/DeleteCommand";
5
+ export * from "./commands/ExecuteStatementCommand";
6
+ export * from "./commands/ExecuteTransactionCommand";
7
+ export * from "./commands/GetCommand";
8
+ export * from "./commands/PutCommand";
9
+ export * from "./commands/QueryCommand";
10
+ export * from "./commands/ScanCommand";
11
+ export * from "./commands/TransactGetCommand";
12
+ export * from "./commands/TransactWriteCommand";
13
+ export * from "./commands/UpdateCommand";
14
+ export * from "./DynamoDBDocumentClient";
15
+ export * from "./DynamoDBDocument";