Enterprise-CMCS/macpro-mako

View on GitHub
lib/packages/shared-types/lambda-events.ts

Summary

Maintainability
A
0 mins
Test Coverage
export type KafkaEvent = {
  /**
   * @example "SelfManagedKafka"
   */
  eventSource: string;
  /**
   * @example: "b-1.master-msk.zf7e0q.c7.kafka.us-east-1.amazonaws.com:9094,b-2.master-msk.zf7e0q.c7.kafka.us-east-1.amazonaws.com:9094,b-3.master-msk.zf7e0q.c7.kafka.us-east-1.amazonaws.com:9094"
   */
  bootstrapServers: string; // comma separated string
  records: Record<string, KafkaRecord[]>;
};

export type KafkaRecord = {
  topic: string;
  partition: number;
  offset: number;
  timestamp: number;
  timestampType: string;
  key: string;
  headers: Record<string, string>;
  value: string; // Kafka records typically have values as base64-encoded strings
};