mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
fix remaining errors
This commit is contained in:
parent
4f6a79d407
commit
39c5e1cb5c
14 changed files with 17 additions and 17 deletions
|
@ -218,7 +218,7 @@ export async function getTile({
|
|||
|
||||
// Todo: pass in epochMillies-fields
|
||||
const featureCollection = hitsToGeoJson(
|
||||
// @ts-expect-error hitsToGeoJson should be refactored to accept estypes.Hit
|
||||
// @ts-expect-error hitsToGeoJson should be refactored to accept estypes.SearchTypesHit
|
||||
documentsResponse.rawResponse.hits.hits,
|
||||
(hit: Record<string, unknown>) => {
|
||||
return flattenHit(geometryFieldName, hit);
|
||||
|
|
|
@ -13,7 +13,7 @@ export type Datafeed = estypes.Datafeed;
|
|||
|
||||
export type ChunkingConfig = estypes.ChunkingConfig;
|
||||
|
||||
export type Aggregation = Record<string, estypes.AggregationContainer>;
|
||||
export type Aggregation = Record<string, estypes.AggregationsAggregationContainer>;
|
||||
|
||||
// export type IndicesOptions = estypes.IndicesOptions;
|
||||
export interface IndicesOptions {
|
||||
|
|
|
@ -76,7 +76,7 @@ export interface DataFrameAnalyticsConfig {
|
|||
};
|
||||
source: {
|
||||
index: IndexName | IndexName[];
|
||||
query?: estypes.QueryContainer;
|
||||
query?: estypes.QueryDslQueryContainer;
|
||||
runtime_mappings?: RuntimeMappings;
|
||||
};
|
||||
analysis: AnalysisConfig;
|
||||
|
|
|
@ -78,7 +78,7 @@ export function isMappableJob(job: CombinedJob, detectorIndex: number): boolean
|
|||
* if composite is defined.
|
||||
* @param buckets
|
||||
*/
|
||||
export function hasValidComposite(buckets: estypes.AggregationContainer) {
|
||||
export function hasValidComposite(buckets: estypes.AggregationsAggregationContainer) {
|
||||
if (
|
||||
isPopulatedObject(buckets, ['composite']) &&
|
||||
isPopulatedObject(buckets.composite, ['sources']) &&
|
||||
|
@ -157,7 +157,7 @@ export function isSourceDataChartableForDetector(job: CombinedJob, detectorIndex
|
|||
}
|
||||
// if fieldName is an aggregated field under nested terms using bucket_script
|
||||
const aggregations =
|
||||
getAggregations<estypes.AggregationContainer>(aggs[aggBucketsName]) ?? {};
|
||||
getAggregations<estypes.AggregationsAggregationContainer>(aggs[aggBucketsName]) ?? {};
|
||||
const foundField = findAggField(aggregations, dtr.field_name, false);
|
||||
if (foundField?.bucket_script !== undefined) {
|
||||
return false;
|
||||
|
|
|
@ -44,7 +44,7 @@ export function buildBaseFilterCriteria(
|
|||
export function buildSamplerAggregation(
|
||||
aggs: any,
|
||||
samplerShardSize: number
|
||||
): Record<string, estypes.AggregationContainer> {
|
||||
): Record<string, estypes.AggregationsAggregationContainer> {
|
||||
if (samplerShardSize < 1) {
|
||||
return aggs;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ export type FactoryQueryTypes = OsqueryQueries;
|
|||
|
||||
export interface RequestBasicOptions extends IEsSearchRequest {
|
||||
filterQuery: ESQuery | string | undefined;
|
||||
aggregations?: Record<string, estypes.AggregationContainer>;
|
||||
aggregations?: Record<string, estypes.AggregationsAggregationContainer>;
|
||||
docValueFields?: DocValueFields[];
|
||||
factoryQueryType?: FactoryQueryTypes;
|
||||
}
|
||||
|
|
|
@ -85,7 +85,6 @@ export class ReportingStore {
|
|||
try {
|
||||
await client.indices.create({
|
||||
index: indexName,
|
||||
// @ts-expect-error @elastic/elasticsearch types don't support nested mappings
|
||||
body,
|
||||
});
|
||||
|
||||
|
|
|
@ -81,7 +81,6 @@ const getSavedObjectsList = async ({
|
|||
ignore_unavailable: true,
|
||||
index: kibanaIndex,
|
||||
size: ES_MAX_RESULT_WINDOW_DEFAULT_VALUE,
|
||||
// @ts-expect-error@elastic/elasticsearch _source does not exist in type SearchRequest
|
||||
_source: filterPath,
|
||||
});
|
||||
return esResponse;
|
||||
|
|
|
@ -17,7 +17,10 @@ export function defineGetBuiltinPrivilegesRoutes({ router }: RouteDefinitionPara
|
|||
|
||||
// Exclude the `none` privilege, as it doesn't make sense as an option within the Kibana UI
|
||||
privileges.cluster = privileges.cluster.filter((privilege) => privilege !== 'none');
|
||||
privileges.index = privileges.index.filter((privilege) => privilege !== 'none');
|
||||
const indexPriviledges = Array.isArray(privileges.index)
|
||||
? privileges.index
|
||||
: [privileges.index];
|
||||
privileges.index = indexPriviledges.filter((privilege) => privilege !== 'none');
|
||||
|
||||
return response.ok({ body: privileges });
|
||||
}
|
||||
|
|
|
@ -339,7 +339,6 @@ export class SessionIndex {
|
|||
try {
|
||||
await this.options.elasticsearchClient.indices.putTemplate({
|
||||
name: sessionIndexTemplateName,
|
||||
// @ts-expect-error @elastic-elasticsearch types don't support nested properties
|
||||
body: getSessionIndexTemplate(this.indexName),
|
||||
});
|
||||
this.options.logger.debug('Successfully created session index template.');
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import type { estypes } from '@elastic/elasticsearch';
|
||||
import { ElasticsearchClient } from 'src/core/server';
|
||||
|
||||
export type ESLicense = estypes.LicenseInformation;
|
||||
export type ESLicense = estypes.LicenseGetLicenseLicenseInformation;
|
||||
|
||||
let cachedLicense: ESLicense | undefined;
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ function mockEsClient() {
|
|||
cluster_uuid: 'test',
|
||||
cluster_name: 'test',
|
||||
version: { number: '8.0.0' } as estypes.ElasticsearchVersionInfo,
|
||||
} as estypes.RootNodeInfoResponse,
|
||||
} as estypes.InfoResponse,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ export function registerTransformsRoutes(routeDependencies: RouteDependencies) {
|
|||
const {
|
||||
body,
|
||||
} = await ctx.core.elasticsearch.client.asCurrentUser.transform.updateTransform({
|
||||
// @ts-expect-error query doesn't satisfy QueryContainer from @elastic/elasticsearch
|
||||
// @ts-expect-error query doesn't satisfy QueryDslQueryContainer from @elastic/elasticsearch
|
||||
body: req.body,
|
||||
transform_id: transformId,
|
||||
});
|
||||
|
|
|
@ -47,7 +47,7 @@ export const getSignalsWithES = async ({
|
|||
es: KibanaClient;
|
||||
indices: string | string[];
|
||||
ids: string | string[];
|
||||
}): Promise<Map<string, Map<string, estypes.Hit<SignalHit>>>> => {
|
||||
}): Promise<Map<string, Map<string, estypes.SearchTypesHit<SignalHit>>>> => {
|
||||
const signals: ApiResponse<estypes.SearchResponse<SignalHit>> = await es.search({
|
||||
index: indices,
|
||||
body: {
|
||||
|
@ -69,13 +69,13 @@ export const getSignalsWithES = async ({
|
|||
return signals.body.hits.hits.reduce((acc, hit) => {
|
||||
let indexMap = acc.get(hit._index);
|
||||
if (indexMap === undefined) {
|
||||
indexMap = new Map<string, estypes.Hit<SignalHit>>([[hit._id, hit]]);
|
||||
indexMap = new Map<string, estypes.SearchTypesHit<SignalHit>>([[hit._id, hit]]);
|
||||
} else {
|
||||
indexMap.set(hit._id, hit);
|
||||
}
|
||||
acc.set(hit._index, indexMap);
|
||||
return acc;
|
||||
}, new Map<string, Map<string, estypes.Hit<SignalHit>>>());
|
||||
}, new Map<string, Map<string, estypes.SearchTypesHit<SignalHit>>>());
|
||||
};
|
||||
|
||||
interface SetStatusCasesParams {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue