Skip to content

Commit

Permalink
Finishes the remove of export all from the common section
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHassanabad committed Dec 2, 2021
1 parent 5b83253 commit f2e5d6a
Show file tree
Hide file tree
Showing 76 changed files with 89 additions and 208 deletions.
136 changes: 4 additions & 132 deletions x-pack/plugins/cases/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,144 +17,16 @@

export { CASES_URL, SECURITY_SOLUTION_OWNER, ENABLE_CASE_CONNECTOR } from './constants';

export {
GetCaseIdsByAlertIdAggsRt,
CasesByAlertIdRt,
CaseType,
caseTypeField,
CaseUserActionExternalServiceRt,
CaseExternalServiceBasicRt,
CaseFullExternalServiceRt,
CaseAttributesRt,
CasesClientPostRequestRt,
CasePostRequestRt,
CasesFindRequestRt,
CasesByAlertIDRequestRt,
CaseResponseRt,
CaseResolveResponseRt,
CasesFindResponseRt,
CasePatchRequestRt,
CasesPatchRequestRt,
CasesResponseRt,
CasePushRequestParamsRt,
ExternalServiceResponseRt,
AllTagsFindRequestRt,
AllReportersFindRequestRt,
CasesConfigureRequestRt,
CasesConfigurePatchRt,
CaseConfigureAttributesRt,
CaseConfigureResponseRt,
GetConfigureFindRequestRt,
CaseConfigureRequestParamsRt,
CaseConfigurationsResponseRt,
AssociationType,
CommentAttributesBasicRt,
CommentType,
ContextTypeUserRt,
AlertCommentRequestRt,
ActionsCommentRequestRt,
CommentRequestRt,
CommentResponseRt,
CommentResponseTypeAlertsRt,
CommentResponseTypeActionsRt,
AllCommentsResponseRT,
CommentPatchRequestRt,
CommentPatchAttributesRt,
CommentsResponseRt,
AllCommentsResponseRt,
FindQueryParamsRt,
CaseStatuses,
CaseStatusRt,
caseStatuses,
CasesStatusResponseRt,
CasesStatusRequestRt,
CaseUserActionAttributesRt,
CaseUserActionsResponseRt,
SubCaseAttributesRt,
SubCasesFindRequestRt,
SubCaseResponseRt,
SubCasesFindResponseRt,
SubCasePatchRequestRt,
SubCasesPatchRequestRt,
SubCasesResponseRt,
OWNER_FIELD,
AlertResponseRt,
JiraFieldsRT,
ServiceNowITSMFieldsRT,
ServiceNowSIRFieldsRT,
ResilientFieldsRT,
ConnectorMappingsAttributesRT,
ConnectorMappingsRt,
SwimlaneFieldsRT,
SwimlaneConnectorType,
ConnectorFieldsRt,
ConnectorTypes,
connectorTypes,
noneConnectorId,
ConnectorTypeFieldsRt,
CaseUserActionConnectorRt,
CaseConnectorRt,
getCaseDetailsUrl,
getSubCasesUrl,
getSubCaseDetailsUrl,
getCaseCommentsUrl,
getCaseCommentDetailsUrl,
getCaseUserActionUrl,
getSubCaseUserActionUrl,
getCasePushUrl,
getCaseConfigurationDetailsUrl,
getCasesFromAlertsUrl,
formatErrors,
createPlainError,
throwErrors,
decodeOrThrow,
excess,
NumberFromString,
SavedObjectFindOptionsRt,
UserRT,
UsersRt,
CaseMetricsResponseRt,
} from './api';
export { CommentType, CaseStatuses, getCasesFromAlertsUrl, throwErrors } from './api';

export type {
CasesUiConfigType,
StatusAllType,
CaseStatusWithAllStatus,
CaseViewRefreshPropInterface,
Comment,
CaseUserActions,
CaseExternalService,
SubCase,
Case,
ResolvedCase,
QueryParams,
FilterOptions,
CasesStatus,
AllCases,
ElasticUser,
FetchCasesProps,
ApiProps,
BulkUpdateStatus,
ActionLicense,
DeleteCase,
FieldMappings,
UpdateKey,
UpdateByKey,
RuleEcs,
SignalEcs,
SignalEcsAAD,
Ecs,
CaseActionConnector,
CasesContextValue,
CaseViewRefreshPropInterface,
} from './ui/types';

export { StatusAll, SortFieldCase } from './ui/types';

export {
getAllConnectorTypesUrl,
getExecuteConnectorUrl,
getCreateConnectorUrl,
getAllConnectorsUrl,
} from './utils/connectors_api';
export { StatusAll } from './ui/types';

