<commit_before>var express = require('express');
var router = express.Router();

var seneca = require('seneca')();
var web = require('seneca-web');
var Promise = require('bluebird');

var act = Promise.promisify(seneca.act,  {context: seneca});
seneca.use( require('./programs_manager_api.js') );

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Programs Manager' });
});

router.get('/programs_manager/test', function (req, res) {
	act ({role:'programs_manager_api', cmd:'test'})
	  .then(function (result) {
		res.render('test', { title: 'Programs - Test', data: JSON.stringify (result) });
	  })
	  .catch(function (err) {
		console.log("ERROR:", err); 
	  });
 });
 
 router.get('/programs_manager/get_one_row', function (req, res) {
	act ({role:'programs_manager_api', cmd:'get_one_row'})
	  .then(function (result) {
		res.send (JSON.stringify (result));
		//res.render('test', { title: 'System User Manager - get_one_row', data: JSON.stringify (result) });
	  })
	  .catch(function (err) {
		console.log("ERROR:", err); 
	  });
 });

/*router.get('/system_user_manager/add_one_user', function (req, res) {
	//console.log(req.query);
	//var _in_data = req.query;
	//console.log(_in_data);
	act ({  role:'system_user_manager', 
	        cmd:'add_one_user', 
			_in_data: {
					firstname: req.query.firstname,
					lastname: req.query.lastname,
					login: req.query.login,
					password:  <PASSWORD>,
					changing_user_login: req.query.changing_user_login
			}
		})
	  .then(function (result) {
		res.send (JSON.stringify (result));
	  })
	  .catch(function (err) {
		console.log("ERROR:", err); 
		res.send ("ERROR:", err);
	  });
});
*/	  



			
 module.exports = router;

 <commit_msg>Add new actions<commit_after>var express = require('express');
var router = express.Router();

var seneca = require('seneca')();
var web = require('seneca-web');
var Promise = require('bluebird');

var act = Promise.promisify(seneca.act,  {context: seneca});
seneca.use( require('./programs_manager_api.js') );

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Programs Manager' });
});

router.get('/programs_manager/test', function (req, res) {
	act ({role:'programs_manager_api', cmd:'test'})
	  .then(function (result) {
		res.render('test', { title: 'Programs - Test', data: JSON.stringify (result) });
	  })
	  .catch(function (err) {
		console.log("ERROR:", err); 
	  });
 });
 
 router.get('/programs_manager/get_one_row', function (req, res) {
	console.log ("In /programs_manager/get_one_row");
	act ({role:'programs_manager_api', cmd:'get_one_row'})
	  .then(function (result) {
		res.send (JSON.stringify (result));
		//res.render('test', { title: 'System User Manager - get_one_row', data: JSON.stringify (result) });
	  })
	  .catch(function (err) {
		console.log("ERROR:", err); 
	  });
 });
 
router.get('/programs_manager/list_user_visible_programs', function (req, res) {
	act ({	role:'programs_manager_api', 
			cmd:'list_user_visible_programs',
			_in_data:	{
						login: req.query.login
			}
		})
	  .then(function (result) {
		res.send (JSON.stringify (result));
	  })
	  .catch(function (err) {
		console.log("ERROR:", err); 
	  });
 });

router.get('/programs_manager/list_user_visible_organizations', function (req, res) {
	act ({	role:'programs_manager_api', 
			cmd:'list_user_visible_organizations',
			_in_data:	{
						login: req.query.login
			}
		})
	  .then(function (result) {
		res.send (JSON.stringify (result));
	  })
	  .catch(function (err) {
		console.log("ERROR:", err); 
	  });
 });

router.get ('/programs_manager/change_program_user_visibility', function (req, res) {
	console.log ("In /programs_manager/change_program_user_visibility");
	act ({	role:'programs_manager_api', 
			cmd:'change_program_user_visibility',
			_in_data:	{
						login: req.query.login,
						service: req.query.service,
						program: req.query.program,
						task: req.query.task,
						changing_user_login: req.query.changing_user_login
			}
		})
	  .then(function (result) {
		res.send (JSON.stringify (result));
	  })
	  .catch(function (err) {
		console.log("ERROR:", err); 
	  });
 });

router.get('/programs_manager/change_organization_user_visibility', function (req, res) {
	act ({	role:'programs_manager_api', 
			cmd:'change_organization_user_visibility',
			_in_data:	{
						login: req.query.login,
						service: req.query.service,
						organization_name: req.query.organization_name,
						task: req.query.task,
						changing_user_login: req.query.changing_user_login
			}
		})
	  .then(function (result) {
		res.send (JSON.stringify (result));
	  })
	  .catch(function (err) {
		console.log("ERROR:", err); 
	  });
 });
 



			
 module.exports = router;

 
{'fraction_non_alphanumeric': 0.18094442122858337, 'fraction_numerical': 0.0, 'mean_word_length': 3.9047131147540983, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '362484', 'n_tokens_mistral': 1843, 'n_tokens_neox': 1633, 'n_words': 296}