Skip to content

Commit 43840c4

Browse files
feat(projection-expression): cleanup
remove partial get request to be consistent for all requests (maybe this could make sense in the future)
1 parent 564d3f9 commit 43840c4

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/dynamo/request/get/get.request.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ import { addProjectionExpressionParam } from '../helper/add-projection-expressio
1212
import { StandardRequest } from '../standard.request'
1313
import { GetResponse } from './get.response'
1414

15-
export interface GetRequestProjected<T>
16-
extends StandardRequest<Partial<T>, DynamoDB.GetItemInput, GetRequest<Partial<T>>> {
17-
execFullResponse(): Promise<GetResponse<Partial<T>>>
18-
exec(): Promise<Partial<T> | null>
19-
}
20-
2115
/**
2216
* Request class for the GetItem operation.
2317
*/
@@ -42,9 +36,9 @@ export class GetRequest<T> extends StandardRequest<T, DynamoDB.GetItemInput, Get
4236
* Specifies the list of model attributes to be returned from the table instead of returning the entire document
4337
* @param attributesToGet List of model attributes to be returned
4438
*/
45-
projectionExpression(...attributesToGet: Array<keyof T | string>): GetRequestProjected<T> {
39+
projectionExpression(...attributesToGet: Array<keyof T | string>): GetRequest<T> {
4640
addProjectionExpressionParam(attributesToGet, this.params, this.metadata)
47-
return <GetRequestProjected<T>>(<any>this)
41+
return this
4842
}
4943

5044
execFullResponse(): Promise<GetResponse<T>> {

src/dynamo/request/get/get.response.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as DynamoDB from 'aws-sdk/clients/dynamodb'
99
*/
1010
export interface GetResponse<T> {
1111
/**
12-
* A map of attribute names to AttributeValue objects, as specified by ProjectionExpression.
12+
* A map of attribute names to AttributeValue objects (subset if ProjectionExpression was defined).
1313
*/
1414
Item: T | null
1515
/**

0 commit comments

Comments
 (0)