<commit_before>define("imcms-files-rest-api", ["imcms-rest-api"], function (rest) {

    let url = '/files';
    let api = new rest.API(url);

    api.download = file => rest.ajax.call({url: `${url}/file/${file}`, type: 'GET', json: false});

    api.get = file => rest.ajax.call({url: `${url}/${file}`, type: 'GET', json: false});

    api.upload = formData => rest.ajax.call({
        url: `${url}/upload/`,
        type: "POST",
        contentType: false,
        processData: false
    }, formData);

    api.copy = pathParam => rest.ajax.call({url: `${url}/copy/`, type: 'POST', json: true}, pathParam);

    api.change = content => rest.ajax.call({url: `${url}/`, type: 'PUT', json: true}, content);

    api.move = pathParam => rest.ajax.call({url: `${url}/move/`, type: 'PUT', json: true}, pathParam);

    api.rename = pathParam => rest.ajax.call({url: `${url}/rename/`, type: 'PUT', json: true}, pathParam);

    api.deleteFile = sourceFile => rest.ajax.call({url: `${url}/`, type: 'DELETE', json: true}, sourceFile);

    api.getDocuments = template => rest.ajax.call({url: `${url}/docs`, type: 'GET', json: false}, template);

    return api;
});<commit_msg>Issue IMCMS-332: New design to super admin page: files tab - Add new method to rest api;<commit_after>define("imcms-files-rest-api", ["imcms-rest-api"], function (rest) {

    let url = '/files';
    let api = new rest.API(url);

    api.download = file => rest.ajax.call({url: `${url}/file/${file}`, type: 'GET', json: false});

    api.get = file => rest.ajax.call({url: `${url}/${file}`, type: 'GET', json: false});

    api.upload = formData => rest.ajax.call({
        url: `${url}/upload/`,
        type: "POST",
        contentType: false,
        processData: false
    }, formData);

    api.copy = pathParam => rest.ajax.call({url: `${url}/copy/`, type: 'POST', json: true}, pathParam);

    api.change = content => rest.ajax.call({url: `${url}/`, type: 'PUT', json: true}, content);

    api.move = pathParam => rest.ajax.call({url: `${url}/move/`, type: 'PUT', json: true}, pathParam);

    api.rename = pathParam => rest.ajax.call({url: `${url}/rename/`, type: 'PUT', json: true}, pathParam);

    api.deleteFile = sourceFile => rest.ajax.call({url: `${url}/`, type: 'DELETE', json: true}, sourceFile);

    api.getDocuments = template => rest.ajax.call({url: `${url}/docs`, type: 'GET', json: false}, template);

    api.addTemplateToGroup = pathParam => rest.ajax.call({url: `${url}/template`, type: 'POST', json: true}, pathParam);

    return api;
});
{'fraction_non_alphanumeric': 0.22449783379283184, 'fraction_numerical': 0.0011815675462780622, 'mean_word_length': 3.5438282647584973, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2886997', 'n_tokens_mistral': 849, 'n_tokens_neox': 840, 'n_words': 214}