fleet/frontend/interfaces/campaign.ts

60 lines
1.2 KiB
TypeScript

import PropTypes from "prop-types";
import { IHost } from "./host";
export default PropTypes.shape({
hosts_count: PropTypes.shape({
total: PropTypes.number,
successful: PropTypes.number,
failed: PropTypes.number,
}),
id: PropTypes.number,
online: PropTypes.number,
});
export interface ICampaignError {
host_hostname: string;
osquery_version: string;
error: string;
}
export interface ICampaign {
Metrics?: {
[key: string]: any;
};
created_at: string;
errors: ICampaignError[];
hosts: IHost[];
hosts_count: {
total: number;
successful: number;
failed: number;
};
id: number;
query_id: number;
query_results: unknown[];
status: string;
totals: {
count: number;
missing_in_action: number;
offline: number;
online: number;
};
updated_at: string;
user_id: number;
}
// TODO: review use of ICampaignState to see if legacy code can be removed
export interface ICampaignState {
campaign: ICampaign;
observerShowSql: boolean;
queryIsRunning: boolean;
queryPosition: {
[key: string]: any;
};
queryResultsToggle: any;
runQueryMilliseconds: number;
selectRelatedHostTarget: boolean;
targetsCount: number;
targetsError: any;
}