@aws-sdk/lib-dynamodb 3.137.0 → 3.145.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/CHANGELOG.md +27 -0
- package/README.md +73 -0
- package/dist-cjs/baseCommand/DynamoDBDocumentClientCommand.js +28 -0
- package/dist-cjs/commands/BatchExecuteStatementCommand.js +8 -13
- package/dist-cjs/commands/BatchGetCommand.js +8 -13
- package/dist-cjs/commands/BatchWriteCommand.js +8 -13
- package/dist-cjs/commands/DeleteCommand.js +8 -13
- package/dist-cjs/commands/ExecuteStatementCommand.js +8 -13
- package/dist-cjs/commands/ExecuteTransactionCommand.js +8 -13
- package/dist-cjs/commands/GetCommand.js +8 -13
- package/dist-cjs/commands/PutCommand.js +8 -13
- package/dist-cjs/commands/QueryCommand.js +8 -13
- package/dist-cjs/commands/ScanCommand.js +8 -13
- package/dist-cjs/commands/TransactGetCommand.js +8 -13
- package/dist-cjs/commands/TransactWriteCommand.js +8 -13
- package/dist-cjs/commands/UpdateCommand.js +8 -13
- package/dist-es/baseCommand/DynamoDBDocumentClientCommand.js +45 -0
- package/dist-es/commands/BatchExecuteStatementCommand.js +11 -18
- package/dist-es/commands/BatchGetCommand.js +11 -18
- package/dist-es/commands/BatchWriteCommand.js +11 -18
- package/dist-es/commands/DeleteCommand.js +11 -18
- package/dist-es/commands/ExecuteStatementCommand.js +11 -18
- package/dist-es/commands/ExecuteTransactionCommand.js +11 -18
- package/dist-es/commands/GetCommand.js +11 -18
- package/dist-es/commands/PutCommand.js +11 -18
- package/dist-es/commands/QueryCommand.js +11 -18
- package/dist-es/commands/ScanCommand.js +11 -18
- package/dist-es/commands/TransactGetCommand.js +11 -18
- package/dist-es/commands/TransactWriteCommand.js +11 -18
- package/dist-es/commands/UpdateCommand.js +11 -18
- package/dist-types/baseCommand/DynamoDBDocumentClientCommand.d.ts +15 -0
- package/dist-types/commands/BatchExecuteStatementCommand.d.ts +17 -5
- package/dist-types/commands/BatchGetCommand.d.ts +26 -5
- package/dist-types/commands/BatchWriteCommand.d.ts +34 -5
- package/dist-types/commands/DeleteCommand.d.ts +25 -5
- package/dist-types/commands/ExecuteStatementCommand.d.ts +11 -5
- package/dist-types/commands/ExecuteTransactionCommand.d.ts +17 -5
- package/dist-types/commands/GetCommand.d.ts +11 -5
- package/dist-types/commands/PutCommand.d.ts +25 -5
- package/dist-types/commands/QueryCommand.d.ts +19 -5
- package/dist-types/commands/ScanCommand.d.ts +19 -5
- package/dist-types/commands/TransactGetCommand.d.ts +20 -5
- package/dist-types/commands/TransactWriteCommand.d.ts +22 -5
- package/dist-types/commands/UpdateCommand.d.ts +25 -5
- package/dist-types/ts3.4/baseCommand/DynamoDBDocumentClientCommand.d.ts +12 -0
- package/dist-types/ts3.4/commands/BatchExecuteStatementCommand.d.ts +17 -5
- package/dist-types/ts3.4/commands/BatchGetCommand.d.ts +26 -5
- package/dist-types/ts3.4/commands/BatchWriteCommand.d.ts +34 -5
- package/dist-types/ts3.4/commands/DeleteCommand.d.ts +25 -5
- package/dist-types/ts3.4/commands/ExecuteStatementCommand.d.ts +11 -5
- package/dist-types/ts3.4/commands/ExecuteTransactionCommand.d.ts +17 -5
- package/dist-types/ts3.4/commands/GetCommand.d.ts +11 -5
- package/dist-types/ts3.4/commands/PutCommand.d.ts +25 -5
- package/dist-types/ts3.4/commands/QueryCommand.d.ts +19 -5
- package/dist-types/ts3.4/commands/ScanCommand.d.ts +19 -5
- package/dist-types/ts3.4/commands/TransactGetCommand.d.ts +20 -5
- package/dist-types/ts3.4/commands/TransactWriteCommand.d.ts +22 -5
- package/dist-types/ts3.4/commands/UpdateCommand.d.ts +25 -5
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.145.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.144.0...v3.145.0) (2022-08-08)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/lib-dynamodb
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-sdk/lib-dynamodb
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **lib-dynamodb:** make command middleware useable, turn marshalling into middleware ([#3808](https://github.com/aws/aws-sdk-js-v3/issues/3808)) ([38b1a28](https://github.com/aws/aws-sdk-js-v3/commit/38b1a2882c70da815b081a378d39bb6dec06d4d2))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
# [3.137.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.136.1...v3.137.0) (2022-07-26)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @aws-sdk/lib-dynamodb
|
package/README.md
CHANGED
|
@@ -160,6 +160,79 @@ await ddbDocClient.put({
|
|
|
160
160
|
});
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
+
### Client and Command middleware stacks
|
|
164
|
+
|
|
165
|
+
As with other AWS SDK for JavaScript v3 clients, you can apply middleware functions
|
|
166
|
+
both on the client itself and individual `Command`s.
|
|
167
|
+
|
|
168
|
+
For individual `Command`s, here are examples of how to add middleware before and after
|
|
169
|
+
both marshalling and unmarshalling. We will use `QueryCommand` as an example.
|
|
170
|
+
Others follow the same pattern.
|
|
171
|
+
|
|
172
|
+
```js
|
|
173
|
+
import { DynamoDBDocumentClient, QueryCommand } from "@aws-sdk/lib-dynamodb";
|
|
174
|
+
|
|
175
|
+
const client = new DynamoDBClient({
|
|
176
|
+
/*...*/
|
|
177
|
+
});
|
|
178
|
+
const doc = DynamoDBDocumentClient.from(client);
|
|
179
|
+
const command = new QueryCommand({
|
|
180
|
+
/*...*/
|
|
181
|
+
});
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Before and after marshalling:
|
|
185
|
+
|
|
186
|
+
```js
|
|
187
|
+
command.middlewareStack.addRelativeTo(
|
|
188
|
+
(next) => async (args) => {
|
|
189
|
+
console.log("pre-marshall", args.input);
|
|
190
|
+
return next(args);
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
relation: "before",
|
|
194
|
+
toMiddleware: "DocumentMarshall",
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
command.middlewareStack.addRelativeTo(
|
|
198
|
+
(next) => async (args) => {
|
|
199
|
+
console.log("post-marshall", args.input);
|
|
200
|
+
return next(args);
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
relation: "after",
|
|
204
|
+
toMiddleware: "DocumentMarshall",
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Before and after unmarshalling:
|
|
210
|
+
|
|
211
|
+
```js
|
|
212
|
+
command.middlewareStack.addRelativeTo(
|
|
213
|
+
(next) => async (args) => {
|
|
214
|
+
const result = await next(args);
|
|
215
|
+
console.log("pre-unmarshall", result.output.Items);
|
|
216
|
+
return result;
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
relation: "after", // <- after for pre-unmarshall
|
|
220
|
+
toMiddleware: "DocumentUnmarshall",
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
command.middlewareStack.addRelativeTo(
|
|
224
|
+
(next) => async (args) => {
|
|
225
|
+
const result = await next(args);
|
|
226
|
+
console.log("post-unmarshall", result.output.Items);
|
|
227
|
+
return result;
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
relation: "before", // <- before for post-unmarshall
|
|
231
|
+
toMiddleware: "DocumentUnmarshall",
|
|
232
|
+
}
|
|
233
|
+
);
|
|
234
|
+
```
|
|
235
|
+
|
|
163
236
|
### Destroying document client
|
|
164
237
|
|
|
165
238
|
The `destroy()` call on document client is a no-op as document client does not
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynamoDBDocumentClientCommand = void 0;
|
|
4
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
5
|
+
const utils_1 = require("../commands/utils");
|
|
6
|
+
class DynamoDBDocumentClientCommand extends smithy_client_1.Command {
|
|
7
|
+
addMarshallingMiddleware(configuration) {
|
|
8
|
+
const { marshallOptions, unmarshallOptions } = configuration.translateConfig || {};
|
|
9
|
+
this.clientCommand.middlewareStack.add((next) => async (args) => {
|
|
10
|
+
args.input = (0, utils_1.marshallInput)(this.input, this.inputKeyNodes, marshallOptions);
|
|
11
|
+
return next(args);
|
|
12
|
+
}, {
|
|
13
|
+
name: "DocumentMarshall",
|
|
14
|
+
step: "initialize",
|
|
15
|
+
override: true,
|
|
16
|
+
});
|
|
17
|
+
this.clientCommand.middlewareStack.add((next) => async (args) => {
|
|
18
|
+
const deserialized = await next(args);
|
|
19
|
+
deserialized.output = (0, utils_1.unmarshallOutput)(deserialized.output, this.outputKeyNodes, unmarshallOptions);
|
|
20
|
+
return deserialized;
|
|
21
|
+
}, {
|
|
22
|
+
name: "DocumentUnmarshall",
|
|
23
|
+
step: "deserialize",
|
|
24
|
+
override: true,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.DynamoDBDocumentClientCommand = DynamoDBDocumentClientCommand;
|
|
@@ -2,26 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BatchExecuteStatementCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class BatchExecuteStatementCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class BatchExecuteStatementCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
11
10
|
this.inputKeyNodes = [{ key: "Statements", children: [{ key: "Parameters" }] }];
|
|
12
11
|
this.outputKeyNodes = [{ key: "Responses", children: [{ key: "Item" }] }];
|
|
12
|
+
this.clientCommand = new client_dynamodb_1.BatchExecuteStatementCommand(this.input);
|
|
13
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
13
14
|
}
|
|
14
15
|
resolveMiddleware(clientStack, configuration, options) {
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const handler =
|
|
18
|
-
return async () =>
|
|
19
|
-
const data = await handler(command);
|
|
20
|
-
return {
|
|
21
|
-
...data,
|
|
22
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
23
|
-
};
|
|
24
|
-
};
|
|
16
|
+
this.addMarshallingMiddleware(configuration);
|
|
17
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
18
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
19
|
+
return async () => handler(this.clientCommand);
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
22
|
exports.BatchExecuteStatementCommand = BatchExecuteStatementCommand;
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BatchGetCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class BatchGetCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class BatchGetCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
@@ -25,18 +24,14 @@ class BatchGetCommand extends smithy_client_1.Command {
|
|
|
25
24
|
},
|
|
26
25
|
},
|
|
27
26
|
];
|
|
27
|
+
this.clientCommand = new client_dynamodb_1.BatchGetItemCommand(this.input);
|
|
28
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
28
29
|
}
|
|
29
30
|
resolveMiddleware(clientStack, configuration, options) {
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const handler =
|
|
33
|
-
return async () =>
|
|
34
|
-
const data = await handler(command);
|
|
35
|
-
return {
|
|
36
|
-
...data,
|
|
37
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
38
|
-
};
|
|
39
|
-
};
|
|
31
|
+
this.addMarshallingMiddleware(configuration);
|
|
32
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
33
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
34
|
+
return async () => handler(this.clientCommand);
|
|
40
35
|
}
|
|
41
36
|
}
|
|
42
37
|
exports.BatchGetCommand = BatchGetCommand;
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BatchWriteCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class BatchWriteCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class BatchWriteCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
@@ -36,18 +35,14 @@ class BatchWriteCommand extends smithy_client_1.Command {
|
|
|
36
35
|
},
|
|
37
36
|
},
|
|
38
37
|
];
|
|
38
|
+
this.clientCommand = new client_dynamodb_1.BatchWriteItemCommand(this.input);
|
|
39
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
39
40
|
}
|
|
40
41
|
resolveMiddleware(clientStack, configuration, options) {
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const handler =
|
|
44
|
-
return async () =>
|
|
45
|
-
const data = await handler(command);
|
|
46
|
-
return {
|
|
47
|
-
...data,
|
|
48
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
49
|
-
};
|
|
50
|
-
};
|
|
42
|
+
this.addMarshallingMiddleware(configuration);
|
|
43
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
44
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
45
|
+
return async () => handler(this.clientCommand);
|
|
51
46
|
}
|
|
52
47
|
}
|
|
53
48
|
exports.BatchWriteCommand = BatchWriteCommand;
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DeleteCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class DeleteCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class DeleteCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
@@ -22,18 +21,14 @@ class DeleteCommand extends smithy_client_1.Command {
|
|
|
22
21
|
{ key: "Attributes" },
|
|
23
22
|
{ key: "ItemCollectionMetrics", children: [{ key: "ItemCollectionKey" }] },
|
|
24
23
|
];
|
|
24
|
+
this.clientCommand = new client_dynamodb_1.DeleteItemCommand(this.input);
|
|
25
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
25
26
|
}
|
|
26
27
|
resolveMiddleware(clientStack, configuration, options) {
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
const handler =
|
|
30
|
-
return async () =>
|
|
31
|
-
const data = await handler(command);
|
|
32
|
-
return {
|
|
33
|
-
...data,
|
|
34
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
35
|
-
};
|
|
36
|
-
};
|
|
28
|
+
this.addMarshallingMiddleware(configuration);
|
|
29
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
30
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
31
|
+
return async () => handler(this.clientCommand);
|
|
37
32
|
}
|
|
38
33
|
}
|
|
39
34
|
exports.DeleteCommand = DeleteCommand;
|
|
@@ -2,26 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExecuteStatementCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class ExecuteStatementCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class ExecuteStatementCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
11
10
|
this.inputKeyNodes = [{ key: "Parameters" }];
|
|
12
11
|
this.outputKeyNodes = [{ key: "Items" }, { key: "LastEvaluatedKey" }];
|
|
12
|
+
this.clientCommand = new client_dynamodb_1.ExecuteStatementCommand(this.input);
|
|
13
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
13
14
|
}
|
|
14
15
|
resolveMiddleware(clientStack, configuration, options) {
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const handler =
|
|
18
|
-
return async () =>
|
|
19
|
-
const data = await handler(command);
|
|
20
|
-
return {
|
|
21
|
-
...data,
|
|
22
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
23
|
-
};
|
|
24
|
-
};
|
|
16
|
+
this.addMarshallingMiddleware(configuration);
|
|
17
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
18
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
19
|
+
return async () => handler(this.clientCommand);
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
22
|
exports.ExecuteStatementCommand = ExecuteStatementCommand;
|
|
@@ -2,26 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExecuteTransactionCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class ExecuteTransactionCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class ExecuteTransactionCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
11
10
|
this.inputKeyNodes = [{ key: "TransactStatements", children: [{ key: "Parameters" }] }];
|
|
12
11
|
this.outputKeyNodes = [{ key: "Responses", children: [{ key: "Item" }] }];
|
|
12
|
+
this.clientCommand = new client_dynamodb_1.ExecuteTransactionCommand(this.input);
|
|
13
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
13
14
|
}
|
|
14
15
|
resolveMiddleware(clientStack, configuration, options) {
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const handler =
|
|
18
|
-
return async () =>
|
|
19
|
-
const data = await handler(command);
|
|
20
|
-
return {
|
|
21
|
-
...data,
|
|
22
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
23
|
-
};
|
|
24
|
-
};
|
|
16
|
+
this.addMarshallingMiddleware(configuration);
|
|
17
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
18
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
19
|
+
return async () => handler(this.clientCommand);
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
22
|
exports.ExecuteTransactionCommand = ExecuteTransactionCommand;
|
|
@@ -2,26 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class GetCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class GetCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
11
10
|
this.inputKeyNodes = [{ key: "Key" }];
|
|
12
11
|
this.outputKeyNodes = [{ key: "Item" }];
|
|
12
|
+
this.clientCommand = new client_dynamodb_1.GetItemCommand(this.input);
|
|
13
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
13
14
|
}
|
|
14
15
|
resolveMiddleware(clientStack, configuration, options) {
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const handler =
|
|
18
|
-
return async () =>
|
|
19
|
-
const data = await handler(command);
|
|
20
|
-
return {
|
|
21
|
-
...data,
|
|
22
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
23
|
-
};
|
|
24
|
-
};
|
|
16
|
+
this.addMarshallingMiddleware(configuration);
|
|
17
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
18
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
19
|
+
return async () => handler(this.clientCommand);
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
22
|
exports.GetCommand = GetCommand;
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PutCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class PutCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class PutCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
@@ -22,18 +21,14 @@ class PutCommand extends smithy_client_1.Command {
|
|
|
22
21
|
{ key: "Attributes" },
|
|
23
22
|
{ key: "ItemCollectionMetrics", children: [{ key: "ItemCollectionKey" }] },
|
|
24
23
|
];
|
|
24
|
+
this.clientCommand = new client_dynamodb_1.PutItemCommand(this.input);
|
|
25
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
25
26
|
}
|
|
26
27
|
resolveMiddleware(clientStack, configuration, options) {
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
const handler =
|
|
30
|
-
return async () =>
|
|
31
|
-
const data = await handler(command);
|
|
32
|
-
return {
|
|
33
|
-
...data,
|
|
34
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
35
|
-
};
|
|
36
|
-
};
|
|
28
|
+
this.addMarshallingMiddleware(configuration);
|
|
29
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
30
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
31
|
+
return async () => handler(this.clientCommand);
|
|
37
32
|
}
|
|
38
33
|
}
|
|
39
34
|
exports.PutCommand = PutCommand;
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QueryCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class QueryCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class QueryCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
@@ -25,18 +24,14 @@ class QueryCommand extends smithy_client_1.Command {
|
|
|
25
24
|
{ key: "ExpressionAttributeValues" },
|
|
26
25
|
];
|
|
27
26
|
this.outputKeyNodes = [{ key: "Items" }, { key: "LastEvaluatedKey" }];
|
|
27
|
+
this.clientCommand = new client_dynamodb_1.QueryCommand(this.input);
|
|
28
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
28
29
|
}
|
|
29
30
|
resolveMiddleware(clientStack, configuration, options) {
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const handler =
|
|
33
|
-
return async () =>
|
|
34
|
-
const data = await handler(command);
|
|
35
|
-
return {
|
|
36
|
-
...data,
|
|
37
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
38
|
-
};
|
|
39
|
-
};
|
|
31
|
+
this.addMarshallingMiddleware(configuration);
|
|
32
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
33
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
34
|
+
return async () => handler(this.clientCommand);
|
|
40
35
|
}
|
|
41
36
|
}
|
|
42
37
|
exports.QueryCommand = QueryCommand;
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ScanCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class ScanCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class ScanCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
@@ -19,18 +18,14 @@ class ScanCommand extends smithy_client_1.Command {
|
|
|
19
18
|
{ key: "ExpressionAttributeValues" },
|
|
20
19
|
];
|
|
21
20
|
this.outputKeyNodes = [{ key: "Items" }, { key: "LastEvaluatedKey" }];
|
|
21
|
+
this.clientCommand = new client_dynamodb_1.ScanCommand(this.input);
|
|
22
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
22
23
|
}
|
|
23
24
|
resolveMiddleware(clientStack, configuration, options) {
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
const handler =
|
|
27
|
-
return async () =>
|
|
28
|
-
const data = await handler(command);
|
|
29
|
-
return {
|
|
30
|
-
...data,
|
|
31
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
32
|
-
};
|
|
33
|
-
};
|
|
25
|
+
this.addMarshallingMiddleware(configuration);
|
|
26
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
27
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
28
|
+
return async () => handler(this.clientCommand);
|
|
34
29
|
}
|
|
35
30
|
}
|
|
36
31
|
exports.ScanCommand = ScanCommand;
|
|
@@ -2,26 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TransactGetCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class TransactGetCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class TransactGetCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
11
10
|
this.inputKeyNodes = [{ key: "TransactItems", children: [{ key: "Get", children: [{ key: "Key" }] }] }];
|
|
12
11
|
this.outputKeyNodes = [{ key: "Responses", children: [{ key: "Item" }] }];
|
|
12
|
+
this.clientCommand = new client_dynamodb_1.TransactGetItemsCommand(this.input);
|
|
13
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
13
14
|
}
|
|
14
15
|
resolveMiddleware(clientStack, configuration, options) {
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const handler =
|
|
18
|
-
return async () =>
|
|
19
|
-
const data = await handler(command);
|
|
20
|
-
return {
|
|
21
|
-
...data,
|
|
22
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
23
|
-
};
|
|
24
|
-
};
|
|
16
|
+
this.addMarshallingMiddleware(configuration);
|
|
17
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
18
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
19
|
+
return async () => handler(this.clientCommand);
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
22
|
exports.TransactGetCommand = TransactGetCommand;
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TransactWriteCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class TransactWriteCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class TransactWriteCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
@@ -27,18 +26,14 @@ class TransactWriteCommand extends smithy_client_1.Command {
|
|
|
27
26
|
},
|
|
28
27
|
},
|
|
29
28
|
];
|
|
29
|
+
this.clientCommand = new client_dynamodb_1.TransactWriteItemsCommand(this.input);
|
|
30
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
30
31
|
}
|
|
31
32
|
resolveMiddleware(clientStack, configuration, options) {
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
const handler =
|
|
35
|
-
return async () =>
|
|
36
|
-
const data = await handler(command);
|
|
37
|
-
return {
|
|
38
|
-
...data,
|
|
39
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
40
|
-
};
|
|
41
|
-
};
|
|
33
|
+
this.addMarshallingMiddleware(configuration);
|
|
34
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
35
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
36
|
+
return async () => handler(this.clientCommand);
|
|
42
37
|
}
|
|
43
38
|
}
|
|
44
39
|
exports.TransactWriteCommand = TransactWriteCommand;
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdateCommand = void 0;
|
|
4
4
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class UpdateCommand extends smithy_client_1.Command {
|
|
5
|
+
const DynamoDBDocumentClientCommand_1 = require("../baseCommand/DynamoDBDocumentClientCommand");
|
|
6
|
+
class UpdateCommand extends DynamoDBDocumentClientCommand_1.DynamoDBDocumentClientCommand {
|
|
8
7
|
constructor(input) {
|
|
9
8
|
super();
|
|
10
9
|
this.input = input;
|
|
@@ -28,18 +27,14 @@ class UpdateCommand extends smithy_client_1.Command {
|
|
|
28
27
|
{ key: "Attributes" },
|
|
29
28
|
{ key: "ItemCollectionMetrics", children: [{ key: "ItemCollectionKey" }] },
|
|
30
29
|
];
|
|
30
|
+
this.clientCommand = new client_dynamodb_1.UpdateItemCommand(this.input);
|
|
31
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
31
32
|
}
|
|
32
33
|
resolveMiddleware(clientStack, configuration, options) {
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
const handler =
|
|
36
|
-
return async () =>
|
|
37
|
-
const data = await handler(command);
|
|
38
|
-
return {
|
|
39
|
-
...data,
|
|
40
|
-
output: (0, utils_1.unmarshallOutput)(data.output, this.outputKeyNodes, unmarshallOptions),
|
|
41
|
-
};
|
|
42
|
-
};
|
|
34
|
+
this.addMarshallingMiddleware(configuration);
|
|
35
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
36
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
37
|
+
return async () => handler(this.clientCommand);
|
|
43
38
|
}
|
|
44
39
|
}
|
|
45
40
|
exports.UpdateCommand = UpdateCommand;
|