@aws-sdk/lib-dynamodb 3.622.0 → 3.623.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-cjs/index.js CHANGED
@@ -980,54 +980,14 @@ var DynamoDBDocument = _DynamoDBDocument;
980
980
  var import_types = require("@smithy/types");
981
981
 
982
982
  // src/pagination/QueryPaginator.ts
983
+ var import_core = require("@smithy/core");
983
984
 
984
- var makePagedClientRequest = /* @__PURE__ */ __name(async (client, input, ...args) => {
985
- return await client.send(new QueryCommand(input), ...args);
986
- }, "makePagedClientRequest");
987
- async function* paginateQuery(config, input, ...additionalArguments) {
988
- let token = config.startingToken || void 0;
989
- let hasNext = true;
990
- let page;
991
- while (hasNext) {
992
- input.ExclusiveStartKey = token;
993
- input["Limit"] = config.pageSize;
994
- if (config.client instanceof DynamoDBDocumentClient) {
995
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
996
- } else {
997
- throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient");
998
- }
999
- yield page;
1000
- token = page.LastEvaluatedKey;
1001
- hasNext = !!token;
1002
- }
1003
- return void 0;
1004
- }
1005
- __name(paginateQuery, "paginateQuery");
985
+ var paginateQuery = (0, import_core.createPaginator)(DynamoDBDocumentClient, QueryCommand, "ExclusiveStartKey", "LastEvaluatedKey", "Limit");
1006
986
 
1007
987
  // src/pagination/ScanPaginator.ts
1008
988
 
1009
- var makePagedClientRequest2 = /* @__PURE__ */ __name(async (client, input, ...args) => {
1010
- return await client.send(new ScanCommand(input), ...args);
1011
- }, "makePagedClientRequest");
1012
- async function* paginateScan(config, input, ...additionalArguments) {
1013
- let token = config.startingToken || void 0;
1014
- let hasNext = true;
1015
- let page;
1016
- while (hasNext) {
1017
- input.ExclusiveStartKey = token;
1018
- input["Limit"] = config.pageSize;
1019
- if (config.client instanceof DynamoDBDocumentClient) {
1020
- page = await makePagedClientRequest2(config.client, input, ...additionalArguments);
1021
- } else {
1022
- throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient");
1023
- }
1024
- yield page;
1025
- token = page.LastEvaluatedKey;
1026
- hasNext = !!token;
1027
- }
1028
- return void 0;
1029
- }
1030
- __name(paginateScan, "paginateScan");
989
+
990
+ var paginateScan = (0, import_core.createPaginator)(DynamoDBDocumentClient, ScanCommand, "ExclusiveStartKey", "LastEvaluatedKey", "Limit");
1031
991
 
1032
992
  // src/index.ts
1033
993
 
@@ -1,24 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { QueryCommand } from "../commands/QueryCommand";
2
3
  import { DynamoDBDocumentClient } from "../DynamoDBDocumentClient";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new QueryCommand(input), ...args);
5
- };
6
- export async function* paginateQuery(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.ExclusiveStartKey = token;
12
- input["Limit"] = config.pageSize;
13
- if (config.client instanceof DynamoDBDocumentClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient");
18
- }
19
- yield page;
20
- token = page.LastEvaluatedKey;
21
- hasNext = !!token;
22
- }
23
- return undefined;
24
- }
4
+ export const paginateQuery = createPaginator(DynamoDBDocumentClient, QueryCommand, "ExclusiveStartKey", "LastEvaluatedKey", "Limit");
@@ -1,24 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ScanCommand } from "../commands/ScanCommand";
2
3
  import { DynamoDBDocumentClient } from "../DynamoDBDocumentClient";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ScanCommand(input), ...args);
