import { CustomIntegration , ROUTES_APPEND_CUSTOM_INTEGRATIONS , ROUTES_REPLACEMENT_CUSTOM_INTEGRATIONS , } from '../../../common' ; import { KibanaPluginServiceFactory } from '../../../../presentation_util/public' ; import { CustomIntegrationsStartDependencies } from '../../types' ; import { CustomIntegrationsFindService , filterCustomIntegrations } from '../find' ; see export type CustomIntegrationsFindServiceFactory = KibanaPluginServiceFactory < CustomIntegrationsFindService , CustomIntegrationsStartDependencies > ; /**
 * A factory to produce the `CustomIntegrationsFindService` for use in Kibana.
 */ export const findServiceFactory = ( { coreStart } ) => ( { findAppendedIntegrations : async ( params ) => { const integrations = await coreStart . http . get ( ROUTES_APPEND_CUSTOM_INTEGRATIONS ) ; return filterCustomIntegrations ( integrations , params ) ; } , findReplacementIntegrations : async ( params ) => { const replacements = await coreStart . http . get ( ROUTES_REPLACEMENT_CUSTOM_INTEGRATIONS ) ; return filterCustomIntegrations ( replacements , params ) ; } , } ) ;