Merge "Fixed title warning in enrichment"
[ccsdk/cds.git] / cds-ui / server / src / services / blueprint.service.ts
1 import {getService} from '@loopback/service-proxy';
2 import {inject, Provider} from '@loopback/core';
3 import {BlueprintDataSource} from '../datasources';
4
5 export interface BlueprintService {
6    getAllblueprints(): Promise<any>;
7    getByTags(tags: string): Promise<JSON>;
8 }
9
10 export class BlueprintServiceProvider implements Provider<BlueprintService> {
11   constructor(
12     // blueprint must match the name property in the datasource json file
13     @inject('datasources.blueprint')
14     protected dataSource: BlueprintDataSource = new BlueprintDataSource(),
15   ) {}
16
17   value(): Promise<BlueprintService> {
18     return getService(this.dataSource);
19   }
20 }