@aws-sdk/lib-dynamodb 3.181.0 → 3.185.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 +16 -0
- package/dist-es/DynamoDBDocument.js +56 -63
- package/dist-es/DynamoDBDocumentClient.js +11 -16
- package/dist-es/baseCommand/DynamoDBDocumentClientCommand.js +12 -33
- package/dist-es/commands/BatchExecuteStatementCommand.js +14 -22
- package/dist-es/commands/BatchGetCommand.js +14 -22
- package/dist-es/commands/BatchWriteCommand.js +14 -22
- package/dist-es/commands/DeleteCommand.js +14 -22
- package/dist-es/commands/ExecuteStatementCommand.js +14 -22
- package/dist-es/commands/ExecuteTransactionCommand.js +14 -22
- package/dist-es/commands/GetCommand.js +14 -22
- package/dist-es/commands/PutCommand.js +14 -22
- package/dist-es/commands/QueryCommand.js +14 -22
- package/dist-es/commands/ScanCommand.js +14 -22
- package/dist-es/commands/TransactGetCommand.js +14 -22
- package/dist-es/commands/TransactWriteCommand.js +14 -22
- package/dist-es/commands/UpdateCommand.js +14 -22
- package/dist-es/commands/utils.js +15 -22
- package/dist-es/pagination/QueryPaginator.js +24 -67
- package/dist-es/pagination/ScanPaginator.js +24 -67
- package/package.json +5 -5
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
import { __awaiter, __extends, __generator } from "tslib";
|
|
2
1
|
import { ExecuteTransactionCommand as __ExecuteTransactionCommand, } from "@aws-sdk/client-dynamodb";
|
|
3
2
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
_this.middlewareStack = _this.clientCommand.middlewareStack;
|
|
13
|
-
return _this;
|
|
3
|
+
export class ExecuteTransactionCommand extends DynamoDBDocumentClientCommand {
|
|
4
|
+
constructor(input) {
|
|
5
|
+
super();
|
|
6
|
+
this.input = input;
|
|
7
|
+
this.inputKeyNodes = [{ key: "TransactStatements", children: [{ key: "Parameters" }] }];
|
|
8
|
+
this.outputKeyNodes = [{ key: "Responses", children: [{ key: "Item" }] }];
|
|
9
|
+
this.clientCommand = new __ExecuteTransactionCommand(this.input);
|
|
10
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
14
11
|
}
|
|
15
|
-
|
|
16
|
-
var _this = this;
|
|
12
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
17
13
|
this.addMarshallingMiddleware(configuration);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
return ExecuteTransactionCommand;
|
|
25
|
-
}(DynamoDBDocumentClientCommand));
|
|
26
|
-
export { ExecuteTransactionCommand };
|
|
14
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
15
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
16
|
+
return async () => handler(this.clientCommand);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
import { __awaiter, __extends, __generator } from "tslib";
|
|
2
1
|
import { GetItemCommand as __GetItemCommand, } from "@aws-sdk/client-dynamodb";
|
|
3
2
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
_this.middlewareStack = _this.clientCommand.middlewareStack;
|
|
13
|
-
return _this;
|
|
3
|
+
export class GetCommand extends DynamoDBDocumentClientCommand {
|
|
4
|
+
constructor(input) {
|
|
5
|
+
super();
|
|
6
|
+
this.input = input;
|
|
7
|
+
this.inputKeyNodes = [{ key: "Key" }];
|
|
8
|
+
this.outputKeyNodes = [{ key: "Item" }];
|
|
9
|
+
this.clientCommand = new __GetItemCommand(this.input);
|
|
10
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
14
11
|
}
|
|
15
|
-
|
|
16
|
-
var _this = this;
|
|
12
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
17
13
|
this.addMarshallingMiddleware(configuration);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
return GetCommand;
|
|
25
|
-
}(DynamoDBDocumentClientCommand));
|
|
26
|
-
export { GetCommand };
|
|
14
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
15
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
16
|
+
return async () => handler(this.clientCommand);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { __awaiter, __extends, __generator } from "tslib";
|
|
2
1
|
import { PutItemCommand as __PutItemCommand, } from "@aws-sdk/client-dynamodb";
|
|
3
2
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
_this.inputKeyNodes = [
|
|
3
|
+
export class PutCommand extends DynamoDBDocumentClientCommand {
|
|
4
|
+
constructor(input) {
|
|
5
|
+
super();
|
|
6
|
+
this.input = input;
|
|
7
|
+
this.inputKeyNodes = [
|
|
10
8
|
{ key: "Item" },
|
|
11
9
|
{
|
|
12
10
|
key: "Expected",
|
|
@@ -16,23 +14,17 @@ var PutCommand = (function (_super) {
|
|
|
16
14
|
},
|
|
17
15
|
{ key: "ExpressionAttributeValues" },
|
|
18
16
|
];
|
|
19
|
-
|
|
17
|
+
this.outputKeyNodes = [
|
|
20
18
|
{ key: "Attributes" },
|
|
21
19
|
{ key: "ItemCollectionMetrics", children: [{ key: "ItemCollectionKey" }] },
|
|
22
20
|
];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return _this;
|
|
21
|
+
this.clientCommand = new __PutItemCommand(this.input);
|
|
22
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
26
23
|
}
|
|
27
|
-
|
|
28
|
-
var _this = this;
|
|
24
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
29
25
|
this.addMarshallingMiddleware(configuration);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
return PutCommand;
|
|
37
|
-
}(DynamoDBDocumentClientCommand));
|
|
38
|
-
export { PutCommand };
|
|
26
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
27
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
28
|
+
return async () => handler(this.clientCommand);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { __awaiter, __extends, __generator } from "tslib";
|
|
2
1
|
import { QueryCommand as __QueryCommand, } from "@aws-sdk/client-dynamodb";
|
|
3
2
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
_this.inputKeyNodes = [
|
|
3
|
+
export class QueryCommand extends DynamoDBDocumentClientCommand {
|
|
4
|
+
constructor(input) {
|
|
5
|
+
super();
|
|
6
|
+
this.input = input;
|
|
7
|
+
this.inputKeyNodes = [
|
|
10
8
|
{
|
|
11
9
|
key: "KeyConditions",
|
|
12
10
|
children: {
|
|
@@ -22,20 +20,14 @@ var QueryCommand = (function (_super) {
|
|
|
22
20
|
{ key: "ExclusiveStartKey" },
|
|
23
21
|
{ key: "ExpressionAttributeValues" },
|
|
24
22
|
];
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return _this;
|
|
23
|
+
this.outputKeyNodes = [{ key: "Items" }, { key: "LastEvaluatedKey" }];
|
|
24
|
+
this.clientCommand = new __QueryCommand(this.input);
|
|
25
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
29
26
|
}
|
|
30
|
-
|
|
31
|
-
var _this = this;
|
|
27
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
32
28
|
this.addMarshallingMiddleware(configuration);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
return QueryCommand;
|
|
40
|
-
}(DynamoDBDocumentClientCommand));
|
|
41
|
-
export { QueryCommand };
|
|
29
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
30
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
31
|
+
return async () => handler(this.clientCommand);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { __awaiter, __extends, __generator } from "tslib";
|
|
2
1
|
import { ScanCommand as __ScanCommand, } from "@aws-sdk/client-dynamodb";
|
|
3
2
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
_this.inputKeyNodes = [
|
|
3
|
+
export class ScanCommand extends DynamoDBDocumentClientCommand {
|
|
4
|
+
constructor(input) {
|
|
5
|
+
super();
|
|
6
|
+
this.input = input;
|
|
7
|
+
this.inputKeyNodes = [
|
|
10
8
|
{
|
|
11
9
|
key: "ScanFilter",
|
|
12
10
|
children: {
|
|
@@ -16,20 +14,14 @@ var ScanCommand = (function (_super) {
|
|
|
16
14
|
{ key: "ExclusiveStartKey" },
|
|
17
15
|
{ key: "ExpressionAttributeValues" },
|
|
18
16
|
];
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return _this;
|
|
17
|
+
this.outputKeyNodes = [{ key: "Items" }, { key: "LastEvaluatedKey" }];
|
|
18
|
+
this.clientCommand = new __ScanCommand(this.input);
|
|
19
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
23
20
|
}
|
|
24
|
-
|
|
25
|
-
var _this = this;
|
|
21
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
26
22
|
this.addMarshallingMiddleware(configuration);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
return ScanCommand;
|
|
34
|
-
}(DynamoDBDocumentClientCommand));
|
|
35
|
-
export { ScanCommand };
|
|
23
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
24
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
25
|
+
return async () => handler(this.clientCommand);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
import { __awaiter, __extends, __generator } from "tslib";
|
|
2
1
|
import { TransactGetItemsCommand as __TransactGetItemsCommand, } from "@aws-sdk/client-dynamodb";
|
|
3
2
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
_this.middlewareStack = _this.clientCommand.middlewareStack;
|
|
13
|
-
return _this;
|
|
3
|
+
export class TransactGetCommand extends DynamoDBDocumentClientCommand {
|
|
4
|
+
constructor(input) {
|
|
5
|
+
super();
|
|
6
|
+
this.input = input;
|
|
7
|
+
this.inputKeyNodes = [{ key: "TransactItems", children: [{ key: "Get", children: [{ key: "Key" }] }] }];
|
|
8
|
+
this.outputKeyNodes = [{ key: "Responses", children: [{ key: "Item" }] }];
|
|
9
|
+
this.clientCommand = new __TransactGetItemsCommand(this.input);
|
|
10
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
14
11
|
}
|
|
15
|
-
|
|
16
|
-
var _this = this;
|
|
12
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
17
13
|
this.addMarshallingMiddleware(configuration);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
return TransactGetCommand;
|
|
25
|
-
}(DynamoDBDocumentClientCommand));
|
|
26
|
-
export { TransactGetCommand };
|
|
14
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
15
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
16
|
+
return async () => handler(this.clientCommand);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { __awaiter, __extends, __generator } from "tslib";
|
|
2
1
|
import { TransactWriteItemsCommand as __TransactWriteItemsCommand, } from "@aws-sdk/client-dynamodb";
|
|
3
2
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
_this.inputKeyNodes = [
|
|
3
|
+
export class TransactWriteCommand extends DynamoDBDocumentClientCommand {
|
|
4
|
+
constructor(input) {
|
|
5
|
+
super();
|
|
6
|
+
this.input = input;
|
|
7
|
+
this.inputKeyNodes = [
|
|
10
8
|
{
|
|
11
9
|
key: "TransactItems",
|
|
12
10
|
children: [
|
|
@@ -17,7 +15,7 @@ var TransactWriteCommand = (function (_super) {
|
|
|
17
15
|
],
|
|
18
16
|
},
|
|
19
17
|
];
|
|
20
|
-
|
|
18
|
+
this.outputKeyNodes = [
|
|
21
19
|
{
|
|
22
20
|
key: "ItemCollectionMetrics",
|
|
23
21
|
children: {
|
|
@@ -25,19 +23,13 @@ var TransactWriteCommand = (function (_super) {
|
|
|
25
23
|
},
|
|
26
24
|
},
|
|
27
25
|
];
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return _this;
|
|
26
|
+
this.clientCommand = new __TransactWriteItemsCommand(this.input);
|
|
27
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
31
28
|
}
|
|
32
|
-
|
|
33
|
-
var _this = this;
|
|
29
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
34
30
|
this.addMarshallingMiddleware(configuration);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
return TransactWriteCommand;
|
|
42
|
-
}(DynamoDBDocumentClientCommand));
|
|
43
|
-
export { TransactWriteCommand };
|
|
31
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
32
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
33
|
+
return async () => handler(this.clientCommand);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { __awaiter, __extends, __generator } from "tslib";
|
|
2
1
|
import { UpdateItemCommand as __UpdateItemCommand, } from "@aws-sdk/client-dynamodb";
|
|
3
2
|
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
_this.inputKeyNodes = [
|
|
3
|
+
export class UpdateCommand extends DynamoDBDocumentClientCommand {
|
|
4
|
+
constructor(input) {
|
|
5
|
+
super();
|
|
6
|
+
this.input = input;
|
|
7
|
+
this.inputKeyNodes = [
|
|
10
8
|
{ key: "Key" },
|
|
11
9
|
{
|
|
12
10
|
key: "AttributeUpdates",
|
|
@@ -22,23 +20,17 @@ var UpdateCommand = (function (_super) {
|
|
|
22
20
|
},
|
|
23
21
|
{ key: "ExpressionAttributeValues" },
|
|
24
22
|
];
|
|
25
|
-
|
|
23
|
+
this.outputKeyNodes = [
|
|
26
24
|
{ key: "Attributes" },
|
|
27
25
|
{ key: "ItemCollectionMetrics", children: [{ key: "ItemCollectionKey" }] },
|
|
28
26
|
];
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return _this;
|
|
27
|
+
this.clientCommand = new __UpdateItemCommand(this.input);
|
|
28
|
+
this.middlewareStack = this.clientCommand.middlewareStack;
|
|
32
29
|
}
|
|
33
|
-
|
|
34
|
-
var _this = this;
|
|
30
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
35
31
|
this.addMarshallingMiddleware(configuration);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
return UpdateCommand;
|
|
43
|
-
}(DynamoDBDocumentClientCommand));
|
|
44
|
-
export { UpdateCommand };
|
|
32
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
33
|
+
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
|
|
34
|
+
return async () => handler(this.clientCommand);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { __assign, __read } from "tslib";
|
|
2
1
|
import { marshall, unmarshall } from "@aws-sdk/util-dynamodb";
|
|
3
|
-
|
|
2
|
+
const processObj = (obj, processFunc, children) => {
|
|
4
3
|
if (obj !== undefined) {
|
|
5
4
|
if (!children || (Array.isArray(children) && children.length === 0)) {
|
|
6
5
|
return processFunc(obj);
|
|
@@ -16,31 +15,25 @@ var processObj = function (obj, processFunc, children) {
|
|
|
16
15
|
}
|
|
17
16
|
return undefined;
|
|
18
17
|
};
|
|
19
|
-
|
|
18
|
+
const processKeyInObj = (obj, processFunc, children) => {
|
|
20
19
|
if (Array.isArray(obj)) {
|
|
21
|
-
return obj.map(
|
|
20
|
+
return obj.map((item) => processObj(item, processFunc, children));
|
|
22
21
|
}
|
|
23
22
|
return processObj(obj, processFunc, children);
|
|
24
23
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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); };
|
|
24
|
+
const processKeysInObj = (obj, processFunc, keyNodes) => keyNodes.reduce((acc, { key, children }) => ({
|
|
25
|
+
...acc,
|
|
26
|
+
[key]: processKeyInObj(acc[key], processFunc, children),
|
|
27
|
+
}), obj);
|
|
28
|
+
const processAllKeysInObj = (obj, processFunc, children) => Object.entries(obj).reduce((acc, [key, value]) => ({
|
|
29
|
+
...acc,
|
|
30
|
+
[key]: processKeyInObj(value, processFunc, children),
|
|
31
|
+
}), {});
|
|
32
|
+
export const marshallInput = (obj, keyNodes, options) => {
|
|
33
|
+
const marshallFunc = (toMarshall) => marshall(toMarshall, options);
|
|
41
34
|
return processKeysInObj(obj, marshallFunc, keyNodes);
|
|
42
35
|
};
|
|
43
|
-
export
|
|
44
|
-
|
|
36
|
+
export const unmarshallOutput = (obj, keyNodes, options) => {
|
|
37
|
+
const unmarshallFunc = (toMarshall) => unmarshall(toMarshall, options);
|
|
45
38
|
return processKeysInObj(obj, unmarshallFunc, keyNodes);
|
|
46
39
|
};
|
|
@@ -1,74 +1,31 @@
|
|
|
1
|
-
import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
|
|
2
1
|
import { QueryCommand } from "../commands/QueryCommand";
|
|
3
2
|
import { DynamoDBDocument } from "../DynamoDBDocument";
|
|
4
3
|
import { DynamoDBDocumentClient } from "../DynamoDBDocumentClient";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
8
|
-
args[_i - 2] = arguments[_i];
|
|
9
|
-
}
|
|
10
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
11
|
-
return __generator(this, function (_a) {
|
|
12
|
-
switch (_a.label) {
|
|
13
|
-
case 0: return [4, client.send.apply(client, __spreadArray([new QueryCommand(input)], __read(args), false))];
|
|
14
|
-
case 1: return [2, _a.sent()];
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
});
|
|
4
|
+
const makePagedClientRequest = async (client, input, ...args) => {
|
|
5
|
+
return await client.send(new QueryCommand(input), ...args);
|
|
18
6
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
22
|
-
args[_i - 2] = arguments[_i];
|
|
23
|
-
}
|
|
24
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
25
|
-
return __generator(this, function (_a) {
|
|
26
|
-
switch (_a.label) {
|
|
27
|
-
case 0: return [4, client.query.apply(client, __spreadArray([input], __read(args), false))];
|
|
28
|
-
case 1: return [2, _a.sent()];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
7
|
+
const makePagedRequest = async (client, input, ...args) => {
|
|
8
|
+
return await client.query(input, ...args);
|
|
32
9
|
};
|
|
33
|
-
export function paginateQuery(config, input) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
10
|
+
export async function* paginateQuery(config, input, ...additionalArguments) {
|
|
11
|
+
let token = config.startingToken || undefined;
|
|
12
|
+
let hasNext = true;
|
|
13
|
+
let page;
|
|
14
|
+
while (hasNext) {
|
|
15
|
+
input.ExclusiveStartKey = token;
|
|
16
|
+
input["Limit"] = config.pageSize;
|
|
17
|
+
if (config.client instanceof DynamoDBDocument) {
|
|
18
|
+
page = await makePagedRequest(config.client, input, ...additionalArguments);
|
|
19
|
+
}
|
|
20
|
+
else if (config.client instanceof DynamoDBDocumentClient) {
|
|
21
|
+
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient");
|
|
25
|
+
}
|
|
26
|
+
yield page;
|
|
27
|
+
token = page.LastEvaluatedKey;
|
|
28
|
+
hasNext = !!token;
|
|
37
29
|
}
|
|
38
|
-
return
|
|
39
|
-
var token, hasNext, page;
|
|
40
|
-
return __generator(this, function (_a) {
|
|
41
|
-
switch (_a.label) {
|
|
42
|
-
case 0:
|
|
43
|
-
token = config.startingToken || undefined;
|
|
44
|
-
hasNext = true;
|
|
45
|
-
_a.label = 1;
|
|
46
|
-
case 1:
|
|
47
|
-
if (!hasNext) return [3, 9];
|
|
48
|
-
input.ExclusiveStartKey = token;
|
|
49
|
-
input["Limit"] = config.pageSize;
|
|
50
|
-
if (!(config.client instanceof DynamoDBDocument)) return [3, 3];
|
|
51
|
-
return [4, __await(makePagedRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
|
|
52
|
-
case 2:
|
|
53
|
-
page = _a.sent();
|
|
54
|
-
return [3, 6];
|
|
55
|
-
case 3:
|
|
56
|
-
if (!(config.client instanceof DynamoDBDocumentClient)) return [3, 5];
|
|
57
|
-
return [4, __await(makePagedClientRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
|
|
58
|
-
case 4:
|
|
59
|
-
page = _a.sent();
|
|
60
|
-
return [3, 6];
|
|
61
|
-
case 5: throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient");
|
|
62
|
-
case 6: return [4, __await(page)];
|
|
63
|
-
case 7: return [4, _a.sent()];
|
|
64
|
-
case 8:
|
|
65
|
-
_a.sent();
|
|
66
|
-
token = page.LastEvaluatedKey;
|
|
67
|
-
hasNext = !!token;
|
|
68
|
-
return [3, 1];
|
|
69
|
-
case 9: return [4, __await(undefined)];
|
|
70
|
-
case 10: return [2, _a.sent()];
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
30
|
+
return undefined;
|
|
74
31
|
}
|
|
@@ -1,74 +1,31 @@
|
|
|
1
|
-
import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
|
|
2
1
|
import { ScanCommand } from "../commands/ScanCommand";
|
|
3
2
|
import { DynamoDBDocument } from "../DynamoDBDocument";
|
|
4
3
|
import { DynamoDBDocumentClient } from "../DynamoDBDocumentClient";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
8
|
-
args[_i - 2] = arguments[_i];
|
|
9
|
-
}
|
|
10
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
11
|
-
return __generator(this, function (_a) {
|
|
12
|
-
switch (_a.label) {
|
|
13
|
-
case 0: return [4, client.send.apply(client, __spreadArray([new ScanCommand(input)], __read(args), false))];
|
|
14
|
-
case 1: return [2, _a.sent()];
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
});
|
|
4
|
+
const makePagedClientRequest = async (client, input, ...args) => {
|
|
5
|
+
return await client.send(new ScanCommand(input), ...args);
|
|
18
6
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
22
|
-
args[_i - 2] = arguments[_i];
|
|
23
|
-
}
|
|
24
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
25
|
-
return __generator(this, function (_a) {
|
|
26
|
-
switch (_a.label) {
|
|
27
|
-
case 0: return [4, client.scan.apply(client, __spreadArray([input], __read(args), false))];
|
|
28
|
-
case 1: return [2, _a.sent()];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
7
|
+
const makePagedRequest = async (client, input, ...args) => {
|
|
8
|
+
return await client.scan(input, ...args);
|
|
32
9
|
};
|
|
33
|
-
export function paginateScan(config, input) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
10
|
+
export async function* paginateScan(config, input, ...additionalArguments) {
|
|
11
|
+
let token = config.startingToken || undefined;
|
|
12
|
+
let hasNext = true;
|
|
13
|
+
let page;
|
|
14
|
+
while (hasNext) {
|
|
15
|
+
input.ExclusiveStartKey = token;
|
|
16
|
+
input["Limit"] = config.pageSize;
|
|
17
|
+
if (config.client instanceof DynamoDBDocument) {
|
|
18
|
+
page = await makePagedRequest(config.client, input, ...additionalArguments);
|
|
19
|
+
}
|
|
20
|
+
else if (config.client instanceof DynamoDBDocumentClient) {
|
|
21
|
+
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient");
|
|
25
|
+
}
|
|
26
|
+
yield page;
|
|
27
|
+
token = page.LastEvaluatedKey;
|
|
28
|
+
hasNext = !!token;
|
|
37
29
|
}
|
|
38
|
-
return
|
|
39
|
-
var token, hasNext, page;
|
|
40
|
-
return __generator(this, function (_a) {
|
|
41
|
-
switch (_a.label) {
|
|
42
|
-
case 0:
|
|
43
|
-
token = config.startingToken || undefined;
|
|
44
|
-
hasNext = true;
|
|
45
|
-
_a.label = 1;
|
|
46
|
-
case 1:
|
|
47
|
-
if (!hasNext) return [3, 9];
|
|
48
|
-
input.ExclusiveStartKey = token;
|
|
49
|
-
input["Limit"] = config.pageSize;
|
|
50
|
-
if (!(config.client instanceof DynamoDBDocument)) return [3, 3];
|
|
51
|
-
return [4, __await(makePagedRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
|
|
52
|
-
case 2:
|
|
53
|
-
page = _a.sent();
|
|
54
|
-
return [3, 6];
|
|
55
|
-
case 3:
|
|
56
|
-
if (!(config.client instanceof DynamoDBDocumentClient)) return [3, 5];
|
|
57
|
-
return [4, __await(makePagedClientRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
|
|
58
|
-
case 4:
|
|
59
|
-
page = _a.sent();
|
|
60
|
-
return [3, 6];
|
|
61
|
-
case 5: throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient");
|
|
62
|
-
case 6: return [4, __await(page)];
|
|
63
|
-
case 7: return [4, _a.sent()];
|
|
64
|
-
case 8:
|
|
65
|
-
_a.sent();
|
|
66
|
-
token = page.LastEvaluatedKey;
|
|
67
|
-
hasNext = !!token;
|
|
68
|
-
return [3, 1];
|
|
69
|
-
case 9: return [4, __await(undefined)];
|
|
70
|
-
case 10: return [2, _a.sent()];
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
30
|
+
return undefined;
|
|
74
31
|
}
|