1 import {getService} from '@loopback/service-proxy';
2 import {inject, Provider} from '@loopback/core';
3 import {ResourceDictionaryDataSource} from '../datasources';
5 export interface ResourceDictionaryService {
6 getByName(name: string): Promise<JSON>;
7 getSourceMapping(): Promise<JSON>;
8 getByTags(tags: string): Promise<JSON>;
9 save(resourceDictionary: JSON): Promise<JSON>;
10 searchbyNames(resourceDictionaryList: JSON): Promise<JSON>;
11 getModelType(source: string): Promise<JSON>;
14 export class ResourceDictionaryServiceProvider implements Provider<ResourceDictionaryService> {
16 // resourceDictionary must match the name property in the datasource json file
17 @inject('datasources.resourceDictionary')
18 protected dataSource: ResourceDictionaryDataSource = new ResourceDictionaryDataSource(),
21 value(): Promise<ResourceDictionaryService> {
22 return getService(this.dataSource);