aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'cds-ui/server/src')
-rw-r--r--cds-ui/server/src/controllers/data-dictionary.controller.ts16
-rw-r--r--cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts18
-rw-r--r--cds-ui/server/src/services/resource-dictionary.service.ts3
3 files changed, 35 insertions, 2 deletions
diff --git a/cds-ui/server/src/controllers/data-dictionary.controller.ts b/cds-ui/server/src/controllers/data-dictionary.controller.ts
index eab0bc50c..076d714c6 100644
--- a/cds-ui/server/src/controllers/data-dictionary.controller.ts
+++ b/cds-ui/server/src/controllers/data-dictionary.controller.ts
@@ -96,6 +96,9 @@ export class DataDictionaryController {
return await this.rdservice.getModelType(source);
}
+ /**
+ * @deprecated use getResourceDictionaryByType Instead.
+ */
@get('/resourcedictionary/model-type/by-definition/data_type', {
responses: {
'200': {
@@ -104,6 +107,19 @@ export class DataDictionaryController {
},
})
async getDataTypes() {
+ console.warn("Calling deprecated function!");
return await this.rdservice.getDataTypes();
}
+
+ @get('/resourcedictionary/model-type/by-definition/{type}', {
+ responses: {
+ '200': {
+ content: {'application/json': {}},
+ },
+ },
+ })
+ async getResourceDictionaryByType(@param.path.string('type') type: string) {
+ return await this.rdservice.getResourceDictionaryByType(type);
+ }
+
}
diff --git a/cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts b/cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts
index f839bb225..7373d069e 100644
--- a/cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts
+++ b/cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts
@@ -119,6 +119,22 @@ export default {
"getDataTypes": []
}
+ },
+ {
+ "template": {
+ "method": "GET",
+ "url": processorApiConfig.http.url + "/model-type/by-definition/{type}",
+ "headers": {
+ "accepts": "application/json",
+ "content-type": "application/json",
+ "authorization": processorApiConfig.http.authToken
+ },
+ "responsePath": "$.*"
+ },
+ "functions": {
+ "getResourceDictionaryByType": ["type"]
+
+ }
}
]
-}; \ No newline at end of file
+};
diff --git a/cds-ui/server/src/services/resource-dictionary.service.ts b/cds-ui/server/src/services/resource-dictionary.service.ts
index 8df22085c..a36c7fe75 100644
--- a/cds-ui/server/src/services/resource-dictionary.service.ts
+++ b/cds-ui/server/src/services/resource-dictionary.service.ts
@@ -7,9 +7,10 @@ export interface ResourceDictionaryService {
getSourceMapping(): Promise<JSON>;
getByTags(tags: string): Promise<JSON>;
save(resourceDictionary: JSON): Promise<JSON>;
- searchbyNames(resourceDictionaryList: JSON): Promise<JSON>;
+ searchbyNames(resourceDictionaryList: JSON): Promise<JSON>;
getModelType(source: string): Promise<JSON>;
getDataTypes(): Promise<JSON>;
+ getResourceDictionaryByType(type: string): Promise<JSON>;
}
export class ResourceDictionaryServiceProvider implements Provider<ResourceDictionaryService> {