9c2cb28d93d9f8ffafd58158af0454aead9cc920
[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 _0xfae6=['format','logo','extname','originalname','post','single','file','server/files/images/logos/','logologin','addLogoLogin','%s%s','preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root'];(function(_0x20ab38,_0x4bf6f2){var _0x1c489e=function(_0x26c915){while(--_0x26c915){_0x20ab38['push'](_0x20ab38['shift']());}};_0x1c489e(++_0x4bf6f2);}(_0xfae6,0x138));var _0x6fae=function(_0x153449,_0x1e1a30){_0x153449=_0x153449-0x0;var _0x503edb=_0xfae6[_0x153449];return _0x503edb;};'use strict';var multer=require(_0x6fae('0x0'));var util=require(_0x6fae('0x1'));var path=require(_0x6fae('0x2'));var timeout=require(_0x6fae('0x3'));var express=require(_0x6fae('0x4'));var router=express['Router']();var fs_extra=require(_0x6fae('0x5'));var auth=require(_0x6fae('0x6'));var interaction=require(_0x6fae('0x7'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0x6fae('0x8')]('/',auth[_0x6fae('0x9')](),controller[_0x6fae('0xa')]);router[_0x6fae('0x8')](_0x6fae('0xb'),controller['getDate']);router['get'](_0x6fae('0xc'),controller[_0x6fae('0xd')]);router['get'](_0x6fae('0xe'),controller[_0x6fae('0xf')]);router[_0x6fae('0x8')](_0x6fae('0x10'),controller[_0x6fae('0x11')]);router[_0x6fae('0x8')]('/:id/gdpr',controller['gdpr']);router[_0x6fae('0x8')](_0x6fae('0x12'),controller['getPreferred']);router[_0x6fae('0x8')](_0x6fae('0x13'),controller[_0x6fae('0x14')]);var upload=multer({'storage':multer[_0x6fae('0x15')]({'destination':function(_0x39169c,_0x4703e3,_0x2a0ec4){_0x2a0ec4(null,path[_0x6fae('0x16')](config[_0x6fae('0x17')],'server/files/images/logos/'));},'filename':function(_0xc5d922,_0x285bf4,_0x1a4020){_0x1a4020(null,util[_0x6fae('0x18')]('%s%s',_0x6fae('0x19'),path[_0x6fae('0x1a')](_0x285bf4[_0x6fae('0x1b')])));}})});router[_0x6fae('0x1c')](_0x6fae('0xe'),upload[_0x6fae('0x1d')](_0x6fae('0x1e')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf912bb,_0x2eaafc,_0x4b9e55){_0x4b9e55(null,path[_0x6fae('0x16')](config[_0x6fae('0x17')],_0x6fae('0x1f')));},'filename':function(_0x3cc1e0,_0x344c4e,_0x5d5537){_0x5d5537(null,util['format']('%s%s',_0x6fae('0x20'),path[_0x6fae('0x1a')](_0x344c4e[_0x6fae('0x1b')])));}})});router[_0x6fae('0x1c')](_0x6fae('0x10'),upload[_0x6fae('0x1d')](_0x6fae('0x1e')),controller[_0x6fae('0x21')]);var upload=multer({'storage':multer[_0x6fae('0x15')]({'destination':function(_0x5b71c1,_0x5c208b,_0x1dc31f){_0x1dc31f(null,path[_0x6fae('0x16')](config['root'],_0x6fae('0x1f')));},'filename':function(_0x500772,_0x3b7fa0,_0x12bf82){_0x12bf82(null,util[_0x6fae('0x18')](_0x6fae('0x22'),_0x6fae('0x23'),path['extname'](_0x3b7fa0[_0x6fae('0x1b')])));}})});router[_0x6fae('0x1c')](_0x6fae('0x12'),upload['single'](_0x6fae('0x1e')),controller[_0x6fae('0x24')]);var upload=multer({'storage':multer[_0x6fae('0x15')]({'destination':function(_0x101ca7,_0x3fa933,_0x52011d){_0x52011d(null,path['join'](config[_0x6fae('0x17')],_0x6fae('0x1f')));},'filename':function(_0x5293b9,_0x4a7174,_0x579243){_0x579243(null,util['format'](_0x6fae('0x22'),_0x6fae('0x25'),path[_0x6fae('0x1a')](_0x4a7174['originalname'])));}})});router[_0x6fae('0x1c')](_0x6fae('0x13'),upload[_0x6fae('0x1d')]('file'),controller[_0x6fae('0x26')]);router[_0x6fae('0x27')](_0x6fae('0xc'),auth['isAuthenticated'](),controller[_0x6fae('0x28')]);module[_0x6fae('0x29')]=router;