@xapp/dynamo-service
Advanced tools
Comparing version 1.0.0-beta.2 to 1.0.1-beta.1
@@ -5,2 +5,11 @@ # Changelog | ||
### [0.2.3](https://github.com/XappMedia/dynamo-service/compare/v0.2.2...v0.2.3) (2019-06-11) | ||
### Bug Fixes | ||
* Adding DateFormat ([056d542](https://github.com/XappMedia/dynamo-service/commit/056d542)) | ||
### [0.2.2](https://github.com/XappMedia/dynamo-service/compare/v0.2.1...v0.2.2) (2019-06-07) | ||
@@ -7,0 +16,0 @@ |
@@ -9,3 +9,4 @@ "use strict"; | ||
reset() { | ||
return sandbox.reset(); | ||
sandbox.resetHistory(); | ||
sandbox.resetBehavior(); | ||
}, | ||
@@ -12,0 +13,0 @@ restore() { |
@@ -51,5 +51,7 @@ "use strict"; | ||
spyDb.reset(); | ||
putTransformer.reset(); | ||
putTransformer.resetBehavior(); | ||
putTransformer.resetHistory(); | ||
putTransformer.callsFake(justReturnsObject); | ||
updateTransformer.reset(); | ||
updateTransformer.resetBehavior(); | ||
updateTransformer.resetHistory(); | ||
updateTransformer.callsFake(justReturnsObject); | ||
@@ -216,3 +218,4 @@ }); | ||
beforeEach(() => { | ||
batchWriteStub.reset(); | ||
batchWriteStub.resetHistory(); | ||
batchWriteStub.resetBehavior(); | ||
batchWriteStub.callsFake((items) => { | ||
@@ -219,0 +222,0 @@ const response = { |
@@ -8,2 +8,5 @@ import { DynamoDB } from "aws-sdk"; | ||
} | ||
export interface QueryCountResult { | ||
Count: number; | ||
} | ||
export interface ScanResult<T> { | ||
@@ -23,2 +26,3 @@ Items: T[]; | ||
} | ||
export declare type QueryCountParams = Pick<QueryParams, "KeyConditionExpression" | "FilterExpression" | "ExpressionAttributeNames" | "ExpressionAttributeValues" | "IndexName">; | ||
export interface ScanParams { | ||
@@ -92,2 +96,3 @@ IndexName?: string; | ||
query<T>(table: string, myParams: QueryParams, projection: string[]): Promise<QueryResult<Partial<T>>>; | ||
count(table: string, myParams: QueryCountParams): Promise<QueryCountResult>; | ||
scan<T>(table: string, myParams: ScanParams): Promise<ScanResult<T>>; | ||
@@ -94,0 +99,0 @@ scan<T, P extends keyof T>(table: string, myParams: ScanParams, projection: P): Promise<ScanResult<Pick<T, P>>>; |
@@ -111,2 +111,16 @@ "use strict"; | ||
} | ||
count(table, myParams) { | ||
const params = { | ||
TableName: table, | ||
Select: "COUNT" | ||
}; | ||
addIfExists(params, myParams, [ | ||
"KeyConditionExpression", | ||
"FilterExpression", | ||
"ExpressionAttributeNames", | ||
"ExpressionAttributeValues", | ||
"IndexName" | ||
]); | ||
return this.db.query(params).promise(); | ||
} | ||
scan(table, myParams, projection) { | ||
@@ -113,0 +127,0 @@ const params = { |
@@ -7,4 +7,6 @@ "use strict"; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) | ||
t[p[i]] = s[p[i]]; | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
@@ -11,0 +13,0 @@ }; |
@@ -7,4 +7,6 @@ "use strict"; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) | ||
t[p[i]] = s[p[i]]; | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
@@ -11,0 +13,0 @@ }; |
import { DynamoDB } from "aws-sdk"; | ||
import { ConditionExpression, DynamoService, QueryParams, QueryResult, ScanParams, ScanResult, UpdateBody, UpdateReturnAllType, UpdateReturnNoneType, UpdateReturnType, UpdateReturnUpdatedType } from "../DynamoService"; | ||
import { ConditionExpression, DynamoService, QueryCountParams, QueryCountResult, QueryParams, QueryResult, ScanParams, ScanResult, UpdateBody, UpdateReturnAllType, UpdateReturnNoneType, UpdateReturnType, UpdateReturnUpdatedType } from "../DynamoService"; | ||
import { KeySchema, TableSchema } from "../KeySchema"; | ||
@@ -47,2 +47,3 @@ import { ValidationError } from "../ValidationError"; | ||
query(params: QueryParams, projection: string[]): Promise<QueryResult<Partial<T>>>; | ||
count(params: QueryCountParams): Promise<QueryCountResult>; | ||
scan(params: ScanParams): Promise<ScanResult<T>>; | ||
@@ -49,0 +50,0 @@ scan<P extends keyof T>(params: ScanParams, projection: P | P[]): Promise<ScanResult<Pick<T, P>>>; |
@@ -65,2 +65,5 @@ "use strict"; | ||
} | ||
count(params) { | ||
return this.db.count(this.tableName, params); | ||
} | ||
scan(params, projection) { | ||
@@ -67,0 +70,0 @@ const realProjection = (projection || this.knownKeys); |
{ | ||
"name": "@xapp/dynamo-service", | ||
"version": "1.0.0-beta.2", | ||
"version": "1.0.1-beta.1", | ||
"description": "A dynamo help class which will help maintain data integrity.", | ||
@@ -27,26 +27,26 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/chai": "^4.0.10", | ||
"@types/mocha": "^2.2.45", | ||
"@types/node": "^9.4.0", | ||
"@types/chai": "^4.1.7", | ||
"@types/mocha": "^5.2.7", | ||
"@types/node": "^12.6.8", | ||
"@types/runes": "^0.4.1", | ||
"@types/sinon": "^4.1.2", | ||
"@types/sinon-chai": "^2.7.29", | ||
"@xapp/config": "^0.2.1", | ||
"aws-sdk": "^2.175.0", | ||
"chai": "^4.1.2", | ||
"mocha": "^4.1.0", | ||
"nyc": "^11.4.1", | ||
"prettier": "^1.12.1", | ||
"sinon": "^4.1.3", | ||
"sinon-chai": "^2.14.0", | ||
"@types/sinon": "^7.0.13", | ||
"@types/sinon-chai": "^3.2.2", | ||
"@xapp/config": "^0.2.3", | ||
"aws-sdk": "^2.495.0", | ||
"chai": "^4.2.0", | ||
"mocha": "^6.1.4", | ||
"nyc": "^14.1.1", | ||
"prettier": "^1.18.2", | ||
"sinon": "^7.3.2", | ||
"sinon-chai": "^3.3.0", | ||
"standard-version": "^6.0.1", | ||
"ts-node": "^4.1.0", | ||
"tslint": "^5.9.1", | ||
"typescript": "3.4.5", | ||
"uuid4": "^1.0.0" | ||
"ts-node": "^8.3.0", | ||
"tslint": "^5.18.0", | ||
"typescript": "^3.5.3", | ||
"uuid4": "^1.1.4" | ||
}, | ||
"dependencies": { | ||
"runes": "^0.4.3", | ||
"runes": "0.4.3", | ||
"slugify": "1.3.4" | ||
} | ||
} |
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
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
141
8209
1
396446
Updatedrunes@0.4.3