Skip to content

Commit

Permalink
rename common utils
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed Apr 15, 2020
1 parent 4f45e17 commit ddf4409
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 506 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
import { createMockConfig, requestContextMock, serverMock, requestMock } from '../__mocks__';
import { importRulesRoute } from './import_rules_route';
import { DEFAULT_SIGNALS_INDEX } from '../../../../../common/constants';
import * as createRulesStreamFromNdJson from '../../../../utils/read_stream/create_rules_stream_from_ndjson';
import * as createRulesStreamFromNdJson from '../../rules/create_rules_stream_from_ndjson';
import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags';

describe('import_rules_route', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import {
buildSiemResponse,
validateLicenseForRuleType,
} from '../utils';
import { createRulesStreamFromNdJson } from '../../../../utils/read_stream/create_rules_stream_from_ndjson';
import { ImportRuleAlertRest } from '../../types';
import { patchRules } from '../../rules/patch_rules';
import { importRulesQuerySchema, importRulesPayloadSchema } from '../schemas/import_rules_schema';
import { ImportRulesSchema, importRulesSchema } from '../schemas/response/import_rules_schema';
import { getTupleDuplicateErrorsAndUniqueRules } from './utils';
import { validate } from './validate';
import { createRulesStreamFromNdJson } from '../../rules/create_rules_stream_from_ndjson';

type PromiseFromStreams = ImportRuleAlertRest | Error;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import { INTERNAL_IDENTIFIER } from '../../../../../common/constants';
import { ImportRuleAlertRest, RuleAlertParamsRest, RuleTypeParams } from '../../types';
import { BulkError, ImportSuccessError } from '../utils';
import { getSimpleRule, getOutputRuleAlertForRest } from '../__mocks__/utils';
import { createRulesStreamFromNdJson } from '../../../../utils/read_stream/create_rules_stream_from_ndjson';
import { createPromiseFromStreams } from '../../../../../../../../../src/legacy/utils/streams';
import { PartialAlert } from '../../../../../../../../plugins/alerting/server';
import { SanitizedAlert } from '../../../../../../../../plugins/alerting/server/types';
import { RuleAlertType } from '../../rules/types';
import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags';
import { createRulesStreamFromNdJson } from '../../rules/create_rules_stream_from_ndjson';

type PromiseFromStreams = ImportRuleAlertRest | Error;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
parseNdjsonStrings,
filterExportedCounts,
createLimitStream,
} from '../../../utils/read_stream/create_rules_stream_from_ndjson';
} from '../../../utils/read_stream/create_stream_from_ndjson';

export const validateRules = (): Transform => {
return createMapStream((obj: ImportRuleAlertRest) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AlertsClient } from '../../../../../../../plugins/alerting/server';
import { getNonPackagedRules } from './get_existing_prepackaged_rules';
import { getExportDetailsNdjson } from './get_export_details_ndjson';
import { transformAlertsToRules } from '../routes/rules/utils';
import { transformDataToNdjson } from '../../../utils/read_stream/create_rules_stream_from_ndjson';
import { transformDataToNdjson } from '../../../utils/read_stream/create_stream_from_ndjson';

export const getExportAll = async (
alertsClient: AlertsClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { isAlertType } from '../rules/types';
import { readRules } from './read_rules';
import { transformAlertToRule } from '../routes/rules/utils';
import { OutputRuleAlertRest } from '../types';
import { transformDataToNdjson } from '../../../utils/read_stream/create_rules_stream_from_ndjson';
import { transformDataToNdjson } from '../../../utils/read_stream/create_stream_from_ndjson';

interface ExportSuccesRule {
statusCode: 200;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
parseNdjsonStrings,
filterExportedCounts,
createLimitStream,
} from '../../utils/read_stream/create_rules_stream_from_ndjson';
} from '../../utils/read_stream/create_stream_from_ndjson';

import { ImportTimelineResponse } from './routes/utils/import_timelines';
import { ImportTimelinesSchemaRt } from './routes/schemas/import_timelines_schema';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
ExportedNotes,
TimelineSavedObject,
} from '../../types';
import { transformDataToNdjson } from '../../../../utils/read_stream/create_rules_stream_from_ndjson';
import { transformDataToNdjson } from '../../../../utils/read_stream/create_stream_from_ndjson';

export type TimelineSavedObjectsClient = Pick<
SavedObjectsClient,
Expand Down
Loading

0 comments on commit ddf4409

Please sign in to comment.