import { i18n } from '@kbn/i18n' ; import { LicenseType } from '../../licensing/common/types' ; import { TransformHealthTests } from './types/alerting' ; export const DEFAULT_REFRESH_INTERVAL_MS = 30000 ; export const MINIMUM_REFRESH_INTERVAL_MS = 1000 ; export const PROGRESS_REFRESH_INTERVAL_MS = 2000 ; export const PLUGIN = { ID : 'transform' , MINIMUM_LICENSE_REQUIRED : 'basic' as LicenseType , getI18nName : ( ) : string => { return i18n . translate ( 'xpack.transform.appName' , { defaultMessage : 'Transforms' , } ) ; } , } ; export const API_BASE_PATH = '/api/transform/' ; export const APP_CLUSTER_PRIVILEGES = [ 'cluster:monitor/transform/get' , 'cluster:monitor/transform/stats/get' , 'cluster:admin/transform/delete' , 'cluster:admin/transform/preview' , 'cluster:admin/transform/put' , 'cluster:admin/transform/start' , 'cluster:admin/transform/start_task' , 'cluster:admin/transform/stop' , ] ; export const NODES_INFO_PRIVILEGES = [ 'cluster:monitor/transform/get' ] ; export const APP_GET_TRANSFORM_CLUSTER_PRIVILEGES = [ 'cluster.cluster:monitor/transform/get' , 'cluster.cluster:monitor/transform/stats/get' , ] ; export const APP_CREATE_TRANSFORM_CLUSTER_PRIVILEGES = [ 'cluster.cluster:monitor/transform/get' , 'cluster.cluster:monitor/transform/stats/get' , 'cluster.cluster:admin/transform/preview' , 'cluster.cluster:admin/transform/put' , 'cluster.cluster:admin/transform/start' , 'cluster.cluster:admin/transform/start_task' , ] ; export const APP_INDEX_PRIVILEGES = [ 'monitor' ] ; export const TRANSFORM_STATE = { ABORTING : 'aborting' , FAILED : 'failed' , INDEXING : 'indexing' , STARTED : 'started' , STOPPED : 'stopped' , STOPPING : 'stopping' , WAITING : 'waiting' , } as const ; const transformStates = Object . values ( TRANSFORM_STATE ) ; export type TransformState = typeof transformStates [ number ] ; export const TRANSFORM_MODE = { BATCH : 'batch' , CONTINUOUS : 'continuous' , } as const ; const transformModes = Object . values ( TRANSFORM_MODE ) ; export type TransformMode = typeof transformModes [ number ] ; export const TRANSFORM_FUNCTION = { PIVOT : 'pivot' , LATEST : 'latest' , } as const ; export type TransformFunction = typeof TRANSFORM_FUNCTION [ keyof typeof TRANSFORM_FUNCTION ] ; export const TRANSFORM_RULE_TYPE = { TRANSFORM_HEALTH : 'transform_health' , } as const ; export const ALL_TRANSFORMS_SELECTION = '*' ; export const TRANSFORM_HEALTH_CHECK_NAMES = { notStarted : { name : i18n . translate ( 'xpack.transform.alertTypes.transformHealth.notStartedCheckName' , { defaultMessage : 'Transform is not started' , } ) , description : i18n . translate ( 'xpack.transform.alertTypes.transformHealth.notStartedCheckDescription' , { defaultMessage : 'Get alerts when the transform is not started or is not indexing data.' , } ) , } , } ;