import { CustomIntegration } from '../../common' ; interface FindParams { eprPackageName ? : string ; shipper ? : string ; } /**
 * A plugin service that finds and returns custom integrations.
 */ export interface CustomIntegrationsFindService { findReplacementIntegrations ( params ? ) : Promise < CustomIntegration [ ] > ; findAppendedIntegrations ( params ? ) : Promise < CustomIntegration [ ] > ; } /**
 * Filter a set of integrations by eprPackageName, and/or shipper.
 */ export const filterCustomIntegrations = ( integrations , { eprPackageName , shipper } = { } ) => { if ( ! eprPackageName && ! shipper ) { return integrations ; } let result = integrations ; if ( eprPackageName ) { result = result . filter ( ( integration ) => integration . eprOverlap === eprPackageName ) ; } if ( shipper ) { result = result . filter ( ( integration ) => integration . shipper === shipper ) ; } return result ; } ;