import {getService} from '@loopback/service-proxy'; import {inject, Provider} from '@loopback/core'; import {ControllerCatalogDataSource} from '../datasources'; export interface ControllerCatalogService { getByTags(tags: string): Promise; save(controllerCatalog: JSON): Promise; getDefinitionTypes(definitionType: string): Promise; delete(name: string): Promise; } export class ControllerCatalogServiceProvider implements Provider { constructor( // controllerCatalog must match the name property in the datasource json file @inject('datasources.controllerCatalog') protected dataSource: ControllerCatalogDataSource = new ControllerCatalogDataSource(), ) {} value(): Promise { return getService(this.dataSource); } }