2022-10-14 16:45:57 +00:00
|
|
|
import { flatMap } from "lodash";
|
2016-10-11 15:32:39 +00:00
|
|
|
|
2022-10-14 16:45:57 +00:00
|
|
|
import { IOsQueryTable } from "interfaces/osquery_table";
|
|
|
|
import osqueryFleetTablesJSON from "../../schema/osquery_fleet_schema.json";
|
|
|
|
|
|
|
|
// Typecasting explicity here as we are adding more rigid types such as
|
|
|
|
// IOsqueryPlatform for platform names, instead of just any strings.
|
|
|
|
const queryTable = osqueryFleetTablesJSON as IOsQueryTable[];
|
|
|
|
|
|
|
|
export const osqueryTables = queryTable.sort((a, b) => {
|
|
|
|
return a.name >= b.name ? 1 : -1;
|
|
|
|
});
|
2016-10-11 15:32:39 +00:00
|
|
|
|
|
|
|
export const osqueryTableNames = flatMap(osqueryTables, (table) => {
|
|
|
|
return table.name;
|
|
|
|
});
|