<commit_before>//importController
(function (importController) {
    var gh = require('./helpers/github'),
        bodyParser = require('body-parser'),
        config = require('../config'),
        eventStore = require('./helpers/eventStore');
    
    importController.init = function (app) {
        
        app.post("/api/importHistory", bodyParser.json(), function (req, res) {
            var owner = req.body.owner;
            var accessToken = req.body.accessToken;
            var repo = req.body.repo;
            
            var githubHelper = new gh();
            githubHelper.getAllCommits({
                owner: owner,
                repo: repo,
                accessToken: accessToken
            });
            
            res.json({ message: 'Your repository is in queue to be added to CommitStream.' });
            res.end();
        });
        
        app.post("/api/listenerWebhook", bodyParser.json(), function (req, res) {
            res.set('Content-Type', 'application/json');
            //TODO: all this logic, yikes!
            if (!req.headers.hasOwnProperty('x-github-event')) {
                res.json({ message: 'Unknown event type.' });
            } else if (req.headers['x-github-event'] == 'push') {
                var translator = require('./translators/githubTranslator');
                var events = translator.translatePush(req.body);
                var es = new eventStore(config.eventStoreBaseUrl, config.eventStoreUser, config.eventStorePassword);
                es.pushEvents(JSON.stringify(events));
                res.json({ message: 'Your push event is in queue to be added to CommitStream.' });
            } else if (req.headers['x-github-event'] == 'ping') {
                res.json({ message: 'Pong.' });
            } else {
                res.json({ message: 'Unknown event type.' });
            }
            res.end();
        });

    };

})(module.exports);<commit_msg>S-48712 Phrasing on importHistory response message<commit_after>//importController
(function (importController) {
    var gh = require('./helpers/github'),
        bodyParser = require('body-parser'),
        config = require('../config'),
        eventStore = require('./helpers/eventStore');
    
    importController.init = function (app) {
        
        app.post("/api/importHistory", bodyParser.json(), function (req, res) {
            var owner = req.body.owner;
            var accessToken = req.body.accessToken;
            var repo = req.body.repo;
            
            var githubHelper = new gh();
            githubHelper.getAllCommits({
                owner: owner,
                repo: repo,
                accessToken: accessToken
            });
            
            res.json({ message: 'Your repository has been queued to be imported into CommitStream.' });
            res.end();
        });
        
        app.post("/api/listenerWebhook", bodyParser.json(), function (req, res) {
            res.set('Content-Type', 'application/json');
            //TODO: all this logic, yikes!
            if (!req.headers.hasOwnProperty('x-github-event')) {
                res.json({ message: 'Unknown event type.' });
            } else if (req.headers['x-github-event'] == 'push') {
                var translator = require('./translators/githubTranslator');
                var events = translator.translatePush(req.body);
                var es = new eventStore(config.eventStoreBaseUrl, config.eventStoreUser, config.eventStorePassword);
                es.pushEvents(JSON.stringify(events));
                res.json({ message: 'Your push event is in queue to be added to CommitStream.' });
            } else if (req.headers['x-github-event'] == 'ping') {
                res.json({ message: 'Pong.' });
            } else {
                res.json({ message: 'Unknown event type.' });
            }
            res.end();
        });

    };

})(module.exports);
{'fraction_non_alphanumeric': 0.1366632860040568, 'fraction_numerical': 0.0012677484787018255, 'mean_word_length': 1.7879858657243817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4902070', 'n_tokens_mistral': 1028, 'n_tokens_neox': 992, 'n_words': 238}