1 | import { Handler } from "../handler";
|
2 |
|
3 |
|
4 | export type KinesisStreamHandler = Handler<KinesisStreamEvent, KinesisStreamBatchResponse | void>;
|
5 |
|
6 | export type KinesisStreamTumblingWindowHandler = Handler<
|
7 | KinesisStreamTumblingWindowEvent,
|
8 |
|
9 | KinesisStreamStateResponse | void
|
10 | >;
|
11 |
|
12 |
|
13 |
|
14 | export interface KinesisStreamRecordPayload {
|
15 | approximateArrivalTimestamp: number;
|
16 | data: string;
|
17 | kinesisSchemaVersion: string;
|
18 | partitionKey: string;
|
19 | sequenceNumber: string;
|
20 | }
|
21 |
|
22 | export interface KinesisStreamRecord {
|
23 | awsRegion: string;
|
24 | eventID: string;
|
25 | eventName: string;
|
26 | eventSource: string;
|
27 | eventSourceARN: string;
|
28 | eventVersion: string;
|
29 | invokeIdentityArn: string;
|
30 | kinesis: KinesisStreamRecordPayload;
|
31 | }
|
32 |
|
33 | export interface KinesisStreamEvent {
|
34 | Records: KinesisStreamRecord[];
|
35 | }
|
36 |
|
37 |
|
38 | export interface KinesisStreamTumblingWindowEvent extends KinesisStreamEvent {
|
39 | window: { start: string; end: string };
|
40 | state?: { [key: string]: any };
|
41 | isFinalInvokeForWindow: boolean;
|
42 | isWindowTerminatedEarly: boolean;
|
43 | }
|
44 |
|
45 | export interface KinesisStreamStateResponse extends Partial<KinesisStreamBatchResponse> {
|
46 | state: { [key: string]: any };
|
47 | }
|
48 |
|
49 |
|
50 | export interface KinesisStreamBatchResponse {
|
51 | batchItemFailures: KinesisStreamBatchItemFailure[];
|
52 | }
|
53 |
|
54 | export interface KinesisStreamBatchItemFailure {
|
55 | itemIdentifier: string;
|
56 | }
|