From 9d7d8bf90a893aed653ba7c07ce415c160b3ccd2 Mon Sep 17 00:00:00 2001 From: restrry Date: Fri, 4 Oct 2019 10:15:05 +0200 Subject: [PATCH] rename IUiSettingsService --> IUiSettingsClient --- src/legacy/server/kbn_server.d.ts | 6 +++--- .../ui/ui_settings/routes/integration_tests/lib/servers.ts | 4 ++-- src/legacy/ui/ui_settings/ui_settings_service.mock.ts | 4 ++-- src/legacy/ui/ui_settings/ui_settings_service.ts | 4 ++-- src/legacy/ui/ui_settings/ui_settings_service_factory.ts | 6 +++--- .../ui/ui_settings/ui_settings_service_for_request.ts | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/legacy/server/kbn_server.d.ts b/src/legacy/server/kbn_server.d.ts index e94c1b3e54d71..b3e7078d8b5a9 100644 --- a/src/legacy/server/kbn_server.d.ts +++ b/src/legacy/server/kbn_server.d.ts @@ -39,7 +39,7 @@ import { CallClusterWithRequest, ElasticsearchPlugin } from '../core_plugins/ela import { CapabilitiesModifier } from './capabilities'; import { IndexPatternsServiceFactory } from './index_patterns'; import { Capabilities } from '../../core/public'; -import { IUiSettingsService } from '../../legacy/ui/ui_settings/ui_settings_service'; +import { IUiSettingsClient } from '../../legacy/ui/ui_settings/ui_settings_service'; import { UiSettingsServiceFactoryOptions } from '../../legacy/ui/ui_settings/ui_settings_service_factory'; export interface KibanaConfig { @@ -79,7 +79,7 @@ declare module 'hapi' { name: string, factoryFn: (request: Request) => Record ) => void; - uiSettingsServiceFactory: (options?: UiSettingsServiceFactoryOptions) => IUiSettingsService; + uiSettingsServiceFactory: (options?: UiSettingsServiceFactoryOptions) => IUiSettingsClient; logWithMetadata: (tags: string[], message: string, meta: Record) => void; } @@ -87,7 +87,7 @@ declare module 'hapi' { getSavedObjectsClient(options?: SavedObjectsClientProviderOptions): SavedObjectsClientContract; getBasePath(): string; getDefaultRoute(): Promise; - getUiSettingsService(): IUiSettingsService; + getUiSettingsService(): IUiSettingsClient; getCapabilities(): Promise; } diff --git a/src/legacy/ui/ui_settings/routes/integration_tests/lib/servers.ts b/src/legacy/ui/ui_settings/routes/integration_tests/lib/servers.ts index 1df7468a9f452..b076a2a86e166 100644 --- a/src/legacy/ui/ui_settings/routes/integration_tests/lib/servers.ts +++ b/src/legacy/ui/ui_settings/routes/integration_tests/lib/servers.ts @@ -23,7 +23,7 @@ import { SavedObjectsClientContract } from 'src/core/server'; import KbnServer from '../../../../../server/kbn_server'; import { createTestServers } from '../../../../../../test_utils/kbn_server'; import { CallCluster } from '../../../../../../legacy/core_plugins/elasticsearch'; -import { IUiSettingsService } from '../../../ui_settings_service'; +import { IUiSettingsClient } from '../../../ui_settings_service'; let kbnServer: KbnServer; let servers: ReturnType; @@ -34,7 +34,7 @@ interface AllServices { kbnServer: KbnServer; savedObjectsClient: SavedObjectsClientContract; callCluster: CallCluster; - uiSettings: IUiSettingsService; + uiSettings: IUiSettingsClient; deleteKibanaIndex: typeof deleteKibanaIndex; } diff --git a/src/legacy/ui/ui_settings/ui_settings_service.mock.ts b/src/legacy/ui/ui_settings/ui_settings_service.mock.ts index bf5fdc5eb1ced..7c1a17ebd447c 100644 --- a/src/legacy/ui/ui_settings/ui_settings_service.mock.ts +++ b/src/legacy/ui/ui_settings/ui_settings_service.mock.ts @@ -17,10 +17,10 @@ * under the License. */ -import { IUiSettingsService } from './ui_settings_service'; +import { IUiSettingsClient } from './ui_settings_service'; const createServiceMock = () => { - const mocked: jest.Mocked = { + const mocked: jest.Mocked = { getDefaults: jest.fn(), get: jest.fn(), getAll: jest.fn(), diff --git a/src/legacy/ui/ui_settings/ui_settings_service.ts b/src/legacy/ui/ui_settings/ui_settings_service.ts index d77965dedec90..57312140b16b3 100644 --- a/src/legacy/ui/ui_settings/ui_settings_service.ts +++ b/src/legacy/ui/ui_settings/ui_settings_service.ts @@ -62,7 +62,7 @@ interface UiSettingsParams { type?: UiSettingsType; } -export interface IUiSettingsService { +export interface IUiSettingsClient { getDefaults: () => Promise>; get: (key: string) => Promise; getAll: () => Promise>; @@ -77,7 +77,7 @@ export interface IUiSettingsService { * Service that provides access to the UiSettings stored in elasticsearch. * @class UiSettingsService */ -export class UiSettingsService implements IUiSettingsService { +export class UiSettingsService implements IUiSettingsClient { private readonly _type: UiSettingsServiceOptions['type']; private readonly _id: UiSettingsServiceOptions['id']; private readonly _buildNum: UiSettingsServiceOptions['buildNum']; diff --git a/src/legacy/ui/ui_settings/ui_settings_service_factory.ts b/src/legacy/ui/ui_settings/ui_settings_service_factory.ts index a65c112380510..9e1384494161c 100644 --- a/src/legacy/ui/ui_settings/ui_settings_service_factory.ts +++ b/src/legacy/ui/ui_settings/ui_settings_service_factory.ts @@ -18,7 +18,7 @@ */ import { Legacy } from 'kibana'; import { - IUiSettingsService, + IUiSettingsClient, UiSettingsService, UiSettingsServiceOptions, } from './ui_settings_service'; @@ -31,12 +31,12 @@ export type UiSettingsServiceFactoryOptions = Pick< * Create an instance of UiSettingsService that will use the * passed `savedObjectsClient` to communicate with elasticsearch * - * @return {IUiSettingsService} + * @return {IUiSettingsClient} */ export function uiSettingsServiceFactory( server: Legacy.Server, options: UiSettingsServiceFactoryOptions -): IUiSettingsService { +): IUiSettingsClient { const config = server.config(); const { savedObjectsClient, getDefaults, overrides } = options; diff --git a/src/legacy/ui/ui_settings/ui_settings_service_for_request.ts b/src/legacy/ui/ui_settings/ui_settings_service_for_request.ts index 4649a97c070ef..e265ad5f1e115 100644 --- a/src/legacy/ui/ui_settings/ui_settings_service_for_request.ts +++ b/src/legacy/ui/ui_settings/ui_settings_service_for_request.ts @@ -19,7 +19,7 @@ import { Legacy } from 'kibana'; import { uiSettingsServiceFactory } from './ui_settings_service_factory'; -import { IUiSettingsService, UiSettingsServiceOptions } from './ui_settings_service'; +import { IUiSettingsClient, UiSettingsServiceOptions } from './ui_settings_service'; type Options = Pick; /** @@ -32,13 +32,13 @@ type Options = Pick; * @param {Hapi.Request} request * @param {Object} [options={}] - * @return {IUiSettingsService} + * @return {IUiSettingsClient} */ export function getUiSettingsServiceForRequest( server: Legacy.Server, request: Legacy.Request, options: Options -): IUiSettingsService { +): IUiSettingsClient { const { getDefaults, overrides } = options; const uiSettingsService = uiSettingsServiceFactory(server, {