mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
Changes: - Deleted `schema/fleet_schema.json` (This file was previously used when merging the osquery schema with Fleet's overrides before we switched to using YAML override files). - Updated the description of the `generate-merged-schema` script.
30 lines
982 B
JavaScript
Vendored
30 lines
982 B
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'Generate merged schema',
|
|
|
|
|
|
description: 'Merge the osquery schema from the osquery/osquery-site GitHub repo with Fleet\'s overrides (/schema/tables/) and save the merged schema to /schema/osquery_fleet_schema.json',
|
|
|
|
|
|
|
|
fn: async function () {
|
|
let path = require('path');
|
|
let topLvlRepoPath = path.resolve(sails.config.appPath, '../');
|
|
|
|
let mergedSchemaOutputPath = path.resolve(topLvlRepoPath+'/schema', 'osquery_fleet_schema.json');
|
|
|
|
let mergedSchemaTables = await sails.helpers.getExtendedOsquerySchema();
|
|
|
|
// Save the merged schema to /schema/merged_schema.json. Note: If this file already exists, it will be overwritten.
|
|
await sails.helpers.fs.writeJson.with({
|
|
destination: mergedSchemaOutputPath,
|
|
json: mergedSchemaTables,
|
|
force: true
|
|
});
|
|
|
|
sails.log(`osquery schema successfully merged with Fleet\'s overrides. The merged schema has been saved at ${mergedSchemaOutputPath}`);
|
|
}
|
|
|
|
};
|
|
|