import {getService} from '@loopback/service-proxy'; import {inject, Provider} from '@loopback/core'; import {ResourceDictionaryDataSource} from '../datasources'; export interface ResourceDictionaryService { getByName(name: string, authtoken: string): Promise; getSourceMapping(authtoken: string): Promise; getByTags(tags: string, authtoken: string): Promise; save(authtoken: string, resourceDictionary: JSON): Promise; searchbyNames(authtoken: string, resourceDictionaryList: JSON): 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); } }