aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/server/src/services
diff options
context:
space:
mode:
authorswapnalipode <sp00501638@techmahindra.com>2020-01-10 22:28:48 +0530
committerKAPIL SINGAL <ks220y@att.com>2020-01-13 19:40:39 +0000
commitf52cf7ce4451fd5fa1bbc6cf30e5b2a0acab7276 (patch)
treef8f7c455e9751633e47686d5065f47704c79f56d /cds-ui/server/src/services
parent2977ea8da5b586a301a858f82b3956151d4ef742 (diff)
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 <sp00501638@techmahindra.com>
Diffstat (limited to 'cds-ui/server/src/services')
-rw-r--r--cds-ui/server/src/services/controller-catalog.service.ts22
-rw-r--r--cds-ui/server/src/services/index.ts1
2 files changed, 23 insertions, 0 deletions
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<JSON>;
+ save(controllerCatalog: JSON): Promise<JSON>;
+ getDefinitionTypes(definitionType: string): Promise<JSON>;
+ deleteCatalog(name: string): Promise<JSON>;
+}
+
+export class ControllerCatalogServiceProvider implements Provider<ControllerCatalogService> {
+ constructor(
+ // controllerCatalog must match the name property in the datasource json file
+ @inject('datasources.controllerCatalog')
+ protected dataSource: ControllerCatalogDataSource = new ControllerCatalogDataSource(),
+ ) {}
+
+ value(): Promise<ControllerCatalogService> {
+ 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';