fix(core): Resolve TypeScript strict mode and ES client API compatibility issues for v3.0.0
- Fix ES client v8+ API: use document/doc instead of body for index/update operations - Add type assertions (as any) for ES client ILM, template, and search APIs - Fix strict null checks with proper undefined handling (nullish coalescing) - Fix MetricsCollector interface to match required method signatures - Fix Logger.error signature compatibility in plugins - Resolve TermsQuery type index signature conflict - Remove sourceMap from tsconfig (handled by tsbuild with inlineSourceMap)
This commit is contained in:
@@ -14,7 +14,6 @@ import type {
|
||||
FieldDefinition,
|
||||
SchemaMigration,
|
||||
MigrationHistoryEntry,
|
||||
MigrationStatus,
|
||||
SchemaManagerConfig,
|
||||
SchemaValidationResult,
|
||||
SchemaDiff,
|
||||
@@ -144,7 +143,7 @@ export class SchemaManager {
|
||||
index,
|
||||
...mapping,
|
||||
timeout: `${this.config.timeout}ms`,
|
||||
});
|
||||
} as any);
|
||||
|
||||
if (this.config.enableLogging) {
|
||||
this.logger.info('Mapping updated', {
|
||||
@@ -183,7 +182,7 @@ export class SchemaManager {
|
||||
index,
|
||||
settings,
|
||||
timeout: `${this.config.timeout}ms`,
|
||||
});
|
||||
} as any);
|
||||
} finally {
|
||||
if (requiresClose) {
|
||||
await client.indices.open({ index });
|
||||
@@ -559,7 +558,7 @@ export class SchemaManager {
|
||||
template: template.template,
|
||||
data_stream: template.data_stream,
|
||||
_meta: template._meta,
|
||||
});
|
||||
} as any);
|
||||
|
||||
this.stats.totalTemplates++;
|
||||
|
||||
@@ -586,11 +585,11 @@ export class SchemaManager {
|
||||
|
||||
return {
|
||||
name: template.name,
|
||||
index_patterns: template.index_template.index_patterns,
|
||||
index_patterns: template.index_template.index_patterns as string[],
|
||||
priority: template.index_template.priority,
|
||||
version: template.index_template.version,
|
||||
composed_of: template.index_template.composed_of,
|
||||
template: template.index_template.template,
|
||||
template: template.index_template.template as IndexTemplate['template'],
|
||||
data_stream: template.index_template.data_stream,
|
||||
_meta: template.index_template._meta,
|
||||
};
|
||||
@@ -638,7 +637,7 @@ export class SchemaManager {
|
||||
template: template.template,
|
||||
version: template.version,
|
||||
_meta: template._meta,
|
||||
});
|
||||
} as any);
|
||||
|
||||
if (this.config.enableLogging) {
|
||||
this.logger.info('Component template created/updated', { name: template.name });
|
||||
@@ -667,7 +666,8 @@ export class SchemaManager {
|
||||
|
||||
if (aliases.add) {
|
||||
for (const [alias, config] of Object.entries(aliases.add)) {
|
||||
actions.push({ add: { index, alias, ...config } });
|
||||
const configObj = config as Record<string, unknown>;
|
||||
actions.push({ add: { index, alias, ...configObj } });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user