Built motion from commit 26159a51.|2.5.44
[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 _0xa49e=['/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','logo','extname','originalname','post','file','addLogo','%s%s','logologin','single','server/files/images/logos/','favicon','addFavicon','put','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','getDate','/:id','show','/:id/logo','getLogo'];(function(_0x26660c,_0xa474ef){var _0x21fb98=function(_0xcedc16){while(--_0xcedc16){_0x26660c['push'](_0x26660c['shift']());}};_0x21fb98(++_0xa474ef);}(_0xa49e,0xdc));var _0xea49=function(_0x1a051d,_0x3a017a){_0x1a051d=_0x1a051d-0x0;var _0x275ccb=_0xa49e[_0x1a051d];return _0x275ccb;};'use strict';var multer=require('multer');var util=require(_0xea49('0x0'));var path=require(_0xea49('0x1'));var timeout=require('connect-timeout');var express=require(_0xea49('0x2'));var router=express[_0xea49('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xea49('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xea49('0x5'));var controller=require(_0xea49('0x6'));router[_0xea49('0x7')]('/',auth[_0xea49('0x8')](),controller['index']);router[_0xea49('0x7')]('/now',controller[_0xea49('0x9')]);router[_0xea49('0x7')](_0xea49('0xa'),controller[_0xea49('0xb')]);router[_0xea49('0x7')](_0xea49('0xc'),controller[_0xea49('0xd')]);router[_0xea49('0x7')](_0xea49('0xe'),controller['getLogoLogin']);router[_0xea49('0x7')](_0xea49('0xf'),controller[_0xea49('0x10')]);router[_0xea49('0x7')](_0xea49('0x11'),controller[_0xea49('0x12')]);router[_0xea49('0x7')](_0xea49('0x13'),controller[_0xea49('0x14')]);var upload=multer({'storage':multer[_0xea49('0x15')]({'destination':function(_0x53577a,_0x2cc278,_0x3f1951){_0x3f1951(null,path[_0xea49('0x16')](config[_0xea49('0x17')],'server/files/images/logos/'));},'filename':function(_0x3bf966,_0x295cd4,_0x631bb2){_0x631bb2(null,util[_0xea49('0x18')]('%s%s',_0xea49('0x19'),path[_0xea49('0x1a')](_0x295cd4[_0xea49('0x1b')])));}})});router[_0xea49('0x1c')](_0xea49('0xc'),upload['single'](_0xea49('0x1d')),controller[_0xea49('0x1e')]);var upload=multer({'storage':multer[_0xea49('0x15')]({'destination':function(_0xbd9f16,_0x5b651d,_0x3ad486){_0x3ad486(null,path[_0xea49('0x16')](config['root'],'server/files/images/logos/'));},'filename':function(_0x7e31a1,_0x432bde,_0x539bd4){_0x539bd4(null,util[_0xea49('0x18')](_0xea49('0x1f'),_0xea49('0x20'),path[_0xea49('0x1a')](_0x432bde[_0xea49('0x1b')])));}})});router[_0xea49('0x1c')]('/:id/logo_login',upload[_0xea49('0x21')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xea49('0x15')]({'destination':function(_0x3c4693,_0x3aca1c,_0x557a0f){_0x557a0f(null,path[_0xea49('0x16')](config[_0xea49('0x17')],_0xea49('0x22')));},'filename':function(_0x1b08bb,_0x10814b,_0x19df2b){_0x19df2b(null,util[_0xea49('0x18')](_0xea49('0x1f'),'preferred',path[_0xea49('0x1a')](_0x10814b[_0xea49('0x1b')])));}})});router[_0xea49('0x1c')]('/:id/preferred',upload[_0xea49('0x21')](_0xea49('0x1d')),controller['addPreferred']);var upload=multer({'storage':multer[_0xea49('0x15')]({'destination':function(_0x313115,_0x26a746,_0x2f17f6){_0x2f17f6(null,path[_0xea49('0x16')](config[_0xea49('0x17')],_0xea49('0x22')));},'filename':function(_0x13202b,_0x336e00,_0x526edd){_0x526edd(null,util[_0xea49('0x18')]('%s%s',_0xea49('0x23'),path['extname'](_0x336e00['originalname'])));}})});router[_0xea49('0x1c')]('/:id/favicon',upload['single'](_0xea49('0x1d')),controller[_0xea49('0x24')]);router[_0xea49('0x25')]('/:id',auth['isAuthenticated'](),controller['update']);module[_0xea49('0x26')]=router;