fleet/frontend/interfaces/query.ts
gillespi314 deeaf9d036
Add ability to detect compatibility and update which hosts are checked for a policy (#4703)
Add new usePlatformSelector custom hook
Add new usePlatformCompatibility custom hook
Add new PlatformSelector global component
Refactor PlatformCompatibility as global component
Refactor sql_tools to TypeScript
Improve type definitions for context/policy
Align PolicyPage and QueryPage with platform compatibility changes
2022-03-21 11:51:00 -05:00

51 lines
1.3 KiB
TypeScript

import PropTypes from "prop-types";
import { IFormField } from "./form_field";
import packInterface, { IPack } from "./pack";
import scheduledQueryStatsInterface, {
IScheduledQueryStats,
} from "./scheduled_query_stats";
export default PropTypes.shape({
created_at: PropTypes.string,
updated_at: PropTypes.string,
id: PropTypes.number,
name: PropTypes.string,
description: PropTypes.string,
query: PropTypes.string,
saved: PropTypes.bool,
author_id: PropTypes.number,
author_name: PropTypes.string,
observer_can_run: PropTypes.bool,
packs: PropTypes.arrayOf(packInterface),
stats: scheduledQueryStatsInterface,
});
export interface IQueryFormData {
description?: string | number | boolean | undefined;
name?: string | number | boolean | undefined;
query?: string | number | boolean | undefined;
observer_can_run?: string | number | boolean | undefined;
}
export interface IQuery {
created_at: string;
updated_at: string;
id: number;
name: string;
description: string;
query: string;
saved: boolean;
author_id: number;
author_name: string;
author_email: string;
observer_can_run: boolean;
packs: IPack[];
stats?: IScheduledQueryStats;
}
export interface IQueryFormFields {
description: IFormField;
name: IFormField;
query: IFormField;
observer_can_run: IFormField;
}