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