import {getService} from '@loopback/service-proxy'; import {inject, Provider} from '@loopback/core'; import {ResourceDictionaryDataSource} from '../datasources'; export interface ResourceDictionaryService { getByName(name: string): Promise; getSourceMapping(): Promise; getByTags(tags: string): Promise; save(resourceDictionary: JSON): Promise; searchbyNames(resourceDictionaryList: JSON): Promise; getModelType(source: string): Promise; getDataTypes(): Promise; } export class ResourceDictionaryServiceProvider implements Provider { constructor( // resourceDictionary must match the name property in the datasource json file @inject('datasources.resourceDictionary') protected dataSource: ResourceDictionaryDataSource = new ResourceDictionaryDataSource(), ) {} value(): Promise { return getService(this.dataSource); } }