mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 00:52:55 +00:00
refactor: migrate es mapping types from es-mapping-generator to .d.ts next to generated mappings
This commit is contained in:
@@ -36,8 +36,8 @@ import {fieldmap, filterableMap, filterableTagName} from './config/fieldmap';
|
||||
import {premaps} from './config/premap';
|
||||
import {settings} from './config/settings';
|
||||
import {dynamicTypes, isTagType, MISSING_PREMAP, PARSE_ERROR, TYPE_CONFLICT, typemap} from './config/typemap';
|
||||
import {AggregationSchema, ESNestedAggregation} from './types/aggregation';
|
||||
import {ElasticsearchTemplateCollection, MappingGenTemplate} from './types/mapping';
|
||||
import type {AggregationSchema, ESNestedAggregation} from '../schema/aggregations';
|
||||
import type {ElasticsearchTemplateCollection, MappingGenTemplate} from '../schema/mappings';
|
||||
import * as console from 'console';
|
||||
|
||||
let dynamicTemplates: Record<string, MappingDynamicTemplate>[] = [];
|
||||
@@ -862,10 +862,8 @@ export function generateTemplate(
|
||||
},
|
||||
};
|
||||
|
||||
let typeNameWithoutSpaces = typeName.toLowerCase();
|
||||
while (typeNameWithoutSpaces.includes(' ')) {
|
||||
typeNameWithoutSpaces = typeNameWithoutSpaces.replace(' ', '_');
|
||||
}
|
||||
// eslint-disable-next-line unicorn/prefer-string-replace-all
|
||||
const typeNameWithoutSpaces = typeName.toLowerCase().replace(/\s/g, '_');
|
||||
const templateName = `template_${typeNameWithoutSpaces}`;
|
||||
|
||||
out[templateName] = {
|
||||
|
||||
Reference in New Issue
Block a user