diff options
Diffstat (limited to 'cds-ui/server')
-rw-r--r-- | cds-ui/server/package.json | 3 | ||||
-rw-r--r-- | cds-ui/server/pom.xml | 2 | ||||
-rw-r--r-- | cds-ui/server/src/controllers/data-dictionary.controller.ts | 11 | ||||
-rw-r--r-- | cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts | 17 | ||||
-rw-r--r-- | cds-ui/server/src/services/resource-dictionary.service.ts | 3 |
5 files changed, 32 insertions, 4 deletions
diff --git a/cds-ui/server/package.json b/cds-ui/server/package.json index 627a34eaa..8abadb15b 100644 --- a/cds-ui/server/package.json +++ b/cds-ui/server/package.json @@ -86,5 +86,4 @@ "@types/node": "^10.11.2", "@types/request": "^2.48.1" } - -}
\ No newline at end of file +} diff --git a/cds-ui/server/pom.xml b/cds-ui/server/pom.xml index 8d758c710..d0fc42190 100644 --- a/cds-ui/server/pom.xml +++ b/cds-ui/server/pom.xml @@ -80,8 +80,8 @@ limitations under the License. <version>1.3</version> <configuration> <nodeVersion>v8.12.0</nodeVersion> + <npmVersion>6.4.1</npmVersion> <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot> - <npmDownloadRoot>https://nodejs.org/dist/npm/</npmDownloadRoot> <installDirectory>./</installDirectory> </configuration> <executions> diff --git a/cds-ui/server/src/controllers/data-dictionary.controller.ts b/cds-ui/server/src/controllers/data-dictionary.controller.ts index 486c28658..63587e6b3 100644 --- a/cds-ui/server/src/controllers/data-dictionary.controller.ts +++ b/cds-ui/server/src/controllers/data-dictionary.controller.ts @@ -84,4 +84,15 @@ export class DataDictionaryController { }) resourceDictionaryList: JSON): Promise<any> { return await this.rdservice.searchbyNames(resourceDictionaryList); } + + @get('/resourcedictionary/model-type/{source}', { + responses: { + '200': { + content: { 'application/json': {} }, + }, + }, + }) + async getmodelType(@param.path.string('source') source: string) { + return await this.rdservice.getModelType(source); + } } 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 c749eee62..af96aca04 100644 --- a/cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts +++ b/cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts @@ -87,6 +87,23 @@ export default { "searchbyNames": ["resourceDictionaryList"] } + }, + , + { + "template": { + "method": "GET", + "url": controllerApiConfig.http.url + "/model-type/{source}", + "headers": { + "accepts": "application/json", + "content-type": "application/json", + "authorization": controllerApiConfig.http.authToken + }, + "responsePath": "$.*" + }, + "functions": { + "getModelType": ["source"] + + } } ] };
\ 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 8bc61fad1..9a781d6b8 100644 --- a/cds-ui/server/src/services/resource-dictionary.service.ts +++ b/cds-ui/server/src/services/resource-dictionary.service.ts @@ -7,7 +7,8 @@ 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>; } export class ResourceDictionaryServiceProvider implements Provider<ResourceDictionaryService> { |