@mcma/aws-dynamodb
Advanced tools
Comparing version 0.13.28 to 0.13.29
import { DynamoDB } from "aws-sdk"; | ||
import { Key } from "aws-sdk/clients/dynamodb"; | ||
import { CustomQuery, CustomQueryParameters, Document, DocumentDatabaseMutex, DocumentDatabaseTable, MutexProperties, Query, QueryResults } from "@mcma/data"; | ||
import { DynamoDbTableOptions } from "./dynamo-db-table-options"; | ||
import { DynamoDbTableDescription } from "./dynamo-db-table-description"; | ||
export declare function keyFromBase64Json(str: string): Key; | ||
export declare function base64JsonFromKey(key: Key): string; | ||
export declare class DynamoDbTable implements DocumentDatabaseTable { | ||
@@ -6,0 +9,0 @@ private tableDescription; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DynamoDbTable = void 0; | ||
exports.DynamoDbTable = exports.base64JsonFromKey = exports.keyFromBase64Json = void 0; | ||
const util_1 = require("util"); | ||
@@ -27,5 +27,7 @@ const dynamodb_1 = require("aws-sdk/clients/dynamodb"); | ||
} | ||
exports.keyFromBase64Json = keyFromBase64Json; | ||
function base64JsonFromKey(key) { | ||
return key ? core_1.Utils.toBase64(JSON.stringify(key)) : undefined; | ||
} | ||
exports.base64JsonFromKey = base64JsonFromKey; | ||
class DynamoDbTable { | ||
@@ -76,3 +78,3 @@ constructor(dynamoDb, tableDescription, options) { | ||
async query(query) { | ||
var _a, _b; | ||
var _a; | ||
let keyNames = this.tableDescription.keyNames; | ||
@@ -104,4 +106,4 @@ let keyConditionExpression = "#partitionKey = :partitionKey"; | ||
IndexName: indexName, | ||
ScanIndexForward: (_a = query.sortAscending) !== null && _a !== void 0 ? _a : true, | ||
ConsistentRead: (_b = this.options) === null || _b === void 0 ? void 0 : _b.consistentQuery, | ||
ScanIndexForward: query.sortOrder === data_1.QuerySortOrder.Ascending, | ||
ConsistentRead: (_a = this.options) === null || _a === void 0 ? void 0 : _a.consistentQuery, | ||
Limit: query.pageSize, | ||
@@ -108,0 +110,0 @@ ExclusiveStartKey: keyFromBase64Json(query.pageStartToken) |
{ | ||
"name": "@mcma/aws-dynamodb", | ||
"version": "0.13.28", | ||
"version": "0.13.29", | ||
"description": "Node module with code for using DynamoDB as the backing data storage for MCMA API handlers and workers.", | ||
@@ -39,8 +39,8 @@ "engines": { | ||
"peerDependencies": { | ||
"@mcma/core": "0.13.28", | ||
"@mcma/data": "0.13.28" | ||
"@mcma/core": "0.13.29", | ||
"@mcma/data": "0.13.29" | ||
}, | ||
"devDependencies": { | ||
"@mcma/core": "0.13.28", | ||
"@mcma/data": "0.13.28", | ||
"@mcma/core": "0.13.29", | ||
"@mcma/data": "0.13.29", | ||
"@types/jsonpath": "0.2.0", | ||
@@ -47,0 +47,0 @@ "@types/node": "^14.17.22", |
23241
496