Built motion from commit e1760111.|2.6.18
[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 _0xb68e=['server/files/images/logos/','logologin','addLogoLogin','format','addPreferred','favicon','update','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/now','getDate','/:id','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','root','%s%s','logo','extname','originalname','post','single','file','addLogo'];(function(_0x2466bb,_0x4e9039){var _0xc50aff=function(_0x1d9646){while(--_0x1d9646){_0x2466bb['push'](_0x2466bb['shift']());}};_0xc50aff(++_0x4e9039);}(_0xb68e,0xd0));var _0xeb68=function(_0x3199cc,_0x566fab){_0x3199cc=_0x3199cc-0x0;var _0x86219a=_0xb68e[_0x3199cc];return _0x86219a;};'use strict';var multer=require(_0xeb68('0x0'));var util=require(_0xeb68('0x1'));var path=require(_0xeb68('0x2'));var timeout=require(_0xeb68('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeb68('0x4'));var interaction=require(_0xeb68('0x5'));var config=require(_0xeb68('0x6'));var controller=require('./setting.controller');router[_0xeb68('0x7')]('/',auth[_0xeb68('0x8')](),controller[_0xeb68('0x9')]);router[_0xeb68('0x7')](_0xeb68('0xa'),controller[_0xeb68('0xb')]);router[_0xeb68('0x7')](_0xeb68('0xc'),controller['show']);router[_0xeb68('0x7')](_0xeb68('0xd'),controller['getLogo']);router['get'](_0xeb68('0xe'),controller[_0xeb68('0xf')]);router[_0xeb68('0x7')](_0xeb68('0x10'),controller[_0xeb68('0x11')]);router[_0xeb68('0x7')](_0xeb68('0x12'),controller[_0xeb68('0x13')]);router[_0xeb68('0x7')](_0xeb68('0x14'),controller['getFavicon']);var upload=multer({'storage':multer[_0xeb68('0x15')]({'destination':function(_0x381b5c,_0x12e7da,_0x350721){_0x350721(null,path[_0xeb68('0x16')](config[_0xeb68('0x17')],'server/files/images/logos/'));},'filename':function(_0x285651,_0x3cf6e8,_0x57beb9){_0x57beb9(null,util['format'](_0xeb68('0x18'),_0xeb68('0x19'),path[_0xeb68('0x1a')](_0x3cf6e8[_0xeb68('0x1b')])));}})});router[_0xeb68('0x1c')](_0xeb68('0xd'),upload[_0xeb68('0x1d')](_0xeb68('0x1e')),controller[_0xeb68('0x1f')]);var upload=multer({'storage':multer[_0xeb68('0x15')]({'destination':function(_0x34679d,_0x4636f6,_0x4ce219){_0x4ce219(null,path[_0xeb68('0x16')](config['root'],_0xeb68('0x20')));},'filename':function(_0xeef458,_0x31850c,_0x407bc8){_0x407bc8(null,util['format'](_0xeb68('0x18'),_0xeb68('0x21'),path[_0xeb68('0x1a')](_0x31850c[_0xeb68('0x1b')])));}})});router[_0xeb68('0x1c')](_0xeb68('0xe'),upload[_0xeb68('0x1d')](_0xeb68('0x1e')),controller[_0xeb68('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x37bb9c,_0x3db88e,_0x397a4f){_0x397a4f(null,path[_0xeb68('0x16')](config[_0xeb68('0x17')],_0xeb68('0x20')));},'filename':function(_0x46c33e,_0x4601b5,_0x17a7d2){_0x17a7d2(null,util[_0xeb68('0x23')](_0xeb68('0x18'),'preferred',path['extname'](_0x4601b5[_0xeb68('0x1b')])));}})});router[_0xeb68('0x1c')]('/:id/preferred',upload[_0xeb68('0x1d')](_0xeb68('0x1e')),controller[_0xeb68('0x24')]);var upload=multer({'storage':multer[_0xeb68('0x15')]({'destination':function(_0x4419a1,_0x3b65e3,_0x26d38d){_0x26d38d(null,path[_0xeb68('0x16')](config[_0xeb68('0x17')],'server/files/images/logos/'));},'filename':function(_0x344d62,_0x4a39eb,_0x265d33){_0x265d33(null,util[_0xeb68('0x23')](_0xeb68('0x18'),_0xeb68('0x25'),path[_0xeb68('0x1a')](_0x4a39eb[_0xeb68('0x1b')])));}})});router[_0xeb68('0x1c')]('/:id/favicon',upload[_0xeb68('0x1d')](_0xeb68('0x1e')),controller['addFavicon']);router['put'](_0xeb68('0xc'),auth[_0xeb68('0x8')](),controller[_0xeb68('0x26')]);module[_0xeb68('0x27')]=router;