summaryrefslogtreecommitdiffstats
path: root/cds-ui/server/src/services/controller-catalog.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cds-ui/server/src/services/controller-catalog.service.ts')
-rw-r--r--cds-ui/server/src/services/controller-catalog.service.ts22
1 files changed, 22 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);
+ }
+}