-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
34 lines (30 loc) · 1.14 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { QueryCommandInput } from "@aws-sdk/lib-dynamodb";
export interface QueryOptions extends Omit<QueryCommandInput, 'TableName' | 'KeyConditionExpression' | 'ExpressionAttributeNames' | 'ExpressionAttributeValues'> {
ProjectionExpression?: string;
IndexName?: string;
Limit?: number;
}
export interface UpdateItemParams<T extends {} = Record<string, any>> {
// only set needs validation i think
set?: Partial<T>; // edit or change an existing item
remove?: string[]; // remove from a list, remove attributes
add?: Record<
string, number | Set<string> | Array<string> | Set<number> | Array<number>
>; // add to a set
delete?: Record<string, Set<string> | Array<string>>; // delete from a set
listAppend?: Record<string, Array<any>>; // append to a list
setIfNotExists?: Partial<T>; // set if it doesn't exist
}
export interface UpdateItemOptions {
ReturnValues?: "NONE" |
"ALL_OLD" |
"UPDATED_OLD" |
"ALL_NEW" |
"UPDATED_NEW";
primaryKey?: string;
debug?: boolean;
throwConditionalFail?: boolean;
}
export interface UpdateExpressionOptions {
generateRandomId?: () => string;
}