summaryrefslogtreecommitdiffstats
path: root/cds-ui/server/src/datasources
diff options
context:
space:
mode:
Diffstat (limited to 'cds-ui/server/src/datasources')
-rw-r--r--cds-ui/server/src/datasources/controller-catalog.datasource-template.ts76
-rw-r--r--cds-ui/server/src/datasources/controller-catalog.datasource.ts14
-rw-r--r--cds-ui/server/src/datasources/index.ts1
3 files changed, 91 insertions, 0 deletions
diff --git a/cds-ui/server/src/datasources/controller-catalog.datasource-template.ts b/cds-ui/server/src/datasources/controller-catalog.datasource-template.ts
new file mode 100644
index 000000000..e45741576
--- /dev/null
+++ b/cds-ui/server/src/datasources/controller-catalog.datasource-template.ts
@@ -0,0 +1,76 @@
+import {processorApiConfig} from '../config/app-config';
+
+export default {
+ "name": "controllerCatalog",
+ "connector": "rest",
+ "baseURL": processorApiConfig.http.url + "/model-type",
+ "crud": false,
+ "debug": true,
+ "operations": [
+
+ {
+ "template": {
+ "method": "GET",
+ "url": processorApiConfig.http.url + "/model-type/search/{tags}",
+ "headers": {
+ "accepts": "application/json",
+ "content-type": "application/json",
+ "authorization": processorApiConfig.http.authToken
+ },
+ "responsePath": "$.*"
+ },
+ "functions": {
+ "getByTags": ["tags"]
+
+ }
+ },
+ {
+ "template": {
+ "method": "POST",
+ "url": processorApiConfig.http.url + "/model-type",
+ "headers": {
+ "accepts": "application/json",
+ "content-type": "application/json",
+ "authorization": processorApiConfig.http.authToken
+ },
+ "body": "{controllerCatalog}",
+ "responsePath": "$.*"
+ },
+ "functions": {
+ "save": ["controllerCatalog"]
+
+ }
+ },
+ {
+ "template": {
+ "method": "GET",
+ "url": processorApiConfig.http.url + "/model-type/by-definition/{definitionType}",
+ "headers": {
+ "accepts": "application/json",
+ "content-type": "application/json",
+ "authorization": processorApiConfig.http.authToken
+ },
+ "responsePath": "$.*"
+ },
+ "functions": {
+ "getDefinitionTypes": ["definitionType"]
+
+ }
+ },
+ {
+ "template": {
+ "method": "DEL",
+ "url": processorApiConfig.http.url + "/model-type/{name}",
+ "headers": {
+ "accepts": "application/json",
+ "content-type": "application/json",
+ "authorization": processorApiConfig.http.authToken
+ },
+ "responsePath": "$.*"
+ },
+ "functions": {
+ "delete": ["name"]
+ }
+ }
+ ]
+}; \ No newline at end of file
diff --git a/cds-ui/server/src/datasources/controller-catalog.datasource.ts b/cds-ui/server/src/datasources/controller-catalog.datasource.ts
new file mode 100644
index 000000000..d711d4693
--- /dev/null
+++ b/cds-ui/server/src/datasources/controller-catalog.datasource.ts
@@ -0,0 +1,14 @@
+import {inject} from '@loopback/core';
+import {juggler} from '@loopback/repository';
+import config from './controller-catalog.datasource-template';
+
+export class ControllerCatalogDataSource extends juggler.DataSource {
+ static dataSourceName = 'controllerCatalog';
+
+ constructor(
+ @inject('datasources.config.controllerCatalog', {optional: true})
+ dsConfig: object = config,
+ ) {
+ super(dsConfig);
+ }
+}
diff --git a/cds-ui/server/src/datasources/index.ts b/cds-ui/server/src/datasources/index.ts
index 7ed2c9121..273441131 100644
--- a/cds-ui/server/src/datasources/index.ts
+++ b/cds-ui/server/src/datasources/index.ts
@@ -23,3 +23,4 @@ limitations under the License.
export * from './db.datasource';
export * from './blueprint.datasource';
export * from './resource-dictionary.datasource';
+export * from './controller-catalog.datasource';