mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Adapt internal core imports to use @kbn-logging
(#132900)
* Adapt internal core imports to use `@kbn-logging` * remove re-export of logger mocks * re-export @kbn/logging types from the entrypoint now * fix missing imports * update generated doc * update generated doc
This commit is contained in:
parent
7f2c3698e9
commit
a044026920
78 changed files with 91 additions and 115 deletions
|
@ -10,10 +10,10 @@ Set of helpers used to create `KibanaResponse` to form HTTP response on an incom
|
|||
|
||||
```typescript
|
||||
kibanaResponseFactory: {
|
||||
custom: <T extends string | Record<string, any> | Error | Buffer | Stream | {
|
||||
custom: <T extends string | Record<string, any> | Error | Buffer | {
|
||||
message: string | Error;
|
||||
attributes?: ResponseErrorAttributes | undefined;
|
||||
} | undefined>(options: CustomHttpResponseOptions<T>) => KibanaResponse<T>;
|
||||
} | Stream | undefined>(options: CustomHttpResponseOptions<T>) => KibanaResponse<T>;
|
||||
badRequest: (options?: ErrorHttpResponseOptions) => KibanaResponse<string | Error | {
|
||||
message: string | Error;
|
||||
attributes?: ResponseErrorAttributes | undefined;
|
||||
|
@ -34,10 +34,10 @@ kibanaResponseFactory: {
|
|||
message: string | Error;
|
||||
attributes?: ResponseErrorAttributes | undefined;
|
||||
}>;
|
||||
customError: (options: CustomHttpResponseOptions<ResponseError | Buffer | Stream>) => KibanaResponse<string | Error | Buffer | Stream | {
|
||||
customError: (options: CustomHttpResponseOptions<ResponseError | Buffer | Stream>) => KibanaResponse<string | Error | Buffer | {
|
||||
message: string | Error;
|
||||
attributes?: ResponseErrorAttributes | undefined;
|
||||
}>;
|
||||
} | Stream>;
|
||||
redirected: (options: RedirectResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
|
||||
ok: (options?: HttpResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
|
||||
accepted: (options?: HttpResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { Logger } from '@kbn/logging';
|
||||
import { Capabilities, CapabilitiesProvider, CapabilitiesSwitcher } from './types';
|
||||
import { CoreContext } from '../core_context';
|
||||
import { Logger } from '../logging';
|
||||
import { InternalHttpServicePreboot, InternalHttpServiceSetup, KibanaRequest } from '../http';
|
||||
import { mergeCapabilities } from './merge_capabilities';
|
||||
import { getCapabilitiesResolver, CapabilitiesResolver } from './resolve_capabilities';
|
||||
|
|
|
@ -11,12 +11,12 @@ import { stringify } from 'querystring';
|
|||
import { Env } from '@kbn/config';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { fromRoot } from '@kbn/utils';
|
||||
import { Logger } from '@kbn/logging';
|
||||
|
||||
import { IRouter, IBasePath, IKibanaResponse, KibanaResponseFactory, KibanaRequest } from '../http';
|
||||
import { HttpResources, HttpResourcesServiceToolkit } from '../http_resources';
|
||||
import { InternalCorePreboot, InternalCoreSetup } from '../internal_types';
|
||||
import { CoreContext } from '../core_context';
|
||||
import { Logger } from '../logging';
|
||||
import { registerBundleRoutes } from './bundle_routes';
|
||||
import { UiPlugins } from '../plugins';
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { LoggerFactory } from '@kbn/logging';
|
||||
import { IConfigService, Env } from './config';
|
||||
import { LoggerFactory } from './logging';
|
||||
|
||||
/** @internal */
|
||||
export type CoreId = symbol;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import type { GetDeprecationsContext } from './types';
|
||||
import { DeprecationsFactory, DeprecationsFactoryConfig } from './deprecations_factory';
|
||||
import { loggerMock } from '../logging/logger.mock';
|
||||
import { loggerMock } from '@kbn/logging-mocks';
|
||||
import { DeprecationsDetails } from './types';
|
||||
|
||||
describe('DeprecationsFactory', () => {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { DeprecationsRegistry } from './deprecations_registry';
|
||||
import type { Logger } from '../logging';
|
||||
import type {
|
||||
DomainDeprecationDetails,
|
||||
DeprecationsDetails,
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { DeprecationsFactory } from './deprecations_factory';
|
||||
import { DomainDeprecationDetails, RegisterDeprecationsConfig } from './types';
|
||||
import { registerRoutes } from './routes';
|
||||
|
@ -16,7 +17,6 @@ import { CoreContext } from '../core_context';
|
|||
import { IConfigService } from '../config';
|
||||
import { CoreService } from '../../types';
|
||||
import { InternalHttpServiceSetup } from '../http';
|
||||
import { Logger } from '../logging';
|
||||
import { IScopedClusterClient } from '../elasticsearch/client';
|
||||
import { SavedObjectsClientContract } from '../saved_objects/types';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import type { Client } from '@elastic/elasticsearch';
|
||||
import { Logger } from '../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { IAuthHeadersStorage, Headers, isKibanaRequest, isRealRequest } from '../../http';
|
||||
import { ensureRawRequest, filterHeaders } from '../../http/router';
|
||||
import { ScopeableRequest } from '../types';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { Client, HttpConnection } from '@elastic/elasticsearch';
|
||||
import { Logger } from '../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { parseClientOptions, ElasticsearchClientConfig } from './client_config';
|
||||
import { instrumentEsQueryAndDeprecationLogger } from './log_query_and_deprecation';
|
||||
import { createTransport } from './create_transport';
|
||||
|
|
|
@ -10,9 +10,9 @@ import { Buffer } from 'buffer';
|
|||
import { stringify } from 'querystring';
|
||||
import { errors, DiagnosticResult, RequestBody, Client } from '@elastic/elasticsearch';
|
||||
import numeral from '@elastic/numeral';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import type { ElasticsearchErrorDetails } from './types';
|
||||
import { getEcsResponseLog } from './get_ecs_response_log';
|
||||
import { Logger } from '../../logging';
|
||||
|
||||
const convertQueryString = (qs: string | Record<string, any> | undefined): string => {
|
||||
if (qs === undefined || typeof qs === 'string') {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import { defer, throwError, iif, timer } from 'rxjs';
|
||||
import { concatMap, retryWhen } from 'rxjs/operators';
|
||||
import { Logger } from '../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
|
||||
const retryResponseStatuses = [
|
||||
503, // ServiceUnavailable
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
import { firstValueFrom, Observable, Subject } from 'rxjs';
|
||||
import { map, shareReplay, takeUntil } from 'rxjs/operators';
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { registerAnalyticsContextProvider } from './register_analytics_context_provider';
|
||||
import { AnalyticsServiceSetup } from '../analytics';
|
||||
import { CoreService } from '../../types';
|
||||
import { CoreContext } from '../core_context';
|
||||
import { Logger } from '../logging';
|
||||
|
||||
import { ClusterClient, ElasticsearchClientConfig } from './client';
|
||||
import { ElasticsearchConfig, ElasticsearchConfigType } from './elasticsearch_config';
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
|
||||
import { timer, of, from, Observable } from 'rxjs';
|
||||
import { map, distinctUntilChanged, catchError, exhaustMap } from 'rxjs/operators';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import {
|
||||
esVersionCompatibleWithKibana,
|
||||
esVersionEqualsKibana,
|
||||
} from './es_kibana_version_compatability';
|
||||
import { Logger } from '../../logging';
|
||||
import type { ElasticsearchClient } from '../client';
|
||||
|
||||
/** @public */
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
|
||||
import { PathConfigType } from '@kbn/utils';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { mkdir } from './fs';
|
||||
import { Logger } from '../logging';
|
||||
|
||||
export async function createDataFolder({
|
||||
pathConfig,
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
import { firstValueFrom, of } from 'rxjs';
|
||||
import { PathConfigType, config as pathConfigDef } from '@kbn/utils';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import type { AnalyticsServicePreboot } from '../analytics';
|
||||
import { CoreContext } from '../core_context';
|
||||
import { Logger } from '../logging';
|
||||
import { IConfigService } from '../config';
|
||||
import { HttpConfigType, config as httpConfigDef } from '../http';
|
||||
import { PidConfigType, config as pidConfigDef } from './pid_config';
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
import uuid from 'uuid';
|
||||
import { join } from 'path';
|
||||
import { PathConfigType } from '@kbn/utils';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { readFile, writeFile } from './fs';
|
||||
import { HttpConfigType } from '../http';
|
||||
import { Logger } from '../logging';
|
||||
import { uuidRegexp } from '../http/http_config';
|
||||
|
||||
const FILE_ENCODING = 'utf8';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import { unlinkSync as unlink } from 'fs';
|
||||
import once from 'lodash/once';
|
||||
import { Logger } from '../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { writeFile, exists } from './fs';
|
||||
import { PidConfigType } from './pid_config';
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@ import apm from 'elastic-apm-node';
|
|||
import { isUndefined, omitBy } from 'lodash';
|
||||
import type { Subscription } from 'rxjs';
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import type { CoreService, KibanaExecutionContext } from '../../types';
|
||||
import type { CoreContext } from '../core_context';
|
||||
import type { Logger } from '../logging';
|
||||
import type { ExecutionContextConfigType } from './execution_context_config';
|
||||
|
||||
import {
|
||||
|
|
|
@ -22,7 +22,7 @@ import type { Duration } from 'moment';
|
|||
import { firstValueFrom, Observable } from 'rxjs';
|
||||
import { take } from 'rxjs/operators';
|
||||
import apm from 'elastic-apm-node';
|
||||
import { Logger, LoggerFactory } from '../logging';
|
||||
import type { Logger, LoggerFactory } from '@kbn/logging';
|
||||
import { HttpConfig } from './http_config';
|
||||
import type { InternalExecutionContextSetup } from '../execution_context';
|
||||
import { adoptToHapiAuthFormat, AuthenticationHandler } from './lifecycle/auth';
|
||||
|
|
|
@ -10,10 +10,10 @@ import { Observable, Subscription, combineLatest, firstValueFrom } from 'rxjs';
|
|||
import { map } from 'rxjs/operators';
|
||||
import { pick } from '@kbn/std';
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import type { RequestHandlerContext } from '..';
|
||||
import type { InternalExecutionContextSetup } from '../execution_context';
|
||||
import { CoreService } from '../../types';
|
||||
import { Logger } from '../logging';
|
||||
import { ContextSetup, InternalContextPreboot } from '../context';
|
||||
import { Env } from '../config';
|
||||
import { CoreContext } from '../core_context';
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
import { Request, ResponseToolkit, Server } from '@hapi/hapi';
|
||||
import { format as formatUrl } from 'url';
|
||||
import { createServer, getListenerOptions, getServerOptions } from '@kbn/server-http-tools';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
|
||||
import { Logger } from '../logging';
|
||||
import { HttpConfig } from './http_config';
|
||||
|
||||
export class HttpsRedirectServer {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { Lifecycle, Request, ResponseToolkit } from '@hapi/hapi';
|
||||
import { Logger } from '../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import {
|
||||
HapiResponseAdapter,
|
||||
KibanaRequest,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi';
|
||||
import { Logger } from '../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import {
|
||||
HapiResponseAdapter,
|
||||
KibanaRequest,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi';
|
||||
import { Logger } from '../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import {
|
||||
HapiResponseAdapter,
|
||||
KibanaRequest,
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
ResponseToolkit as HapiResponseToolkit,
|
||||
} from '@hapi/hapi';
|
||||
import Boom from '@hapi/boom';
|
||||
import { Logger } from '../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
|
||||
import { HapiResponseAdapter, KibanaRequest, ResponseHeaders } from '../router';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi';
|
||||
import { Logger } from '../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import {
|
||||
HapiResponseAdapter,
|
||||
KibanaRequest,
|
||||
|
|
|
@ -14,7 +14,7 @@ import { createReadStream } from 'fs';
|
|||
import { PassThrough } from 'stream';
|
||||
import { createGunzip, createGzip } from 'zlib';
|
||||
|
||||
import { loggerMock, MockedLogger } from '../../logging/logger.mock';
|
||||
import { loggerMock, MockedLogger } from '@kbn/logging-mocks';
|
||||
|
||||
import { getResponsePayloadBytes } from './get_payload_size';
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { ReadStream } from 'fs';
|
|||
import { Zlib } from 'zlib';
|
||||
import { isBoom } from '@hapi/boom';
|
||||
import type { Request } from '@hapi/hapi';
|
||||
import { Logger } from '../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
|
||||
type Response = Request['response'];
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import type { Request } from '@hapi/hapi';
|
||||
import Boom from '@hapi/boom';
|
||||
import { loggerMock, MockedLogger } from '../../logging/logger.mock';
|
||||
import { loggerMock, MockedLogger } from '@kbn/logging-mocks';
|
||||
import { getEcsResponseLog } from './get_response_log';
|
||||
|
||||
jest.mock('./get_payload_size', () => ({
|
||||
|
|
|
@ -10,8 +10,7 @@ import querystring from 'querystring';
|
|||
import { isBoom } from '@hapi/boom';
|
||||
import type { Request } from '@hapi/hapi';
|
||||
import numeral from '@elastic/numeral';
|
||||
import { LogMeta } from '@kbn/logging';
|
||||
import { Logger } from '../../logging';
|
||||
import type { LogMeta, Logger } from '@kbn/logging';
|
||||
import { getResponsePayloadBytes } from './get_payload_size';
|
||||
import type { KibanaRequestState } from '../router';
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import { Request, ResponseObject, ResponseToolkit } from '@hapi/hapi';
|
|||
import Boom from '@hapi/boom';
|
||||
|
||||
import { isConfigSchema } from '@kbn/config-schema';
|
||||
import { Logger } from '../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import {
|
||||
isUnauthorizedError as isElasticsearchUnauthorizedError,
|
||||
UnauthorizedError as EsNotAuthorizedError,
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { RequestHandlerContext } from '..';
|
||||
|
||||
import { CoreContext } from '../core_context';
|
||||
|
@ -18,7 +19,6 @@ import {
|
|||
InternalHttpServicePreboot,
|
||||
} from '../http';
|
||||
|
||||
import { Logger } from '../logging';
|
||||
import { InternalRenderingServicePreboot, InternalRenderingServiceSetup } from '../rendering';
|
||||
import { CoreService } from '../../types';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { Logger } from '../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { IConfigService } from '../config';
|
||||
import { CoreContext } from '../core_context';
|
||||
import { InternalHttpServicePreboot, InternalHttpServiceSetup } from '../http';
|
||||
|
|
|
@ -242,6 +242,12 @@ export type {
|
|||
} from './http_resources';
|
||||
|
||||
export type { IRenderOptions } from './rendering';
|
||||
export type {
|
||||
LoggingServiceSetup,
|
||||
LoggerContextConfigInput,
|
||||
LoggerConfigType,
|
||||
AppenderConfigType,
|
||||
} from './logging';
|
||||
export type {
|
||||
Logger,
|
||||
LoggerFactory,
|
||||
|
@ -253,11 +259,7 @@ export type {
|
|||
LogMeta,
|
||||
LogRecord,
|
||||
LogLevel,
|
||||
LoggingServiceSetup,
|
||||
LoggerContextConfigInput,
|
||||
LoggerConfigType,
|
||||
AppenderConfigType,
|
||||
} from './logging';
|
||||
} from '@kbn/logging';
|
||||
|
||||
export { PluginType } from './plugins';
|
||||
|
||||
|
|
|
@ -5,22 +5,7 @@
|
|||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
export { LogLevel } from '@kbn/logging';
|
||||
export type {
|
||||
DisposableAppender,
|
||||
Appender,
|
||||
Ecs,
|
||||
EcsEventCategory,
|
||||
EcsEventKind,
|
||||
EcsEventOutcome,
|
||||
EcsEventType,
|
||||
LogRecord,
|
||||
Layout,
|
||||
LoggerFactory,
|
||||
LogMeta,
|
||||
Logger,
|
||||
LogLevelId,
|
||||
} from '@kbn/logging';
|
||||
|
||||
export { config } from './logging_config';
|
||||
export type {
|
||||
LoggingConfigType,
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
export { loggerMock } from '@kbn/logging-mocks';
|
||||
export type { MockedLogger } from '@kbn/logging-mocks';
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { Logger } from '.';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { LoggerAdapter } from './logger_adapter';
|
||||
|
||||
test('proxies all method calls to the internal logger.', () => {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// Test helpers to simplify mocking logs and collecting all their outputs
|
||||
import { LoggerFactory } from '@kbn/logging';
|
||||
import { ILoggingSystem } from './logging_system';
|
||||
import { loggerMock, MockedLogger } from './logger.mock';
|
||||
import { loggerMock, MockedLogger } from '@kbn/logging-mocks';
|
||||
|
||||
const createLoggingSystemMock = () => {
|
||||
const mockLog = loggerMock.create();
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
*/
|
||||
|
||||
import { firstValueFrom, ReplaySubject } from 'rxjs';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { CoreService } from '../../types';
|
||||
import { CoreContext } from '../core_context';
|
||||
import { Logger } from '../logging';
|
||||
import { InternalHttpServiceSetup } from '../http';
|
||||
import { InternalMetricsServiceSetup, InternalMetricsServiceStart, OpsMetrics } from './types';
|
||||
import { OpsMetricsCollector } from './ops_metrics_collector';
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
import { from, merge } from 'rxjs';
|
||||
import { catchError, filter, map, mergeMap, concatMap, shareReplay, toArray } from 'rxjs/operators';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { CoreContext } from '../../core_context';
|
||||
import { Logger } from '../../logging';
|
||||
import { PluginWrapper } from '../plugin';
|
||||
import { createPluginInitializerContext, InstanceInfo } from '../plugin_context';
|
||||
import { PluginsConfig } from '../plugins_config';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { PathLike, readdir, stat, Stats } from 'fs';
|
|||
import { resolve } from 'path';
|
||||
import { bindNodeCallback, from, Observable } from 'rxjs';
|
||||
import { catchError, mergeMap } from 'rxjs/operators';
|
||||
import { Logger } from '../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { PluginDiscoveryError } from './plugin_discovery_error';
|
||||
|
||||
const fsReadDir$ = bindNodeCallback<[string], [string[]]>(readdir);
|
||||
|
|
|
@ -11,8 +11,8 @@ import typeDetect from 'type-detect';
|
|||
import { firstValueFrom, Subject } from 'rxjs';
|
||||
import { isPromise } from '@kbn/std';
|
||||
import { isConfigSchema } from '@kbn/config-schema';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
|
||||
import { Logger } from '../logging';
|
||||
import {
|
||||
AsyncPlugin,
|
||||
Plugin,
|
||||
|
|
|
@ -11,9 +11,9 @@ import { firstValueFrom, Observable } from 'rxjs';
|
|||
import { filter, map, tap, toArray } from 'rxjs/operators';
|
||||
import { getFlattenedObject } from '@kbn/std';
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { CoreService } from '../../types';
|
||||
import { CoreContext } from '../core_context';
|
||||
import { Logger } from '../logging';
|
||||
import { discover, PluginDiscoveryError, PluginDiscoveryErrorType } from './discovery';
|
||||
import { PluginWrapper } from './plugin';
|
||||
import {
|
||||
|
|
|
@ -15,6 +15,7 @@ import {
|
|||
import { BehaviorSubject } from 'rxjs';
|
||||
|
||||
import { REPO_ROOT } from '@kbn/utils';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { Env } from '../config';
|
||||
import { configServiceMock, getEnvOptions } from '../config/mocks';
|
||||
import { CoreContext } from '../core_context';
|
||||
|
@ -24,7 +25,6 @@ import { PluginWrapper } from './plugin';
|
|||
import { PluginName, PluginType } from './types';
|
||||
import { PluginsSystem } from './plugins_system';
|
||||
import { coreMock } from '../mocks';
|
||||
import { Logger } from '../logging';
|
||||
|
||||
function createPlugin(
|
||||
id: string,
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
|
||||
import { withTimeout, isPromise } from '@kbn/std';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { CoreContext } from '../core_context';
|
||||
import { Logger } from '../logging';
|
||||
import { PluginWrapper } from './plugin';
|
||||
import { DiscoveredPlugin, PluginDependencies, PluginName, PluginType } from './types';
|
||||
import {
|
||||
|
|
|
@ -10,9 +10,9 @@ import { Observable } from 'rxjs';
|
|||
import { Type } from '@kbn/config-schema';
|
||||
import { RecursiveReadonly } from '@kbn/utility-types';
|
||||
import { PathConfigType } from '@kbn/utils';
|
||||
import { LoggerFactory } from '@kbn/logging';
|
||||
|
||||
import { ConfigPath, EnvironmentMode, PackageInfo, ConfigDeprecationProvider } from '../config';
|
||||
import { LoggerFactory } from '../logging';
|
||||
import { ElasticsearchConfigType } from '../elasticsearch/elasticsearch_config';
|
||||
import { SavedObjectsConfigType } from '../saved_objects/saved_objects_config';
|
||||
import { CorePreboot, CoreSetup, CoreStart } from '..';
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
import { ConnectableObservable, Subscription } from 'rxjs';
|
||||
import { first, publishReplay, switchMap, concatMap, tap } from 'rxjs/operators';
|
||||
|
||||
import type { Logger, LoggerFactory } from '@kbn/logging';
|
||||
import { Env, RawConfigurationProvider } from '../config';
|
||||
import { Logger, LoggerFactory, LoggingConfigType, LoggingSystem } from '../logging';
|
||||
import { LoggingConfigType, LoggingSystem } from '../logging';
|
||||
import { Server } from '../server';
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import { applyExportTransformsMock } from './collect_exported_objects.test.mocks';
|
||||
import { savedObjectsClientMock } from '../../mocks';
|
||||
import { httpServerMock } from '../../http/http_server.mocks';
|
||||
import { loggerMock } from '../../logging/logger.mock';
|
||||
import { loggerMock } from '@kbn/logging-mocks';
|
||||
import { SavedObject, SavedObjectError } from '../../../types';
|
||||
import { SavedObjectTypeRegistry } from '../saved_objects_type_registry';
|
||||
import type { SavedObjectsExportTransform } from './types';
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import type { SavedObject } from '../../../types';
|
||||
import type { KibanaRequest } from '../../http';
|
||||
import type { Logger } from '../../logging';
|
||||
import { SavedObjectsClientContract, SavedObjectsExportablePredicate } from '../types';
|
||||
import { ISavedObjectTypeRegistry } from '../saved_objects_type_registry';
|
||||
import type { SavedObjectsExportTransform } from './types';
|
||||
|
|
|
@ -11,7 +11,7 @@ import { SavedObjectsExporter } from './saved_objects_exporter';
|
|||
import { savedObjectsClientMock } from '../service/saved_objects_client.mock';
|
||||
import { SavedObjectTypeRegistry } from '../saved_objects_type_registry';
|
||||
import { httpServerMock } from '../../http/http_server.mocks';
|
||||
import { loggerMock, MockedLogger } from '../../logging/logger.mock';
|
||||
import { loggerMock, MockedLogger } from '@kbn/logging-mocks';
|
||||
import { Readable } from 'stream';
|
||||
import { createPromiseFromStreams, createConcatStream } from '@kbn/utils';
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ import uuidv5 from 'uuid/v5';
|
|||
import { set } from '@elastic/safer-lodash-set';
|
||||
import _ from 'lodash';
|
||||
import Semver from 'semver';
|
||||
import { Logger } from '../../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { SavedObjectUnsanitizedDoc } from '../../serialization';
|
||||
import {
|
||||
SavedObjectsMigrationVersion,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { Logger, LogMeta } from '../../../logging';
|
||||
import type { Logger, LogMeta } from '@kbn/logging';
|
||||
|
||||
/*
|
||||
* This file provides a helper class for ensuring that all logging
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import Semver from 'semver';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { ElasticsearchClient } from '../../elasticsearch';
|
||||
import { Logger } from '../../logging';
|
||||
import { IndexMapping, SavedObjectsTypeMappingDefinitions } from '../mappings';
|
||||
import {
|
||||
SavedObjectUnsanitizedDoc,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import { errors as EsErrors } from '@elastic/elasticsearch';
|
||||
import * as Option from 'fp-ts/lib/Option';
|
||||
import { Logger, LogMeta } from '../../logging';
|
||||
import type { Logger, LogMeta } from '@kbn/logging';
|
||||
import type { ElasticsearchClient } from '../../elasticsearch';
|
||||
import { getErrorMessage, getRequestDebugMeta } from '../../elasticsearch';
|
||||
import { Model, Next, stateActionMachine } from './state_action_machine';
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { ElasticsearchClient } from '../../elasticsearch';
|
||||
import { IndexMapping } from '../mappings';
|
||||
import { Logger } from '../../logging';
|
||||
import type { SavedObjectsMigrationVersion } from '../types';
|
||||
import type { TransformRawDocs } from './types';
|
||||
import { MigrationResult } from './core';
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { InternalHttpServiceSetup } from '../../http';
|
||||
import { InternalCoreUsageDataSetup } from '../../core_usage_data';
|
||||
import { Logger } from '../../logging';
|
||||
import { SavedObjectConfig } from '../saved_objects_config';
|
||||
import { IKibanaMigrator } from '../migrations';
|
||||
import { registerGetRoute } from './get';
|
||||
|
|
|
@ -37,7 +37,7 @@ import { coreUsageStatsClientMock } from '../../../../core_usage_data/core_usage
|
|||
import { coreUsageDataServiceMock } from '../../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { registerLegacyExportRoute } from '../export';
|
||||
import { setupServer } from '../../test_utils';
|
||||
import { loggerMock } from '../../../../logging/logger.mock';
|
||||
import { loggerMock } from '@kbn/logging-mocks';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
let coreUsageStatsClient: jest.Mocked<CoreUsageStatsClient>;
|
||||
|
|
|
@ -37,7 +37,7 @@ import { coreUsageStatsClientMock } from '../../../../core_usage_data/core_usage
|
|||
import { coreUsageDataServiceMock } from '../../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { registerLegacyImportRoute } from '../import';
|
||||
import { setupServer } from '../../test_utils';
|
||||
import { loggerMock } from '../../../../logging/logger.mock';
|
||||
import { loggerMock } from '@kbn/logging-mocks';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
let coreUsageStatsClient: jest.Mocked<CoreUsageStatsClient>;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
import { Subject, Observable, firstValueFrom } from 'rxjs';
|
||||
import { filter, take, switchMap } from 'rxjs/operators';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { CoreService } from '../../types';
|
||||
import {
|
||||
SavedObjectsClient,
|
||||
|
@ -40,7 +41,6 @@ import {
|
|||
SavedObjectsClientFactoryProvider,
|
||||
SavedObjectsClientWrapperFactory,
|
||||
} from './service/lib/scoped_client_provider';
|
||||
import { Logger } from '../logging';
|
||||
import { SavedObjectTypeRegistry, ISavedObjectTypeRegistry } from './saved_objects_type_registry';
|
||||
import { SavedObjectsSerializer } from './serialization';
|
||||
import { SavedObjectsExporter, ISavedObjectsExporter } from './export';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { loggerMock, MockedLogger } from '../../../logging/logger.mock';
|
||||
import { loggerMock, MockedLogger } from '@kbn/logging-mocks';
|
||||
import type { SavedObjectsClientContract } from '../../types';
|
||||
import type { ISavedObjectsRepository } from './repository';
|
||||
import { PointInTimeFinder } from './point_in_time_finder';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { loggerMock, MockedLogger } from '../../../logging/logger.mock';
|
||||
import { loggerMock, MockedLogger } from '@kbn/logging-mocks';
|
||||
import type { SavedObjectsFindResult } from '..';
|
||||
import { savedObjectsRepositoryMock } from './repository.mock';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type { Logger } from '../../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import type { SavedObjectsFindOptions, SavedObjectsClientContract } from '../../types';
|
||||
import type { SavedObjectsFindResponse } from '..';
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ import {
|
|||
SavedObjectsCreatePointInTimeFinderOptions,
|
||||
} from './point_in_time_finder';
|
||||
import { ALL_NAMESPACES_STRING } from './utils';
|
||||
import { loggerMock } from '../../../logging/logger.mock';
|
||||
import { loggerMock } from '@kbn/logging-mocks';
|
||||
import {
|
||||
SavedObjectsRawDocSource,
|
||||
SavedObjectsSerializer,
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
import { omit, isObject } from 'lodash';
|
||||
import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import * as esKuery from '@kbn/es-query';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import type { ElasticsearchClient } from '../../../elasticsearch';
|
||||
import { isSupportedEsServer, isNotFoundFromUnsupportedServer } from '../../../elasticsearch';
|
||||
import type { Logger } from '../../../logging';
|
||||
import { getRootPropertiesObjects, IndexMapping } from '../../mappings';
|
||||
import {
|
||||
ISavedObjectsPointInTimeFinder,
|
||||
|
|
|
@ -10,7 +10,7 @@ import { SavedObjectsRepository } from './repository';
|
|||
import { mockKibanaMigrator } from '../../migrations/kibana_migrator.mock';
|
||||
import { KibanaMigrator } from '../../migrations';
|
||||
import { SavedObjectTypeRegistry } from '../../saved_objects_type_registry';
|
||||
import { loggerMock, MockedLogger } from '../../../logging/logger.mock';
|
||||
import { loggerMock, MockedLogger } from '@kbn/logging-mocks';
|
||||
|
||||
jest.mock('./repository');
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
|
||||
import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks';
|
||||
|
||||
import { loggerMock } from '../../../logging/logger.mock';
|
||||
import { loggerMock } from '@kbn/logging-mocks';
|
||||
import { typeRegistryMock } from '../../saved_objects_type_registry.mock';
|
||||
import { SavedObjectsSerializer } from '../../serialization';
|
||||
import type {
|
||||
|
|
|
@ -10,7 +10,7 @@ import pMap from 'p-map';
|
|||
import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import intersection from 'lodash/intersection';
|
||||
|
||||
import type { Logger } from '../../../logging';
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { isNotFoundFromUnsupportedServer } from '../../../elasticsearch';
|
||||
import type { IndexMapping } from '../../mappings';
|
||||
import type { ISavedObjectTypeRegistry } from '../../saved_objects_type_registry';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import { schema } from '@kbn/config-schema';
|
||||
import { SavedObjectsTypeValidator, SavedObjectsValidationMap } from '.';
|
||||
import { SavedObjectSanitizedDoc } from '../serialization';
|
||||
import { loggerMock, MockedLogger } from '../../logging/logger.mock';
|
||||
import { loggerMock, MockedLogger } from '@kbn/logging-mocks';
|
||||
|
||||
describe('Saved Objects type validator', () => {
|
||||
let validator: SavedObjectsTypeValidator;
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { createSavedObjectSanitizedDocSchema } from './schema';
|
||||
import { SavedObjectsValidationMap } from './types';
|
||||
import { SavedObjectSanitizedDoc } from '../serialization';
|
||||
import { Logger } from '../../logging';
|
||||
|
||||
/**
|
||||
* Helper class that takes a {@link SavedObjectsValidationMap} and runs validations for a
|
||||
|
|
|
@ -1475,10 +1475,10 @@ export type KibanaResponseFactory = typeof kibanaResponseFactory;
|
|||
|
||||
// @public
|
||||
export const kibanaResponseFactory: {
|
||||
custom: <T extends string | Record<string, any> | Error | Buffer | Stream | {
|
||||
custom: <T extends string | Record<string, any> | Error | Buffer | {
|
||||
message: string | Error;
|
||||
attributes?: ResponseErrorAttributes | undefined;
|
||||
} | undefined>(options: CustomHttpResponseOptions<T>) => KibanaResponse<T>;
|
||||
} | Stream | undefined>(options: CustomHttpResponseOptions<T>) => KibanaResponse<T>;
|
||||
badRequest: (options?: ErrorHttpResponseOptions) => KibanaResponse<string | Error | {
|
||||
message: string | Error;
|
||||
attributes?: ResponseErrorAttributes | undefined;
|
||||
|
@ -1499,10 +1499,10 @@ export const kibanaResponseFactory: {
|
|||
message: string | Error;
|
||||
attributes?: ResponseErrorAttributes | undefined;
|
||||
}>;
|
||||
customError: (options: CustomHttpResponseOptions<ResponseError | Buffer | Stream>) => KibanaResponse<string | Error | Buffer | Stream | {
|
||||
customError: (options: CustomHttpResponseOptions<ResponseError | Buffer | Stream>) => KibanaResponse<string | Error | Buffer | {
|
||||
message: string | Error;
|
||||
attributes?: ResponseErrorAttributes | undefined;
|
||||
}>;
|
||||
} | Stream>;
|
||||
redirected: (options: RedirectResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
|
||||
ok: (options?: HttpResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
|
||||
accepted: (options?: HttpResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
import apm from 'elastic-apm-node';
|
||||
import { config as pathConfig } from '@kbn/utils';
|
||||
import type { Logger, LoggerFactory } from '@kbn/logging';
|
||||
import {
|
||||
ConfigService,
|
||||
Env,
|
||||
|
@ -21,7 +22,7 @@ import { ElasticsearchService } from './elasticsearch';
|
|||
import { HttpService } from './http';
|
||||
import { HttpResourcesService } from './http_resources';
|
||||
import { RenderingService } from './rendering';
|
||||
import { Logger, LoggerFactory, LoggingService, ILoggingSystem } from './logging';
|
||||
import { LoggingService, ILoggingSystem } from './logging';
|
||||
import { UiSettingsService } from './ui_settings';
|
||||
import { PluginsService, config as pluginsConfig } from './plugins';
|
||||
import { SavedObjectsService, SavedObjectsServiceStart } from './saved_objects';
|
||||
|
|
|
@ -19,11 +19,11 @@ import { map, distinctUntilChanged, shareReplay, debounceTime, takeUntil } from
|
|||
import { isDeepStrictEqual } from 'util';
|
||||
|
||||
import type { RootSchema } from '@kbn/analytics-client';
|
||||
import type { Logger, LogMeta } from '@kbn/logging';
|
||||
|
||||
import { AnalyticsServiceSetup } from '../analytics';
|
||||
import { CoreService } from '../../types';
|
||||
import { CoreContext } from '../core_context';
|
||||
import { Logger, LogMeta } from '../logging';
|
||||
import { InternalElasticsearchServiceSetup } from '../elasticsearch';
|
||||
import { InternalHttpServiceSetup } from '../http';
|
||||
import { InternalSavedObjectsServiceSetup } from '../saved_objects';
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
import { omit } from 'lodash';
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import {
|
||||
IUiSettingsClient,
|
||||
UiSettingsParams,
|
||||
PublicUiSettingsParams,
|
||||
UserProvidedValues,
|
||||
} from './types';
|
||||
import { Logger } from '../logging';
|
||||
|
||||
export interface BaseUiSettingsDefaultsClientOptions {
|
||||
overrides?: Record<string, any>;
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
import { defaults } from 'lodash';
|
||||
|
||||
import type { Logger, LogMeta } from '@kbn/logging';
|
||||
import { SavedObjectsClientContract } from '../../saved_objects/types';
|
||||
import { SavedObjectsErrorHelpers } from '../../saved_objects';
|
||||
import { Logger, LogMeta } from '../../logging';
|
||||
|
||||
import { getUpgradeableConfig } from './get_upgradeable_config';
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { SavedObjectsErrorHelpers } from '../saved_objects';
|
||||
import { SavedObjectsClientContract } from '../saved_objects/types';
|
||||
import { Logger } from '../logging';
|
||||
import { createOrUpgradeSavedConfig } from './create_or_upgrade_saved_config';
|
||||
import { UiSettingsParams } from './types';
|
||||
import { CannotOverrideError } from './ui_settings_errors';
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { UiSettingsParams, UserProvidedValues } from './types';
|
||||
import { Logger } from '../logging';
|
||||
import { BaseUiSettingsClient } from './base_ui_settings_client';
|
||||
|
||||
export interface UiSettingsDefaultsClientOptions {
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
import { firstValueFrom, Observable } from 'rxjs';
|
||||
import { mapToObject } from '@kbn/std';
|
||||
|
||||
import type { Logger } from '@kbn/logging';
|
||||
import { CoreService } from '../../types';
|
||||
import { CoreContext } from '../core_context';
|
||||
import { Logger } from '../logging';
|
||||
import { SavedObjectsClientContract } from '../saved_objects/types';
|
||||
import { InternalSavedObjectsServiceSetup } from '../saved_objects';
|
||||
import { InternalHttpServiceSetup } from '../http';
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
jest.mock('axios', () => jest.fn());
|
||||
|
||||
import { SyntheticsService, SyntheticsConfig } from './synthetics_service';
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { loggerMock } from '@kbn/core/server/logging/logger.mock';
|
||||
import { loggerMock } from '@kbn/logging-mocks';
|
||||
import { UptimeServerSetup } from '../legacy_uptime/lib/adapters';
|
||||
import axios, { AxiosResponse } from 'axios';
|
||||
import times from 'lodash/times';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue