UNPKG

642 BTypeScriptView Raw
1import { Handler } from "../handler";
2
3export type MSKHandler = Handler<MSKEvent, void>;
4
5export interface MSKRecordHeader {
6 [headerKey: string]: number[];
7}
8
9export interface MSKRecord {
10 topic: string;
11 partition: number;
12 offset: number;
13 timestamp: number;
14 timestampType: "CREATE_TIME" | "LOG_APPEND_TIME";
15 key: string;
16 value: string;
17 headers: MSKRecordHeader[];
18}
19
20// https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html
21export interface MSKEvent {
22 eventSource: "aws:kafka";
23 eventSourceArn: string;
24 bootstrapServers: string;
25 records: {
26 [topic: string]: MSKRecord[];
27 };
28}