1 import { getService } from '@loopback/service-proxy';
2 import { inject, Provider } from '@loopback/core';
3 import { BlueprintDataSource } from '../datasources';
5 export interface BlueprintService {
6 getOneBlueprint(id: string): any;
7 deleteBlueprint(id: string): any;
8 getAllblueprints(): Promise<any>;
9 getBlueprintsByKeyword(keyword: string): Promise<any>;
10 getByTags(tags: string): Promise<JSON>;
11 getPagedBlueprints(limit: number, offset: number, sort: string, sortType: String): Promise<any>;
12 getMetaDataPagedBlueprints(limit: number, offset: number, sort: string, keyword: string, sortType: String): Promise<any>;
13 getBlueprintByNameAndVersion(name: string, version: string): Promise<any>;
18 export class BlueprintServiceProvider implements Provider<BlueprintService> {
20 // blueprint must match the name property in the datasource json file
21 @inject('datasources.blueprint')
22 protected dataSource: BlueprintDataSource = new BlueprintDataSource(),
25 value(): Promise<BlueprintService> {
26 return getService(this.dataSource);