kibana/x-pack/plugins/rollup/server/types.ts
Mikhail Shustov 99cd66f72d
[Core] Explicit typings for request handler context (#88718) (#88975)
* move context to server part. couple with RequestHandlerContext

Context implementation will be simplified in follow-up.

* adopt core code

* adopt bfetch code

* adopt data code

* adopt search examples

* adopt vis_type_timelion

* adopt vis_type_timeseries

* adopt plugin functional tests

* adopt actions

* adopt alerting plugin

* adopt APM plugin

* adopt beats_management

* adopt case plugin

* adopt cross_cluster_replication

* adopt data_enhanced

* adopt event_log

* adopt global_search

* adopt index_management

* adopt infra

* adopt licensing

* adopt lists

* adopt logstash

* adopt reporting

* adopt observability

* adopt monitoring

* adopt rollup

* adopt so tagging

* adopt security

* adopt security_solutions

* adopt watcher

* adopt uptime

* adopt spaces

* adopt snapshot_restore

* adopt features changes

* mute error when null used to extend context

* update docs

* small cleanup

* add type safety for return type

* refactor registerRouteHandlerContext type

* update docs

* update license header

* update docs

* fix type error. fetch body does not accept array of strings

* fix telemetry test

* remove unnecessary ts-ignore

* address comments

* update docs
# Conflicts:
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.start.md
#	src/plugins/data/server/server.api.md
#	x-pack/plugins/monitoring/server/plugin.ts
2021-01-21 18:13:51 +01:00

59 lines
1.8 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { IRouter, ILegacyScopedClusterClient, RequestHandlerContext } from 'src/core/server';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import { VisTypeTimeseriesSetup } from 'src/plugins/vis_type_timeseries/server';
import { getCapabilitiesForRollupIndices } from 'src/plugins/data/server';
import { IndexManagementPluginSetup } from '../../index_management/server';
import { PluginSetupContract as FeaturesPluginSetup } from '../../features/server';
import { LicensingPluginSetup } from '../../licensing/server';
import { License } from './services';
import { IndexPatternsFetcher } from './shared_imports';
import { isEsError } from './shared_imports';
import { formatEsError } from './lib/format_es_error';
export interface Dependencies {
indexManagement?: IndexManagementPluginSetup;
visTypeTimeseries?: VisTypeTimeseriesSetup;
usageCollection?: UsageCollectionSetup;
licensing: LicensingPluginSetup;
features: FeaturesPluginSetup;
}
export interface RouteDependencies {
router: RollupPluginRouter;
license: License;
lib: {
isEsError: typeof isEsError;
formatEsError: typeof formatEsError;
getCapabilitiesForRollupIndices: typeof getCapabilitiesForRollupIndices;
};
sharedImports: {
IndexPatternsFetcher: typeof IndexPatternsFetcher;
};
}
/**
* @internal
*/
interface RollupApiRequestHandlerContext {
client: ILegacyScopedClusterClient;
}
/**
* @internal
*/
export interface RollupHandlerContext extends RequestHandlerContext {
rollup: RollupApiRequestHandlerContext;
}
/**
* @internal
*/
export type RollupPluginRouter = IRouter<RollupHandlerContext>;