diff --git a/config/default.ts b/config/default.ts index e71f421d..92f39c49 100644 --- a/config/default.ts +++ b/config/default.ts @@ -58,6 +58,7 @@ const config: Partial = { SCThingType.Diff, SCThingType.Floor, ], + mappingIgnoredTags: ['minlength', 'pattern', 'see', 'tjs-format'], maxMultiSearchRouteQueries: 5, maxRequestBodySize: 512 * 1024, name: 'Technische Universität Berlin', diff --git a/package.json b/package.json index 3f0f64a9..1ff599a4 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "tslint": "tslint -p tsconfig.json -c tslint.json 'src/**/*.ts'" }, "dependencies": { - "@openstapps/core": "0.28.0", + "@openstapps/core": "0.29.0", "@openstapps/core-tools": "0.9.0", "@openstapps/logger": "0.4.0", "@types/node": "10.14.12", diff --git a/src/storage/elasticsearch/templating.ts b/src/storage/elasticsearch/templating.ts index 8c246c52..87459c32 100644 --- a/src/storage/elasticsearch/templating.ts +++ b/src/storage/elasticsearch/templating.ts @@ -20,15 +20,13 @@ import {Client} from 'elasticsearch'; import {existsSync, writeFileSync} from 'fs'; import {readFile} from 'fs-extra'; import {resolve} from 'path'; -import {coreVersion} from '../../common'; +import {configFile, coreVersion} from '../../common'; const dirPath = resolve('src', 'storage', 'elasticsearch', 'templates'); const templatePath = resolve(dirPath, `template_${coreVersion}.json`); const errorPath = resolve(dirPath, `failed_template_${coreVersion}.json`); const errorReportPath = resolve(dirPath, `error_report_${coreVersion}.txt`); -const ignoredTags = ['minlength', 'pattern', 'see', 'tjs-format']; // TODO: put this into config - /** * Check if the correct template exists */ @@ -41,7 +39,7 @@ export function checkESTemplate(forceUpdate: boolean) { Logger.info(`No mapping for Core version ${coreVersion} found, starting automatic mapping generation. ` + `This may take a while.`); const map = generateTemplate(getProjectReflection(resolve('node_modules', '@openstapps', 'core', 'src')), - ignoredTags, false); + configFile.backend.mappingIgnoredTags, false); if (map.errors.length > 0) { // tslint:disable-next-line:no-magic-numbers