From f52cf7ce4451fd5fa1bbc6cf30e5b2a0acab7276 Mon Sep 17 00:00:00 2001 From: swapnalipode Date: Fri, 10 Jan 2020 22:28:48 +0530 Subject: Adding integration to backend in Controller catalog Adding integration to backend in controller catalog Change-Id: Ia423d05ee5b089af6df70296a40d36d84892d488 Issue-ID: CCSDK-814 Signed-off-by: swapnalipode --- .../src/services/controller-catalog.service.ts | 22 ++++++++++++++++++++++ cds-ui/server/src/services/index.ts | 1 + 2 files changed, 23 insertions(+) create mode 100644 cds-ui/server/src/services/controller-catalog.service.ts (limited to 'cds-ui/server/src/services') diff --git a/cds-ui/server/src/services/controller-catalog.service.ts b/cds-ui/server/src/services/controller-catalog.service.ts new file mode 100644 index 000000000..9b4880543 --- /dev/null +++ b/cds-ui/server/src/services/controller-catalog.service.ts @@ -0,0 +1,22 @@ +import {getService} from '@loopback/service-proxy'; +import {inject, Provider} from '@loopback/core'; +import {ControllerCatalogDataSource} from '../datasources'; + +export interface ControllerCatalogService { + getByTags(tags: string): Promise; + save(controllerCatalog: JSON): Promise; + getDefinitionTypes(definitionType: string): Promise; + deleteCatalog(name: string): Promise; +} + +export class ControllerCatalogServiceProvider implements Provider { + constructor( + // controllerCatalog must match the name property in the datasource json file + @inject('datasources.controllerCatalog') + protected dataSource: ControllerCatalogDataSource = new ControllerCatalogDataSource(), + ) {} + + value(): Promise { + return getService(this.dataSource); + } +} diff --git a/cds-ui/server/src/services/index.ts b/cds-ui/server/src/services/index.ts index 8a82e3231..be987b1c9 100644 --- a/cds-ui/server/src/services/index.ts +++ b/cds-ui/server/src/services/index.ts @@ -1,2 +1,3 @@ export * from './blueprint.service'; export * from './resource-dictionary.service'; +export * from './controller-catalog.service'; -- cgit 1.2.3-korg