72a547495c4b8459cd64b5e4bcf88dece36f3945
[motion2.git] / server / api / setting / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x2e05=['file','addLogo','diskStorage','join','logologin','addLogoLogin','preferred','addPreferred','addFavicon','update','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x2e05,0x138));var _0x52e0=function(_0x573b53,_0x4ad750){_0x573b53=_0x573b53-0x0;var _0xb255f6=_0x2e05[_0x573b53];return _0xb255f6;};'use strict';var multer=require(_0x52e0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x52e0('0x1'));var express=require(_0x52e0('0x2'));var router=express[_0x52e0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x52e0('0x4'));var interaction=require(_0x52e0('0x5'));var config=require('../../config/environment');var controller=require(_0x52e0('0x6'));router[_0x52e0('0x7')]('/',auth[_0x52e0('0x8')](),controller[_0x52e0('0x9')]);router['get'](_0x52e0('0xa'),controller[_0x52e0('0xb')]);router[_0x52e0('0x7')](_0x52e0('0xc'),controller[_0x52e0('0xd')]);router['get'](_0x52e0('0xe'),controller[_0x52e0('0xf')]);router[_0x52e0('0x7')](_0x52e0('0x10'),controller[_0x52e0('0x11')]);router[_0x52e0('0x7')]('/:id/gdpr',controller[_0x52e0('0x12')]);router[_0x52e0('0x7')](_0x52e0('0x13'),controller[_0x52e0('0x14')]);router[_0x52e0('0x7')](_0x52e0('0x15'),controller[_0x52e0('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x31de1e,_0x174c66,_0x334562){_0x334562(null,path['join'](config[_0x52e0('0x17')],_0x52e0('0x18')));},'filename':function(_0x23e624,_0x26cf96,_0x52eea0){_0x52eea0(null,util[_0x52e0('0x19')](_0x52e0('0x1a'),_0x52e0('0x1b'),path[_0x52e0('0x1c')](_0x26cf96[_0x52e0('0x1d')])));}})});router[_0x52e0('0x1e')]('/:id/logo',upload[_0x52e0('0x1f')](_0x52e0('0x20')),controller[_0x52e0('0x21')]);var upload=multer({'storage':multer[_0x52e0('0x22')]({'destination':function(_0x296613,_0x4f6101,_0x1776eb){_0x1776eb(null,path[_0x52e0('0x23')](config[_0x52e0('0x17')],_0x52e0('0x18')));},'filename':function(_0x21817e,_0x349520,_0x5b556a){_0x5b556a(null,util['format']('%s%s',_0x52e0('0x24'),path['extname'](_0x349520[_0x52e0('0x1d')])));}})});router[_0x52e0('0x1e')](_0x52e0('0x10'),upload[_0x52e0('0x1f')]('file'),controller[_0x52e0('0x25')]);var upload=multer({'storage':multer[_0x52e0('0x22')]({'destination':function(_0x57e312,_0x2725c3,_0x291ed3){_0x291ed3(null,path['join'](config[_0x52e0('0x17')],_0x52e0('0x18')));},'filename':function(_0x2f4649,_0xb15a37,_0x59b013){_0x59b013(null,util[_0x52e0('0x19')](_0x52e0('0x1a'),_0x52e0('0x26'),path[_0x52e0('0x1c')](_0xb15a37[_0x52e0('0x1d')])));}})});router['post'](_0x52e0('0x13'),upload[_0x52e0('0x1f')](_0x52e0('0x20')),controller[_0x52e0('0x27')]);var upload=multer({'storage':multer[_0x52e0('0x22')]({'destination':function(_0x1c8ed9,_0x4a1f06,_0x4e4de1){_0x4e4de1(null,path[_0x52e0('0x23')](config[_0x52e0('0x17')],_0x52e0('0x18')));},'filename':function(_0x20bab5,_0x299201,_0x4773b5){_0x4773b5(null,util[_0x52e0('0x19')](_0x52e0('0x1a'),'favicon',path[_0x52e0('0x1c')](_0x299201[_0x52e0('0x1d')])));}})});router['post'](_0x52e0('0x15'),upload['single'](_0x52e0('0x20')),controller[_0x52e0('0x28')]);router['put'](_0x52e0('0xc'),auth['isAuthenticated'](),controller[_0x52e0('0x29')]);module[_0x52e0('0x2a')]=router;