b60cc889edb85663c0e2265c9e9430c6b1da9b71
[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 _0xad42=['/:id/gdpr','gdpr','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname','post','single','addLogo','logologin','/:id/logo_login','file','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','/:id/logo','getLogo','getLogoLogin'];(function(_0x50da7a,_0x1d67f4){var _0x2eeb7d=function(_0x1eb018){while(--_0x1eb018){_0x50da7a['push'](_0x50da7a['shift']());}};_0x2eeb7d(++_0x1d67f4);}(_0xad42,0xbd));var _0x2ad4=function(_0x5e307c,_0xfd90e){_0x5e307c=_0x5e307c-0x0;var _0x171570=_0xad42[_0x5e307c];return _0x171570;};'use strict';var multer=require(_0x2ad4('0x0'));var util=require(_0x2ad4('0x1'));var path=require(_0x2ad4('0x2'));var timeout=require(_0x2ad4('0x3'));var express=require(_0x2ad4('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2ad4('0x5'));var config=require(_0x2ad4('0x6'));var controller=require(_0x2ad4('0x7'));router[_0x2ad4('0x8')]('/',auth[_0x2ad4('0x9')](),controller[_0x2ad4('0xa')]);router[_0x2ad4('0x8')](_0x2ad4('0xb'),controller['getDate']);router[_0x2ad4('0x8')](_0x2ad4('0xc'),controller['show']);router[_0x2ad4('0x8')](_0x2ad4('0xd'),controller[_0x2ad4('0xe')]);router[_0x2ad4('0x8')]('/:id/logo_login',controller[_0x2ad4('0xf')]);router['get'](_0x2ad4('0x10'),controller[_0x2ad4('0x11')]);router['get']('/:id/preferred',controller['getPreferred']);router[_0x2ad4('0x8')](_0x2ad4('0x12'),controller['getFavicon']);var upload=multer({'storage':multer[_0x2ad4('0x13')]({'destination':function(_0x48e8a6,_0x533a60,_0x35d411){_0x35d411(null,path[_0x2ad4('0x14')](config[_0x2ad4('0x15')],_0x2ad4('0x16')));},'filename':function(_0x345398,_0x1cfd6e,_0x4e54d6){_0x4e54d6(null,util[_0x2ad4('0x17')](_0x2ad4('0x18'),'logo',path[_0x2ad4('0x19')](_0x1cfd6e[_0x2ad4('0x1a')])));}})});router[_0x2ad4('0x1b')]('/:id/logo',upload[_0x2ad4('0x1c')]('file'),controller[_0x2ad4('0x1d')]);var upload=multer({'storage':multer[_0x2ad4('0x13')]({'destination':function(_0x563e07,_0x2f820e,_0x11cfae){_0x11cfae(null,path[_0x2ad4('0x14')](config['root'],'server/files/images/logos/'));},'filename':function(_0x3a5551,_0x13199e,_0x59617a){_0x59617a(null,util[_0x2ad4('0x17')](_0x2ad4('0x18'),_0x2ad4('0x1e'),path[_0x2ad4('0x19')](_0x13199e['originalname'])));}})});router[_0x2ad4('0x1b')](_0x2ad4('0x1f'),upload[_0x2ad4('0x1c')](_0x2ad4('0x20')),controller[_0x2ad4('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3bc2c8,_0x223299,_0x8e4717){_0x8e4717(null,path[_0x2ad4('0x14')](config[_0x2ad4('0x15')],_0x2ad4('0x16')));},'filename':function(_0x4decab,_0x8d0e84,_0x5f5a25){_0x5f5a25(null,util[_0x2ad4('0x17')](_0x2ad4('0x18'),_0x2ad4('0x22'),path[_0x2ad4('0x19')](_0x8d0e84[_0x2ad4('0x1a')])));}})});router[_0x2ad4('0x1b')](_0x2ad4('0x23'),upload[_0x2ad4('0x1c')](_0x2ad4('0x20')),controller[_0x2ad4('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x551e93,_0xd87f1d,_0xfc5a60){_0xfc5a60(null,path[_0x2ad4('0x14')](config[_0x2ad4('0x15')],_0x2ad4('0x16')));},'filename':function(_0x3b4417,_0x1f0708,_0x28b4a3){_0x28b4a3(null,util[_0x2ad4('0x17')](_0x2ad4('0x18'),_0x2ad4('0x25'),path['extname'](_0x1f0708['originalname'])));}})});router[_0x2ad4('0x1b')]('/:id/favicon',upload[_0x2ad4('0x1c')](_0x2ad4('0x20')),controller[_0x2ad4('0x26')]);router[_0x2ad4('0x27')](_0x2ad4('0xc'),auth['isAuthenticated'](),controller['update']);module[_0x2ad4('0x28')]=router;