<commit_before>

angular.module('dotApp').factory('appaudit', ['$http', 'localStorageService', function($http, localStorageService){
    return {
        clickDotMark: function(id){
            var o = {};
            o['user'] = 'ivan';
            o['source_id'] = id;
            o['action'] = 'click';
            $http.defaults.headers.common['Authorization'] = 'Basic ' + localStorageService.get('token');
            return $http.post( auditUrl, JSON.stringify(o), config);
        },
        starDotMark: function(id, star){
            var o = {};
            o['user'] = 'ivan';
            o['source_id'] = id;
            o['action'] = 'star';
            o['value'] = '' + star;
            $http.defaults.headers.common['Authorization'] = 'Basic ' + localStorageService.get('token');
            return $http.post( auditUrl, JSON.stringify(o));
        },


    };
}]);

angular.module('dotApp').factory('api', ['$http', 'localStorageService', function($http, localStorageService) {



    return {
        getDotMarksEntries: function(params) {
            var username = localStorageService.get('username');
            var dest = dotmarksUrl + '?where={"username":"' + username + '"}&sort=[("views",-1)]&d=' + Date.now();
            if(params.page !== undefined){
                return $http.get(dest + "&page=" + params.page);
            }else{
                return $http.get(dest);
            }


        },
        saveDotMark: function(entry) {
            var config = {
                headers: {
                    "Content-Type": "application/json",
                },
                responseType: "application/json",
            };
            $http.defaults.headers.common['Authorization'] = 'Basic ' + localStorageService.get('token');
            return $http.post(dotmarksUrl, entry, config);
        },

        getDotMarksByTag: function(tag){
            var config = {
                headers: {
                    "Content-Type": "application/json",
                },
                responseType: "application/json",
            };
            var filter = "?where={\"$or\":[{\"tags\":\"" + tag + "\"},{\"atags\":\"" +  tag + "\"}]}";
            return $http.get(dotmarksUrl + filter, config);

        },
        searchDotMarks: function(query){
            var username = localStorageService.get('username');
            var filter = "?where={\"$and\":[{\"username\": \"" + username +"\"}, {\"$or\": [{\"url\":{\"$regex\":\".*" + query + ".*\"}},{\"title\":{\"$regex\":\".*" + query + ".*\",\"$options\":\"i\"}}]}]}";
            return $http.get(dotmarksUrl + filter);
        },
        getDotMark: function(id){
            return $http.get(dotmarksUrl + "/" + id);
        },
        updateDotMark: function(dotmark) {
            log("updating " + dotmark._id);
            log(dotmark);
            var config = {
                headers: {<commit_msg>removed user from factory query conditions<commit_after>

angular.module('dotApp').factory('appaudit', ['$http', 'localStorageService', function($http, localStorageService){
    return {
        clickDotMark: function(id){
            var o = {};
            o['user'] = 'ivan';
            o['source_id'] = id;
            o['action'] = 'click';
            $http.defaults.headers.common['Authorization'] = 'Basic ' + localStorageService.get('token');
            return $http.post( auditUrl, JSON.stringify(o), config);
        },
        starDotMark: function(id, star){
            var o = {};
            o['user'] = 'ivan';
            o['source_id'] = id;
            o['action'] = 'star';
            o['value'] = '' + star;
            $http.defaults.headers.common['Authorization'] = 'Basic ' + localStorageService.get('token');
            return $http.post( auditUrl, JSON.stringify(o));
        },


    };
}]);

angular.module('dotApp').factory('api', ['$http', 'localStorageService', function($http, localStorageService) {



    return {
        getDotMarksEntries: function(params) {
            var username = localStorageService.get('username');
            var dest = dotmarksUrl + '?sort=[("views",-1)]&d=' + Date.now();
            if(params.page !== undefined){
                return $http.get(dest + "&page=" + params.page);
            }else{
                return $http.get(dest);
            }


        },
        saveDotMark: function(entry) {
            var config = {
                headers: {
                    "Content-Type": "application/json",
                },
                responseType: "application/json",
            };
            $http.defaults.headers.common['Authorization'] = 'Basic ' + localStorageService.get('token');
            return $http.post(dotmarksUrl, entry, config);
        },

        getDotMarksByTag: function(tag){
            var config = {
                headers: {
                    "Content-Type": "application/json",
                },
                responseType: "application/json",
            };
            var filter = "?where={\"$or\":[{\"tags\":\"" + tag + "\"},{\"atags\":\"" +  tag + "\"}]}";
            return $http.get(dotmarksUrl + filter, config);

        },
        searchDotMarks: function(query){
            var username = localStorageService.get('username');
            var filter = "?where={\"$or\": [{\"url\":{\"$regex\":\".*" + query + ".*\"}},{\"title\":{\"$regex\":\".*" + query + ".*\",\"$options\":\"i\"}}]}";
            return $http.get(dotmarksUrl + filter);
        },
        getDotMark: function(id){
            return $http.get(dotmarksUrl + "/" + id);
        },
        updateDotMark: function(dotmark) {
            log("updating " + dotmark._id);
            log(dotmark);
            var config = {
                headers: {
{'fraction_non_alphanumeric': 0.18575152041702866, 'fraction_numerical': 0.0003475238922675934, 'mean_word_length': 1.8312838170191834, 'pattern_counts': {'":': 25, '<': 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': '5290560', 'n_tokens_mistral': 1624, 'n_tokens_neox': 1578, 'n_words': 277}