export interface Event {
  type?: string;
  Index?: string;
  sign_id?: string;
  '@created'?: string;
  event_id?: string;
  rule_tags?: string;
  sign_name?: string;
  source_ip?: string;
  '@timestamp'?: string;
  event_hash?: string;
  event_last?: string;
  source_mac?: string;
  celery_done?: boolean;
  event_count?: number;
  event_first?: string;
  source_host?: string;
  source_port?: number;
  source_user?: string;
  aggregated_id?: string;
  device_action?: string;
  device_vendor?: string;
  event_src_msg?: string;
  sign_category?: string;
  destination_ip?: string;
  device_product?: string;
  device_version?: string;
  event_protocol?: string;
  event_severity?: number;
  event_timestamp?: string;
  destination_host?: string;
  destination_port?: number;
  destination_user?: string;
  sign_subcategory?: string;
}

export enum EventJournalGroupName {
  Event = 'event',
  Source = 'source',
  Destination = 'destination',
  Device = 'device',
  Signature = 'signature',
  Service = 'service',
  App = 'app',
  Etc = 'etc',
  Object = 'object',
  Main = 'main',
  Recipient = 'recipient',
  Additionally = 'additionally',
}

export type TypeEventJournalTableCardInfoMainMessages = {
  title: string;
  aggregated_id: string;
  event_id: string;
  event_timestamp: string;
  event_src_msg: string;
  event_severity: string;
  event_first: string;
  event_last: string;
  event_protocol: string;
  event_count: string;
  sign_id: string;
  sign_name: string;
};

export type TypeEventJournalTableCardInfoSourceMessages = {
  title: string;
  source_ip: string;
  source_user: string;
  source_host: string;
  source_port: string;
  source_mac: string;
  source_timezon: string;
  source_software: string;
  source_action: string;
};

export type TypeEventJournalTableCardInfoRecipientMessages = {
  title: string;
  destination_ip: string;
  destination_port: string;
  destination_user: string;
  destination_host: string;
  destination_mac: string;
  destination_timezon: string;
  destination_software: string;
  destination_action: string;
};

export type TypeEventJournalTableCardInfoDeviceMessages = {
  title: string;
  device_version: string;
  device_action: string;
  device_product: string;
  device_timezon: string;
  device_vendor: string;
};

export type TypeEventJournalTableCardInfoAdditionallyMessages = {
  title: string;
  customLable1: string;
  customField1: string;
  customLable2: string;
  customField2: string;
  rule_tags: string;
  event_hash: string;
  type: string;
  sign_category: string;
  sign_subcategory: string;
};

export type TypeEventJournalTableCardInfoMessages = {
  title: string;
  [EventJournalGroupName.Main]: TypeEventJournalTableCardInfoMainMessages;
  [EventJournalGroupName.Source]: TypeEventJournalTableCardInfoSourceMessages;
  [EventJournalGroupName.Recipient]: TypeEventJournalTableCardInfoRecipientMessages;
  [EventJournalGroupName.Device]: TypeEventJournalTableCardInfoDeviceMessages;
  [EventJournalGroupName.Additionally]: TypeEventJournalTableCardInfoAdditionallyMessages;
};

export type TypeEventJournalTableMessages = {
  column: {
    data: string;
    message: string;
    sigName: string;
    severity: string;
    category: string;
    sourceIp: string;
    destinationIp: string;
    columnMessage: {
      moreInfo: string;
      hideInfo: string;
    };
  };

  cardInfo: TypeEventJournalTableCardInfoMessages;
};

export type TypeEventJournalMessages = {
  title: string;
  table: TypeEventJournalTableMessages;
};

type TypeEvent = [
  'aggregated_id',
  'event_id',
  'event_timestamp',
  'event_src_msg',
  'event_severity',
  'event_first',
  'event_last',
  'event_protocol',
  'event_count',
];

type TypeESource = [
  'source_ip',
  'source_user',
  'source_host',
  'source_port',
  'source_mac',
  'source_timezon',
  'source_software',
  'source_action',
];

type TypeDestination = [
  'destination_ip',
  'destination_port',
  'destination_user',
  'destination_host',
  'destination_mac',
  'destination_timezon',
  'destination_software',
  'destination_action',
];

type TypeDevice = [
  'device_version',
  'device_action',
  'device_product',
  'device_timezon',
  'device_vendor',
];
type TypeSignature = ['sign_id', 'sign_name'];
type TypeService = ['rule_tags', 'event_hash', 'type'];
type TypeApp = ['sign_category', 'sign_subcategory'];
type TypeEtc = ['cs1Label', 'cs1', 'cs2Label', 'cs2'];
type TypeObject = ['object_type', 'app'];

export type TypeEventsGroup = {
  [EventJournalGroupName.Event]: TypeEvent;
  [EventJournalGroupName.Source]: TypeESource;
  [EventJournalGroupName.Destination]: TypeDestination;
  [EventJournalGroupName.Device]: TypeDevice;
  [EventJournalGroupName.Signature]: TypeSignature;
  [EventJournalGroupName.Service]: TypeService;
  [EventJournalGroupName.App]: TypeApp;
  [EventJournalGroupName.Etc]: TypeEtc;
  [EventJournalGroupName.Object]: TypeObject;
};
