Skip to content

Commit

Permalink
rename common/types to common/types_old
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenIdo committed Dec 7, 2023
1 parent d9d2723 commit f3fbc91
Show file tree
Hide file tree
Showing 69 changed files with 71 additions and 71 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/cloud_security_posture/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
VulnSeverity,
AwsCredentialsTypeFieldMap,
GcpCredentialsTypeFieldMap,
} from './types';
} from './types_old';

export const STATUS_ROUTE_PATH = '/internal/cloud_security_posture/status';
export const STATUS_API_CURRENT_VERSION = '1';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// TODO: this needs to be defined in a versioned schema
import type { EcsEvent } from '@kbn/ecs';
import { VulnSeverity } from '../types';
import { VulnSeverity } from '../types_old';

export interface CspVulnerabilityFinding {
'@timestamp': string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import type {
GcpCredentialsType,
AzureCredentialsType,
RuleSection,
} from '../types';
} from '../types_old';

/**
* @example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { useQuery, type UseQueryOptions } from '@tanstack/react-query';
import { useKibana } from '../hooks/use_kibana';
import { type CspSetupStatus } from '../../../common/types';
import { type CspSetupStatus } from '../../../common/types_old';
import { STATUS_API_CURRENT_VERSION, STATUS_ROUTE_PATH } from '../../../common/constants';

const getCspSetupStatusQueryKey = 'csp_status_key';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { useQuery, UseQueryOptions } from '@tanstack/react-query';
import { useKibana } from '../hooks/use_kibana';
import { ComplianceDashboardDataV2, PosturePolicyTemplate } from '../../../common/types';
import { ComplianceDashboardDataV2, PosturePolicyTemplate } from '../../../common/types_old';
import {
CSPM_POLICY_TEMPLATE,
KSPM_POLICY_TEMPLATE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { useQuery, UseQueryOptions } from '@tanstack/react-query';
import { CnvmDashboardData } from '../../../common/types';
import { CnvmDashboardData } from '../../../common/types_old';
import { useKibana } from '../hooks/use_kibana';
import { VULNERABILITIES_DASHBOARD_ROUTE_PATH } from '../../../common/constants';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { i18n } from '@kbn/i18n';
import { euiThemeVars } from '@kbn/ui-theme';
import type { CloudSecurityPolicyTemplate, PostureInput } from '../../common/types';
import type { CloudSecurityPolicyTemplate, PostureInput } from '../../common/types_old';
import {
CLOUDBEAT_EKS,
CLOUDBEAT_VANILLA,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { i18n } from '@kbn/i18n';
import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '../../../common/constants';
import { PosturePolicyTemplate } from '../../../common/types';
import { PosturePolicyTemplate } from '../../../common/types_old';
import type {
CspBenchmarksPage,
CspIntegrationDocNavigationItem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { pagePathGetters, pkgKeyFromPackageInfo } from '@kbn/fleet-plugin/public';
import type { CloudSecurityPolicyTemplate } from '../../../common/types';
import type { CloudSecurityPolicyTemplate } from '../../../common/types_old';
import { useCisKubernetesIntegration } from '../api/use_cis_kubernetes_integration';
import { useKibana } from '../hooks/use_kibana';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { pagePathGetters, pkgKeyFromPackageInfo } from '@kbn/fleet-plugin/public
import { useCisKubernetesIntegration } from '../api/use_cis_kubernetes_integration';
import { useKibana } from '../hooks/use_kibana';
import { useCspBenchmarkIntegrations } from '../../pages/benchmarks/use_csp_benchmark_integrations';
import { PostureTypes } from '../../../common/types';
import { PostureTypes } from '../../../common/types_old';

export const useCISIntegrationPoliciesLink = ({
postureType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import type { PackagePolicy } from '@kbn/fleet-plugin/common';
import type { PostureInput } from '../../../common/types';
import type { PostureInput } from '../../../common/types_old';
import { SUPPORTED_CLOUDBEAT_INPUTS } from '../../../common/constants';
import { cloudPostureIntegrations, type CloudPostureIntegrations } from '../constants';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { euiThemeVars } from '@kbn/ui-theme';
import { VULNERABILITIES_SEVERITY } from '../../../common/constants';
import { VulnSeverity } from '../../../common/types';
import { VulnSeverity } from '../../../common/types_old';

export const getCvsScoreColor = (score: number): string | undefined => {
if (score <= 4) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { CIS_AWS, CIS_GCP, CIS_AZURE, CIS_K8S, CIS_EKS } from '../../common/cons
import { CISBenchmarkIcon } from './cis_benchmark_icon';
import { CompactFormattedNumber } from './compact_formatted_number';
import { useNavigateFindings } from '../common/hooks/use_navigate_findings';
import { BenchmarkData } from '../../common/types';
import { BenchmarkData } from '../../common/types_old';

// order in array will determine order of appearance in the dashboard
const benchmarks = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import { EuiIcon, EuiToolTip, IconSize } from '@elastic/eui';
import { CSSInterpolation } from '@emotion/serialize';
import type { BenchmarkId } from '../../common/types';
import type { BenchmarkId } from '../../common/types_old';
import cisEksIcon from '../assets/icons/cis_eks_logo.svg';
import googleCloudLogo from '../assets/icons/google_cloud_logo.svg';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
} from '../utils';
import { SetupFormat, useAwsCredentialsForm } from './hooks';
import { AWS_ORGANIZATION_ACCOUNT } from '../policy_template_form';
import { AwsCredentialsType } from '../../../../common/types';
import { AwsCredentialsType } from '../../../../common/types_old';

interface AWSSetupInfoContentProps {
integrationLink: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { NewPackagePolicyInput } from '@kbn/fleet-plugin/common';
import { AwsCredentialsType } from '../../../../common/types';
import { AwsCredentialsType } from '../../../../common/types_old';

const AssumeRoleDescription = (
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
getInputVarsFields,
} from './get_aws_credentials_form_options';
import { CLOUDBEAT_AWS } from '../../../../common/constants';
import { AwsCredentialsType } from '../../../../common/types';
import { AwsCredentialsType } from '../../../../common/types_old';
/**
* Update CloudFormation template and stack name in the Agent Policy
* based on the selected policy template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
AzureOptions,
getAzureCredentialsFormManualOptions,
} from './get_azure_credentials_form_options';
import { AzureCredentialsType } from '../../../../common/types';
import { AzureCredentialsType } from '../../../../common/types_old';
import { SetupFormat, useAzureCredentialsForm } from './hooks';
import { getPosturePolicy, NewPackagePolicyPostureInput } from '../utils';
import { CspRadioOption, RadioGroup } from '../csp_boxed_radio_group';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiText } from '@elastic/eui';
import { AzureCredentialsType } from '../../../../common/types';
import { AzureCredentialsType } from '../../../../common/types_old';

export type AzureCredentialsFields = Record<string, { label: string; type?: 'password' | 'text' }>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
getInputVarsFields,
} from './get_azure_credentials_form_options';
import { CLOUDBEAT_AZURE } from '../../../../common/constants';
import { AzureCredentialsType } from '../../../../common/types';
import { AzureCredentialsType } from '../../../../common/types_old';

export type SetupFormat = 'arm_template' | 'manual';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { type CustomAssetsAccordionProps, CustomAssetsAccordion } from '@kbn/fle
import { i18n } from '@kbn/i18n';
import { useParams } from 'react-router-dom';
import { EuiSpacer } from '@elastic/eui';
import { CloudSecurityPolicyTemplate } from '../../../common/types';
import { CloudSecurityPolicyTemplate } from '../../../common/types_old';
import { VULN_MGMT_POLICY_TEMPLATE } from '../../../common/constants';
import { useKibana } from '../../common/hooks/use_kibana';
import { benchmarksNavigation, cloudPosturePages } from '../../common/navigation/constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type { NewPackagePolicy } from '@kbn/fleet-plugin/public';
import { NewPackagePolicyInput, PackageInfo } from '@kbn/fleet-plugin/common';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { GcpCredentialsType } from '../../../common/types';
import { GcpCredentialsType } from '../../../common/types_old';
import {
CLOUDBEAT_GCP,
SETUP_ACCESS_CLOUD_SHELL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
CLOUDBEAT_AWS,
CLOUDBEAT_VULN_MGMT_AWS,
} from '../../../common/constants';
import type { PostureInput } from '../../../common/types';
import type { PostureInput } from '../../../common/types_old';

export const getMockPolicyAWS = () => getPolicyMock(CLOUDBEAT_AWS, 'cspm', 'aws');
export const getMockPolicyGCP = () => getPolicyMock(CLOUDBEAT_GCP, 'cspm', 'gcp');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { i18n } from '@kbn/i18n';
import { AZURE_ARM_TEMPLATE_CREDENTIAL_TYPE } from './azure_credentials_form/azure_credentials_form';
import { CspRadioGroupProps, RadioGroup } from './csp_boxed_radio_group';
import { assert } from '../../../common/utils/helpers';
import type { CloudSecurityPolicyTemplate, PostureInput } from '../../../common/types';
import type { CloudSecurityPolicyTemplate, PostureInput } from '../../../common/types_old';
import {
CLOUDBEAT_AWS,
CLOUDBEAT_VANILLA,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
VULN_MGMT_POLICY_TEMPLATE,
CNVM_POLICY_TEMPLATE,
} from '../../../common/constants';
import type { PostureInput, CloudSecurityPolicyTemplate } from '../../../common/types';
import type { PostureInput, CloudSecurityPolicyTemplate } from '../../../common/types_old';
import { getPolicyTemplateInputOptions, type NewPackagePolicyPostureInput } from './utils';
import { RadioGroup } from './csp_boxed_radio_group';
import { AzureCredentialsForm } from './azure_credentials_form/azure_credentials_form';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
VULN_MGMT_POLICY_TEMPLATE,
} from '../../../common/constants';
import { getDefaultAwsVarsGroup } from './aws_credentials_form/aws_credentials_form';
import type { PostureInput, CloudSecurityPolicyTemplate } from '../../../common/types';
import type { PostureInput, CloudSecurityPolicyTemplate } from '../../../common/types_old';
import { cloudPostureIntegrations } from '../../common/constants';
import { DEFAULT_EKS_VARS_GROUP } from './eks_credentials_form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
} from './test_subjects';
import { CloudPosturePage, PACKAGE_NOT_INSTALLED_TEST_SUBJECT } from './cloud_posture_page';
import { useCspSetupStatusApi } from '../common/api/use_setup_status_api';
import type { IndexDetails, PostureTypes } from '../../common/types';
import type { IndexDetails, PostureTypes } from '../../common/types_old';
import { cspIntegrationDocsNavigation } from '../common/navigation/constants';
import noDataIllustration from '../assets/illustrations/no_data_illustration.svg';
import { useCspIntegrationLink } from '../common/navigation/use_csp_integration_link';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ import { VULN_MGMT_POLICY_TEMPLATE } from '../../common/constants';
import { FullSizeCenteredPage } from './full_size_centered_page';
import { CloudPosturePage } from './cloud_posture_page';
import { useCspSetupStatusApi } from '../common/api/use_setup_status_api';
import type { IndexDetails } from '../../common/types';
import type { IndexDetails } from '../../common/types_old';
import {
NO_VULNERABILITIES_STATUS_TEST_SUBJ,
CNVM_NOT_INSTALLED_ACTION_SUBJ,
} from './test_subjects';
import noDataIllustration from '../assets/illustrations/no_data_illustration.svg';
import { useCspIntegrationLink } from '../common/navigation/use_csp_integration_link';
import { useCISIntegrationPoliciesLink } from '../common/navigation/use_navigate_to_cis_integration_policies';
import { PostureTypes } from '../../common/types';
import { PostureTypes } from '../../common/types_old';

const REFETCH_INTERVAL_MS = 20000;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import { css } from '@emotion/react';
import { float } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { getCvsScoreColor, getSeverityStatusColor } from '../common/utils/get_vulnerability_colors';
import { VulnSeverity } from '../../common/types';
import { VulnSeverity } from '../../common/types_old';
import { VULNERABILITIES_CVSS_SCORE_BADGE_SUBJ } from './test_subjects';

interface CVSScoreBadgeProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { i18n } from '@kbn/i18n';
import type { PackagePolicy } from '@kbn/fleet-plugin/common';
import { FormattedMessage } from '@kbn/i18n-react';
import { TimestampTableCell } from '../../components/timestamp_table_cell';
import type { Benchmark } from '../../../common/types';
import type { Benchmark } from '../../../common/types_old';
import { useKibana } from '../../common/hooks/use_kibana';
import { benchmarksNavigation } from '../../common/navigation/constants';
import * as TEST_SUBJ from './test_subjects';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { ListResult } from '@kbn/fleet-plugin/common';
import { BENCHMARKS_API_CURRENT_VERSION, BENCHMARKS_ROUTE_PATH } from '../../../common/constants';
import type { BenchmarksQueryParams } from '../../../common/schemas/benchmark';
import { useKibana } from '../../common/hooks/use_kibana';
import type { Benchmark } from '../../../common/types';
import type { Benchmark } from '../../../common/types_old';

const QUERY_KEY = 'csp_benchmark_integrations';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { DASHBOARD_COMPLIANCE_SCORE_CHART } from '../test_subjects';
import { statusColors } from '../../../common/constants';
import { RULE_FAILED, RULE_PASSED } from '../../../../common/constants';
import { CompactFormattedNumber } from '../../../components/compact_formatted_number';
import type { Evaluation, PostureTrend, Stats } from '../../../../common/types';
import type { Evaluation, PostureTrend, Stats } from '../../../../common/types_old';
import { useKibana } from '../../../common/hooks/use_kibana';

interface ComplianceScoreChartProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { i18n } from '@kbn/i18n';
import { css } from '@emotion/react';
import { ComplianceScoreBar } from '../../../components/compliance_score_bar';
import { ComplianceDashboardData, GroupedFindingsEvaluation } from '../../../../common/types';
import { ComplianceDashboardData, GroupedFindingsEvaluation } from '../../../../common/types_old';

export interface RisksTableProps {
data: ComplianceDashboardData['groupedFindingsEvaluation'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
BaseCspSetupStatus,
ComplianceDashboardDataV2,
CspStatusCode,
} from '../../../common/types';
} from '../../../common/types_old';

jest.mock('../../common/api/use_setup_status_api');
jest.mock('../../common/api/use_stats_api');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type {
PosturePolicyTemplate,
ComplianceDashboardDataV2,
BaseCspSetupStatus,
} from '../../../common/types';
} from '../../../common/types_old';
import { CloudPosturePageTitle } from '../../components/cloud_posture_page_title';
import {
CloudPosturePage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { FormattedMessage } from '@kbn/i18n-react';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { getBenchmarkIdQuery } from './benchmarks_section';
import { BenchmarkData } from '../../../../common/types';
import { BenchmarkData } from '../../../../common/types_old';
import { useNavigateFindings } from '../../../common/hooks/use_navigate_findings';
import { CISBenchmarkIcon } from '../../../components/cis_benchmark_icon';
import cisLogoIcon from '../../../assets/icons/cis_logo.svg';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type {
ComplianceDashboardDataV2,
Evaluation,
PosturePolicyTemplate,
} from '../../../../common/types';
} from '../../../../common/types_old';
import { RisksTable } from '../compliance_charts/risks_table';
import { RULE_FAILED } from '../../../../common/constants';
import { LOCAL_STORAGE_DASHBOARD_BENCHMARK_SORT_KEY } from '../../../common/constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type {
ComplianceDashboardDataV2,
Evaluation,
PosturePolicyTemplate,
} from '../../../../common/types';
} from '../../../../common/types_old';
import { RisksTable } from '../compliance_charts/risks_table';
import { NavFilter, useNavigateFindings } from '../../../common/hooks/use_navigate_findings';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { BenchmarkData, ComplianceDashboardDataV2 } from '../../../common/types';
import { BenchmarkData, ComplianceDashboardDataV2 } from '../../../common/types_old';

export const getMockDashboardData = () => ({
...mockDashboardData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ import { TableTab } from './table_tab';
import { JsonTab } from './json_tab';
import { OverviewTab } from './overview_tab';
import { RuleTab } from './rule_tab';
import type { BenchmarkId } from '../../../../common/types';
import type { BenchmarkId } from '../../../../common/types_old';
import { CISBenchmarkIcon } from '../../../components/cis_benchmark_icon';
import { BenchmarkName } from '../../../../common/types';
import { BenchmarkName } from '../../../../common/types_old';
import { FINDINGS_FLYOUT } from '../test_subjects';
import { createDetectionRuleFromFinding } from '../utils/create_detection_rule_from_finding';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from '@kbn/securitysolution-grouping/src';
import { useMemo } from 'react';
import { DataView } from '@kbn/data-views-plugin/common';
import { Evaluation } from '../../../../common/types';
import { Evaluation } from '../../../../common/types_old';
import { LATEST_FINDINGS_RETENTION_POLICY } from '../../../../common/constants';
import {
FindingsGroupingAggregation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DataView } from '@kbn/data-views-plugin/common';
import { Filter } from '@kbn/es-query';
import { useMemo } from 'react';
import { FindingsBaseURLQuery } from '../../../common/types';
import { Evaluation } from '../../../../common/types';
import { Evaluation } from '../../../../common/types_old';
import { LOCAL_STORAGE_DATA_TABLE_PAGE_SIZE_KEY } from '../../../common/constants';
import { useCloudPostureDataTable } from '../../../common/hooks/use_cloud_posture_data_table';
import { getFilters } from '../utils/get_filters';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { TrackApplicationView } from '@kbn/usage-collection-plugin/public';
import { CspFinding } from '../../../../common/schemas/csp_finding';
import type { Evaluation } from '../../../../common/types';
import type { Evaluation } from '../../../../common/types_old';
import { FindingsSearchBar } from '../layout/findings_search_bar';
import * as TEST_SUBJECTS from '../test_subjects';
import { usePageSlice } from '../../../common/hooks/use_page_slice';
Expand Down
Loading

0 comments on commit f3fbc91

Please sign in to comment.