@aws-sdk/lib-dynamodb
Advanced tools
Comparing version 3.622.0 to 3.623.0
@@ -983,51 +983,11 @@ "use strict"; | ||
// src/pagination/QueryPaginator.ts | ||
var import_core = require("@smithy/core"); | ||
var makePagedClientRequest = /* @__PURE__ */ __name(async (client, input, ...args) => { | ||
return await client.send(new QueryCommand(input), ...args); | ||
}, "makePagedClientRequest"); | ||
async function* paginateQuery(config, input, ...additionalArguments) { | ||
let token = config.startingToken || void 0; | ||
let hasNext = true; | ||
let page; | ||
while (hasNext) { | ||
input.ExclusiveStartKey = token; | ||
input["Limit"] = config.pageSize; | ||
if (config.client instanceof DynamoDBDocumentClient) { | ||
page = await makePagedClientRequest(config.client, input, ...additionalArguments); | ||
} else { | ||
throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient"); | ||
} | ||
yield page; | ||
token = page.LastEvaluatedKey; | ||
hasNext = !!token; | ||
} | ||
return void 0; | ||
} | ||
__name(paginateQuery, "paginateQuery"); | ||
var paginateQuery = (0, import_core.createPaginator)(DynamoDBDocumentClient, QueryCommand, "ExclusiveStartKey", "LastEvaluatedKey", "Limit"); | ||
// src/pagination/ScanPaginator.ts | ||
var makePagedClientRequest2 = /* @__PURE__ */ __name(async (client, input, ...args) => { | ||
return await client.send(new ScanCommand(input), ...args); | ||
}, "makePagedClientRequest"); | ||
async function* paginateScan(config, input, ...additionalArguments) { | ||
let token = config.startingToken || void 0; | ||
let hasNext = true; | ||
let page; | ||
while (hasNext) { | ||
input.ExclusiveStartKey = token; | ||
input["Limit"] = config.pageSize; | ||
if (config.client instanceof DynamoDBDocumentClient) { | ||
page = await makePagedClientRequest2(config.client, input, ...additionalArguments); | ||
} else { | ||
throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient"); | ||
} | ||
yield page; | ||
token = page.LastEvaluatedKey; | ||
hasNext = !!token; | ||
} | ||
return void 0; | ||
} | ||
__name(paginateScan, "paginateScan"); | ||
var paginateScan = (0, import_core.createPaginator)(DynamoDBDocumentClient, ScanCommand, "ExclusiveStartKey", "LastEvaluatedKey", "Limit"); | ||
// src/index.ts | ||
@@ -1034,0 +994,0 @@ |
@@ -0,24 +1,4 @@ | ||
import { createPaginator } from "@smithy/core"; | ||
import { QueryCommand } from "../commands/QueryCommand"; | ||
import { DynamoDBDocumentClient } from "../DynamoDBDocumentClient"; | ||
const makePagedClientRequest = async (client, input, ...args) => { | ||
return await client.send(new QueryCommand(input), ...args); | ||
}; | ||
export async function* paginateQuery(config, input, ...additionalArguments) { | ||
let token = config.startingToken || undefined; | ||
let hasNext = true; | ||
let page; | ||
while (hasNext) { | ||
input.ExclusiveStartKey = token; | ||
input["Limit"] = config.pageSize; | ||
if (config.client instanceof DynamoDBDocumentClient) { | ||
page = await makePagedClientRequest(config.client, input, ...additionalArguments); | ||
} | ||
else { | ||
throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient"); | ||
} | ||
yield page; | ||
token = page.LastEvaluatedKey; | ||
hasNext = !!token; | ||
} | ||
return undefined; | ||
} | ||
export const paginateQuery = createPaginator(DynamoDBDocumentClient, QueryCommand, "ExclusiveStartKey", "LastEvaluatedKey", "Limit"); |
@@ -0,24 +1,4 @@ | ||
import { createPaginator } from "@smithy/core"; | ||
import { ScanCommand } from "../commands/ScanCommand"; | ||
import { DynamoDBDocumentClient } from "../DynamoDBDocumentClient"; | ||
const makePagedClientRequest = async (client, input, ...args) => { | ||
return await client.send(new ScanCommand(input), ...args); | ||
}; | ||
export async function* paginateScan(config, input, ...additionalArguments) { | ||
let token = config.startingToken || undefined; | ||
let hasNext = true; | ||
let page; | ||
while (hasNext) { | ||
input.ExclusiveStartKey = token; | ||
input["Limit"] = config.pageSize; | ||
if (config.client instanceof DynamoDBDocumentClient) { | ||
page = await makePagedClientRequest(config.client, input, ...additionalArguments); | ||
} | ||
else { | ||
throw new Error("Invalid client, expected DynamoDBDocument | DynamoDBDocumentClient"); | ||
} | ||
yield page; | ||
token = page.LastEvaluatedKey; | ||
hasNext = !!token; | ||
} | ||
return undefined; | ||
} | ||
export const paginateScan = createPaginator(DynamoDBDocumentClient, ScanCommand, "ExclusiveStartKey", "LastEvaluatedKey", "Limit"); |
@@ -10,7 +10,3 @@ import { Paginator } from "@smithy/types"; | ||
* @public | ||
* | ||
* @param QueryCommandInput - {@link QueryCommandInput} | ||
* @returns {@link QueryCommandOutput} | ||
* | ||
*/ | ||
export declare function paginateQuery(config: DynamoDBDocumentPaginationConfiguration, input: QueryCommandInput, ...additionalArguments: any): Paginator<QueryCommandOutput>; | ||
export declare const paginateQuery: (config: DynamoDBDocumentPaginationConfiguration, input: QueryCommandInput, ...additionalArguments: any) => Paginator<QueryCommandOutput>; |
@@ -10,7 +10,3 @@ import { Paginator } from "@smithy/types"; | ||
* @public | ||
* | ||
* @param ScanCommandInput - {@link ScanCommandInput} | ||
* @returns {@link ScanCommandOutput} | ||
* | ||
*/ | ||
export declare function paginateScan(config: DynamoDBDocumentPaginationConfiguration, input: ScanCommandInput, ...additionalArguments: any): Paginator<ScanCommandOutput>; | ||
export declare const paginateScan: (config: DynamoDBDocumentPaginationConfiguration, input: ScanCommandInput, ...additionalArguments: any) => Paginator<ScanCommandOutput>; |
@@ -8,6 +8,6 @@ import { Paginator } from "@smithy/types"; | ||
export { Paginator }; | ||
export declare function paginateQuery( | ||
export declare const paginateQuery: ( | ||
config: DynamoDBDocumentPaginationConfiguration, | ||
input: QueryCommandInput, | ||
...additionalArguments: any | ||
): Paginator<QueryCommandOutput>; | ||
) => Paginator<QueryCommandOutput>; |
@@ -5,6 +5,6 @@ import { Paginator } from "@smithy/types"; | ||
export { Paginator }; | ||
export declare function paginateScan( | ||
export declare const paginateScan: ( | ||
config: DynamoDBDocumentPaginationConfiguration, | ||
input: ScanCommandInput, | ||
...additionalArguments: any | ||
): Paginator<ScanCommandOutput>; | ||
) => Paginator<ScanCommandOutput>; |
{ | ||
"name": "@aws-sdk/lib-dynamodb", | ||
"version": "3.622.0", | ||
"version": "3.623.0", | ||
"description": "The document client simplifies working with items in Amazon DynamoDB by abstracting away the notion of attribute values.", | ||
@@ -29,3 +29,3 @@ "main": "./dist-cjs/index.js", | ||
"dependencies": { | ||
"@aws-sdk/util-dynamodb": "3.622.0", | ||
"@aws-sdk/util-dynamodb": "3.623.0", | ||
"@smithy/smithy-client": "^3.1.12", | ||
@@ -36,6 +36,6 @@ "@smithy/types": "^3.3.0", | ||
"peerDependencies": { | ||
"@aws-sdk/client-dynamodb": "^3.622.0" | ||
"@aws-sdk/client-dynamodb": "^3.623.0" | ||
}, | ||
"devDependencies": { | ||
"@aws-sdk/client-dynamodb": "3.622.0", | ||
"@aws-sdk/client-dynamodb": "3.623.0", | ||
"@tsconfig/recommended": "1.0.1", | ||
@@ -42,0 +42,0 @@ "@types/node": "^16.18.96", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
210227
4727
+ Added@aws-sdk/util-dynamodb@3.623.0(transitive)
- Removed@aws-sdk/util-dynamodb@3.622.0(transitive)