1 | import { Handler } from "../handler";
|
2 |
|
3 |
|
4 | export type DynamoDBStreamHandler = Handler<DynamoDBStreamEvent, DynamoDBBatchResponse | void>;
|
5 |
|
6 |
|
7 | export interface AttributeValue {
|
8 | B?: string | undefined;
|
9 | BS?: string[] | undefined;
|
10 | BOOL?: boolean | undefined;
|
11 | L?: AttributeValue[] | undefined;
|
12 | M?: { [id: string]: AttributeValue } | undefined;
|
13 | N?: string | undefined;
|
14 | NS?: string[] | undefined;
|
15 | NULL?: boolean | undefined;
|
16 | S?: string | undefined;
|
17 | SS?: string[] | undefined;
|
18 | }
|
19 |
|
20 |
|
21 | export interface StreamRecord {
|
22 | ApproximateCreationDateTime?: number | undefined;
|
23 | Keys?: { [key: string]: AttributeValue } | undefined;
|
24 | NewImage?: { [key: string]: AttributeValue } | undefined;
|
25 | OldImage?: { [key: string]: AttributeValue } | undefined;
|
26 | SequenceNumber?: string | undefined;
|
27 | SizeBytes?: number | undefined;
|
28 | StreamViewType?: "KEYS_ONLY" | "NEW_IMAGE" | "OLD_IMAGE" | "NEW_AND_OLD_IMAGES" | undefined;
|
29 | }
|
30 |
|
31 |
|
32 | export interface DynamoDBRecord {
|
33 | awsRegion?: string | undefined;
|
34 | dynamodb?: StreamRecord | undefined;
|
35 | eventID?: string | undefined;
|
36 | eventName?: "INSERT" | "MODIFY" | "REMOVE" | undefined;
|
37 | eventSource?: string | undefined;
|
38 | eventSourceARN?: string | undefined;
|
39 | eventVersion?: string | undefined;
|
40 | userIdentity?: any;
|
41 | }
|
42 |
|
43 |
|
44 | export interface DynamoDBStreamEvent {
|
45 | Records: DynamoDBRecord[];
|
46 | }
|
47 |
|
48 |
|
49 | export interface DynamoDBBatchResponse {
|
50 | batchItemFailures: DynamoDBBatchItemFailure[];
|
51 | }
|
52 |
|
53 | export interface DynamoDBBatchItemFailure {
|
54 | itemIdentifier: string;
|
55 | }
|