From 8c7a29816d5fa71fe5737550b0d1ef0d2c61f70f Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Thu, 9 Nov 2023 08:38:00 -0700 Subject: [PATCH] fix some reporting-common package imports --- packages/kbn-generate-csv-types/index.ts | 26 ------------ .../kbn-generate-csv/src/generate_csv.test.ts | 17 ++++---- packages/kbn-generate-csv/src/generate_csv.ts | 9 +++- packages/kbn-generate-csv/tsconfig.json | 1 + .../common/get_full_redirect_app_url.test.ts | 1 + .../common/get_full_redirect_app_url.ts | 1 + packages/kbn-reporting/common/index.ts | 14 +++---- packages/kbn-reporting/common/tsconfig.json | 1 + packages/kbn-reporting/common/types.ts | 41 +++++++++++++++++-- .../csv/csv_searchsource_immediate.ts | 8 ++-- .../export_types/deprecated/index.ts | 1 + .../kbn-reporting/export_types/png/png_v2.ts | 39 +++++++++--------- .../printable_pdf_v2/printable_pdf_v2.ts | 24 ++++++----- .../export_type.ts | 12 +++--- .../generate_pdf_v2.ts | 14 +++++-- .../get_full_urls.test.ts | 4 +- .../get_full_urls.ts | 4 +- .../export_types_helpers_server/index.ts | 1 - .../export_types_helpers_server/tsconfig.json | 1 + .../export_types_helpers_server/types.ts | 39 +++++++----------- .../errors/map_to_reporting_error.test.ts | 6 +-- x-pack/plugins/reporting/public/lib/job.tsx | 10 +++-- .../reporting_api_client.ts | 1 + .../reporting/public/notifier/job_failure.tsx | 1 + .../reporting_panel_content.tsx | 10 ++++- x-pack/plugins/reporting/server/core.ts | 31 +++++++------- .../server/export_types/png_v2/png_v2.test.ts | 3 +- .../printable_pdf/printable_pdf_v2.test.ts | 3 +- .../server/lib/event_logger/logger.ts | 2 +- .../server/lib/event_logger/types.ts | 2 +- .../reporting/server/lib/store/store.ts | 3 +- .../server/lib/tasks/execute_report.ts | 2 +- x-pack/plugins/reporting/server/types.ts | 8 +--- x-pack/plugins/screenshotting/common/types.ts | 31 ++++++++++++++ .../browsers/chromium/driver_factory/index.ts | 5 +-- .../chromium/driver_factory/metrics.ts | 26 +----------- .../server/browsers/chromium/index.ts | 1 - .../screenshotting/server/browsers/index.ts | 2 +- .../server/screenshots/index.ts | 2 +- .../reporting_and_security/csv_v2.ts | 7 ++-- .../services/scenarios.ts | 10 +++-- .../common/reporting/management.ts | 2 +- 42 files changed, 235 insertions(+), 191 deletions(-) create mode 100644 x-pack/plugins/screenshotting/common/types.ts diff --git a/packages/kbn-generate-csv-types/index.ts b/packages/kbn-generate-csv-types/index.ts index 6c5134e1fff99d..3c6836e0683cd7 100644 --- a/packages/kbn-generate-csv-types/index.ts +++ b/packages/kbn-generate-csv-types/index.ts @@ -33,29 +33,3 @@ export interface CsvConfig { size: number; }; } - -/** - * @internal - * Needed to separate dependencies from reporting - */ -export interface CancellationToken { - isCancelled: () => boolean; - cancel: () => void; -} - -/** - * @internal - * Needed to separate dependencies from reporting - */ -export interface TaskRunResult { - content_type: string; - csv_contains_formulas: boolean; - max_size_reached: boolean; - metrics: { - csv: { - rows: number; - }; - }; - warnings: unknown; - error_code: unknown; -} diff --git a/packages/kbn-generate-csv/src/generate_csv.test.ts b/packages/kbn-generate-csv/src/generate_csv.test.ts index 6bfd567ea0424b..afaeedd2a80219 100644 --- a/packages/kbn-generate-csv/src/generate_csv.test.ts +++ b/packages/kbn-generate-csv/src/generate_csv.test.ts @@ -6,6 +6,10 @@ * Side Public License, v 1. */ +import { identity, range } from 'lodash'; +import * as Rx from 'rxjs'; +import type { Writable } from 'stream'; + import { errors as esErrors, estypes } from '@elastic/elasticsearch'; import type { SearchResponse } from '@elastic/elasticsearch/lib/api/types'; import type { IScopedClusterClient, IUiSettingsClient, Logger } from '@kbn/core/server'; @@ -20,25 +24,20 @@ import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_ import { IScopedSearchClient } from '@kbn/data-plugin/server'; import { dataPluginMock } from '@kbn/data-plugin/server/mocks'; import { FieldFormatsRegistry } from '@kbn/field-formats-plugin/common'; -import { identity, range } from 'lodash'; -import * as Rx from 'rxjs'; -import type { Writable } from 'stream'; -import { CsvGenerator } from './generate_csv'; -import { CancellationToken, CsvConfig, JobParams } from '@kbn/generate-csv-types'; +import { CsvConfig, JobParams } from '@kbn/generate-csv-types'; +import { CancellationToken } from '@kbn/reporting-common'; import { UI_SETTINGS_CSV_QUOTE_VALUES, UI_SETTINGS_CSV_SEPARATOR, UI_SETTINGS_DATEFORMAT_TZ, } from './constants'; +import { CsvGenerator } from './generate_csv'; const createMockJob = (baseObj: any = {}): JobParams => ({ ...baseObj, }); -const createMockCancellationToken = (): CancellationToken => ({ - isCancelled: () => false, - cancel: jest.fn(), -}); +const createMockCancellationToken = () => new CancellationToken(); describe('CsvGenerator', () => { let mockEsClient: IScopedClusterClient; diff --git a/packages/kbn-generate-csv/src/generate_csv.ts b/packages/kbn-generate-csv/src/generate_csv.ts index 558cbd8100df5e..2930eb03236808 100644 --- a/packages/kbn-generate-csv/src/generate_csv.ts +++ b/packages/kbn-generate-csv/src/generate_csv.ts @@ -20,8 +20,15 @@ import type { FieldFormatConfig, IFieldFormatsRegistry, } from '@kbn/field-formats-plugin/common'; +import { CsvConfig, JobParams } from '@kbn/generate-csv-types'; +import type { TaskRunResult } from '@kbn/reporting-common/types'; +import { + AuthenticationExpiredError, + CancellationToken, + ReportingError, + byteSizeValueToNumber, +} from '@kbn/reporting-common'; -import { CancellationToken, CsvConfig, JobParams, TaskRunResult } from '@kbn/generate-csv-types'; import { CONTENT_TYPE_CSV } from './constants'; import { CsvExportSettings, getExportSettings } from './get_export_settings'; import { i18nTexts } from './i18n_texts'; diff --git a/packages/kbn-generate-csv/tsconfig.json b/packages/kbn-generate-csv/tsconfig.json index a66a8149968d04..bea48f784bde1d 100644 --- a/packages/kbn-generate-csv/tsconfig.json +++ b/packages/kbn-generate-csv/tsconfig.json @@ -24,5 +24,6 @@ "@kbn/config-schema", "@kbn/i18n", "@kbn/generate-csv-types", + "@kbn/reporting-common", ] } diff --git a/packages/kbn-reporting/common/get_full_redirect_app_url.test.ts b/packages/kbn-reporting/common/get_full_redirect_app_url.test.ts index 64f2ba4452612c..970286320056ff 100644 --- a/packages/kbn-reporting/common/get_full_redirect_app_url.test.ts +++ b/packages/kbn-reporting/common/get_full_redirect_app_url.test.ts @@ -7,6 +7,7 @@ */ import { getFullRedirectAppUrl } from './get_full_redirect_app_url'; +import { ReportingConfigType } from './types'; describe('getFullRedirectAppUrl', () => { const mockConfig = { kibanaServer: {} } as unknown as ReportingConfigType; diff --git a/packages/kbn-reporting/common/get_full_redirect_app_url.ts b/packages/kbn-reporting/common/get_full_redirect_app_url.ts index 1b53cee4c1e33a..cbbf6436d63002 100644 --- a/packages/kbn-reporting/common/get_full_redirect_app_url.ts +++ b/packages/kbn-reporting/common/get_full_redirect_app_url.ts @@ -9,6 +9,7 @@ import { format } from 'url'; import { buildKibanaPath } from './build_kibana_path'; import { getRedirectAppPath } from './constants'; +import { ReportingConfigType, ReportingServerInfo } from './types'; export function getFullRedirectAppUrl( config: ReportingConfigType, diff --git a/packages/kbn-reporting/common/index.ts b/packages/kbn-reporting/common/index.ts index 4574c435fc8a1c..1741a59310e82d 100644 --- a/packages/kbn-reporting/common/index.ts +++ b/packages/kbn-reporting/common/index.ts @@ -6,16 +6,12 @@ * Side Public License, v 1. */ -export { CancellationToken } from './cancellation_token'; -export { buildKibanaPath } from './build_kibana_path'; export * from './constants'; export * from './errors'; -export * from './schema_utils'; export * as jobTypes from './job_types'; export * from './report_types'; -export type { - LocatorParams, - UrlOrUrlLocatorTuple, - IlmPolicyStatusResponse, - ManagementLinkFn, -} from './url'; +export * from './schema_utils'; + +export { buildKibanaPath } from './build_kibana_path'; +export { CancellationToken } from './cancellation_token'; +export { getFullRedirectAppUrl } from './get_full_redirect_app_url'; diff --git a/packages/kbn-reporting/common/tsconfig.json b/packages/kbn-reporting/common/tsconfig.json index 6d275a75640729..80ed6308f02ff7 100644 --- a/packages/kbn-reporting/common/tsconfig.json +++ b/packages/kbn-reporting/common/tsconfig.json @@ -17,6 +17,7 @@ "kbn_references": [ "@kbn/config-schema", "@kbn/utility-types", + "@kbn/screenshotting-plugin", "@kbn/i18n", ] } diff --git a/packages/kbn-reporting/common/types.ts b/packages/kbn-reporting/common/types.ts index e102ea79ab29a4..d56c0dd4a7893a 100644 --- a/packages/kbn-reporting/common/types.ts +++ b/packages/kbn-reporting/common/types.ts @@ -6,7 +6,12 @@ * Side Public License, v 1. */ -import type { LocatorParams } from '.'; +import { LayoutParams } from '@kbn/screenshotting-plugin/common'; +import type { PerformanceMetrics as ScreenshotMetrics } from '@kbn/screenshotting-plugin/common/types'; +import type { ByteSizeValue } from '@kbn/config-schema'; +import type { LocatorParams } from './url'; + +export * from './url'; export interface CsvMetrics { rows: number; @@ -14,8 +19,8 @@ export interface CsvMetrics { export interface TaskRunMetrics { csv?: CsvMetrics; - png?: unknown; - pdf?: unknown; + png?: ScreenshotMetrics; + pdf?: ScreenshotMetrics & { pages?: number }; } export interface TaskRunResult { @@ -44,7 +49,7 @@ export interface ReportOutput extends TaskRunResult { * @deprecated */ export interface BaseParams { - layout?: unknown; + layout?: LayoutParams; objectType: string; title: string; browserTimezone: string; // to format dates in the user's time zone @@ -78,3 +83,31 @@ export interface BasePayloadV2 extends BaseParamsV2 { spaceId?: string; isDeprecated?: boolean; } + +export interface ReportingConfigType { + encryptionKey?: string; + kibanaServer: { + protocol?: string; + hostname?: string; + port?: number; + }; + csv: { + checkForFormulas: boolean; + escapeFormulaValues: boolean; + useByteOrderMarkEncoding: boolean; + maxSizeBytes: number | ByteSizeValue; + scroll: { + duration: string; + size: number; + }; + }; +} + +export interface ReportingServerInfo { + basePath: string; + protocol: string; + hostname: string; + port: number; + name: string; + uuid: string; +} diff --git a/packages/kbn-reporting/export_types/csv/csv_searchsource_immediate.ts b/packages/kbn-reporting/export_types/csv/csv_searchsource_immediate.ts index 2a7a9efbf758a8..bf72577a994dee 100644 --- a/packages/kbn-reporting/export_types/csv/csv_searchsource_immediate.ts +++ b/packages/kbn-reporting/export_types/csv/csv_searchsource_immediate.ts @@ -6,6 +6,8 @@ * Side Public License, v 1. */ +import { Writable } from 'stream'; + import { KibanaRequest } from '@kbn/core-http-server'; import { DataPluginStart } from '@kbn/data-plugin/server/plugin'; import { DiscoverServerPluginStart } from '@kbn/discover-plugin/server'; @@ -20,14 +22,14 @@ import { LICENSE_TYPE_PLATINUM, LICENSE_TYPE_TRIAL, } from '@kbn/reporting-common'; -import { Writable } from 'stream'; +import type { TaskRunResult } from '@kbn/reporting-common/types'; import type { BaseExportTypeSetupDeps, BaseExportTypeStartDeps, - ReportingRequestHandlerContext, JobParamsDownloadCSV, + ReportingRequestHandlerContext, } from '@kbn/reporting-export-types-helpers-server'; -import { getFieldFormats, ExportType } from '@kbn/reporting-export-types-helpers-server'; +import { ExportType, getFieldFormats } from '@kbn/reporting-export-types-helpers-server'; type CsvSearchSourceImmediateExportTypeSetupDeps = BaseExportTypeSetupDeps; interface CsvSearchSourceImmediateExportTypeStartDeps extends BaseExportTypeStartDeps { diff --git a/packages/kbn-reporting/export_types/deprecated/index.ts b/packages/kbn-reporting/export_types/deprecated/index.ts index 0042abdd12330e..3d662d6602d9d5 100644 --- a/packages/kbn-reporting/export_types/deprecated/index.ts +++ b/packages/kbn-reporting/export_types/deprecated/index.ts @@ -7,3 +7,4 @@ */ export { PdfV1ExportType } from './printable_pdf'; +export type { JobParamsPDFDeprecated } from './printable_pdf'; diff --git a/packages/kbn-reporting/export_types/png/png_v2.ts b/packages/kbn-reporting/export_types/png/png_v2.ts index 5cb6c8d74e41f9..ac2879d777d71d 100644 --- a/packages/kbn-reporting/export_types/png/png_v2.ts +++ b/packages/kbn-reporting/export_types/png/png_v2.ts @@ -7,20 +7,6 @@ */ import apm from 'elastic-apm-node'; -import type { LicenseType } from '@kbn/licensing-plugin/server'; -import { - CancellationToken, - LICENSE_TYPE_CLOUD_STANDARD, - LICENSE_TYPE_ENTERPRISE, - LICENSE_TYPE_GOLD, - LICENSE_TYPE_PLATINUM, - LICENSE_TYPE_TRIAL, - LocatorParams, - PNG_JOB_TYPE_V2, - REPORTING_TRANSACTION_TYPE, - REPORTING_REDIRECT_LOCATOR_STORE_KEY, -} from '@kbn/reporting-common'; -import { Writable } from 'stream'; import { finalize, fromEventPattern, @@ -32,18 +18,33 @@ import { takeUntil, tap, } from 'rxjs'; -import { SerializableRecord } from '@kbn/utility-types'; -import { PNG_REPORT_TYPE_V2 } from '@kbn/reporting-common/report_types'; -import type { PngScreenshotOptions, PngScreenshotResult } from '@kbn/screenshotting-plugin/server'; -import type { Context } from '@kbn/screenshotting-plugin/server/browsers'; +import { Writable } from 'stream'; + +import type { LicenseType } from '@kbn/licensing-plugin/server'; +import { + CancellationToken, + getFullRedirectAppUrl, + LICENSE_TYPE_CLOUD_STANDARD, + LICENSE_TYPE_ENTERPRISE, + LICENSE_TYPE_GOLD, + LICENSE_TYPE_PLATINUM, + LICENSE_TYPE_TRIAL, + PNG_JOB_TYPE_V2, + PNG_REPORT_TYPE_V2, + REPORTING_REDIRECT_LOCATOR_STORE_KEY, + REPORTING_TRANSACTION_TYPE, +} from '@kbn/reporting-common'; +import type { LocatorParams, TaskRunResult } from '@kbn/reporting-common/types'; import { decryptJobHeaders, ExportType, - getFullRedirectAppUrl, generatePngObservable, JobParamsPNGV2, TaskPayloadPNGV2, } from '@kbn/reporting-export-types-helpers-server'; +import type { PngScreenshotOptions, PngScreenshotResult } from '@kbn/screenshotting-plugin/server'; +import type { Context } from '@kbn/screenshotting-plugin/server/browsers'; +import { SerializableRecord } from '@kbn/utility-types'; export class PngExportType extends ExportType { id = PNG_REPORT_TYPE_V2; diff --git a/packages/kbn-reporting/export_types/printable_pdf_v2/printable_pdf_v2.ts b/packages/kbn-reporting/export_types/printable_pdf_v2/printable_pdf_v2.ts index 1dac900cf11384..6c6693a195e1f7 100644 --- a/packages/kbn-reporting/export_types/printable_pdf_v2/printable_pdf_v2.ts +++ b/packages/kbn-reporting/export_types/printable_pdf_v2/printable_pdf_v2.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import { Headers } from '@kbn/core/server'; import apm from 'elastic-apm-node'; import { catchError, @@ -21,28 +20,31 @@ import { throwError, } from 'rxjs'; import { Writable } from 'stream'; + +import { Headers } from '@kbn/core/server'; +import type { TaskRunResult } from '@kbn/reporting-common/types'; import { - PDF_REPORT_TYPE_V2, - PDF_JOB_TYPE_V2, - LICENSE_TYPE_TRIAL, + CancellationToken, + getFullRedirectAppUrl, LICENSE_TYPE_CLOUD_STANDARD, + LICENSE_TYPE_ENTERPRISE, LICENSE_TYPE_GOLD, LICENSE_TYPE_PLATINUM, - LICENSE_TYPE_ENTERPRISE, - REPORTING_TRANSACTION_TYPE, - CancellationToken, + LICENSE_TYPE_TRIAL, + PDF_JOB_TYPE_V2, + PDF_REPORT_TYPE_V2, REPORTING_REDIRECT_LOCATOR_STORE_KEY, + REPORTING_TRANSACTION_TYPE, } from '@kbn/reporting-common'; -import type { PdfScreenshotOptions, PdfScreenshotResult } from '@kbn/screenshotting-plugin/server'; import { - generatePdfObservableV2, decryptJobHeaders, - getCustomLogo, - getFullRedirectAppUrl, ExportType, + generatePdfObservableV2, + getCustomLogo, JobParamsPDFV2, TaskPayloadPDFV2, } from '@kbn/reporting-export-types-helpers-server'; +import type { PdfScreenshotOptions, PdfScreenshotResult } from '@kbn/screenshotting-plugin/server'; import { UrlOrUrlWithContext } from '@kbn/screenshotting-plugin/server/screenshots'; export class PdfExportType extends ExportType { diff --git a/packages/kbn-reporting/export_types_helpers_server/export_type.ts b/packages/kbn-reporting/export_types_helpers_server/export_type.ts index 828e7bae57cd34..7de7af835b4846 100644 --- a/packages/kbn-reporting/export_types_helpers_server/export_type.ts +++ b/packages/kbn-reporting/export_types_helpers_server/export_type.ts @@ -6,26 +6,28 @@ * Side Public License, v 1. */ +import type { IClusterClient } from '@kbn/core-elasticsearch-server'; +import { CoreKibanaRequest } from '@kbn/core-http-router-server-internal'; import type { FakeRawRequest, + Headers, HttpServiceSetup, IBasePath, KibanaRequest, - Headers, } from '@kbn/core-http-server'; -import type { Logger } from '@kbn/logging'; import type { CoreSetup } from '@kbn/core-lifecycle-server'; import type { PluginInitializerContext } from '@kbn/core-plugins-server'; import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; import type { SavedObjectsServiceStart } from '@kbn/core-saved-objects-server'; import type { UiSettingsServiceStart } from '@kbn/core-ui-settings-server'; import type { LicenseType } from '@kbn/licensing-plugin/common/types'; +import type { Logger } from '@kbn/logging'; +import { ReportingConfigType, ReportingServerInfo } from '@kbn/reporting-common/types'; import type { ScreenshottingStart } from '@kbn/screenshotting-plugin/server'; import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common'; import type { SpacesPluginSetup } from '@kbn/spaces-plugin/server'; -import type { IClusterClient } from '@kbn/core-elasticsearch-server'; -import { CoreKibanaRequest } from '@kbn/core-http-router-server-internal'; -import { CreateJobFn, ReportingServerInfo, RunTaskFn } from './types'; + +import { CreateJobFn, RunTaskFn } from './types'; export interface BaseExportTypeSetupDeps { basePath: Pick; diff --git a/packages/kbn-reporting/export_types_helpers_server/generate_pdf_v2.ts b/packages/kbn-reporting/export_types_helpers_server/generate_pdf_v2.ts index d6a933c29abd40..da7e64d825ab8c 100644 --- a/packages/kbn-reporting/export_types_helpers_server/generate_pdf_v2.ts +++ b/packages/kbn-reporting/export_types_helpers_server/generate_pdf_v2.ts @@ -6,14 +6,20 @@ * Side Public License, v 1. */ +import { Observable } from 'rxjs'; import { mergeMap, tap } from 'rxjs/operators'; + +import { getFullRedirectAppUrl } from '@kbn/reporting-common'; +import type { + LocatorParams, + ReportingConfigType, + ReportingServerInfo, +} from '@kbn/reporting-common/types'; import type { PdfScreenshotOptions, PdfScreenshotResult } from '@kbn/screenshotting-plugin/server'; -import { Observable } from 'rxjs'; import type { UrlOrUrlWithContext } from '@kbn/screenshotting-plugin/server/screenshots'; -import { LocatorParams } from '@kbn/reporting-common'; -import { ReportingServerInfo, TaskPayloadPDFV2 } from './types'; + import { getTracker } from './pdf_tracker'; -import { getFullRedirectAppUrl } from '.'; +import { TaskPayloadPDFV2 } from './types'; interface PdfResult { buffer: Uint8Array | null; diff --git a/packages/kbn-reporting/export_types_helpers_server/get_full_urls.test.ts b/packages/kbn-reporting/export_types_helpers_server/get_full_urls.test.ts index 228152016d5cb0..6b86fa3006a44a 100644 --- a/packages/kbn-reporting/export_types_helpers_server/get_full_urls.test.ts +++ b/packages/kbn-reporting/export_types_helpers_server/get_full_urls.test.ts @@ -6,7 +6,9 @@ * Side Public License, v 1. */ -import { TaskPayloadPDF, ReportingServerInfo } from './types'; +import { ReportingConfigType, ReportingServerInfo } from '@kbn/reporting-common/types'; + +import { TaskPayloadPDF } from './types'; import { getFullUrls } from './get_full_urls'; const getMockJob = (base: object) => base as TaskPayloadPDF; diff --git a/packages/kbn-reporting/export_types_helpers_server/get_full_urls.ts b/packages/kbn-reporting/export_types_helpers_server/get_full_urls.ts index 726377d08325cf..d554349b018468 100644 --- a/packages/kbn-reporting/export_types_helpers_server/get_full_urls.ts +++ b/packages/kbn-reporting/export_types_helpers_server/get_full_urls.ts @@ -12,9 +12,11 @@ import { UrlWithParsedQuery, UrlWithStringQuery, } from 'url'; -import { ReportingServerInfo, TaskPayloadPDF } from './types'; + +import { ReportingConfigType, ReportingServerInfo } from '@kbn/reporting-common/types'; import { getAbsoluteUrlFactory } from './get_absolute_url'; +import { TaskPayloadPDF } from './types'; import { validateUrls } from './validate_urls'; export function getFullUrls( diff --git a/packages/kbn-reporting/export_types_helpers_server/index.ts b/packages/kbn-reporting/export_types_helpers_server/index.ts index 434c60591e3337..5c53876de8c81c 100644 --- a/packages/kbn-reporting/export_types_helpers_server/index.ts +++ b/packages/kbn-reporting/export_types_helpers_server/index.ts @@ -9,7 +9,6 @@ export { getFieldFormats, setFieldFormats } from './services'; export { decryptJobHeaders } from './decrypt_job_headers'; export { getCustomLogo } from './get_custom_logo'; -export { getFullRedirectAppUrl } from './get_full_redirect_app_url'; export { generatePdfObservable } from './generate_pdf'; export { validateUrls } from './validate_urls'; export { getFullUrls } from './get_full_urls'; diff --git a/packages/kbn-reporting/export_types_helpers_server/tsconfig.json b/packages/kbn-reporting/export_types_helpers_server/tsconfig.json index 7ecc65ada97669..b594d5c979755c 100644 --- a/packages/kbn-reporting/export_types_helpers_server/tsconfig.json +++ b/packages/kbn-reporting/export_types_helpers_server/tsconfig.json @@ -28,6 +28,7 @@ "@kbn/core-saved-objects-api-server", "@kbn/core-saved-objects-server", "@kbn/core-ui-settings-server", + "@kbn/data-plugin", "@kbn/licensing-plugin", "@kbn/spaces-plugin", "@kbn/core-elasticsearch-server", diff --git a/packages/kbn-reporting/export_types_helpers_server/types.ts b/packages/kbn-reporting/export_types_helpers_server/types.ts index f51e5c3ce53dc5..6df8228d68dba9 100644 --- a/packages/kbn-reporting/export_types_helpers_server/types.ts +++ b/packages/kbn-reporting/export_types_helpers_server/types.ts @@ -7,29 +7,24 @@ */ import { Writable } from 'stream'; + +import type { CustomRequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; +import type { KibanaRequest } from '@kbn/core-http-server'; +import type { SerializedSearchSourceFields } from '@kbn/data-plugin/public'; +import type { CancellationToken } from '@kbn/reporting-common'; import type { BaseParams, BaseParamsV2, BasePayload, BasePayloadV2, + LocatorParams, TaskRunResult, } from '@kbn/reporting-common/types'; -import type { CustomRequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; -import type { KibanaRequest } from '@kbn/core-http-server'; -import type { LocatorParams, CancellationToken } from '@kbn/reporting-common'; +import { LayoutParams } from '@kbn/screenshotting-plugin/common'; /** * @internal */ -export interface ReportingServerInfo { - port: number; - name: string; - uuid: string; - basePath: string; - protocol: string; - hostname: string; -} - export interface CommonReportingSetup { registerExportTypes: () => void; /** @@ -63,25 +58,21 @@ export type RunTaskFn = ( export interface JobParamsDownloadCSV { browserTimezone: string; title: string; - searchSource: unknown; + searchSource: SerializedSearchSourceFields; columns?: string[]; } -interface Layout { - id?: 'preserve_layout' | 'print' | 'canvas'; -} - /** * Structure of stored job data provided by create_job */ export interface TaskPayloadPDF extends BasePayload { - layout: Layout; + layout: LayoutParams; forceNow?: string; objects: Array<{ relativeUrl: string }>; } interface BaseParamsPNG { - layout: Layout; + layout: LayoutParams; forceNow?: string; relativeUrl: string; } @@ -96,7 +87,7 @@ export type JobParamsPNGDeprecated = BaseParamsPNG & BaseParams; export type TaskPayloadPNG = BaseParamsPNG & BasePayload; interface BaseParamsPDFV2 { - layout: Layout; + layout: LayoutParams; /** * This value is used to re-create the same visual state as when the report was requested as well as navigate to the correct page. @@ -111,14 +102,14 @@ export type JobAppParamsPDFV2 = Omit { test('Non-Error values', () => { diff --git a/x-pack/plugins/reporting/public/lib/job.tsx b/x-pack/plugins/reporting/public/lib/job.tsx index cc240f390a3ebc..5670054b862382 100644 --- a/x-pack/plugins/reporting/public/lib/job.tsx +++ b/x-pack/plugins/reporting/public/lib/job.tsx @@ -5,13 +5,15 @@ * 2.0. */ -import { EuiText, EuiTextColor } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; import moment from 'moment'; -import type { BaseParamsV2 } from '@kbn/reporting-export-types-helpers-public'; import React from 'react'; + +import { EuiText, EuiTextColor } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { BaseParamsV2, ReportOutput } from '@kbn/reporting-common/types'; + import { JobId, JobTypes, JOB_STATUSES } from '../../common/constants'; -import type { ReportApiJSON, ReportFields, ReportOutput, ReportSource } from '../../common/types'; +import type { ReportApiJSON, ReportFields, ReportSource } from '../../common/types'; const { COMPLETED, FAILED, PENDING, PROCESSING, WARNINGS } = JOB_STATUSES; diff --git a/x-pack/plugins/reporting/public/lib/reporting_api_client/reporting_api_client.ts b/x-pack/plugins/reporting/public/lib/reporting_api_client/reporting_api_client.ts index 3e719199f43dd1..e7727908e9152b 100644 --- a/x-pack/plugins/reporting/public/lib/reporting_api_client/reporting_api_client.ts +++ b/x-pack/plugins/reporting/public/lib/reporting_api_client/reporting_api_client.ts @@ -12,6 +12,7 @@ import rison from '@kbn/rison'; import moment from 'moment'; import { stringify } from 'query-string'; import { buildKibanaPath } from '@kbn/reporting-common'; +import { BaseParams, ManagementLinkFn } from '@kbn/reporting-common/types'; import { getRedirectAppPath, INTERNAL_ROUTES, diff --git a/x-pack/plugins/reporting/public/notifier/job_failure.tsx b/x-pack/plugins/reporting/public/notifier/job_failure.tsx index 13e283efbe12c2..e18782437e799b 100644 --- a/x-pack/plugins/reporting/public/notifier/job_failure.tsx +++ b/x-pack/plugins/reporting/public/notifier/job_failure.tsx @@ -11,6 +11,7 @@ import React from 'react'; import { DocLinksStart, ThemeServiceStart, ToastInput } from '@kbn/core/public'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import * as errors from '@kbn/reporting-common/errors'; +import { ManagementLinkFn } from '@kbn/reporting-common/types'; import type { JobSummary } from '../../common/types'; import { sharedI18nTexts } from '../shared_i18n_texts'; diff --git a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx index e5db2122c78e52..d324dd796c0913 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx +++ b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx @@ -5,6 +5,7 @@ * 2.0. */ +import React, { Component, ReactElement } from 'react'; import url from 'url'; import { @@ -21,7 +22,14 @@ import { IUiSettingsClient, ThemeServiceSetup, ToastsSetup } from '@kbn/core/pub import { i18n } from '@kbn/i18n'; import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n-react'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; -import React, { Component, ReactElement } from 'react'; +import type { BaseParams } from '@kbn/reporting-common/types'; +import { + CSV_REPORT_TYPE, + PDF_REPORT_TYPE, + PDF_REPORT_TYPE_V2, + PNG_REPORT_TYPE, + PNG_REPORT_TYPE_V2, +} from '@kbn/reporting-common'; import { ReportingAPIClient } from '../../lib/reporting_api_client'; import { ErrorUnsavedWorkPanel, ErrorUrlTooLongPanel } from './components'; diff --git a/x-pack/plugins/reporting/server/core.ts b/x-pack/plugins/reporting/server/core.ts index 77926b4194fc24..6195568b333eb4 100644 --- a/x-pack/plugins/reporting/server/core.ts +++ b/x-pack/plugins/reporting/server/core.ts @@ -5,6 +5,9 @@ * 2.0. */ +import * as Rx from 'rxjs'; +import { map, switchMap, take } from 'rxjs/operators'; + import type { CoreSetup, DocLinksServiceSetup, @@ -23,6 +26,17 @@ import type { DiscoverServerPluginStart } from '@kbn/discover-plugin/server'; import type { PluginSetupContract as FeaturesPluginSetup } from '@kbn/features-plugin/server'; import type { FieldFormatsStart } from '@kbn/field-formats-plugin/server'; import type { LicensingPluginStart } from '@kbn/licensing-plugin/server'; +import { REPORTING_REDIRECT_LOCATOR_STORE_KEY } from '@kbn/reporting-common'; +import type { ReportingServerInfo } from '@kbn/reporting-common/types'; +import { + CsvSearchSourceExportType, + CsvSearchSourceImmediateExportType, + CsvV2ExportType, +} from '@kbn/reporting-export-types-csv'; +import { PdfV1ExportType } from '@kbn/reporting-export-types-deprecated'; +import { ExportType } from '@kbn/reporting-export-types-helpers-server'; +import { PdfExportType } from '@kbn/reporting-export-types-pdf'; +import { PngExportType } from '@kbn/reporting-export-types-png'; import { PdfScreenshotResult, PngScreenshotResult, @@ -37,21 +51,10 @@ import type { TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; import type { UsageCounter } from '@kbn/usage-collection-plugin/server'; -import * as Rx from 'rxjs'; -import { map, switchMap, take } from 'rxjs/operators'; -import { REPORTING_REDIRECT_LOCATOR_STORE_KEY } from '@kbn/reporting-common'; -import { ExportType, ReportingServerInfo } from '@kbn/reporting-export-types-helpers-server'; -import { - CsvV2ExportType, - CsvSearchSourceImmediateExportType, - CsvSearchSourceExportType, -} from '@kbn/reporting-export-types-csv'; -import { PdfExportType } from '@kbn/reporting-export-types-pdf'; -import { PdfV1ExportType } from '@kbn/reporting-export-types-deprecated'; -import { PngExportType } from '@kbn/reporting-export-types-png'; + import type { ReportingSetup } from '.'; -import { createConfig, ReportingConfigType } from './config'; -import { checkLicense, ExportTypesRegistry } from './lib'; +import { ReportingConfigType, createConfig } from './config'; +import { ExportTypesRegistry, checkLicense } from './lib'; import { reportingEventLoggerFactory } from './lib/event_logger/logger'; import type { IReport, ReportingStore } from './lib/store'; import { ExecuteReportTask, MonitorReportsTask, ReportTaskParams } from './lib/tasks'; diff --git a/x-pack/plugins/reporting/server/export_types/png_v2/png_v2.test.ts b/x-pack/plugins/reporting/server/export_types/png_v2/png_v2.test.ts index 0cbd43e4dfa87a..af353afa169163 100644 --- a/x-pack/plugins/reporting/server/export_types/png_v2/png_v2.test.ts +++ b/x-pack/plugins/reporting/server/export_types/png_v2/png_v2.test.ts @@ -8,7 +8,8 @@ import * as Rx from 'rxjs'; import { coreMock, elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; import { Writable } from 'stream'; -import { CancellationToken, LocatorParams } from '@kbn/reporting-common'; +import { CancellationToken } from '@kbn/reporting-common'; +import type { LocatorParams } from '@kbn/reporting-common/types'; import { ScreenshottingStart } from '@kbn/screenshotting-plugin/server'; import { PngExportType } from '@kbn/reporting-export-types-png'; import { createMockConfigSchema } from '../../test_helpers'; diff --git a/x-pack/plugins/reporting/server/export_types/printable_pdf/printable_pdf_v2.test.ts b/x-pack/plugins/reporting/server/export_types/printable_pdf/printable_pdf_v2.test.ts index c71c7114950cfa..c43f4b701749c5 100644 --- a/x-pack/plugins/reporting/server/export_types/printable_pdf/printable_pdf_v2.test.ts +++ b/x-pack/plugins/reporting/server/export_types/printable_pdf/printable_pdf_v2.test.ts @@ -6,7 +6,8 @@ */ import { coreMock, elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; -import { CancellationToken, LocatorParams } from '@kbn/reporting-common'; +import { CancellationToken } from '@kbn/reporting-common'; +import { LocatorParams } from '@kbn/reporting-common/types'; import { generatePdfObservableV2, cryptoFactory, diff --git a/x-pack/plugins/reporting/server/lib/event_logger/logger.ts b/x-pack/plugins/reporting/server/lib/event_logger/logger.ts index b28efde88fd18a..8096aa36be7b00 100644 --- a/x-pack/plugins/reporting/server/lib/event_logger/logger.ts +++ b/x-pack/plugins/reporting/server/lib/event_logger/logger.ts @@ -7,7 +7,7 @@ import deepMerge from 'deepmerge'; import type { Logger, LogMeta } from '@kbn/core/server'; -import { TaskRunMetrics } from '@kbn/reporting-common'; +import type { TaskRunMetrics } from '@kbn/reporting-common/types'; import { PLUGIN_ID } from '../../../common/constants'; import { IReport } from '../store'; import { ActionType } from '.'; diff --git a/x-pack/plugins/reporting/server/lib/event_logger/types.ts b/x-pack/plugins/reporting/server/lib/event_logger/types.ts index da453e066c2bee..8a6725eb33a4d8 100644 --- a/x-pack/plugins/reporting/server/lib/event_logger/types.ts +++ b/x-pack/plugins/reporting/server/lib/event_logger/types.ts @@ -6,7 +6,7 @@ */ import { LogMeta } from '@kbn/core/server'; -import { TaskRunMetrics } from '@kbn/reporting-common'; +import type { TaskRunMetrics } from '@kbn/reporting-common/types'; import { ActionType } from '.'; export interface ReportingAction extends LogMeta { diff --git a/x-pack/plugins/reporting/server/lib/store/store.ts b/x-pack/plugins/reporting/server/lib/store/store.ts index d4907d43bc4905..47db231a87f706 100644 --- a/x-pack/plugins/reporting/server/lib/store/store.ts +++ b/x-pack/plugins/reporting/server/lib/store/store.ts @@ -8,12 +8,13 @@ import { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import moment from 'moment'; +import { ReportOutput } from '@kbn/reporting-common/types'; import type { IReport, Report, ReportDocument } from '.'; import { SavedReport } from '.'; import { statuses } from '..'; import type { ReportingCore } from '../..'; import { ILM_POLICY_NAME, REPORTING_SYSTEM_INDEX } from '../../../common/constants'; -import type { JobStatus, ReportOutput, ReportSource } from '../../../common/types'; +import type { JobStatus, ReportSource } from '../../../common/types'; import type { ReportTaskParams } from '../tasks'; import { IlmPolicyManager } from './ilm_policy_manager'; import { indexTimestamp } from './index_timestamp'; diff --git a/x-pack/plugins/reporting/server/lib/tasks/execute_report.ts b/x-pack/plugins/reporting/server/lib/tasks/execute_report.ts index 0fa21b17c6d648..e0b43153456dac 100644 --- a/x-pack/plugins/reporting/server/lib/tasks/execute_report.ts +++ b/x-pack/plugins/reporting/server/lib/tasks/execute_report.ts @@ -13,6 +13,7 @@ import { QueueTimeoutError, ReportingError, } from '@kbn/reporting-common'; +import type { ReportOutput, TaskRunResult } from '@kbn/reporting-common/types'; import type { RunContext, TaskManagerStartContract, @@ -30,7 +31,6 @@ import { ExportTypesRegistry, getContentStream } from '..'; import type { ReportingCore } from '../..'; import { mapToReportingError } from '../../../common/errors/map_to_reporting_error'; import { durationToNumber, numberToDuration } from '../../../common/schema_utils'; -import type { ReportOutput, TaskRunResult } from '../../../common/types'; import type { ReportingConfigType } from '../../config'; import type { ReportDocument, ReportingStore } from '../store'; import { Report, SavedReport } from '../store'; diff --git a/x-pack/plugins/reporting/server/types.ts b/x-pack/plugins/reporting/server/types.ts index bba11a236b0724..bc03e2b702ce15 100644 --- a/x-pack/plugins/reporting/server/types.ts +++ b/x-pack/plugins/reporting/server/types.ts @@ -11,12 +11,8 @@ import { DiscoverServerPluginStart } from '@kbn/discover-plugin/server'; import type { PluginSetupContract as FeaturesPluginSetup } from '@kbn/features-plugin/server'; import { FieldFormatsStart } from '@kbn/field-formats-plugin/server'; import type { LicensingPluginStart } from '@kbn/licensing-plugin/server'; -import type { UrlOrUrlLocatorTuple } from '@kbn/reporting-common'; -import { - BaseParams, - BasePayload, - CommonReportingSetup, -} from '@kbn/reporting-export-types-helpers-server'; +import type { BaseParams, BasePayload, UrlOrUrlLocatorTuple } from '@kbn/reporting-common/types'; +import { CommonReportingSetup } from '@kbn/reporting-export-types-helpers-server'; import type { ScreenshotModePluginSetup } from '@kbn/screenshot-mode-plugin/server'; import type { PdfScreenshotOptions as BasePdfScreenshotOptions, diff --git a/x-pack/plugins/screenshotting/common/types.ts b/x-pack/plugins/screenshotting/common/types.ts new file mode 100644 index 00000000000000..3e6ad952baf55d --- /dev/null +++ b/x-pack/plugins/screenshotting/common/types.ts @@ -0,0 +1,31 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/** + * Collected performance metrics during a screenshotting session. + */ +export interface PerformanceMetrics { + /** + * The percentage of CPU time spent by the browser divided by number or cores. + */ + cpu?: number; + + /** + * The percentage of CPU in percent untis. + */ + cpuInPercentage?: number; + + /** + * The total amount of memory used by the browser. + */ + memory?: number; + + /** + * The total amount of memory used by the browser in megabytes. + */ + memoryInMegabytes?: number; +} diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.ts b/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.ts index ce8b8a3a209d9a..9558b1f6a875fe 100644 --- a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.ts +++ b/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.ts @@ -26,13 +26,14 @@ import { takeUntil, tap, } from 'rxjs/operators'; +import { PerformanceMetrics } from '../../../../common/types'; import { getChromiumDisconnectedError } from '..'; import { errors } from '../../../../common'; import { ConfigType } from '../../../config'; import { safeChildProcess } from '../../safe_child_process'; import { HeadlessChromiumDriver } from '../driver'; import { args } from './args'; -import { getMetrics, PerformanceMetrics } from './metrics'; +import { getMetrics } from './metrics'; interface CreatePageOptions { browserTimezone?: string; @@ -455,5 +456,3 @@ export class HeadlessChromiumDriverFactory { ); } } - -export type { PerformanceMetrics }; diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/metrics.ts b/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/metrics.ts index 6e9971324ae4b8..9c48a1e1fde2a5 100644 --- a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/metrics.ts +++ b/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/metrics.ts @@ -7,6 +7,7 @@ import type { Metrics as PuppeteerMetrics } from 'puppeteer'; import { cpus } from 'os'; +import { PerformanceMetrics } from '../../../../common/types'; declare module 'puppeteer' { interface CDPSession { @@ -29,31 +30,6 @@ interface NormalizedMetrics extends Required { ProcessTime: number; } -/** - * Collected performance metrics during a screenshotting session. - */ -export interface PerformanceMetrics { - /** - * The percentage of CPU time spent by the browser divided by number or cores. - */ - cpu: number; - - /** - * The percentage of CPU in percent untis. - */ - cpuInPercentage: number; - - /** - * The total amount of memory used by the browser. - */ - memory: number; - - /** - * The total amount of memory used by the browser in megabytes. - */ - memoryInMegabytes: number; -} - function normalizeMetrics({ metrics }: Metrics) { return Object.fromEntries( metrics.map(({ name, value }) => [name, value]) diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/index.ts b/x-pack/plugins/screenshotting/server/browsers/chromium/index.ts index 672ea2ec5f020e..e3f96f3a7445b0 100644 --- a/x-pack/plugins/screenshotting/server/browsers/chromium/index.ts +++ b/x-pack/plugins/screenshotting/server/browsers/chromium/index.ts @@ -20,6 +20,5 @@ export const getDisallowedOutgoingUrlError = (interceptedUrl: string) => export { HeadlessChromiumDriver } from './driver'; export type { Context } from './driver'; export { DEFAULT_VIEWPORT, HeadlessChromiumDriverFactory } from './driver_factory'; -export type { PerformanceMetrics } from './driver_factory'; export { ChromiumArchivePaths } from './paths'; export type { PackageInfo } from './paths'; diff --git a/x-pack/plugins/screenshotting/server/browsers/index.ts b/x-pack/plugins/screenshotting/server/browsers/index.ts index 15c8b2b2db06bb..0b6402a0bd6fb3 100644 --- a/x-pack/plugins/screenshotting/server/browsers/index.ts +++ b/x-pack/plugins/screenshotting/server/browsers/index.ts @@ -7,7 +7,7 @@ export { download } from './download'; export { install } from './install'; -export type { Context, PerformanceMetrics } from './chromium'; +export type { Context } from './chromium'; export { getChromiumDisconnectedError, ChromiumArchivePaths, diff --git a/x-pack/plugins/screenshotting/server/screenshots/index.ts b/x-pack/plugins/screenshotting/server/screenshots/index.ts index b1a0d98fe8a279..7f7882cb26b2ef 100644 --- a/x-pack/plugins/screenshotting/server/screenshots/index.ts +++ b/x-pack/plugins/screenshotting/server/screenshots/index.ts @@ -9,7 +9,7 @@ import type { KibanaRequest } from '@kbn/core/server'; import type { ExpressionAstExpression } from '@kbn/expressions-plugin/common'; import type { Optional } from '@kbn/utility-types'; import { LayoutParams } from '../../common'; -import { PerformanceMetrics } from '../browsers'; +import { PerformanceMetrics } from '../../common/types'; import { PdfScreenshotOptions, PdfScreenshotResult, diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/csv_v2.ts b/x-pack/test/reporting_api_integration/reporting_and_security/csv_v2.ts index 959121a67d2cd9..1966ca0645cda7 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/csv_v2.ts +++ b/x-pack/test/reporting_api_integration/reporting_and_security/csv_v2.ts @@ -5,12 +5,13 @@ * 2.0. */ -import { DISCOVER_APP_LOCATOR } from '@kbn/discover-plugin/common'; import expect from '@kbn/expect'; -import { JobParamsCsvFromSavedObject } from '@kbn/reporting-export-types-csv'; +import request from 'supertest'; + +import { DISCOVER_APP_LOCATOR } from '@kbn/discover-plugin/common'; +import type { JobParamsCsvFromSavedObject } from '@kbn/reporting-export-types-helpers-server'; import type { ReportApiJSON } from '@kbn/reporting-plugin/common/types'; import rison from '@kbn/rison'; -import request from 'supertest'; import { FtrProviderContext } from '../ftr_provider_context'; const LOGSTASH_DATA_ARCHIVE = 'test/functional/fixtures/es_archiver/logstash_functional'; diff --git a/x-pack/test/reporting_api_integration/services/scenarios.ts b/x-pack/test/reporting_api_integration/services/scenarios.ts index b718112c69f627..7ea609890e8b1c 100644 --- a/x-pack/test/reporting_api_integration/services/scenarios.ts +++ b/x-pack/test/reporting_api_integration/services/scenarios.ts @@ -5,12 +5,14 @@ * 2.0. */ -import type { JobParamsDownloadCSV } from '@kbn/reporting-export-types-helpers-server'; -import { JobParamsPNGV2 } from '@kbn/reporting-export-types-png'; -import { JobParamsPDFDeprecated } from '@kbn/reporting-export-types-deprecated'; -import { JobParamsCSV } from '@kbn/reporting-export-types-csv'; +import type { + JobParamsCSV, + JobParamsDownloadCSV, +} from '@kbn/reporting-export-types-helpers-server'; +import type { JobParamsPDFDeprecated } from '@kbn/reporting-export-types-deprecated'; import { INTERNAL_ROUTES } from '@kbn/reporting-plugin/common/constants/routes'; import rison from '@kbn/rison'; +import { JobParamsPNGV2 } from '@kbn/reporting-export-types-helpers-server'; import { FtrProviderContext } from '../ftr_provider_context'; function removeWhitespace(str: string) { diff --git a/x-pack/test_serverless/functional/test_suites/common/reporting/management.ts b/x-pack/test_serverless/functional/test_suites/common/reporting/management.ts index 362b255727275b..1168f932d1f1ab 100644 --- a/x-pack/test_serverless/functional/test_suites/common/reporting/management.ts +++ b/x-pack/test_serverless/functional/test_suites/common/reporting/management.ts @@ -7,7 +7,7 @@ import { DISCOVER_APP_LOCATOR } from '@kbn/discover-plugin/common'; import { CSV_REPORT_TYPE_V2 } from '@kbn/reporting-common'; -import { JobParamsCsvFromSavedObject } from '@kbn/reporting-export-types-csv'; +import { JobParamsCsvFromSavedObject } from '@kbn/reporting-export-types-helpers-server'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default ({ getPageObjects, getService }: FtrProviderContext) => {