export { isCreateConnector, isUpdateConnector, isPush } from './utils/user_actions';
export { getCreateConnectorUrl, getAllConnectorsUrl } from './utils/connectors_api';
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { TriggersAndActionsUIPublicPluginStart } from '../../../../triggers_actions_ui/public';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { actionTypeRegistryMock } from '../../../../triggers_actions_ui/public/application/action_type_registry.mock';
import { CaseActionConnector } from '../../../common';
import { CaseActionConnector } from '../../../common/ui/types';

const getUniqueActionTypeIds = (connectors: CaseActionConnector[]) =>
new Set(connectors.map((connector) => connector.actionTypeId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { ConnectorTypes, noneConnectorId } from '../../../common';
import { ConnectorTypes, noneConnectorId } from '../../../common/api';
import { parseStringAsConnector, parseStringAsExternalService } from './parsers';

describe('user actions utility functions', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { EuiButton, EuiFlexItem, EuiFlexGroup, EuiLoadingSpinner } from '@elasti
import styled from 'styled-components';
import { isEmpty } from 'lodash';

import { CommentType } from '../../../common';
import { CommentType } from '../../../common/api';
import { usePostComment } from '../../containers/use_post_comment';
import { Case } from '../../containers/types';
import { EuiMarkdownEditorRef, MarkdownEditorForm } from '../markdown_editor';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/cases/public/components/all_cases/count.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React, { FunctionComponent, useEffect } from 'react';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { CaseStatuses } from '../../../common';
import { CaseStatuses } from '../../../common/api';
import { Stats } from '../status';
import { useGetCasesStatus } from '../../containers/use_get_cases_status';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { EuiBasicTable } from '@elastic/eui';
import styled from 'styled-components';
import { Case, SubCase } from '../../containers/types';
import { CasesColumns } from './columns';
import { AssociationType } from '../../../common';
import { AssociationType } from '../../../common/api';

type ExpandedRowMap = Record<string, Element> | {};

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

import { filter } from 'lodash/fp';
import { AssociationType, CaseStatuses, CaseType } from '../../../common';
import { AssociationType, CaseStatuses, CaseType } from '../../../common/api';
import { Case, SubCase } from '../../containers/types';
import { statuses } from '../status';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useGetReporters } from '../../containers/use_get_reporters';
import { useGetActionLicense } from '../../containers/use_get_action_license';
import { useConnectors } from '../../containers/configure/use_connectors';
import { useKibana } from '../../common/lib/kibana';
import { CaseStatuses } from '../../../common';
import { CaseStatuses } from '../../../common/api';
import { casesStatus, connectorsMock, useGetCasesMockState } from '../../containers/mock';
import { registerConnectorsToMockActionRegistry } from '../../common/mock/register_connectors';
import { useGetCases } from '../../containers/use_get_cases';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import React from 'react';
import { mount } from 'enzyme';
import { waitFor } from '@testing-library/react';

import { CaseStatuses, StatusAll } from '../../../common';
import { StatusAll } from '../../../common/ui/types';
import { CaseStatuses } from '../../../common/api';
import { StatusFilter } from './status_filter';

const stats = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React, { memo } from 'react';
import { EuiSuperSelect, EuiSuperSelectOption, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { Status, statuses } from '../status';
import { CaseStatusWithAllStatus, StatusAll } from '../../../common';
import { CaseStatusWithAllStatus, StatusAll } from '../../../common/ui/types';

interface Props {
stats: Record<CaseStatusWithAllStatus, number | null>;
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/cases/public/components/all_cases/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import styled from 'styled-components';

import { CasesTableUtilityBar } from './utility_bar';
import { LinkButton } from '../links';
import { AllCases, Case, FilterOptions } from '../../../common';
import { AllCases, Case, FilterOptions } from '../../../common/ui/types';
import * as i18n from './translations';
import { useCreateCaseNavigation } from '../../common/navigation';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import { mount } from 'enzyme';

import { CaseStatuses } from '../../../common';
import { CaseStatuses } from '../../../common/api';
import { TestProviders } from '../../common/mock';
import { useGetTags } from '../../containers/use_get_tags';
import { useGetReporters } from '../../containers/use_get_reporters';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { isEqual } from 'lodash/fp';
import styled from 'styled-components';
import { EuiFlexGroup, EuiFlexItem, EuiFieldSearch, EuiFilterGroup } from '@elastic/eui';

import { CaseStatuses, CaseStatusWithAllStatus, StatusAll } from '../../../common';
import { StatusAll, CaseStatusWithAllStatus } from '../../../common/ui/types';
import { CaseStatuses } from '../../../common/api';
import { FilterOptions } from '../../containers/types';
import { useGetTags } from '../../containers/use_get_tags';
import { useGetReporters } from '../../containers/use_get_reporters';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
UtilityBarText,
} from '../utility_bar';
import * as i18n from './translations';
import { AllCases, Case, DeleteCase, FilterOptions } from '../../../common';
import { AllCases, Case, DeleteCase, FilterOptions } from '../../../common/ui/types';
import { getBulkItems } from '../bulk_actions';
import { isSelectedCasesIncludeCollections } from './helpers';
import { useDeleteCases } from '../../containers/use_delete_cases';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/cases/public/components/app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { MutableRefObject } from 'react';
import { Ecs, CaseViewRefreshPropInterface } from '../../../common';
import { Ecs, CaseViewRefreshPropInterface } from '../../../common/ui/types';
import { CasesNavigation } from '../links';
import { CasesTimelineIntegration } from '../timeline_context';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import React from 'react';
import { EuiContextMenuItem } from '@elastic/eui';

import { CaseStatuses, CaseStatusWithAllStatus } from '../../../common';
import { CaseStatusWithAllStatus } from '../../../common/ui/types';
import { CaseStatuses } from '../../../common/api';
import { statuses } from '../status';
import * as i18n from './translations';
import { Case } from '../../containers/types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as i18n from '../case_view/translations';
import { useDeleteCases } from '../../containers/use_delete_cases';
import { ConfirmDeleteCaseModal } from '../confirm_delete_case';
import { PropertyActions } from '../property_actions';
import { Case } from '../../../common';
import { Case } from '../../../common/ui/types';
import { CaseService } from '../../containers/use_get_case_user_actions';
import { useAllCasesNavigation } from '../../common/navigation';

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

import { CaseStatuses } from '../../../common';
import { CaseStatuses } from '../../../common/api';
import { basicCase } from '../../containers/mock';
import { getStatusDate, getStatusTitle } from './helpers';

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

import { CaseStatuses } from '../../../common';
import { CaseStatuses } from '../../../common/api';
import { Case } from '../../containers/types';
import { statuses } from '../status';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {
EuiFlexItem,
EuiIconTip,
} from '@elastic/eui';
import { Case, CaseStatuses, CaseType } from '../../../common';
import { Case } from '../../../common/ui/types';
import { CaseStatuses, CaseType } from '../../../common/api';
import * as i18n from '../case_view/translations';
import { FormattedRelativePreferenceDate } from '../formatted_date';
import { Actions } from './actions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import { mount } from 'enzyme';

import { CaseStatuses } from '../../../common';
import { CaseStatuses } from '../../../common/api';
import { StatusContextMenu } from './status_context_menu';

describe('SyncAlertsSwitch', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React, { memo, useCallback, useMemo, useState } from 'react';
import { EuiPopover, EuiContextMenuPanel, EuiContextMenuItem } from '@elastic/eui';
import { caseStatuses, CaseStatuses } from '../../../common';
import { caseStatuses, CaseStatuses } from '../../../common/api';
import { Status } from '../status';
import { CHANGE_STATUS } from '../all_cases/translations';

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

import { isEmpty } from 'lodash';
import { CommentType } from '../../../common';
import { CommentType } from '../../../common/api';
import { Comment } from '../../containers/types';

export const getManualAlertIdsWithNoRuleId = (comments: Comment[]): string[] => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { useGetCaseUserActions } from '../../containers/use_get_case_user_action
import { useConnectors } from '../../containers/configure/use_connectors';
import { connectorsMock } from '../../containers/configure/mock';
import { usePostPushToService } from '../../containers/use_post_push_to_service';
import { CaseType, ConnectorTypes } from '../../../common';
import { CaseType, ConnectorTypes } from '../../../common/api';
import { useKibana } from '../../common/lib/kibana';

jest.mock('../../containers/use_update_case');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Connectors, Props } from './connectors';
import { TestProviders } from '../../common/mock';
import { ConnectorsDropdown } from './connectors_dropdown';
import { connectors, actionTypes } from './__mock__';
import { ConnectorTypes } from '../../../common';
import { ConnectorTypes } from '../../../common/api';
import { useKibana } from '../../common/lib/kibana';
import { registerConnectorsToMockActionRegistry } from '../../common/mock/register_connectors';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React, { useMemo } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiIconTip, EuiSuperSelect } from '@elastic/eui';
import styled from 'styled-components';

import { ConnectorTypes } from '../../../common';
import { ConnectorTypes } from '../../../common/api';
import { ActionConnector } from '../../containers/configure/types';
import * as i18n from './translations';
import { useKibana } from '../../common/lib/kibana';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
useConnectorsResponse,
useActionTypesResponse,
} from './__mock__';
import { ConnectorTypes } from '../../../common';
import { ConnectorTypes } from '../../../common/api';
import { actionTypeRegistryMock } from '../../../../triggers_actions_ui/public/application/action_type_registry.mock';

jest.mock('../../common/lib/kibana');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import { mount } from 'enzyme';

import { ConnectorTypes } from '../../../common';
import { ConnectorTypes } from '../../../common/api';
import { useKibana } from '../../common/lib/kibana';
import { connectors } from '../configure_cases/__mock__';
import { ConnectorCard } from './card';
Expand Down
Loading

0 comments on commit f2e5d6a

Please sign in to comment.