mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
168e1f9007
Osquery schema JSON has changed, so parsing code has been updated Closes #2232
14 lines
523 B
JavaScript
14 lines
523 B
JavaScript
import { flatMap, sortBy } from 'lodash';
|
|
import osqueryTablesJSON from '../osquery_tables.json';
|
|
|
|
export const normalizeTables = (tablesJSON) => {
|
|
// osquery JSON needs less parsing than it used to
|
|
const parsedTables = typeof tablesJSON === 'object' ? tablesJSON : JSON.parse(tablesJSON);
|
|
return sortBy(parsedTables, (table) => { return table.name; });
|
|
};
|
|
|
|
export const osqueryTables = normalizeTables(osqueryTablesJSON);
|
|
export const osqueryTableNames = flatMap(osqueryTables, (table) => {
|
|
return table.name;
|
|
});
|