2021-11-30 18:24:30 +00:00
|
|
|
import PropTypes from "prop-types";
|
|
|
|
|
|
|
|
// Legacy PropTypes used on host interface
|
|
|
|
export default PropTypes.shape({
|
|
|
|
author_email: PropTypes.string.isRequired,
|
|
|
|
author_id: PropTypes.number.isRequired,
|
|
|
|
author_name: PropTypes.string.isRequired,
|
|
|
|
created_at: PropTypes.string.isRequired,
|
|
|
|
description: PropTypes.string.isRequired,
|
|
|
|
id: PropTypes.number.isRequired,
|
|
|
|
name: PropTypes.string.isRequired,
|
|
|
|
query: PropTypes.string.isRequired,
|
|
|
|
resoluton: PropTypes.string.isRequired,
|
|
|
|
response: PropTypes.string,
|
|
|
|
team_id: PropTypes.number,
|
|
|
|
updated_at: PropTypes.string.isRequired,
|
|
|
|
});
|
|
|
|
|
2021-08-30 23:02:53 +00:00
|
|
|
export interface IPolicy {
|
|
|
|
id: number;
|
2021-11-24 17:16:42 +00:00
|
|
|
name: string;
|
|
|
|
query: string;
|
|
|
|
description: string;
|
|
|
|
author_id: number;
|
|
|
|
author_name: string;
|
|
|
|
author_email: string;
|
|
|
|
resolution: string;
|
2021-11-30 18:24:30 +00:00
|
|
|
team_id?: number;
|
|
|
|
created_at: string;
|
|
|
|
updated_at: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Used on the manage hosts page and other places where aggregate stats are displayed
|
|
|
|
export interface IPolicyStats extends IPolicy {
|
2021-08-30 23:02:53 +00:00
|
|
|
passing_host_count: number;
|
|
|
|
failing_host_count: number;
|
2021-11-30 18:24:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Used on the host details page and other places where the status of individual hosts are displayed
|
|
|
|
export interface IHostPolicy extends IPolicy {
|
|
|
|
response: string;
|
2021-11-24 17:16:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IPolicyFormData {
|
|
|
|
description?: string | number | boolean | any[] | undefined;
|
2021-12-02 15:03:56 +00:00
|
|
|
resolution?: string | number | boolean | any[] | undefined;
|
2021-11-24 17:16:42 +00:00
|
|
|
name?: string | number | boolean | any[] | undefined;
|
|
|
|
query?: string | number | boolean | any[] | undefined;
|
2021-11-29 19:50:58 +00:00
|
|
|
team_id?: number;
|
2021-08-30 23:02:53 +00:00
|
|
|
}
|