Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ import { registerRoutes } from './routes';
import { config as deprecationConfig, DeprecationConfigType } from './deprecation_config';
import { registerApiDeprecationsInfo, registerConfigDeprecationsInfo } from './deprecations';

/**
* Deprecation Service: Internal Start contract
*/
export interface InternalDeprecationsServiceStart {
/**
* Creates a {@link DeprecationsClient} with provided SO client and ES client.
*
* @param esClient Scoped Elasticsearch client
* @param savedObjectsClient Scoped SO Client
*/
asScopedToClient(
esClient: IScopedClusterClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,50 @@ import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-ser
* @public
*/
export interface DeprecationsServiceSetup {
/**
* Registers deprecation messages or notices for a specific feature or functionality
* within the application. This allows developers to flag certain behaviors or APIs
* as deprecated, providing guidance and warnings for future deprecation plans.
*
* @param {RegisterDeprecationsConfig} deprecationContext - The configuration object containing
* information about the deprecated features, including messages, corrective actions,
* and any relevant metadata to inform users or developers about the deprecation.
*/
registerDeprecations: (deprecationContext: RegisterDeprecationsConfig) => void;
}

/**
* Options to provide when registering deprecations via {@link DeprecationsServiceSetup.registerDeprecations}.
* @public
*/
export interface RegisterDeprecationsConfig {
/**
* Method called when the user wants to list any existing deprecations.
* Returns the list of deprecation messages to warn about.
* @param {GetDeprecationsContext} context Scoped clients and helpers to ease fetching the deprecations.
*/
getDeprecations: (context: GetDeprecationsContext) => MaybePromise<DeprecationsDetails[]>;
}

/**
* Scoped clients and helpers to ease fetching the deprecations.
* @public
*/
export interface GetDeprecationsContext {
/** Elasticsearch client scoped to the current user */
esClient: IScopedClusterClient;
/** Saved Objects client scoped to the current user and space */
savedObjectsClient: SavedObjectsClientContract;
}

/**
* Provides a method to scope the {@link DeprecationsServiceSetup | Deprecations Service} to a specific domain.
* @public
*/
export interface DeprecationRegistryProvider {
/**
* Returns the {@link DeprecationsServiceSetup | Deprecations Service} scoped to a specific domain.
* @param domainId Domain ID to categorize the deprecations reported under it.
*/
getRegistry: (domainId: string) => DeprecationsServiceSetup;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import type { DomainDeprecationDetails } from '@kbn/core-deprecations-common';
* @public
*/
export interface DeprecationsClient {
/**
* Fetch all Kibana deprecations.
*/
getAllDeprecations: () => Promise<DomainDeprecationDetails[]>;
}

Expand All @@ -23,5 +26,8 @@ export interface DeprecationsClient {
* @public
*/
export interface DeprecationsRequestHandlerContext {
/**
* {@link DeprecationsClient | Deprecations client} exposed in the request handler context.
*/
client: DeprecationsClient;
}