<commit_before>'use strict';

var request = require('request');

const API_HOST = process.env.UI_API_URL;
const PRODUCTS_URL = '/products/{date}';
const MENU_URL = '/menus/{date}';
const CATEGORIES_URL = '/categories';

const HTTP_REQUEST_GET = 'GET';
const HTTP_REQUEST_POST = 'POST';

function ApiService() {
}

ApiService.prototype = {
    getSellingProducts: function (date) {
        return [
            {
                id: 1,
                name: "Produs 1",
                title: "Titlu produs 1"
            },
            {
                id: 2,
                name: "Produs 2",
                title: "Titlu produs 2"
            },
            {
                id: 3,
                name: "Produs 3",
                title: "Titlu produs 3"
            }
        ];
        var url = PRODUCTS_URL.replace('{data}', date);

        return this.request(url, HTTP_REQUEST_GET);
    },
    getProduct: function (id) {
        return {
            id: 1,
            name: "Produs 1",
            title: "Titlu produs 1"
        };
    },
    getSellingMenus: function (date) {
        var url = MENU_URL.replace('{data}', date);

        return this.request(url, HTTP_REQUEST_GET);
    },
    getSellingProductCategories: function () {
        return [
            {
                id: 1,
                name: "categorie 1",
                title: "Blab labla 1"
            },
            {
                id: 2,
                name: "categorie 2",
                title: "Titlu"
            }
        ];
        return this.request(CATEGORIES_URL, HTTP_REQUEST_GET);
    },
    getUrl: function (url) {
        return API_HOST + url;
    },<commit_msg>add categories api<commit_after>'use strict';

var request = require('request');

const API_HOST = process.env.UI_API_URL;
const PRODUCTS_URL = '/products/{date}';
const MENU_URL = '/menus/{date}';
const CATEGORIES_URL = '/api/categories/daily?date={date}';

const HTTP_REQUEST_GET = 'GET';
const HTTP_REQUEST_POST = 'POST';

function ApiService() {
}

ApiService.prototype = {
    getSellingProducts: function (date) {
        return [
            {
                id: 1,
                name: "<NAME>",
                title: "Titlu produs 1"
            },
            {
                id: 2,
                name: "<NAME>",
                title: "Titlu produs 2"
            },
            {
                id: 3,
                name: "<NAME>",
                title: "Titlu produs 3"
            }
        ];
        var url = PRODUCTS_URL.replace('{data}', date);

        return this.request(url, HTTP_REQUEST_GET);
    },
    getProduct: function (id) {
        return {
            id: 1,
            name: "<NAME>",
            title: "Titlu produs 1"
        };
    },
    getSellingMenus: function (date) {
        var url = MENU_URL.replace('{data}', date);

        return this.request(url, HTTP_REQUEST_GET);
    },
    getSellingProductCategories: function () {
        var date = new Date();
        var url = CATEGORIES_URL.replace('{data}', date.format("%Y-%m-%d"));
        
        return this.request(url, HTTP_REQUEST_GET);
    },
    getUrl: function (url) {
        return API_HOST + url;
    },
{'fraction_non_alphanumeric': 0.12566427008440137, 'fraction_numerical': 0.007814942169427946, 'mean_word_length': 1.5177025963808026, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1269762', 'n_tokens_mistral': 1021, 'n_tokens_neox': 969, 'n_words': 219}