1 import {getService} from '@loopback/service-proxy';
2 import {inject, Provider} from '@loopback/core';
3 import {BlueprintDataSource} from '../datasources';
5 export interface BlueprintService {
6 getAllblueprints(): Promise<any>;
7 getBlueprintsByKeyword(keyword: string): Promise<any>;
8 getByTags(tags: string): Promise<JSON>;
9 getPagedBueprints(limit: number, offset: number , sort: string): Promise<any>;
12 export class BlueprintServiceProvider implements Provider<BlueprintService> {
14 // blueprint must match the name property in the datasource json file
15 @inject('datasources.blueprint')
16 protected dataSource: BlueprintDataSource = new BlueprintDataSource(),
19 value(): Promise<BlueprintService> {
20 return getService(this.dataSource);