import { getService } from '@loopback/service-proxy'; import { inject, Provider } from '@loopback/core'; import { BlueprintDataSource } from '../datasources'; export interface BlueprintService { getOneBluePrint(id: string): any; deleteBluePrint(id: string): any; getAllblueprints(): Promise; getBlueprintsByKeyword(keyword: string): Promise; getByTags(tags: string): Promise; getPagedBueprints(limit: number, offset: number, sort: string, sortType: String): Promise; getMetaDataPagedBlueprints(limit: number, offset: number, sort: string, keyword: string, sortType: String): Promise; getBlueprintByNameAndVersion(name: string, version: string): Promise; } export class BlueprintServiceProvider implements Provider { constructor( // blueprint must match the name property in the datasource json file @inject('datasources.blueprint') protected dataSource: BlueprintDataSource = new BlueprintDataSource(), ) { } value(): Promise { return getService(this.dataSource); } }