-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from NSWC-Crane/CHRIS_DEV
- Loading branch information
Showing
119 changed files
with
15,781 additions
and
19,467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
!####################################################################### | ||
! C-PATTM SOFTWARE | ||
! CRANE C-PATTM plan of action and milestones software. Use is governed by the Open Source Academic Research License Agreement contained in the file | ||
! crane_C_PAT.1_license.txt, which is part of this software package. BY | ||
! USING OR MODIFYING THIS SOFTWARE, YOU ARE AGREEING TO THE TERMS AND | ||
! CONDITIONS OF THE LICENSE. | ||
!######################################################################## | ||
*/ | ||
|
||
const iavService = require('../Services/iavService') | ||
|
||
|
||
module.exports.getVramDataUpdatedDate = async function getVramDataUpdatedDate(req, res, next) { | ||
try { | ||
const vramUpdatedDate = await iavService.getVramDataUpdatedDate(req, res, next); | ||
res.status(200).json(vramUpdatedDate); | ||
} catch (error) { | ||
if (error.status === 400) { | ||
res.status(400).json({ error: 'Validation Error', detail: error.errors }); | ||
} else { | ||
res.status(500).json({ error: 'Internal Server Error', detail: error.message }); | ||
} | ||
} | ||
} | ||
|
||
module.exports.getIAVTableData = async function getIAVTableData(req, res, next) { | ||
try { | ||
const iavTableData = await iavService.getIAVTableData(req, res, next); | ||
res.status(200).json(iavTableData); | ||
} catch (error) { | ||
if (error.status === 400) { | ||
res.status(400).json({ error: 'Validation Error', detail: error.errors }); | ||
} else { | ||
res.status(500).json({ error: 'Internal Server Error', detail: error.message }); | ||
} | ||
} | ||
} | ||
|
||
module.exports.mapIAVPluginIds = async function mapIAVPluginIds(req, res, next) { | ||
try { | ||
const updatedCount = await iavService.mapIAVPluginIds(req.body); | ||
res.status(200).json({ message: 'PluginIDs mapped updated successfully', updatedCount }); | ||
} catch (error) { | ||
if (error.status === 400) { | ||
res.status(400).json({ error: 'Validation Error', detail: error.errors }); | ||
} else { | ||
res.status(500).json({ error: 'Internal Server Error', detail: error.message }); | ||
} | ||
} | ||
} | ||
|
||
module.exports.getIAVPluginIds = async function getIAVPluginIds(req, res, next) { | ||
try { | ||
const iavPluginIDs = await iavService.getIAVPluginIds(req, res, next); | ||
res.status(200).json(iavPluginIDs); | ||
} catch (error) { | ||
if (error.status === 400) { | ||
res.status(400).json({ error: 'Validation Error', detail: error.errors }); | ||
} else { | ||
res.status(500).json({ error: 'Internal Server Error', detail: error.message }); | ||
} | ||
} | ||
} | ||
|
||
module.exports.getIAVInfoForPlugins = async function getIAVInfoForPlugins(req, res, next) { | ||
try { | ||
const pluginIDs = req.query.pluginIDs; | ||
const iavInfo = await iavService.getIAVInfoForPlugins(pluginIDs); | ||
res.status(200).json(iavInfo); | ||
} catch (error) { | ||
res.status(500).json({ error: 'Internal Server Error', detail: error.message }); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = (sequelize, DataTypes) => { | ||
const Config = sequelize.define('Config', { | ||
key: { | ||
type: DataTypes.STRING(45), | ||
primaryKey: true, | ||
allowNull: false | ||
}, | ||
value: { | ||
type: DataTypes.STRING(255), | ||
allowNull: false | ||
} | ||
}, { | ||
tableName: 'config', | ||
timestamps: false | ||
}); | ||
|
||
return Config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
module.exports = (sequelize, DataTypes) => { | ||
const IAV = sequelize.define('IAV', { | ||
iav: { | ||
type: DataTypes.STRING(25), | ||
primaryKey: true, | ||
allowNull: false | ||
}, | ||
status: { | ||
type: DataTypes.STRING(25), | ||
allowNull: true | ||
}, | ||
title: { | ||
type: DataTypes.STRING(255), | ||
allowNull: false | ||
}, | ||
iavCat: { | ||
type: DataTypes.TINYINT(1), | ||
allowNull: true | ||
}, | ||
type: { | ||
type: DataTypes.CHAR(1), | ||
allowNull: false | ||
}, | ||
releaseDate: { | ||
type: DataTypes.DATEONLY, | ||
allowNull: true | ||
}, | ||
navyComplyDate: { | ||
type: DataTypes.DATEONLY, | ||
allowNull: true | ||
}, | ||
supersededBy: { | ||
type: DataTypes.STRING(25), | ||
allowNull: true | ||
}, | ||
knownExploits: { | ||
type: DataTypes.STRING(3), | ||
allowNull: true | ||
}, | ||
knownDodIncidents: { | ||
type: DataTypes.STRING(3), | ||
allowNull: true | ||
}, | ||
nessusPlugins: { | ||
type: DataTypes.INTEGER, | ||
allowNull: true | ||
} | ||
}, { | ||
tableName: 'iav', | ||
timestamps: false | ||
}); | ||
|
||
IAV.associate = function (models) { | ||
IAV.belongsToMany(models.IAV_Plugin, { | ||
through: 'iav_plugin', | ||
foreignKey: 'iav' | ||
}); | ||
}; | ||
|
||
return IAV; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module.exports = (sequelize, DataTypes) => { | ||
const IAV_Plugin = sequelize.define('IAV_Plugin', { | ||
iav: { | ||
type: DataTypes.STRING(25), | ||
primaryKey: true, | ||
allowNull: false, | ||
references: { | ||
model: 'iav', | ||
key: 'iav' | ||
} | ||
}, | ||
pluginID: { | ||
type: DataTypes.INTEGER, | ||
primaryKey: true, | ||
allowNull: false | ||
} | ||
}, { | ||
tableName: 'iav_plugin', | ||
timestamps: false, | ||
indexes: [ | ||
{ | ||
fields: ['pluginID'] | ||
} | ||
] | ||
}); | ||
|
||
IAV_Plugin.associate = function (models) { | ||
IAV_Plugin.belongsToMany(models.IAV, { | ||
through: 'iav_plugin', | ||
foreignKey: 'pluginID' | ||
}); | ||
}; | ||
return IAV_Plugin; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.