@aws-sdk/lib-dynamodb 3.427.0 → 3.428.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/baseCommand/DynamoDBDocumentClientCommand.js +4 -1
- package/dist-cjs/commands/BatchExecuteStatementCommand.js +18 -4
- package/dist-cjs/commands/BatchGetCommand.js +20 -13
- package/dist-cjs/commands/BatchWriteCommand.js +30 -22
- package/dist-cjs/commands/DeleteCommand.js +15 -12
- package/dist-cjs/commands/ExecuteStatementCommand.js +10 -2
- package/dist-cjs/commands/ExecuteTransactionCommand.js +15 -2
- package/dist-cjs/commands/GetCommand.js +7 -2
- package/dist-cjs/commands/PutCommand.js +15 -12
- package/dist-cjs/commands/QueryCommand.js +17 -13
- package/dist-cjs/commands/ScanCommand.js +14 -9
- package/dist-cjs/commands/TransactGetCommand.js +17 -2
- package/dist-cjs/commands/TransactWriteCommand.js +29 -16
- package/dist-cjs/commands/UpdateCommand.js +18 -16
- package/dist-cjs/commands/utils.js +41 -19
- package/dist-es/baseCommand/DynamoDBDocumentClientCommand.js +3 -1
- package/dist-es/commands/BatchExecuteStatementCommand.js +18 -4
- package/dist-es/commands/BatchGetCommand.js +20 -13
- package/dist-es/commands/BatchWriteCommand.js +30 -22
- package/dist-es/commands/DeleteCommand.js +15 -12
- package/dist-es/commands/ExecuteStatementCommand.js +10 -2
- package/dist-es/commands/ExecuteTransactionCommand.js +15 -2
- package/dist-es/commands/GetCommand.js +7 -2
- package/dist-es/commands/PutCommand.js +15 -12
- package/dist-es/commands/QueryCommand.js +17 -13
- package/dist-es/commands/ScanCommand.js +14 -9
- package/dist-es/commands/TransactGetCommand.js +17 -2
- package/dist-es/commands/TransactWriteCommand.js +29 -16
- package/dist-es/commands/UpdateCommand.js +18 -16
- package/dist-es/commands/utils.js +40 -18
- package/dist-types/baseCommand/DynamoDBDocumentClientCommand.d.ts +3 -3
- package/dist-types/commands/BatchExecuteStatementCommand.d.ts +15 -16
- package/dist-types/commands/BatchGetCommand.d.ts +19 -17
- package/dist-types/commands/BatchWriteCommand.d.ts +31 -25
- package/dist-types/commands/DeleteCommand.d.ts +15 -19
- package/dist-types/commands/ExecuteStatementCommand.d.ts +7 -4
- package/dist-types/commands/ExecuteTransactionCommand.d.ts +12 -10
- package/dist-types/commands/GetCommand.d.ts +4 -4
- package/dist-types/commands/PutCommand.d.ts +15 -19
- package/dist-types/commands/QueryCommand.d.ts +18 -12
- package/dist-types/commands/ScanCommand.d.ts +13 -12
- package/dist-types/commands/TransactGetCommand.d.ts +14 -13
- package/dist-types/commands/TransactWriteCommand.d.ts +28 -14
- package/dist-types/commands/UpdateCommand.d.ts +20 -19
- package/dist-types/commands/utils.d.ts +32 -9
- package/dist-types/ts3.4/baseCommand/DynamoDBDocumentClientCommand.d.ts +3 -3
- package/dist-types/ts3.4/commands/BatchExecuteStatementCommand.d.ts +15 -19
- package/dist-types/ts3.4/commands/BatchGetCommand.d.ts +20 -21
- package/dist-types/ts3.4/commands/BatchWriteCommand.d.ts +31 -28
- package/dist-types/ts3.4/commands/DeleteCommand.d.ts +16 -26
- package/dist-types/ts3.4/commands/ExecuteStatementCommand.d.ts +7 -4
- package/dist-types/ts3.4/commands/ExecuteTransactionCommand.d.ts +12 -10
- package/dist-types/ts3.4/commands/GetCommand.d.ts +4 -4
- package/dist-types/ts3.4/commands/PutCommand.d.ts +16 -26
- package/dist-types/ts3.4/commands/QueryCommand.d.ts +19 -16
- package/dist-types/ts3.4/commands/ScanCommand.d.ts +14 -16
- package/dist-types/ts3.4/commands/TransactGetCommand.d.ts +14 -13
- package/dist-types/ts3.4/commands/TransactWriteCommand.d.ts +28 -14
- package/dist-types/ts3.4/commands/UpdateCommand.d.ts +21 -26
- package/dist-types/ts3.4/commands/utils.d.ts +8 -9
- package/package.json +7 -6
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import { BatchExecuteStatementCommand as __BatchExecuteStatementCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_MEMBERS, ALL_VALUES } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class BatchExecuteStatementCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
Statements: {
|
|
12
|
+
"*": {
|
|
13
|
+
Parameters: ALL_MEMBERS,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
this.outputKeyNodes = {
|
|
18
|
+
Responses: {
|
|
19
|
+
"*": {
|
|
20
|
+
Error: {
|
|
21
|
+
Item: ALL_VALUES,
|
|
22
|
+
},
|
|
23
|
+
Item: ALL_VALUES,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
13
27
|
this.clientCommand = new __BatchExecuteStatementCommand(this.input);
|
|
14
28
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
15
29
|
}
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
import { BatchGetItemCommand as __BatchGetItemCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_VALUES } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class BatchGetCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
RequestItems: {
|
|
12
|
+
"*": {
|
|
13
|
+
Keys: {
|
|
14
|
+
"*": ALL_VALUES,
|
|
15
|
+
},
|
|
14
16
|
},
|
|
15
17
|
},
|
|
16
|
-
|
|
17
|
-
this.outputKeyNodes =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
children: {
|
|
22
|
-
children: [{ key: "Keys" }],
|
|
18
|
+
};
|
|
19
|
+
this.outputKeyNodes = {
|
|
20
|
+
Responses: {
|
|
21
|
+
"*": {
|
|
22
|
+
"*": ALL_VALUES,
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
|
-
|
|
25
|
+
UnprocessedKeys: {
|
|
26
|
+
"*": {
|
|
27
|
+
Keys: {
|
|
28
|
+
"*": ALL_VALUES,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
26
33
|
this.clientCommand = new __BatchGetItemCommand(this.input);
|
|
27
34
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
28
35
|
}
|
|
@@ -1,39 +1,47 @@
|
|
|
1
1
|
import { BatchWriteItemCommand as __BatchWriteItemCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_VALUES } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class BatchWriteCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
RequestItems: {
|
|
12
|
+
"*": {
|
|
13
|
+
"*": {
|
|
14
|
+
PutRequest: {
|
|
15
|
+
Item: ALL_VALUES,
|
|
16
|
+
},
|
|
17
|
+
DeleteRequest: {
|
|
18
|
+
Key: ALL_VALUES,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
17
21
|
},
|
|
18
22
|
},
|
|
19
|
-
|
|
20
|
-
this.outputKeyNodes =
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
};
|
|
24
|
+
this.outputKeyNodes = {
|
|
25
|
+
UnprocessedItems: {
|
|
26
|
+
"*": {
|
|
27
|
+
"*": {
|
|
28
|
+
PutRequest: {
|
|
29
|
+
Item: ALL_VALUES,
|
|
30
|
+
},
|
|
31
|
+
DeleteRequest: {
|
|
32
|
+
Key: ALL_VALUES,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
28
35
|
},
|
|
29
36
|
},
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
ItemCollectionMetrics: {
|
|
38
|
+
"*": {
|
|
39
|
+
"*": {
|
|
40
|
+
ItemCollectionKey: ALL_VALUES,
|
|
41
|
+
},
|
|
34
42
|
},
|
|
35
43
|
},
|
|
36
|
-
|
|
44
|
+
};
|
|
37
45
|
this.clientCommand = new __BatchWriteItemCommand(this.input);
|
|
38
46
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
39
47
|
}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import { DeleteItemCommand as __DeleteItemCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_MEMBERS, ALL_VALUES, SELF } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class DeleteCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
Key: ALL_VALUES,
|
|
12
|
+
Expected: {
|
|
13
|
+
"*": {
|
|
14
|
+
Value: SELF,
|
|
15
|
+
AttributeValueList: ALL_MEMBERS,
|
|
15
16
|
},
|
|
16
17
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
this.outputKeyNodes =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
ExpressionAttributeValues: ALL_VALUES,
|
|
19
|
+
};
|
|
20
|
+
this.outputKeyNodes = {
|
|
21
|
+
Attributes: ALL_VALUES,
|
|
22
|
+
ItemCollectionMetrics: {
|
|
23
|
+
ItemCollectionKey: ALL_VALUES,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
23
26
|
this.clientCommand = new __DeleteItemCommand(this.input);
|
|
24
27
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
25
28
|
}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { ExecuteStatementCommand as __ExecuteStatementCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_MEMBERS, ALL_VALUES } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class ExecuteStatementCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
Parameters: ALL_MEMBERS,
|
|
12
|
+
};
|
|
13
|
+
this.outputKeyNodes = {
|
|
14
|
+
Items: {
|
|
15
|
+
"*": ALL_VALUES,
|
|
16
|
+
},
|
|
17
|
+
LastEvaluatedKey: ALL_VALUES,
|
|
18
|
+
};
|
|
11
19
|
this.clientCommand = new __ExecuteStatementCommand(this.input);
|
|
12
20
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
13
21
|
}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { ExecuteTransactionCommand as __ExecuteTransactionCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_MEMBERS, ALL_VALUES } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class ExecuteTransactionCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
TransactStatements: {
|
|
12
|
+
"*": {
|
|
13
|
+
Parameters: ALL_MEMBERS,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
this.outputKeyNodes = {
|
|
18
|
+
Responses: {
|
|
19
|
+
"*": {
|
|
20
|
+
Item: ALL_VALUES,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
11
24
|
this.clientCommand = new __ExecuteTransactionCommand(this.input);
|
|
12
25
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
13
26
|
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { GetItemCommand as __GetItemCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_VALUES } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class GetCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
Key: ALL_VALUES,
|
|
12
|
+
};
|
|
13
|
+
this.outputKeyNodes = {
|
|
14
|
+
Item: ALL_VALUES,
|
|
15
|
+
};
|
|
11
16
|
this.clientCommand = new __GetItemCommand(this.input);
|
|
12
17
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
13
18
|
}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import { PutItemCommand as __PutItemCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_MEMBERS, ALL_VALUES, SELF } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class PutCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
Item: ALL_VALUES,
|
|
12
|
+
Expected: {
|
|
13
|
+
"*": {
|
|
14
|
+
Value: SELF,
|
|
15
|
+
AttributeValueList: ALL_MEMBERS,
|
|
15
16
|
},
|
|
16
17
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
this.outputKeyNodes =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
ExpressionAttributeValues: ALL_VALUES,
|
|
19
|
+
};
|
|
20
|
+
this.outputKeyNodes = {
|
|
21
|
+
Attributes: ALL_VALUES,
|
|
22
|
+
ItemCollectionMetrics: {
|
|
23
|
+
ItemCollectionKey: ALL_VALUES,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
23
26
|
this.clientCommand = new __PutItemCommand(this.input);
|
|
24
27
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
25
28
|
}
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
import { QueryCommand as __QueryCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_MEMBERS, ALL_VALUES } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class QueryCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
children: [{ key: "AttributeValueList" }],
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
KeyConditions: {
|
|
12
|
+
"*": {
|
|
13
|
+
AttributeValueList: ALL_MEMBERS,
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
children: [{ key: "AttributeValueList" }],
|
|
16
|
+
QueryFilter: {
|
|
17
|
+
"*": {
|
|
18
|
+
AttributeValueList: ALL_MEMBERS,
|
|
20
19
|
},
|
|
21
20
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.outputKeyNodes =
|
|
21
|
+
ExclusiveStartKey: ALL_VALUES,
|
|
22
|
+
ExpressionAttributeValues: ALL_VALUES,
|
|
23
|
+
};
|
|
24
|
+
this.outputKeyNodes = {
|
|
25
|
+
Items: {
|
|
26
|
+
"*": ALL_VALUES,
|
|
27
|
+
},
|
|
28
|
+
LastEvaluatedKey: ALL_VALUES,
|
|
29
|
+
};
|
|
26
30
|
this.clientCommand = new __QueryCommand(this.input);
|
|
27
31
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
28
32
|
}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { ScanCommand as __ScanCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_MEMBERS, ALL_VALUES } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class ScanCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
children: [{ key: "AttributeValueList" }],
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
ScanFilter: {
|
|
12
|
+
"*": {
|
|
13
|
+
AttributeValueList: ALL_MEMBERS,
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
this.outputKeyNodes =
|
|
16
|
+
ExclusiveStartKey: ALL_VALUES,
|
|
17
|
+
ExpressionAttributeValues: ALL_VALUES,
|
|
18
|
+
};
|
|
19
|
+
this.outputKeyNodes = {
|
|
20
|
+
Items: {
|
|
21
|
+
"*": ALL_VALUES,
|
|
22
|
+
},
|
|
23
|
+
LastEvaluatedKey: ALL_VALUES,
|
|
24
|
+
};
|
|
20
25
|
this.clientCommand = new __ScanCommand(this.input);
|
|
21
26
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
22
27
|
}
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import { TransactGetItemsCommand as __TransactGetItemsCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_VALUES } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class TransactGetCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
TransactItems: {
|
|
12
|
+
"*": {
|
|
13
|
+
Get: {
|
|
14
|
+
Key: ALL_VALUES,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
this.outputKeyNodes = {
|
|
20
|
+
Responses: {
|
|
21
|
+
"*": {
|
|
22
|
+
Item: ALL_VALUES,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
11
26
|
this.clientCommand = new __TransactGetItemsCommand(this.input);
|
|
12
27
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
13
28
|
}
|
|
@@ -1,30 +1,43 @@
|
|
|
1
1
|
import { TransactWriteItemsCommand as __TransactWriteItemsCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_VALUES } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class TransactWriteCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
TransactItems: {
|
|
12
|
+
"*": {
|
|
13
|
+
ConditionCheck: {
|
|
14
|
+
Key: ALL_VALUES,
|
|
15
|
+
ExpressionAttributeValues: ALL_VALUES,
|
|
16
|
+
},
|
|
17
|
+
Put: {
|
|
18
|
+
Item: ALL_VALUES,
|
|
19
|
+
ExpressionAttributeValues: ALL_VALUES,
|
|
20
|
+
},
|
|
21
|
+
Delete: {
|
|
22
|
+
Key: ALL_VALUES,
|
|
23
|
+
ExpressionAttributeValues: ALL_VALUES,
|
|
24
|
+
},
|
|
25
|
+
Update: {
|
|
26
|
+
Key: ALL_VALUES,
|
|
27
|
+
ExpressionAttributeValues: ALL_VALUES,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
18
30
|
},
|
|
19
|
-
|
|
20
|
-
this.outputKeyNodes =
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
31
|
+
};
|
|
32
|
+
this.outputKeyNodes = {
|
|
33
|
+
ItemCollectionMetrics: {
|
|
34
|
+
"*": {
|
|
35
|
+
"*": {
|
|
36
|
+
ItemCollectionKey: ALL_VALUES,
|
|
37
|
+
},
|
|
25
38
|
},
|
|
26
39
|
},
|
|
27
|
-
|
|
40
|
+
};
|
|
28
41
|
this.clientCommand = new __TransactWriteItemsCommand(this.input);
|
|
29
42
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
30
43
|
}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { UpdateItemCommand as __UpdateItemCommand, } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
3
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
+
import { ALL_MEMBERS, ALL_VALUES, SELF } from "../commands/utils";
|
|
4
5
|
export { DynamoDBDocumentClientCommand, $Command };
|
|
5
6
|
export class UpdateCommand extends DynamoDBDocumentClientCommand {
|
|
6
7
|
constructor(input) {
|
|
7
8
|
super();
|
|
8
9
|
this.input = input;
|
|
9
|
-
this.inputKeyNodes =
|
|
10
|
-
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
children: [{ key: "Value" }],
|
|
10
|
+
this.inputKeyNodes = {
|
|
11
|
+
Key: ALL_VALUES,
|
|
12
|
+
AttributeUpdates: {
|
|
13
|
+
"*": {
|
|
14
|
+
Value: SELF,
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
Expected: {
|
|
18
|
+
"*": {
|
|
19
|
+
Value: SELF,
|
|
20
|
+
AttributeValueList: ALL_MEMBERS,
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.outputKeyNodes =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
ExpressionAttributeValues: ALL_VALUES,
|
|
24
|
+
};
|
|
25
|
+
this.outputKeyNodes = {
|
|
26
|
+
Attributes: ALL_VALUES,
|
|
27
|
+
ItemCollectionMetrics: {
|
|
28
|
+
ItemCollectionKey: ALL_VALUES,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
29
31
|
this.clientCommand = new __UpdateItemCommand(this.input);
|
|
30
32
|
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
31
33
|
}
|
|
@@ -1,37 +1,59 @@
|
|
|
1
1
|
import { marshall, unmarshall } from "@aws-sdk/util-dynamodb";
|
|
2
|
-
const
|
|
2
|
+
export const SELF = null;
|
|
3
|
+
export const ALL_VALUES = {};
|
|
4
|
+
export const ALL_MEMBERS = [];
|
|
5
|
+
const NEXT_LEVEL = "*";
|
|
6
|
+
const processObj = (obj, processFunc, keyNodes) => {
|
|
3
7
|
if (obj !== undefined) {
|
|
4
|
-
if (
|
|
8
|
+
if (keyNodes == null) {
|
|
5
9
|
return processFunc(obj);
|
|
6
10
|
}
|
|
7
11
|
else {
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
const keys = Object.keys(keyNodes);
|
|
13
|
+
const goToNextLevel = keys.length === 1 && keys[0] === NEXT_LEVEL;
|
|
14
|
+
const someChildren = keys.length >= 1 && !goToNextLevel;
|
|
15
|
+
const allChildren = keys.length === 0;
|
|
16
|
+
if (someChildren) {
|
|
17
|
+
return processKeysInObj(obj, processFunc, keyNodes);
|
|
10
18
|
}
|
|
11
|
-
else {
|
|
12
|
-
return processAllKeysInObj(obj, processFunc,
|
|
19
|
+
else if (allChildren) {
|
|
20
|
+
return processAllKeysInObj(obj, processFunc, SELF);
|
|
21
|
+
}
|
|
22
|
+
else if (goToNextLevel) {
|
|
23
|
+
return Object.entries(obj ?? {}).reduce((acc, [k, v]) => {
|
|
24
|
+
acc[k] = processObj(v, processFunc, keyNodes[NEXT_LEVEL]);
|
|
25
|
+
return acc;
|
|
26
|
+
}, (Array.isArray(obj) ? [] : {}));
|
|
13
27
|
}
|
|
14
28
|
}
|
|
15
29
|
}
|
|
16
30
|
return undefined;
|
|
17
31
|
};
|
|
18
|
-
const
|
|
32
|
+
const processKeysInObj = (obj, processFunc, keyNodes) => {
|
|
33
|
+
let accumulator;
|
|
19
34
|
if (Array.isArray(obj)) {
|
|
20
|
-
|
|
35
|
+
accumulator = [...obj];
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
accumulator = { ...obj };
|
|
39
|
+
}
|
|
40
|
+
for (const [nodeKey, nodes] of Object.entries(keyNodes)) {
|
|
41
|
+
const processedValue = processObj(obj[nodeKey], processFunc, nodes);
|
|
42
|
+
if (processedValue !== undefined) {
|
|
43
|
+
accumulator[nodeKey] = processedValue;
|
|
44
|
+
}
|
|
21
45
|
}
|
|
22
|
-
return
|
|
46
|
+
return accumulator;
|
|
23
47
|
};
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
48
|
+
const processAllKeysInObj = (obj, processFunc, keyNodes) => {
|
|
49
|
+
if (Array.isArray(obj)) {
|
|
50
|
+
return obj.map((item) => processObj(item, processFunc, keyNodes));
|
|
51
|
+
}
|
|
52
|
+
return Object.entries(obj).reduce((acc, [key, value]) => {
|
|
53
|
+
acc[key] = processObj(value, processFunc, keyNodes);
|
|
28
54
|
return acc;
|
|
29
|
-
},
|
|
55
|
+
}, {});
|
|
30
56
|
};
|
|
31
|
-
const processAllKeysInObj = (obj, processFunc, children) => Object.entries(obj).reduce((acc, [key, value]) => {
|
|
32
|
-
acc[key] = processKeyInObj(value, processFunc, children);
|
|
33
|
-
return acc;
|
|
34
|
-
}, {});
|
|
35
57
|
export const marshallInput = (obj, keyNodes, options) => {
|
|
36
58
|
const marshallFunc = (toMarshall) => marshall(toMarshall, options);
|
|
37
59
|
return processKeysInObj(obj, marshallFunc, keyNodes);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
2
2
|
import { MiddlewareStack } from "@smithy/types";
|
|
3
|
-
import {
|
|
3
|
+
import { KeyNodeChildren } from "../commands/utils";
|
|
4
4
|
import { DynamoDBDocumentClientResolvedConfig } from "../DynamoDBDocumentClient";
|
|
5
5
|
/**
|
|
6
6
|
* Base class for Commands in lib-dynamodb used to pass middleware to
|
|
@@ -9,8 +9,8 @@ import { DynamoDBDocumentClientResolvedConfig } from "../DynamoDBDocumentClient"
|
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
11
|
export declare abstract class DynamoDBDocumentClientCommand<Input extends object, Output extends object, BaseInput extends object, BaseOutput extends object, ResolvedClientConfiguration> extends $Command<Input | BaseInput, Output | BaseOutput, ResolvedClientConfiguration> {
|
|
12
|
-
protected abstract readonly inputKeyNodes:
|
|
13
|
-
protected abstract readonly outputKeyNodes:
|
|
12
|
+
protected abstract readonly inputKeyNodes: KeyNodeChildren;
|
|
13
|
+
protected abstract readonly outputKeyNodes: KeyNodeChildren;
|
|
14
14
|
protected abstract clientCommand: $Command<Input | BaseInput, Output | BaseOutput, ResolvedClientConfiguration>;
|
|
15
15
|
abstract middlewareStack: MiddlewareStack<Input | BaseInput, Output | BaseOutput>;
|
|
16
16
|
private static defaultLogFilterOverrides;
|