@xapp/dynamo-service
Advanced tools
Comparing version 0.0.56 to 0.0.57
@@ -16,2 +16,5 @@ import { DynamoDB } from "aws-sdk"; | ||
} | ||
export interface FilterQuery extends AttributeQuery { | ||
FilterExpression: string; | ||
} | ||
export declare type DynamoQuery = ScanQuery | ConditionQuery | IndexQuery; | ||
@@ -38,2 +41,3 @@ export interface Parameter<T extends DynamoQuery> { | ||
export declare function index(partitionKey: string, indexName?: string): Parameter<IndexQuery>; | ||
export declare function filter(initialKey: string): Parameter<FilterQuery>; | ||
export declare function scan(initialKey: string): Parameter<ScanQuery>; | ||
@@ -40,0 +44,0 @@ export declare function scan(initialKey: ScanQuery, inclusive?: boolean): Conjunction<ScanQuery>; |
@@ -9,2 +9,8 @@ "use strict"; | ||
exports.index = index; | ||
function filter(initialKey) { | ||
const hiddenQuery = new HiddenFilterQuery(); | ||
hiddenQuery.addName(initialKey); | ||
return new ParameterImpl(hiddenQuery, initialKey); | ||
} | ||
exports.filter = filter; | ||
function scan(initialKey, inclusive) { | ||
@@ -171,2 +177,20 @@ if (typeof initialKey === "string") { | ||
} | ||
class HiddenFilterQuery extends HiddenQuery { | ||
constructor() { | ||
super(); | ||
this.prefix = "___filter_"; | ||
this.FilterExpression = ""; | ||
} | ||
addExpression(expression) { | ||
this.FilterExpression += expression; | ||
} | ||
get expression() { | ||
return this.FilterExpression; | ||
} | ||
buildObj() { | ||
return { | ||
FilterExpression: this.FilterExpression | ||
}; | ||
} | ||
} | ||
class ParameterImpl { | ||
@@ -173,0 +197,0 @@ constructor(scanQuery, key) { |
{ | ||
"name": "@xapp/dynamo-service", | ||
"version": "0.0.56", | ||
"version": "0.0.57", | ||
"description": "A dynamo help class which will help maintain data integrity.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
140184
296
3771