mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-18 15:42:54 +00:00
ci: make mapping test work for new mappings
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user