export type TrackedRoute = {
  method: string
  url: string
  routePath: string
  config?: any
  schema?: any
  handler?: any
  routePrefix?: string
}

export type PluginRegistration = {
  pluginName: string
  author: string
  pluginKey: string
  pluginPath: string
  frontendPath: string
  routePrefix: string
  entityMapping?: Record<string, string>
  customConfig?: {
    broadcast?: boolean
    channels?: Record<string, string>
    operationMapping?: Record<string, string>
  }
  registeredAt: number
}

export type CrudOperation = {
  target: string | ((payload: any) => string)
  method?: string
  broadcast?: boolean
  storeActionType?: string
  channels?: {
    channel: string
    core: boolean
    prefix?: string
  }
}

export type GeneratedDataType = {
  type: string
  operations: {
    [operationName: string]: CrudOperation
  }
}

export type ParsedRouteInfo = {
  method: string
  url: string
  entityName: string
  operationName: string
  pathParams: string[]
  registration?: PluginRegistration | null
  config: any
  schema: any
}
