import { Logger } from '../../logger'; import { IFeatureStrategiesStore, IUnleashConfig, IUnleashStores, serializeDates, } from '../../types'; import { IFeatureSearchParams } from '../feature-toggle/types/feature-toggle-strategies-store-type'; export class FeatureSearchService { private featureStrategiesStore: IFeatureStrategiesStore; private logger: Logger; constructor( { featureStrategiesStore, }: Pick, { getLogger }: Pick, ) { this.featureStrategiesStore = featureStrategiesStore; this.logger = getLogger('services/feature-search-service.ts'); } async search(params: IFeatureSearchParams) { const { features, total } = await this.featureStrategiesStore.searchFeatures({ ...params, limit: params.limit, }); return { features, total, }; } }