ccc6274bea5b86604411c08cf7f119b5a8ba6a02
[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 _0x13b3=['index','/now','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','root','server/files/images/logos/','format','%s%s','logo','extname','post','single','addLogo','diskStorage','join','logologin','originalname','file','addPreferred','favicon','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x13b3,0xa3));var _0x313b=function(_0x188cc8,_0xd39746){_0x188cc8=_0x188cc8-0x0;var _0x4cb155=_0x13b3[_0x188cc8];return _0x4cb155;};'use strict';var multer=require(_0x313b('0x0'));var util=require(_0x313b('0x1'));var path=require(_0x313b('0x2'));var timeout=require(_0x313b('0x3'));var express=require(_0x313b('0x4'));var router=express[_0x313b('0x5')]();var fs_extra=require(_0x313b('0x6'));var auth=require(_0x313b('0x7'));var interaction=require(_0x313b('0x8'));var config=require(_0x313b('0x9'));var controller=require(_0x313b('0xa'));router[_0x313b('0xb')]('/',auth[_0x313b('0xc')](),controller[_0x313b('0xd')]);router[_0x313b('0xb')](_0x313b('0xe'),controller['getDate']);router[_0x313b('0xb')](_0x313b('0xf'),controller[_0x313b('0x10')]);router[_0x313b('0xb')]('/:id/logo',controller[_0x313b('0x11')]);router[_0x313b('0xb')](_0x313b('0x12'),controller[_0x313b('0x13')]);router[_0x313b('0xb')](_0x313b('0x14'),controller[_0x313b('0x15')]);router['get'](_0x313b('0x16'),controller['getPreferred']);router['get'](_0x313b('0x17'),controller[_0x313b('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x488761,_0x2ca9a7,_0x3c0647){_0x3c0647(null,path['join'](config[_0x313b('0x19')],_0x313b('0x1a')));},'filename':function(_0x3ad675,_0x4c6b0f,_0x7a075c){_0x7a075c(null,util[_0x313b('0x1b')](_0x313b('0x1c'),_0x313b('0x1d'),path[_0x313b('0x1e')](_0x4c6b0f['originalname'])));}})});router[_0x313b('0x1f')]('/:id/logo',upload[_0x313b('0x20')]('file'),controller[_0x313b('0x21')]);var upload=multer({'storage':multer[_0x313b('0x22')]({'destination':function(_0x3f3ab5,_0x20f2ac,_0x41f3e6){_0x41f3e6(null,path[_0x313b('0x23')](config['root'],_0x313b('0x1a')));},'filename':function(_0x1b23ef,_0x4a2ba7,_0x203f72){_0x203f72(null,util['format'](_0x313b('0x1c'),_0x313b('0x24'),path[_0x313b('0x1e')](_0x4a2ba7[_0x313b('0x25')])));}})});router['post'](_0x313b('0x12'),upload[_0x313b('0x20')](_0x313b('0x26')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x313b('0x22')]({'destination':function(_0x1236f7,_0x3d1b9c,_0x231e09){_0x231e09(null,path[_0x313b('0x23')](config[_0x313b('0x19')],_0x313b('0x1a')));},'filename':function(_0x316120,_0x32e367,_0x4fc9f3){_0x4fc9f3(null,util[_0x313b('0x1b')](_0x313b('0x1c'),'preferred',path[_0x313b('0x1e')](_0x32e367[_0x313b('0x25')])));}})});router['post'](_0x313b('0x16'),upload[_0x313b('0x20')](_0x313b('0x26')),controller[_0x313b('0x27')]);var upload=multer({'storage':multer[_0x313b('0x22')]({'destination':function(_0x4cd2a8,_0x1da7fc,_0x3ae6ac){_0x3ae6ac(null,path[_0x313b('0x23')](config[_0x313b('0x19')],'server/files/images/logos/'));},'filename':function(_0x5c9be,_0x1b6771,_0x5ed3f8){_0x5ed3f8(null,util['format']('%s%s',_0x313b('0x28'),path[_0x313b('0x1e')](_0x1b6771[_0x313b('0x25')])));}})});router[_0x313b('0x1f')](_0x313b('0x17'),upload[_0x313b('0x20')](_0x313b('0x26')),controller['addFavicon']);router[_0x313b('0x29')](_0x313b('0xf'),auth[_0x313b('0xc')](),controller[_0x313b('0x2a')]);module[_0x313b('0x2b')]=router;