mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-11 12:12:55 +00:00
fix: esacpe mappin template filename
This commit is contained in:
committed by
Rainer Killinger
parent
4ac6987813
commit
496e6c5bd0
27
package-lock.json
generated
27
package-lock.json
generated
@@ -219,9 +219,9 @@
|
||||
}
|
||||
},
|
||||
"@openstapps/core": {
|
||||
"version": "0.28.0",
|
||||
"resolved": "https://registry.npmjs.org/@openstapps/core/-/core-0.28.0.tgz",
|
||||
"integrity": "sha512-VwL0ngs2o1xEsgNdne/XipYQimidrtfxT/DemVf28SMbGGjXDDS6NO8er4nMVV9C1uKm6SnKwWlzhKQF2OJjYg==",
|
||||
"version": "0.29.0",
|
||||
"resolved": "https://registry.npmjs.org/@openstapps/core/-/core-0.29.0.tgz",
|
||||
"integrity": "sha512-xXfBIYWQlnYiRSURxNBs1nmd38EcgAZGXoHRBaT4Cv/E5bt2ciMOo+MqPVLtKaAf1YPHB419FbxxDjxTkccL2g==",
|
||||
"requires": {
|
||||
"@types/geojson": "1.0.6",
|
||||
"@types/json-patch": "0.0.30",
|
||||
@@ -4151,6 +4151,14 @@
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"sanitize-filename": {
|
||||
"version": "1.6.3",
|
||||
"resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz",
|
||||
"integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==",
|
||||
"requires": {
|
||||
"truncate-utf8-bytes": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz",
|
||||
@@ -4688,6 +4696,14 @@
|
||||
"integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=",
|
||||
"dev": true
|
||||
},
|
||||
"truncate-utf8-bytes": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz",
|
||||
"integrity": "sha1-QFkjkJWS1W94pYGENLC3hInKXys=",
|
||||
"requires": {
|
||||
"utf8-byte-length": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"ts-json-schema-generator": {
|
||||
"version": "0.42.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-0.42.0.tgz",
|
||||
@@ -4930,6 +4946,11 @@
|
||||
"prepend-http": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"utf8-byte-length": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz",
|
||||
"integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E="
|
||||
},
|
||||
"utf8-bytes": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/utf8-bytes/-/utf8-bytes-0.0.1.tgz",
|
||||
|
||||
13
package.json
13
package.json
@@ -10,7 +10,7 @@
|
||||
"Jovan Krunić <jovan.krunic@gmail.com>",
|
||||
"Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
|
||||
"Michel Jonathan Schmitz",
|
||||
"Rainer Killinger",
|
||||
"Rainer Killinger <git@killinger.co>",
|
||||
"Sebastian Lange",
|
||||
"Wieland Schöbl"
|
||||
],
|
||||
@@ -37,8 +37,8 @@
|
||||
"config": "3.1.0",
|
||||
"cors": "2.8.5",
|
||||
"elasticsearch": "16.1.1",
|
||||
"express-promise-router": "3.0.3",
|
||||
"express": "4.17.1",
|
||||
"express-promise-router": "3.0.3",
|
||||
"fs-extra": "8.0.1",
|
||||
"got": "9.6.0",
|
||||
"jsonschema": "1.2.4",
|
||||
@@ -49,13 +49,14 @@
|
||||
"node-cron": "2.0.3",
|
||||
"nodemailer": "6.2.1",
|
||||
"promise-queue": "2.2.5",
|
||||
"sanitize-filename": "1.6.3",
|
||||
"ts-node": "8.2.0",
|
||||
"uuid": "3.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@openstapps/configuration": "0.21.0",
|
||||
"@types/chai-as-promised": "7.1.0",
|
||||
"@types/chai": "4.1.7",
|
||||
"@types/chai-as-promised": "7.1.0",
|
||||
"@types/config": "0.0.34",
|
||||
"@types/cors": "2.8.5",
|
||||
"@types/elasticsearch": "5.0.34",
|
||||
@@ -71,16 +72,16 @@
|
||||
"@types/sinon-express-mock": "1.3.7",
|
||||
"@types/supertest": "2.0.7",
|
||||
"@types/uuid": "3.4.5",
|
||||
"chai-as-promised": "7.1.1",
|
||||
"chai": "4.2.0",
|
||||
"chai-as-promised": "7.1.1",
|
||||
"conventional-changelog-cli": "2.0.21",
|
||||
"mocha-typescript": "1.1.17",
|
||||
"mocha": "6.1.4",
|
||||
"mocha-typescript": "1.1.17",
|
||||
"nyc": "14.1.1",
|
||||
"prepend-file-cli": "1.0.6",
|
||||
"rimraf": "2.6.3",
|
||||
"sinon-express-mock": "2.2.0",
|
||||
"sinon": "7.3.2",
|
||||
"sinon-express-mock": "2.2.0",
|
||||
"supertest": "4.0.2",
|
||||
"tslint": "5.18.0",
|
||||
"typedoc": "0.14.2",
|
||||
|
||||
@@ -20,12 +20,13 @@ import {Client} from 'elasticsearch';
|
||||
import {existsSync, writeFileSync} from 'fs';
|
||||
import {readFile} from 'fs-extra';
|
||||
import {resolve} from 'path';
|
||||
import sanitize = require('sanitize-filename');
|
||||
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 templatePath = resolve(dirPath, sanitize(`template_${coreVersion}.json`, {replacement: '-'}));
|
||||
const errorPath = resolve(dirPath, sanitize(`failed_template_${coreVersion}.json`, {replacement: '-'}));
|
||||
const errorReportPath = resolve(dirPath, sanitize(`error_report_${coreVersion}.txt`, {replacement: '-'}));
|
||||
|
||||
/**
|
||||
* Check if the correct template exists
|
||||
|
||||
Reference in New Issue
Block a user