From 886aeae4a48a56e6ad78062cc05702e6144b2c25 Mon Sep 17 00:00:00 2001 From: Brad White Date: Tue, 26 Sep 2023 14:01:27 -0600 Subject: [PATCH] Squash all fixes --- package.json | 4 ++-- packages/shared-ux/markdown/mocks/storybook.ts | 2 +- .../public/lib/autocomplete/autocomplete.ts | 2 +- .../apps/dashboard/group3/copy_panel_to.ts | 1 - .../get_apm_service_summary/index.ts | 1 + .../server/routes/assets/hosts.ts | 3 +++ .../plugins/enterprise_search/server/plugin.ts | 2 +- x-pack/plugins/ml/public/mocks.ts | 2 ++ x-pack/plugins/ml/public/plugin.ts | 16 ++++++++++++---- .../app/custom_logs/install_elastic_agent.tsx | 4 ++-- .../observability_onboarding/public/index.ts | 2 +- .../onboarding_locator/locator_definition.ts | 2 ++ .../locators/onboarding_locator/types.ts | 1 + x-pack/plugins/osquery/cypress/tsconfig.json | 9 ++++++--- .../reporting/server/lib/store/store.ts | 3 +-- .../markdown_editor/plugins/index.ts | 12 +++--------- .../public/flyout/left/components/test_ids.ts | 1 + .../roles/complete_with_endpoint_roles.cy.ts | 6 +++--- .../roles/essentials_with_endpoint.roles.cy.ts | 6 +++--- .../public/management/cypress/tasks/login.ts | 5 ++++- .../public/common/__mocks__/services.mock.ts | 3 +++ .../public/upselling/register_upsellings.tsx | 2 +- .../upselling/hooks/use_product_type_by_pli.ts | 4 ++-- .../osquery_automated_response_actions.tsx | 9 ++++----- .../pages/threat_intelligence_paywall.tsx | 4 ++-- .../serverless_search/public/layout/nav.tsx | 12 ++++++------ .../monitor_add_edit/monitor_add_page.tsx | 2 +- .../create_with_circuit_breaker.ts | 4 ++-- .../tests/alerting/suggestions_value_alert.ts | 1 - .../ingest_pipelines/lib/fixtures.ts | 4 ++-- .../apis/security_solution/authentications.ts | 2 +- .../apm_api_integration/common/registry.ts | 2 +- .../tests/diagnostics/indices.spec.ts | 16 ++++++++-------- .../exception_operators_data_types/ip_array.ts | 8 ++++---- .../text_array.ts | 8 ++++---- x-pack/test/disable_ems/tests/fonts.ts | 1 + .../apis/download_sources/crud.ts | 2 +- .../apis/fleet_telemetry.ts | 6 +++++- .../drilldowns/explore_data_chart_action.ts | 6 +++--- .../index_pattern/continuous_transform.ts | 1 + .../page_objects/tag_management_page.ts | 1 - .../cypress/e2e/inspect/inspect_button.cy.ts | 8 +++++--- .../e2e/investigations/alerts/navigation.cy.ts | 2 +- .../timelines/row_renderers.cy.ts | 8 +++++--- .../cypress/tasks/login.ts | 4 ++-- .../api_integration/services/svl_cases/api.ts | 13 ++++++------- .../api_integration/services/svl_cases/omit.ts | 16 ++++++++-------- .../observability/cypress/support/commands.ts | 4 ++-- .../security/cypress/tasks/login.ts | 8 ++++---- yarn.lock | 18 +++++++++--------- 50 files changed, 144 insertions(+), 119 deletions(-) diff --git a/package.json b/package.json index 90d9f8aa5d2d7..e908c931fce58 100644 --- a/package.json +++ b/package.json @@ -938,7 +938,7 @@ "maplibre-gl": "3.1.0", "markdown-it": "^12.3.2", "md5": "^2.1.0", - "mdast-util-to-hast": "10.0.1", + "mdast-util-to-hast": "10.2.0", "memoize-one": "^6.0.0", "mime": "^2.4.4", "mime-types": "^2.1.27", @@ -1042,7 +1042,7 @@ "type-detect": "^4.0.8", "typescript-fsa": "^3.0.0", "typescript-fsa-reducers": "^1.2.2", - "unified": "^9.2.1", + "unified": "9.2.2", "use-resize-observer": "^9.1.0", "usng.js": "^0.4.5", "utility-types": "^3.10.0", diff --git a/packages/shared-ux/markdown/mocks/storybook.ts b/packages/shared-ux/markdown/mocks/storybook.ts index 3ed41273764ed..74c865365583b 100644 --- a/packages/shared-ux/markdown/mocks/storybook.ts +++ b/packages/shared-ux/markdown/mocks/storybook.ts @@ -82,7 +82,7 @@ export class MarkdownStorybookMock extends AbstractStorybookMock< }; } - getServices() { + getServices(): MarkdownProps { return { ...this.getProps() }; } } diff --git a/src/plugins/console/public/lib/autocomplete/autocomplete.ts b/src/plugins/console/public/lib/autocomplete/autocomplete.ts index d6bb3879669ae..79adee3bd42b7 100644 --- a/src/plugins/console/public/lib/autocomplete/autocomplete.ts +++ b/src/plugins/console/public/lib/autocomplete/autocomplete.ts @@ -999,7 +999,7 @@ export default function ({ // will simulate autocomplete on 'GET /a/b/' with a filter by index return { tokenPath: context.urlTokenPath?.slice(0, -1), - predicate: (term: any) => term.meta === 'index', + predicate: (term: ReturnType[0]) => term.meta === 'index', }; } else { // will do nothing special diff --git a/test/functional/apps/dashboard/group3/copy_panel_to.ts b/test/functional/apps/dashboard/group3/copy_panel_to.ts index dbafa5d68b5e8..3c6fa6d790eaf 100644 --- a/test/functional/apps/dashboard/group3/copy_panel_to.ts +++ b/test/functional/apps/dashboard/group3/copy_panel_to.ts @@ -14,7 +14,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const dashboardPanelActions = getService('dashboardPanelActions'); const testSubjects = getService('testSubjects'); const kibanaServer = getService('kibanaServer'); - const find = getService('find'); const PageObjects = getPageObjects([ 'header', diff --git a/x-pack/plugins/apm/server/routes/assistant_functions/get_apm_service_summary/index.ts b/x-pack/plugins/apm/server/routes/assistant_functions/get_apm_service_summary/index.ts index 92eafdf0b4ee7..64035f0373cfb 100644 --- a/x-pack/plugins/apm/server/routes/assistant_functions/get_apm_service_summary/index.ts +++ b/x-pack/plugins/apm/server/routes/assistant_functions/get_apm_service_summary/index.ts @@ -275,6 +275,7 @@ export async function getApmServiceSummary({ start, end, serviceName, + environment, }), getAnomalies({ serviceName, diff --git a/x-pack/plugins/asset_manager/server/routes/assets/hosts.ts b/x-pack/plugins/asset_manager/server/routes/assets/hosts.ts index 2b1088990334c..68ed4baaeb5c8 100644 --- a/x-pack/plugins/asset_manager/server/routes/assets/hosts.ts +++ b/x-pack/plugins/asset_manager/server/routes/assets/hosts.ts @@ -47,12 +47,15 @@ export function hostsRoutes({ async (context, req, res) => { const { from = 'now-24h', to = 'now' } = req.query || {}; const esClient = await getEsClientFromContext(context); + const coreContext = await context.core; + const soClient = coreContext.savedObjects.client; try { const response = await assetAccessor.getHosts({ from: datemath.parse(from)!.toISOString(), to: datemath.parse(to)!.toISOString(), esClient, + soClient, }); return res.ok({ body: response }); diff --git a/x-pack/plugins/enterprise_search/server/plugin.ts b/x-pack/plugins/enterprise_search/server/plugin.ts index 5dd5e56b2c3a1..02444bd6efa72 100644 --- a/x-pack/plugins/enterprise_search/server/plugin.ts +++ b/x-pack/plugins/enterprise_search/server/plugin.ts @@ -94,7 +94,7 @@ interface PluginsSetup { usageCollection?: UsageCollectionSetup; } -interface PluginsStart { +export interface PluginsStart { data: DataPluginStart; security: SecurityPluginStart; spaces?: SpacesPluginStart; diff --git a/x-pack/plugins/ml/public/mocks.ts b/x-pack/plugins/ml/public/mocks.ts index 77cdefdb2f1c9..c72d9ad0714bd 100644 --- a/x-pack/plugins/ml/public/mocks.ts +++ b/x-pack/plugins/ml/public/mocks.ts @@ -12,6 +12,8 @@ import type { MlPluginSetup, MlPluginStart } from './plugin'; const createSetupContract = (): jest.Mocked => { return { locator: sharePluginMock.createLocator(), + // TODO: Fix with proper mock (cc: @arnautov) + elasticModels: undefined as any, }; }; diff --git a/x-pack/plugins/ml/public/plugin.ts b/x-pack/plugins/ml/public/plugin.ts index 4eae00a53d401..14c4357aac7ad 100644 --- a/x-pack/plugins/ml/public/plugin.ts +++ b/x-pack/plugins/ml/public/plugin.ts @@ -18,7 +18,7 @@ import { take } from 'rxjs/operators'; import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import type { ManagementSetup } from '@kbn/management-plugin/public'; -import type { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; +import type { LocatorPublic, SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { HomePublicPluginSetup } from '@kbn/home-plugin/public'; import type { EmbeddableSetup, EmbeddableStart } from '@kbn/embeddable-plugin/public'; @@ -53,12 +53,13 @@ import { MlSharedServices, } from './application/services/get_shared_ml_services'; import { registerManagementSection } from './application/management'; -import { MlLocatorDefinition, type MlLocator } from './locator'; +import { MlLocatorDefinition, MlLocatorParams, type MlLocator } from './locator'; import { setDependencyCache } from './application/util/dependency_cache'; import { registerHomeFeature } from './register_home_feature'; import { isFullLicense, isMlEnabled } from '../common/license'; import { ML_APP_ROUTE, PLUGIN_ICON_SOLUTION, PLUGIN_ID } from '../common/constants/app'; import type { MlCapabilities } from './shared'; +import { ElasticModels } from './application/services/elastic_models_service'; export interface MlStartDependencies { data: DataPublicPluginStart; @@ -116,7 +117,10 @@ export class MlPlugin implements Plugin { this.isServerless = initializerContext.env.packageInfo.buildFlavor === 'serverless'; } - setup(core: MlCoreSetup, pluginsSetup: MlSetupDependencies) { + setup( + core: MlCoreSetup, + pluginsSetup: MlSetupDependencies + ): { locator?: LocatorPublic; elasticModels?: ElasticModels } { this.sharedMlServices = getMlSharedServices(core.http); core.application.register({ @@ -244,10 +248,14 @@ export class MlPlugin implements Plugin { return { locator: this.locator, + elasticModels: this.sharedMlServices.elasticModels, }; } - start(core: CoreStart, deps: MlStartDependencies) { + start( + core: CoreStart, + deps: MlStartDependencies + ): { locator?: LocatorPublic; elasticModels?: ElasticModels } { setDependencyCache({ docLinks: core.docLinks!, basePath: core.http.basePath, diff --git a/x-pack/plugins/observability_onboarding/public/components/app/custom_logs/install_elastic_agent.tsx b/x-pack/plugins/observability_onboarding/public/components/app/custom_logs/install_elastic_agent.tsx index aea68cdd6711c..5b6db7f900b79 100644 --- a/x-pack/plugins/observability_onboarding/public/components/app/custom_logs/install_elastic_agent.tsx +++ b/x-pack/plugins/observability_onboarding/public/components/app/custom_logs/install_elastic_agent.tsx @@ -63,7 +63,7 @@ export function InstallElasticAgent() { useState('linux-tar'); const enforcedDatasetName = - integration === dataset ? dataset : `${integration}.${dataset}`; + (integration === dataset ? dataset : `${integration}.${dataset}`) || ''; async function onContinue() { await singleDatasetLocator!.navigate({ @@ -113,7 +113,7 @@ export function InstallElasticAgent() { return callApi('POST /internal/observability_onboarding/logs/flow', { params: { body: { - name: datasetName, + name: datasetName || '', type: 'logFiles', state: { datasetName, diff --git a/x-pack/plugins/observability_onboarding/public/index.ts b/x-pack/plugins/observability_onboarding/public/index.ts index b83c5b6d5cad0..2b8271bb5c8ed 100644 --- a/x-pack/plugins/observability_onboarding/public/index.ts +++ b/x-pack/plugins/observability_onboarding/public/index.ts @@ -17,7 +17,7 @@ import { ObservabilityOnboardingPluginStart, } from './plugin'; -export { OBSERVABILITY_ONBOARDING_LOCATOR } from './locators/onboarding_locator/locator_definition'; +export type { OBSERVABILITY_ONBOARDING_LOCATOR } from './locators/onboarding_locator/locator_definition'; export type { ObservabilityOnboardingLocatorParams } from './locators/onboarding_locator/types'; export interface ConfigSchema { diff --git a/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/locator_definition.ts b/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/locator_definition.ts index a4f8965dda5a3..58b506ca4fa04 100644 --- a/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/locator_definition.ts +++ b/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/locator_definition.ts @@ -11,6 +11,8 @@ import { OBSERVABILITY_ONBOARDING_LOCATOR, } from '@kbn/deeplinks-observability/locators'; +export type { OBSERVABILITY_ONBOARDING_LOCATOR } from '@kbn/deeplinks-observability/locators'; + export class ObservabilityOnboardingLocatorDefinition implements LocatorDefinition { diff --git a/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/types.ts b/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/types.ts index 61f6d923db49d..5dfe136624d95 100644 --- a/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/types.ts +++ b/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/types.ts @@ -8,5 +8,6 @@ import type { LocatorPublic } from '@kbn/share-plugin/public'; import type { ObservabilityOnboardingLocatorParams } from '@kbn/deeplinks-observability/locators'; +export type { ObservabilityOnboardingLocatorParams } from '@kbn/deeplinks-observability/locators'; export type ObservabilityOnboardingLocator = LocatorPublic; diff --git a/x-pack/plugins/osquery/cypress/tsconfig.json b/x-pack/plugins/osquery/cypress/tsconfig.json index 11f17f033495b..17f02a25f4d61 100644 --- a/x-pack/plugins/osquery/cypress/tsconfig.json +++ b/x-pack/plugins/osquery/cypress/tsconfig.json @@ -3,11 +3,11 @@ "include": [ "**/*", "../cypress.config.ts", - "../serverless_cypress.config.ts", "../../../test_serverless/shared/lib" ], "exclude": [ - "target/**/*" + "target/**/*", + "../serverless_cypress.config.ts" ], "compilerOptions": { "outDir": "target/types", @@ -19,6 +19,9 @@ "resolveJsonModule": true, }, "kbn_references": [ + { + "path": "../../../test_serverless/tsconfig.json" + }, "@kbn/cypress-config", // cypress projects that are nested inside of other ts project use code // from the parent ts project in ways that can't be automatically deteceted @@ -31,4 +34,4 @@ "@kbn/fleet-plugin", "@kbn/cases-plugin", ] -} +} \ No newline at end of file diff --git a/x-pack/plugins/reporting/server/lib/store/store.ts b/x-pack/plugins/reporting/server/lib/store/store.ts index 1a0dcbf16a893..d4907d43bc490 100644 --- a/x-pack/plugins/reporting/server/lib/store/store.ts +++ b/x-pack/plugins/reporting/server/lib/store/store.ts @@ -86,7 +86,6 @@ export class ReportingStore { private readonly indexPrefix: string; // config setting of index prefix in system index name private readonly indexInterval: string; // config setting of index prefix: how often to poll for pending work private client?: ElasticsearchClient; - private ilmPolicyManager?: IlmPolicyManager; config: ReportingCore['config']; constructor(private reportingCore: ReportingCore, private logger: Logger) { @@ -107,7 +106,7 @@ export class ReportingStore { private async getIlmPolicyManager() { const client = await this.getClient(); - return (this.ilmPolicyManager = IlmPolicyManager.create({ client })); + return IlmPolicyManager.create({ client }); } private async createIndex(indexName: string) { diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/index.ts b/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/index.ts index ed2c60ea2e961..a34ac40ec8a28 100644 --- a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/index.ts +++ b/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/index.ts @@ -14,15 +14,9 @@ import * as timelineMarkdownPlugin from './timeline'; import * as osqueryMarkdownPlugin from './osquery'; import * as insightMarkdownPlugin from './insight'; -export const { - uiPlugins: nonStatefulUiPlugins, - parsingPlugins, - processingPlugins, -} = { - uiPlugins: getDefaultEuiMarkdownUiPlugins(), - parsingPlugins: getDefaultEuiMarkdownParsingPlugins(), - processingPlugins: getDefaultEuiMarkdownProcessingPlugins(), -}; +export const nonStatefulUiPlugins = getDefaultEuiMarkdownUiPlugins(); +export const parsingPlugins = getDefaultEuiMarkdownParsingPlugins(); +export const processingPlugins = getDefaultEuiMarkdownProcessingPlugins(); export const platinumOnlyPluginTokens = [insightMarkdownPlugin.insightPrefix]; diff --git a/x-pack/plugins/security_solution/public/flyout/left/components/test_ids.ts b/x-pack/plugins/security_solution/public/flyout/left/components/test_ids.ts index fc152e34d5074..5832ddda60c6d 100644 --- a/x-pack/plugins/security_solution/public/flyout/left/components/test_ids.ts +++ b/x-pack/plugins/security_solution/public/flyout/left/components/test_ids.ts @@ -11,6 +11,7 @@ import { PREFIX } from '../../shared/test_ids'; export const ANALYZER_GRAPH_TEST_ID = `${PREFIX}AnalyzerGraph` as const; export const SESSION_VIEW_TEST_ID = `${PREFIX}SessionView` as const; +export const SESSION_VIEW_ERROR_TEST_ID = `${PREFIX}SessionViewError` as const; /* Insights tab */ diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts index 534b681c2aeb4..86fea41b7729a 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts @@ -8,7 +8,7 @@ import { pick } from 'lodash'; import type { CyIndexEndpointHosts } from '../../../tasks/index_endpoint_hosts'; import { indexEndpointHosts } from '../../../tasks/index_endpoint_hosts'; -import { login, ROLE } from '../../../tasks/login'; +import { login, ROLE, type ROLE_KEYS } from '../../../tasks/login'; import { ensurePolicyDetailsPageAuthzAccess } from '../../../screens/policy_details'; import type { EndpointArtifactPageId } from '../../../screens'; import { @@ -63,7 +63,7 @@ describe( }); // roles `t1_analyst` and `t2_analyst` are very similar with exception of one page - (['t1_analyst', `t2_analyst`] as ROLE[]).forEach((roleName) => { + (['t1_analyst', `t2_analyst`] as ROLE_KEYS[]).forEach((roleName) => { describe(`for role: ${roleName}`, () => { const deniedPages = allPages.filter((page) => page.id !== 'endpointList'); @@ -350,7 +350,7 @@ describe( }); }); - (['platform_engineer', 'endpoint_policy_manager'] as ROLE[]).forEach((roleName) => { + (['platform_engineer', 'endpoint_policy_manager'] as ROLE_KEYS[]).forEach((roleName) => { describe(`for role: ${roleName}`, () => { const artifactPagesFullAccess = [ pageById.trustedApps, diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/essentials_with_endpoint.roles.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/essentials_with_endpoint.roles.cy.ts index 6cf3ab727980a..7ba47f2be985a 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/essentials_with_endpoint.roles.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/essentials_with_endpoint.roles.cy.ts @@ -7,7 +7,7 @@ import type { CyIndexEndpointHosts } from '../../../tasks/index_endpoint_hosts'; import { indexEndpointHosts } from '../../../tasks/index_endpoint_hosts'; -import { login, ROLE } from '../../../tasks/login'; +import { login, ROLE, type ROLE_KEYS } from '../../../tasks/login'; import type { EndpointArtifactPageId } from '../../../screens'; import { getNoPrivilegesPage, @@ -55,7 +55,7 @@ describe( }); // roles `t1_analyst` and `t2_analyst` are the same as far as endpoint access - (['t1_analyst', `t2_analyst`] as ROLE[]).forEach((roleName) => { + (['t1_analyst', `t2_analyst`] as ROLE_KEYS[]).forEach((roleName) => { describe(`for role: ${roleName}`, () => { const deniedPages = allPages.filter((page) => page.id !== 'endpointList'); @@ -238,7 +238,7 @@ describe( // Endpoint Operations Manager, Endpoint Policy Manager and Platform Engineer currently have the same level of access ( - ['platform_engineer', `endpoint_operations_analyst`, 'endpoint_policy_manager'] as ROLE[] + ['platform_engineer', `endpoint_operations_analyst`, 'endpoint_policy_manager'] as ROLE_KEYS[] ).forEach((roleName) => { describe(`for role: ${roleName}`, () => { const artifactPagesFullAccess = [ diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/login.ts b/x-pack/plugins/security_solution/public/management/cypress/tasks/login.ts index 8ac78b508d084..2b8bb2bb1c8df 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/tasks/login.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/tasks/login.ts @@ -17,6 +17,7 @@ export const ROLE = Object.freeze>({ elastic_serverless: 'elastic_serverless', system_indices_superuser: 'system_indices_superuser', }); +export type ROLE_KEYS = keyof typeof ROLE; interface CyLoginTask { (user?: SecurityTestUser): ReturnType; @@ -94,7 +95,9 @@ const sendApiLoginRequest = ( const basicProvider = loginState.body.selector.providers.find( (provider) => provider.type === 'basic' ); - + if (!basicProvider) { + throw new Error(`basicProvider was not found`); + } return request({ url: loginUrl, method: 'POST', diff --git a/x-pack/plugins/security_solution_ess/public/common/__mocks__/services.mock.ts b/x-pack/plugins/security_solution_ess/public/common/__mocks__/services.mock.ts index 9e9909b45894b..a7ec12d938dbd 100644 --- a/x-pack/plugins/security_solution_ess/public/common/__mocks__/services.mock.ts +++ b/x-pack/plugins/security_solution_ess/public/common/__mocks__/services.mock.ts @@ -12,4 +12,7 @@ import type { Services } from '../services'; export const mockServices: Services = { ...coreMock.createStart(), securitySolution: securitySolutionMock.createStart(), + // TODO: contact @machadoum Pablo Machado + // eslint-disable-next-line @typescript-eslint/no-explicit-any + licensing: undefined as any, }; diff --git a/x-pack/plugins/security_solution_ess/public/upselling/register_upsellings.tsx b/x-pack/plugins/security_solution_ess/public/upselling/register_upsellings.tsx index 05af48c280395..45dada7dfecbe 100644 --- a/x-pack/plugins/security_solution_ess/public/upselling/register_upsellings.tsx +++ b/x-pack/plugins/security_solution_ess/public/upselling/register_upsellings.tsx @@ -7,13 +7,13 @@ import { SecurityPageName } from '@kbn/security-solution-plugin/common'; import type { - MessageUpsellings, PageUpsellings, SectionUpsellings, UpsellingMessageId, UpsellingSectionId, UpsellingService, } from '@kbn/security-solution-upselling/service'; +import type { MessageUpsellings } from '@kbn/security-solution-upselling/service/types'; import type { ILicense, LicenseType } from '@kbn/licensing-plugin/public'; import React, { lazy } from 'react'; import { UPGRADE_INVESTIGATION_GUIDE } from '@kbn/security-solution-upselling/messages'; diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/hooks/use_product_type_by_pli.ts b/x-pack/plugins/security_solution_serverless/public/upselling/hooks/use_product_type_by_pli.ts index dc5d7debb2954..89038bcf4f4af 100644 --- a/x-pack/plugins/security_solution_serverless/public/upselling/hooks/use_product_type_by_pli.ts +++ b/x-pack/plugins/security_solution_serverless/public/upselling/hooks/use_product_type_by_pli.ts @@ -5,10 +5,10 @@ * 2.0. */ -import type { AppFeatureKey } from '@kbn/security-solution-plugin/common'; +import type { AppFeatureKeyType } from '@kbn/security-solution-features/keys'; import { PLI_APP_FEATURES } from '../../../common/pli/pli_config'; -export const getProductTypeByPLI = (requiredPLI: AppFeatureKey): string | null => { +export const getProductTypeByPLI = (requiredPLI: AppFeatureKeyType): string | null => { if (PLI_APP_FEATURES.security.essentials.includes(requiredPLI)) { return 'Security Essentials'; } diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/pages/osquery_automated_response_actions.tsx b/x-pack/plugins/security_solution_serverless/public/upselling/pages/osquery_automated_response_actions.tsx index 2168390eb31a2..acb9816140584 100644 --- a/x-pack/plugins/security_solution_serverless/public/upselling/pages/osquery_automated_response_actions.tsx +++ b/x-pack/plugins/security_solution_serverless/public/upselling/pages/osquery_automated_response_actions.tsx @@ -8,11 +8,11 @@ import { EuiEmptyPrompt, EuiIcon } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; -import type { AppFeatureKey } from '@kbn/security-solution-plugin/common'; +import type { AppFeatureKeyType } from '@kbn/security-solution-features/keys'; import { getProductTypeByPLI } from '../hooks/use_product_type_by_pli'; -const OsqueryResponseActionsUpsellingSection: React.FC<{ requiredPLI: AppFeatureKey }> = React.memo( - ({ requiredPLI }) => { +const OsqueryResponseActionsUpsellingSection: React.FC<{ requiredPLI: AppFeatureKeyType }> = + React.memo(({ requiredPLI }) => { const productTypeRequired = getProductTypeByPLI(requiredPLI); return ( @@ -38,8 +38,7 @@ const OsqueryResponseActionsUpsellingSection: React.FC<{ requiredPLI: AppFeature } /> ); - } -); + }); OsqueryResponseActionsUpsellingSection.displayName = 'OsqueryResponseActionsUpsellingSection'; diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/pages/threat_intelligence_paywall.tsx b/x-pack/plugins/security_solution_serverless/public/upselling/pages/threat_intelligence_paywall.tsx index 984b4ac74ca79..9fc0d63a77bd2 100644 --- a/x-pack/plugins/security_solution_serverless/public/upselling/pages/threat_intelligence_paywall.tsx +++ b/x-pack/plugins/security_solution_serverless/public/upselling/pages/threat_intelligence_paywall.tsx @@ -8,11 +8,11 @@ import React from 'react'; import { EuiEmptyPrompt, EuiIcon } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import type { AppFeatureKey } from '@kbn/security-solution-plugin/common'; +import type { AppFeatureKeyType } from '@kbn/security-solution-features/keys'; import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { getProductTypeByPLI } from '../hooks/use_product_type_by_pli'; -const ThreatIntelligencePaywall: React.FC<{ requiredPLI: AppFeatureKey }> = React.memo( +const ThreatIntelligencePaywall: React.FC<{ requiredPLI: AppFeatureKeyType }> = React.memo( function PaywallComponent({ requiredPLI }) { const productTypeRequired = getProductTypeByPLI(requiredPLI); diff --git a/x-pack/plugins/serverless_search/public/layout/nav.tsx b/x-pack/plugins/serverless_search/public/layout/nav.tsx index 10d963100f89c..ebf26bcf0a44b 100644 --- a/x-pack/plugins/serverless_search/public/layout/nav.tsx +++ b/x-pack/plugins/serverless_search/public/layout/nav.tsx @@ -17,12 +17,12 @@ import type { ServerlessPluginStart } from '@kbn/serverless/public'; import type { CloudStart } from '@kbn/cloud-plugin/public'; // Hiding this until page is in a better space -const _connectorItem = { - link: 'serverlessConnectors', - title: i18n.translate('xpack.serverlessSearch.nav.connectors', { - defaultMessage: 'Connectors', - }), -}; +// const _connectorItem = { +// link: 'serverlessConnectors', +// title: i18n.translate('xpack.serverlessSearch.nav.connectors', { +// defaultMessage: 'Connectors', +// }), +// }; const navigationTree: NavigationTreeDefinition = { body: [ diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.tsx index debe978973bac..b6f54e7ad6fff 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.tsx @@ -40,7 +40,7 @@ export const MonitorAddPage = () => { } return locationsLoaded ? ( - + ) : ( diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/schedule_circuit_breaker/create_with_circuit_breaker.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/schedule_circuit_breaker/create_with_circuit_breaker.ts index 8183f6b48f4ed..bf1a0792a0091 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/schedule_circuit_breaker/create_with_circuit_breaker.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/schedule_circuit_breaker/create_with_circuit_breaker.ts @@ -26,7 +26,7 @@ export default function createWithCircuitBreakerTests({ getService }: FtrProvide .expect(200); objectRemover.add('space1', createdRule.id, 'rule', 'alerting'); - const { body } = await supertest + await supertest .post(`${getUrlPrefix('space1')}/api/alerting/rule`) .set('kbn-xsrf', 'foo') .send(getTestRuleData({ schedule: { interval: '10s' } })) @@ -41,7 +41,7 @@ export default function createWithCircuitBreakerTests({ getService }: FtrProvide .expect(200); objectRemover.add('space1', createdRule.id, 'rule', 'alerting'); - const { body } = await supertest + await supertest .post(`${getUrlPrefix('space2')}/api/alerting/rule`) .set('kbn-xsrf', 'foo') .send(getTestRuleData({ schedule: { interval: '10s' } })) diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/suggestions_value_alert.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/suggestions_value_alert.ts index 3980c174528ed..1478a02454bb0 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/suggestions_value_alert.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/suggestions_value_alert.ts @@ -17,7 +17,6 @@ export default function createRuleSuggestionValuesTests({ getService }: FtrProvi describe('alerts/suggestions/values', async () => { const esArchiver = getService('esArchiver'); const supertest = getService('supertest'); - const supertestWithoutAuth = getService('supertestWithoutAuth'); before(async () => { await esArchiver.load('x-pack/test/functional/es_archives/observability/alerts'); diff --git a/x-pack/test/api_integration/apis/management/ingest_pipelines/lib/fixtures.ts b/x-pack/test/api_integration/apis/management/ingest_pipelines/lib/fixtures.ts index c148101749085..344b6fab0f07f 100644 --- a/x-pack/test/api_integration/apis/management/ingest_pipelines/lib/fixtures.ts +++ b/x-pack/test/api_integration/apis/management/ingest_pipelines/lib/fixtures.ts @@ -12,7 +12,7 @@ import { IngestPutPipelineRequest, } from '@elastic/elasticsearch/lib/api/types'; -interface Pipeline { +export interface Pipeline { name: string; description?: string; onFailureProcessors?: IngestProcessorContainer[]; @@ -21,7 +21,7 @@ interface Pipeline { metadata?: Metadata; } -interface IngestPutPipelineInternalRequest extends Omit { +export interface IngestPutPipelineInternalRequest extends Omit { name: string; } diff --git a/x-pack/test/api_integration/apis/security_solution/authentications.ts b/x-pack/test/api_integration/apis/security_solution/authentications.ts index aa54114e04d72..b65c93995156b 100644 --- a/x-pack/test/api_integration/apis/security_solution/authentications.ts +++ b/x-pack/test/api_integration/apis/security_solution/authentications.ts @@ -9,10 +9,10 @@ import expect from '@kbn/expect'; import { AuthStackByField, Direction, - UserAuthenticationsRequestOptions, UserAuthenticationsStrategyResponse, UsersQueries, } from '@kbn/security-solution-plugin/common/search_strategy'; +import type { UserAuthenticationsRequestOptions } from '@kbn/security-solution-plugin/common/api/search_strategy'; import { FtrProviderContext } from '../../ftr_provider_context'; diff --git a/x-pack/test/apm_api_integration/common/registry.ts b/x-pack/test/apm_api_integration/common/registry.ts index 6876854b5991d..6ae932f59e2a4 100644 --- a/x-pack/test/apm_api_integration/common/registry.ts +++ b/x-pack/test/apm_api_integration/common/registry.ts @@ -153,7 +153,7 @@ export function RegistryProvider({ getService }: FtrProviderContext) { await supertest .get('/api/ml/saved_objects/sync') .set('kbn-xsrf', 'foo') - .auth(ApmUsername.editorUser, kbnTestConfig.getUrlParts().password); + .auth(ApmUsername.editorUser, kbnTestConfig.getUrlParts().password!); } if (condition.archives.length) { log('Loaded all archives'); diff --git a/x-pack/test/apm_api_integration/tests/diagnostics/indices.spec.ts b/x-pack/test/apm_api_integration/tests/diagnostics/indices.spec.ts index 3314b4fdcfcfc..7822acfe923ff 100644 --- a/x-pack/test/apm_api_integration/tests/diagnostics/indices.spec.ts +++ b/x-pack/test/apm_api_integration/tests/diagnostics/indices.spec.ts @@ -61,7 +61,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); expect(status).to.be(200); - expect(body.validIndices.length).to.be.greaterThan(0); + expect(body.validIndices?.length).to.be.greaterThan(0); expect(body.invalidIndices).to.eql([]); }); }); @@ -102,7 +102,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); expect(status).to.be(200); - expect(body.validIndices.length).to.be.greaterThan(0); + expect(body.validIndices?.length).to.be.greaterThan(0); expect(body.invalidIndices).to.eql([ { isValid: false, @@ -158,10 +158,10 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); expect(status).to.be(200); - expect(body.validIndices.length).to.be.greaterThan(0); - expect(body.invalidIndices.length).to.be(1); + expect(body.validIndices?.length).to.be.greaterThan(0); + expect(body.invalidIndices?.length).to.be(1); - expect(omit(body.invalidIndices[0], 'index')).to.eql({ + expect(omit(body.invalidIndices?.[0], 'index')).to.eql({ isValid: false, fieldMappings: { isValid: true }, ingestPipeline: { isValid: false }, @@ -187,9 +187,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); expect(status).to.be(200); - expect(body.validIndices.length).to.be.greaterThan(0); - expect(body.invalidIndices.length).to.be(1); - expect(omit(body.invalidIndices[0], 'index')).to.eql({ + expect(body.validIndices?.length).to.be.greaterThan(0); + expect(body.invalidIndices?.length).to.be(1); + expect(omit(body.invalidIndices?.[0], 'index')).to.eql({ isValid: false, fieldMappings: { isValid: true }, ingestPipeline: { isValid: false, id: 'logs-default-pipeline' }, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group9/exception_operators_data_types/ip_array.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group9/exception_operators_data_types/ip_array.ts index d828b332d215a..0fcdf1a03b14b 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group9/exception_operators_data_types/ip_array.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group9/exception_operators_data_types/ip_array.ts @@ -152,7 +152,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); const ips = signalsOpen.hits.hits.map((hit) => hit._source?.ip).sort(); - expect(ips.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); + expect(ips.flat(10)).to.eql([]); }); it('should filter a CIDR range of "127.0.0.1/30"', async () => { @@ -347,7 +347,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); const ips = signalsOpen.hits.hits.map((hit) => hit._source?.ip).sort(); - expect(ips.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); + expect(ips.flat(10)).to.eql([]); }); }); @@ -409,7 +409,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); const ips = signalsOpen.hits.hits.map((hit) => hit._source?.ip).sort(); - expect(ips.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); + expect(ips.flat(10)).to.eql([]); }); }); @@ -514,7 +514,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); const ips = signalsOpen.hits.hits.map((hit) => hit._source?.ip).sort(); - expect(ips.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); + expect(ips.flat(10)).to.eql([]); }); it('will return 2 results if we have a list which contains the CIDR ranges of "127.0.0.1/32, 127.0.0.2/31, 127.0.0.4/30"', async () => { diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group9/exception_operators_data_types/text_array.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group9/exception_operators_data_types/text_array.ts index 27d28c3630293..fe4a13fcc3c84 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group9/exception_operators_data_types/text_array.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group9/exception_operators_data_types/text_array.ts @@ -152,7 +152,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); const hits = signalsOpen.hits.hits.map((hit) => hit._source?.text).sort(); - expect(hits.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); + expect(hits.flat(10)).to.eql([]); }); }); @@ -280,7 +280,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); const hits = signalsOpen.hits.hits.map((hit) => hit._source?.text).sort(); - expect(hits.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); + expect(hits.flat(10)).to.eql([]); }); }); @@ -342,7 +342,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); const hits = signalsOpen.hits.hits.map((hit) => hit._source?.text).sort(); - expect(hits.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); + expect(hits.flat(10)).to.eql([]); }); }); @@ -522,7 +522,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); const hits = signalsOpen.hits.hits.map((hit) => hit._source?.text).sort(); - expect(hits.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); + expect(hits.flat(10)).to.eql([]); }); }); diff --git a/x-pack/test/disable_ems/tests/fonts.ts b/x-pack/test/disable_ems/tests/fonts.ts index aec0b0a6d6802..b8b6d6903db5e 100644 --- a/x-pack/test/disable_ems/tests/fonts.ts +++ b/x-pack/test/disable_ems/tests/fonts.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import type { FtrProviderContext } from '../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['maps']); diff --git a/x-pack/test/fleet_api_integration/apis/download_sources/crud.ts b/x-pack/test/fleet_api_integration/apis/download_sources/crud.ts index 587a4b7fc884c..8b0e5ca8c4e77 100644 --- a/x-pack/test/fleet_api_integration/apis/download_sources/crud.ts +++ b/x-pack/test/fleet_api_integration/apis/download_sources/crud.ts @@ -357,7 +357,7 @@ export default function (providerContext: FtrProviderContext) { 'https://some.source.proxy:3232' ); - const res = await supertest + await supertest .put(`/api/fleet/agent_download_sources/${downloadSourceId}`) .set('kbn-xsrf', 'xxxx') .send({ diff --git a/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts b/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts index e0c6799b5a3cd..3f5c414f46ef8 100644 --- a/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts +++ b/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts @@ -126,7 +126,11 @@ export default function (providerContext: FtrProviderContext) { ); }); - async function waitForAgents(expectedAgentCount: number, attempts: number, _attemptsMade = 0) { + async function waitForAgents( + expectedAgentCount: number, + attempts: number, + _attemptsMade = 0 + ): Promise { const { body: apiResponse } = await supertest .get(`/api/fleet/agents?showInactive=true`) .set('kbn-xsrf', 'xxxx') diff --git a/x-pack/test/functional/apps/dashboard/group3/drilldowns/explore_data_chart_action.ts b/x-pack/test/functional/apps/dashboard/group3/drilldowns/explore_data_chart_action.ts index dff41ef2ead73..b8521914da174 100644 --- a/x-pack/test/functional/apps/dashboard/group3/drilldowns/explore_data_chart_action.ts +++ b/x-pack/test/functional/apps/dashboard/group3/drilldowns/explore_data_chart_action.ts @@ -13,7 +13,7 @@ const ACTION_TEST_SUBJ = `embeddablePanelAction-${ACTION_ID}`; export default function ({ getService, getPageObjects }: FtrProviderContext) { const drilldowns = getService('dashboardDrilldownsManage'); - const { dashboard, discover, common, timePicker } = getPageObjects([ + const { dashboard, discover, timePicker } = getPageObjects([ 'dashboard', 'discover', 'common', @@ -28,7 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Explore underlying data - chart action', () => { describe('value click action', () => { it('action exists in chart click popup menu', async () => { - await PageObjects.dashboard.navigateToApp(); + await dashboard.navigateToApp(); await dashboard.preserveCrossAppState(); await dashboard.loadSavedDashboard(drilldowns.DASHBOARD_WITH_PIE_CHART_NAME); await pieChart.clickOnPieSlice('160,000'); @@ -60,7 +60,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { let originalTimeRangeDurationHours: number | undefined; it('action exists in chart brush popup menu', async () => { - await PageObjects.dashboard.navigateToApp(); + await dashboard.navigateToApp(); await dashboard.preserveCrossAppState(); await dashboard.loadSavedDashboard(drilldowns.DASHBOARD_WITH_AREA_CHART_NAME); diff --git a/x-pack/test/functional/apps/transform/creation/index_pattern/continuous_transform.ts b/x-pack/test/functional/apps/transform/creation/index_pattern/continuous_transform.ts index d050a1a9013c6..4364e386b8637 100644 --- a/x-pack/test/functional/apps/transform/creation/index_pattern/continuous_transform.ts +++ b/x-pack/test/functional/apps/transform/creation/index_pattern/continuous_transform.ts @@ -6,6 +6,7 @@ */ import { TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; +import type { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/types'; import type { FtrProviderContext } from '../../../../ftr_provider_context'; import { diff --git a/x-pack/test/functional/page_objects/tag_management_page.ts b/x-pack/test/functional/page_objects/tag_management_page.ts index 2dbff16429c93..7e8fbd8346c1d 100644 --- a/x-pack/test/functional/page_objects/tag_management_page.ts +++ b/x-pack/test/functional/page_objects/tag_management_page.ts @@ -239,7 +239,6 @@ class TagAssignmentFlyout extends FtrService { */ export class TagManagementPageObject extends FtrService { private readonly testSubjects = this.ctx.getService('testSubjects'); - private readonly find = this.ctx.getService('find'); private readonly browser = this.ctx.getService('browser'); private readonly retry = this.ctx.getService('retry'); private readonly header = this.ctx.getPageObject('header'); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/inspect/inspect_button.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/inspect/inspect_button.cy.ts index dbd593f15e1ac..78ead35a49327 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/inspect/inspect_button.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/inspect/inspect_button.cy.ts @@ -47,9 +47,11 @@ describe('Inspect Explore pages', { tags: ['@ess', '@serverless', '@brokenInServ login(); visit(url, { - onLoad: () => { - waitForWelcomePanelToBeLoaded(); - selectDataView(DATA_VIEW); + visitOptions: { + onLoad: () => { + waitForWelcomePanelToBeLoaded(); + selectDataView(DATA_VIEW); + }, }, }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/navigation.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/navigation.cy.ts index f8107e92cc64b..d61ba89fa90b2 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/navigation.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/alerts/navigation.cy.ts @@ -9,7 +9,7 @@ import { expandFirstAlert, waitForAlerts } from '../../../tasks/alerts'; import { createRule } from '../../../tasks/api_calls/rules'; import { cleanKibana } from '../../../tasks/common'; import { login } from '../../../tasks/login'; -import { visit } from '../../../tasks/navigation'; +import { visit, visitWithTimeRange } from '../../../tasks/navigation'; import { getNewRule } from '../../../objects/rule'; diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts index 8abcac5843cfa..60af66a577b23 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts @@ -34,9 +34,11 @@ describe('Row renderers', { tags: ['@ess', '@serverless'] }, () => { deleteTimelines(); login(); visitWithTimeRange(hostsUrl('allHosts'), { - onLoad: () => { - waitForWelcomePanelToBeLoaded(); - waitForAllHostsToBeLoaded(); + visitOptions: { + onLoad: () => { + waitForWelcomePanelToBeLoaded(); + waitForAllHostsToBeLoaded(); + }, }, }); openTimelineUsingToggle(); diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/login.ts b/x-pack/test/security_solution_cypress/cypress/tasks/login.ts index 34312b3bd5876..40e63c462e27e 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/login.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/login.ts @@ -147,8 +147,8 @@ const loginWithUsernameAndPassword = (username: string, password: string) => { method: 'POST', headers, body: { - providerType: basicProvider.type, - providerName: basicProvider.name, + providerType: basicProvider!.type, + providerName: basicProvider!.name, currentURL: '/', params: { username, password }, }, diff --git a/x-pack/test_serverless/api_integration/services/svl_cases/api.ts b/x-pack/test_serverless/api_integration/services/svl_cases/api.ts index 474a92c317e9f..9571806ef39b9 100644 --- a/x-pack/test_serverless/api_integration/services/svl_cases/api.ts +++ b/x-pack/test_serverless/api_integration/services/svl_cases/api.ts @@ -14,17 +14,16 @@ import { CasesFindResponse } from '@kbn/cases-plugin/common/types/api'; import { kbnTestConfig, kibanaTestSuperuserServerless } from '@kbn/test'; import { FtrProviderContext } from '../../ftr_provider_context'; +export interface User { + username: string; + password: string; + description?: string; + roles: string[]; +} export function SvlCasesApiServiceProvider({ getService }: FtrProviderContext) { const kbnServer = getService('kibanaServer'); const supertest = getService('supertest'); - interface User { - username: string; - password: string; - description?: string; - roles: string[]; - } - const superUser: User = { username: 'superuser', password: 'superuser', diff --git a/x-pack/test_serverless/api_integration/services/svl_cases/omit.ts b/x-pack/test_serverless/api_integration/services/svl_cases/omit.ts index 94ce0a479fffc..cb424ed73609c 100644 --- a/x-pack/test_serverless/api_integration/services/svl_cases/omit.ts +++ b/x-pack/test_serverless/api_integration/services/svl_cases/omit.ts @@ -9,15 +9,15 @@ import { Case, Attachment } from '@kbn/cases-plugin/common/types/domain'; import { omit } from 'lodash'; import { FtrProviderContext } from '../../ftr_provider_context'; -export function SvlCasesOmitServiceProvider({}: FtrProviderContext) { - interface CommonSavedObjectAttributes { - id?: string | null; - created_at?: string | null; - updated_at?: string | null; - version?: string | null; - [key: string]: unknown; - } +export interface CommonSavedObjectAttributes { + id?: string | null; + created_at?: string | null; + updated_at?: string | null; + version?: string | null; + [key: string]: unknown; +} +export function SvlCasesOmitServiceProvider({}: FtrProviderContext) { const savedObjectCommonAttributes = ['created_at', 'updated_at', 'version', 'id']; return { diff --git a/x-pack/test_serverless/functional/test_suites/observability/cypress/support/commands.ts b/x-pack/test_serverless/functional/test_suites/observability/cypress/support/commands.ts index 42b6801c6ab5b..8554aed56d3f4 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/cypress/support/commands.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/cypress/support/commands.ts @@ -31,8 +31,8 @@ Cypress.Commands.add('loginAsElasticUser', () => { method: 'POST', url: `${kibanaUrlWithoutAuth}/internal/security/login`, body: { - providerType: basicProvider.type, - providerName: basicProvider.name, + providerType: basicProvider!.type, + providerName: basicProvider!.name, currentURL: `${kibanaUrlWithoutAuth}/login`, params: { username, password }, }, diff --git a/x-pack/test_serverless/functional/test_suites/security/cypress/tasks/login.ts b/x-pack/test_serverless/functional/test_suites/security/cypress/tasks/login.ts index de79a7a94f275..8f731304db293 100644 --- a/x-pack/test_serverless/functional/test_suites/security/cypress/tasks/login.ts +++ b/x-pack/test_serverless/functional/test_suites/security/cypress/tasks/login.ts @@ -7,7 +7,7 @@ import { request } from '@kbn/security-solution-plugin/public/management/cypress/tasks/common'; import { LoginState } from '@kbn/security-plugin/common/login_state'; -import type { ServerlessRoleName } from '../../../../../shared/lib'; +import { ServerlessRoleName } from '../../../../../shared/lib'; import { STANDARD_HTTP_HEADERS } from '../../../../../shared/lib/security/default_http_headers'; /** @@ -36,8 +36,8 @@ const sendApiLoginRequest = ( method: 'POST', headers, body: { - providerType: basicProvider.type, - providerName: basicProvider.name, + providerType: basicProvider!.type, + providerName: basicProvider!.name, currentURL: '/', params: { username, password }, }, @@ -64,7 +64,7 @@ interface CyLoginTask { * @param user Defaults to `soc_manager` */ export const login: CyLoginTask = ( - user: ServerlessRoleName | 'elastic' = 'soc_manager' + user: ServerlessRoleName | 'elastic' = ServerlessRoleName.SOC_MANAGER ): ReturnType => { let username = Cypress.env('KIBANA_USERNAME'); let password = Cypress.env('KIBANA_PASSWORD'); diff --git a/yarn.lock b/yarn.lock index 6a4f80236417c..ac82dfdfe47dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21736,7 +21736,7 @@ mdast-util-to-hast@10.0.1, mdast-util-to-hast@^10.0.0: unist-util-position "^3.0.0" unist-util-visit "^2.0.0" -mdast-util-to-hast@^10.2.0: +mdast-util-to-hast@10.2.0, mdast-util-to-hast@^10.2.0: version "10.2.0" resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-10.2.0.tgz#61875526a017d8857b71abc9333942700b2d3604" integrity sha512-JoPBfJ3gBnHZ18icCwHR50orC9kNH81tiR1gs01D8Q5YpV6adHNO9nKNuFBCJQ941/32PT1a63UF/DitmS3amQ== @@ -29483,10 +29483,10 @@ unified@9.2.0: trough "^1.0.0" vfile "^4.0.0" -unified@^9.0.0, unified@^9.2.1: - version "9.2.1" - resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.1.tgz#ae18d5674c114021bfdbdf73865ca60f410215a3" - integrity sha512-juWjuI8Z4xFg8pJbnEZ41b5xjGUWGHqXALmBZ3FC3WX0PIx1CZBIIJ6mXbYMcf6Yw4Fi0rFUTA1cdz/BglbOhA== +unified@9.2.2, unified@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.2.tgz#67649a1abfc3ab85d2969502902775eb03146975" + integrity sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ== dependencies: bail "^1.0.0" extend "^3.0.0" @@ -29495,10 +29495,10 @@ unified@^9.0.0, unified@^9.2.1: trough "^1.0.0" vfile "^4.0.0" -unified@^9.2.2: - version "9.2.2" - resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.2.tgz#67649a1abfc3ab85d2969502902775eb03146975" - integrity sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ== +unified@^9.0.0: + version "9.2.1" + resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.1.tgz#ae18d5674c114021bfdbdf73865ca60f410215a3" + integrity sha512-juWjuI8Z4xFg8pJbnEZ41b5xjGUWGHqXALmBZ3FC3WX0PIx1CZBIIJ6mXbYMcf6Yw4Fi0rFUTA1cdz/BglbOhA== dependencies: bail "^1.0.0" extend "^3.0.0"