5
- };
6
- export async function* paginateScan(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.ExclusiveStartKey = token;
12
- input["Limit"] = config.pageSize;
13
- if (config.client instanceof DynamoDBDocumentClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient");
18
- }
19
- yield page;
20
- token = page.LastEvaluatedKey;
21
- hasNext = !!token;
22
- }
23
- return undefined;
24
- }
4
+ export const paginateScan = createPaginator(DynamoDBDocumentClient, ScanCommand, "ExclusiveStartKey", "LastEvaluatedKey", "Limit");
@@ -7,9 +7,5 @@ import { DynamoDBDocumentPaginationConfiguration } from "./Interfaces";
7
7
  export { Paginator };
8
8
  /**
9
9
  * @public
10
- *
11
- * @param QueryCommandInput - {@link QueryCommandInput}
12
- * @returns {@link QueryCommandOutput}
13
- *
14
10
  */
15
- export declare function paginateQuery(config: DynamoDBDocumentPaginationConfiguration, input: QueryCommandInput, ...additionalArguments: any): Paginator<QueryCommandOutput>;
11
+ export declare const paginateQuery: (config: DynamoDBDocumentPaginationConfiguration, input: QueryCommandInput, ...additionalArguments: any) => Paginator<QueryCommandOutput>;
@@ -7,9 +7,5 @@ import { DynamoDBDocumentPaginationConfiguration } from "./Interfaces";
7
7
  export { Paginator };
8
8
  /**
9
9
  * @public
10
- *
11
- * @param ScanCommandInput - {@link ScanCommandInput}
12
- * @returns {@link ScanCommandOutput}
13
- *
14
10
  */
15
- export declare function paginateScan(config: DynamoDBDocumentPaginationConfiguration, input: ScanCommandInput, ...additionalArguments: any): Paginator<ScanCommandOutput>;
11
+ export declare const paginateScan: (config: DynamoDBDocumentPaginationConfiguration, input: ScanCommandInput, ...additionalArguments: any) => Paginator<ScanCommandOutput>;
@@ -5,8 +5,8 @@ import {
5
5
  } from "../commands/QueryCommand";
6
6
  import { DynamoDBDocumentPaginationConfiguration } from "./Interfaces";
7
7
  export { Paginator };
8
- export declare function paginateQuery(
8
+ export declare const paginateQuery: (
9
9
  config: DynamoDBDocumentPaginationConfiguration,
10
10
  input: QueryCommandInput,
11
11
  ...additionalArguments: any
12
- ): Paginator<QueryCommandOutput>;
12
+ ) => Paginator<QueryCommandOutput>;
@@ -2,8 +2,8 @@ import { Paginator } from "@smithy/types";
2
2
  import { ScanCommandInput, ScanCommandOutput } from "../commands/ScanCommand";
3
3
  import { DynamoDBDocumentPaginationConfiguration } from "./Interfaces";
4
4
  export { Paginator };
5
- export declare function paginateScan(
5
+ export declare const paginateScan: (
6
6
  config: DynamoDBDocumentPaginationConfiguration,
7
7
  input: ScanCommandInput,
8
8
  ...additionalArguments: any
9
- ): Paginator<ScanCommandOutput>;
9
+ ) => Paginator<ScanCommandOutput>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/lib-dynamodb",
3
- "version": "3.622.0",
3
+ "version": "3.623.0",
4
4
  "description": "The document client simplifies working with items in Amazon DynamoDB by abstracting away the notion of attribute values.",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -26,16 +26,16 @@
26
26
  },
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@aws-sdk/util-dynamodb": "3.622.0",
29
+ "@aws-sdk/util-dynamodb": "3.623.0",
30
30
  "@smithy/smithy-client": "^3.1.12",
31
31
  "@smithy/types": "^3.3.0",
32
32
  "tslib": "^2.6.2"
33
33
  },
34
34
  "peerDependencies": {
35
- "@aws-sdk/client-dynamodb": "^3.622.0"
35
+ "@aws-sdk/client-dynamodb": "^3.623.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@aws-sdk/client-dynamodb": "3.622.0",
38
+ "@aws-sdk/client-dynamodb": "3.623.0",
39
39
  "@tsconfig/recommended": "1.0.1",
40
40
  "@types/node": "^16.18.96",
41
41
  "concurrently": "7.0.0",