Merge "netconf lib bugfixes: invoke_rpc + timeouts."
[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    getBlueprintsByKeyword(keyword: string): Promise<any>;
8    getByTags(tags: string): Promise<JSON>;
9 }
10
11 export class BlueprintServiceProvider implements Provider<BlueprintService> {
12   constructor(
13     // blueprint must match the name property in the datasource json file
14     @inject('datasources.blueprint')
15     protected dataSource: BlueprintDataSource = new BlueprintDataSource(),
16   ) {}
17
18   value(): Promise<BlueprintService> {
19     return getService(this.dataSource);
20   }
21 }