dynoquery 0.1.13 → 0.1.14
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/index-query.d.ts +3 -0
- package/dist/index-query.js +3 -6
- package/dist/partition.d.ts +3 -0
- package/dist/partition.js +3 -6
- package/package.json +1 -1
package/dist/index-query.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ export declare class IndexQuery {
|
|
|
23
23
|
scanIndexForward?: boolean;
|
|
24
24
|
exclusiveStartKey?: any;
|
|
25
25
|
skValue?: string;
|
|
26
|
+
filterExpression?: string;
|
|
27
|
+
expressionAttributeNames?: Record<string, string>;
|
|
28
|
+
expressionAttributeValues?: Record<string, any>;
|
|
26
29
|
}): Promise<T[]>;
|
|
27
30
|
get<T = any>(skValue?: string): Promise<T | null>;
|
|
28
31
|
getPkValue(): string;
|
package/dist/index-query.js
CHANGED
|
@@ -35,12 +35,8 @@ class IndexQuery {
|
|
|
35
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
36
|
const finalSkValue = (options === null || options === void 0 ? void 0 : options.skValue) || this.skValue;
|
|
37
37
|
let keyCondition = "#pk = :pk";
|
|
38
|
-
const expressionAttributeNames = {
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
const expressionAttributeValues = {
|
|
42
|
-
":pk": this.pkValue,
|
|
43
|
-
};
|
|
38
|
+
const expressionAttributeNames = Object.assign({ "#pk": this.pkName }, options === null || options === void 0 ? void 0 : options.expressionAttributeNames);
|
|
39
|
+
const expressionAttributeValues = Object.assign({ ":pk": this.pkValue }, options === null || options === void 0 ? void 0 : options.expressionAttributeValues);
|
|
44
40
|
if (finalSkValue) {
|
|
45
41
|
keyCondition += " AND begins_with(#sk, :sk)";
|
|
46
42
|
expressionAttributeNames["#sk"] = this.skName;
|
|
@@ -50,6 +46,7 @@ class IndexQuery {
|
|
|
50
46
|
TableName: this.tableName,
|
|
51
47
|
IndexName: this.indexName,
|
|
52
48
|
KeyConditionExpression: keyCondition,
|
|
49
|
+
FilterExpression: options === null || options === void 0 ? void 0 : options.filterExpression,
|
|
53
50
|
ExpressionAttributeNames: expressionAttributeNames,
|
|
54
51
|
ExpressionAttributeValues: expressionAttributeValues,
|
|
55
52
|
Limit: options === null || options === void 0 ? void 0 : options.limit,
|
package/dist/partition.d.ts
CHANGED
|
@@ -22,6 +22,9 @@ export declare class Partition {
|
|
|
22
22
|
getAll<T = any>(options?: {
|
|
23
23
|
limit?: number;
|
|
24
24
|
exclusiveStartKey?: any;
|
|
25
|
+
filterExpression?: string;
|
|
26
|
+
expressionAttributeNames?: Record<string, string>;
|
|
27
|
+
expressionAttributeValues?: Record<string, any>;
|
|
25
28
|
}): Promise<T[]>;
|
|
26
29
|
/**
|
|
27
30
|
* Create an item in this partition.
|
package/dist/partition.js
CHANGED
|
@@ -60,12 +60,9 @@ class Partition {
|
|
|
60
60
|
const response = yield this.db.query({
|
|
61
61
|
TableName: this.tableName,
|
|
62
62
|
KeyConditionExpression: "#pk = :pk",
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
ExpressionAttributeValues: {
|
|
67
|
-
":pk": this.pkValue,
|
|
68
|
-
},
|
|
63
|
+
FilterExpression: options === null || options === void 0 ? void 0 : options.filterExpression,
|
|
64
|
+
ExpressionAttributeNames: Object.assign({ "#pk": this.pkName }, options === null || options === void 0 ? void 0 : options.expressionAttributeNames),
|
|
65
|
+
ExpressionAttributeValues: Object.assign({ ":pk": this.pkValue }, options === null || options === void 0 ? void 0 : options.expressionAttributeValues),
|
|
69
66
|
Limit: options === null || options === void 0 ? void 0 : options.limit,
|
|
70
67
|
ExclusiveStartKey: options === null || options === void 0 ? void 0 : options.exclusiveStartKey,
|
|
71
68
|
});
|