import type { ErrorType } from '../util/errors' ; export type JobType = 'anomaly-detector' | 'data-frame-analytics' ; export const ML_SAVED_OBJECT_TYPE = 'ml-job' ; export const ML_MODULE_SAVED_OBJECT_TYPE = 'ml-module' ; export interface SavedObjectResult { [ jobId ] : { success : boolean ; type : JobType ; error ? : ErrorType ; } ; } export interface SyncSavedObjectResponse { savedObjectsCreated : SavedObjectResult ; savedObjectsDeleted : SavedObjectResult ; datafeedsAdded : SavedObjectResult ; datafeedsRemoved : SavedObjectResult ; } export interface CanDeleteJobResponse { [ jobId ] : { canDelete : boolean ; canRemoveFromSpace : boolean ; } ; } export type JobsSpacesResponse = { [ jobType in JobType ] : { [ jobId ] : string [ ] ; } ; } ; export interface InitializeSavedObjectResponse { jobs : Array < { id : string ; type : JobType ; } > ; datafeeds : Array < { id : string ; type : JobType ; } > ; success : boolean ; error ? : ErrorType ; } export interface SyncCheckResponse { result : boolean ; } export interface DeleteJobCheckResponse { [ jobId ] : DeleteJobPermission ; } export interface DeleteJobPermission { canDelete : boolean ; canRemoveFromSpace : boolean ; }