ci: make mapping test work for new mappings

This commit is contained in:
Wieland Schöbl
2019-11-05 13:26:33 +01:00
parent 8f7201e2cf
commit 19ef656289
5 changed files with 30735 additions and 31669 deletions

View File

@@ -35,8 +35,8 @@ import {settings} from './mappings/definitions/settings';
import {dynamicTypes, ElasticsearchDataType, typemap} from './mappings/definitions/typemap';
import {
ElasticsearchDynamicTemplate,
ElasticsearchMappings,
ElasticsearchObject, ElasticsearchType,
ElasticsearchObject, ElasticsearchTemplateCollection,
ElasticsearchType,
ElasticsearchValue,
} from './mappings/mapping-definitions';
@@ -172,9 +172,11 @@ function handleExternalType(ref: ReferenceType, generics: Map<string, Elasticsea
return {type: ElasticsearchDataType.parse_error};
}
return readFieldTags(handleType(ref.typeArguments[0], getReflectionGeneric(ref, new Map(generics), path,
topTypeName, tags),
path, topTypeName, tags),
return readFieldTags(
handleType(
ref.typeArguments[0], getReflectionGeneric(
ref, new Map(generics), path, topTypeName, tags),
path, topTypeName, tags),
path, topTypeName, tags);
}
if (ref.name === '__type') { // empty object
@@ -531,7 +533,7 @@ function readTypeTags(type: string, path: string, topTypeName: string, tags: Com
*/
export function generateTemplate(projectReflection: ProjectReflection, ignoredTags: string[], showErrorOutput = true):
// tslint:disable-next-line:completed-docs
{ aggregations: AggregationSchema; errors: string[]; mappings: ElasticsearchMappings; } {
{ aggregations: AggregationSchema; errors: string[]; mappings: ElasticsearchTemplateCollection; } {
errors = [];
aggregations = {
'@all': {
@@ -548,7 +550,7 @@ export function generateTemplate(projectReflection: ProjectReflection, ignoredTa
const indexableInterfaces = getAllIndexableInterfaces(projectReflection);
const out: ElasticsearchMappings = {};
const out: ElasticsearchTemplateCollection = {};
for (const _interface of indexableInterfaces) {
if (!Array.isArray(_interface.children) || _interface.children.length === 0) {
@@ -604,7 +606,7 @@ export function generateTemplate(projectReflection: ProjectReflection, ignoredTa
settings: settings,
template: `stapps_${typeNameWithoutSpaces}*`,
}
;
;
out[templateName].mappings[typeName].properties.creation_date = {
type: ElasticsearchDataType.date,
};