Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Remove remaining usage of rule_schema_legacy types #188079

Merged
merged 6 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@ import {
list_id,
DefaultNamespaceArray,
} from '@kbn/securitysolution-io-ts-list-types';
import { NonEmptyStringArray } from '@kbn/securitysolution-io-ts-types';
import { NonEmptyStringArray, NonEmptyString, UUID } from '@kbn/securitysolution-io-ts-types';

// TODO https://github.com/elastic/security-team/issues/7491
jpdjere marked this conversation as resolved.
Show resolved Hide resolved
// eslint-disable-next-line no-restricted-imports
import { RuleName, RuleObjectId, RuleSignatureId } from '../../model/rule_schema_legacy';
type RuleObjectId = t.TypeOf<typeof RuleObjectId>;
const RuleObjectId = UUID;

type RuleSignatureId = t.TypeOf<typeof RuleSignatureId>;
const RuleSignatureId = t.string;

type RuleName = t.TypeOf<typeof RuleName>;
const RuleName = NonEmptyString;

// If ids and list_ids are undefined, route will fetch all lists matching the
// specified namespace type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,31 @@ import { Direction } from '../../../search_strategy';
import type { PinnedEvent } from '../pinned_events/pinned_events_route';
import { PinnedEventRuntimeType } from '../pinned_events/pinned_events_route';
// TODO https://github.com/elastic/security-team/issues/7491
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

// eslint-disable-next-line no-restricted-imports
import {
SavedObjectResolveAliasPurpose,
SavedObjectResolveAliasTargetId,
SavedObjectResolveOutcome,
} from '../../detection_engine/model/rule_schema_legacy';

/**
* Outcome is a property of the saved object resolve api
* will tell us info about the rule after 8.0 migrations
*/
export type SavedObjectResolveOutcome = runtimeTypes.TypeOf<typeof SavedObjectResolveOutcome>;
export const SavedObjectResolveOutcome = runtimeTypes.union([
runtimeTypes.literal('exactMatch'),
runtimeTypes.literal('aliasMatch'),
runtimeTypes.literal('conflict'),
]);

export type SavedObjectResolveAliasTargetId = runtimeTypes.TypeOf<
typeof SavedObjectResolveAliasTargetId
>;
export const SavedObjectResolveAliasTargetId = runtimeTypes.string;

export type SavedObjectResolveAliasPurpose = runtimeTypes.TypeOf<
typeof SavedObjectResolveAliasPurpose
>;
export const SavedObjectResolveAliasPurpose = runtimeTypes.union([
runtimeTypes.literal('savedObjectConversion'),
runtimeTypes.literal('savedObjectImport'),
]);

import { ErrorSchema } from './error_schema';

export const BareNoteSchema = runtimeTypes.intersection([
Expand Down