fleet/frontend/utilities/osquery_tables.ts
Gabriel Hernandez a950e9d095
Feat/update query doc sidepanel (#8214)
* create new components for query side panel

* add reusable icon component that uses svg for icons

* integrate with new osquery_fleet_schema.json data

* update UI to work with osquery_fleet_schema.json

* add remark-gfm to safely support direct urls in markdown

* move fleet ace into markdown component so we can render code with ace editor

* add testing for new query sidebar

* remove incomplete tests for query sidepanel
2022-10-14 17:45:57 +01:00

17 lines
567 B
TypeScript

import { flatMap } from "lodash";
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;
});
export const osqueryTableNames = flatMap(osqueryTables, (table) => {
return table.name;
});