function getAllEntitiesForBot(req, res, next) { logger.winston.info('Entities.getAllEntitiesForBot'); db.all('select * from entities where bot_id = ? order by entity_id desc', req.params.bot_id, function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getIntentUsageByDay(req, res, next) { db.all("select strftime('%m/%d', timestamp) as day, count(*) as cnt from nlu_log group by strftime('%m/%d', timestamp)", req.params.query, function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getIntentExpressionQuery(req, res, next) { logger.winston.info('expression.getIntentExpressionQuery'); var array_intentIds = req.query.intent_ids.split(","); //Very hacky due to the node-sqlite not supporting IN from an array db.all('select * from expressions where intent_id in (' + array_intentIds + ') order by expression_id desc', function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getSynonymsVariants(req, res, next) { logger.winston.info('variants.getSynonymVariants'); const synonymsId = req.params.synonyms_id; var array_synonymIds = synonymsId.split(","); //Very hacky due to the node-sqlite not supporting IN from an array db.all('select * from synonym_variants where synonym_id in (' + array_synonymIds + ')', function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getAllBots(req, res, next) { logger.winston.info('Bot.getAllBots'); db.all('select * from bots order by bot_id desc', function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getExpressionParameters(req, res, next) { logger.winston.info('parameters.getExpressionParameters'); db.all('select * from expression_parameters where expression_id = ?', req.params.expression_id, function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getExpressionParametersQuery(req, res, next) { logger.winston.info('parameters.getExpressionParametersQuery'); const expressionIds = req.query.expression_ids; var array_expressionIds = expressionIds.split(","); //Very hacky due to the node-sqlite not supporting IN from an array db.all("select * from expression_parameters inner join entities on expression_parameters.entity_id = entities.entity_id where expression_id in (" + array_expressionIds + ")", function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getIntentExpressions(req, res, next) { logger.winston.info('expression.getIntentExpressions'); db.all('select * from expressions where intent_id = ? order by expression_id desc', req.params.intent_id, function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getBotModels(req, res, next) { logger.winston.info('Model.getBotModels'); db.all('select * from models where bot_id = ? order by model_id desc', req.params.bot_id, function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getAllBotStories(req, res, next) { logger.winston.info('Stories.getAllStories'); db.all('select * from stories where bot_id = ? order by story_id desc', req.params.bot_id, function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getConversations(req, res, next) { logger.winston.info('Conversations.getConversations'); db.all('select * from conversations where bot_id = ? order by timestamp desc', req.params.bot_id, function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getBotIntents(req, res, next) { logger.winston.info('intents.getBotIntents'); db.all('select * from intents where bot_id = ? order by intent_id desc', req.params.bot_id, function(err, data) { if (err) { logger.winston.error(err);; } else { res.status(200).json(data); } }); }
function getBotRegex(req, res, next) { logger.winston.info('regex.getBotRegex'); db.all('select * from regex where bot_id = ? order by regex_id desc', req.params.bot_id, function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getAllEntities(req, res, next) { logger.winston.info('Entities.getAllEntities'); db.all('select * from entities', function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }
function getLogs(req, res, next) { db.all('select * from nlu_log where event_type = ? order by timestamp desc', req.params.query, function(err, data) { if (err) { logger.winston.error(err); } else { res.status(200).json(data); } }); }