53f0b85b373c5fd3404363380c494f3727e79faf
[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 _0x681b=['Router','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/:id','show','getLogo','/:id/logo_login','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','addLogo','diskStorage','logologin','addLogoLogin','addPreferred','favicon','post','addFavicon','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x2088b6,_0x3ca4ae){var _0x4f80c0=function(_0x18dba0){while(--_0x18dba0){_0x2088b6['push'](_0x2088b6['shift']());}};_0x4f80c0(++_0x3ca4ae);}(_0x681b,0x175));var _0xb681=function(_0x458904,_0x45398f){_0x458904=_0x458904-0x0;var _0x1dced6=_0x681b[_0x458904];return _0x1dced6;};'use strict';var multer=require(_0xb681('0x0'));var util=require(_0xb681('0x1'));var path=require(_0xb681('0x2'));var timeout=require(_0xb681('0x3'));var express=require(_0xb681('0x4'));var router=express[_0xb681('0x5')]();var auth=require(_0xb681('0x6'));var interaction=require(_0xb681('0x7'));var config=require('../../config/environment');var controller=require(_0xb681('0x8'));router[_0xb681('0x9')]('/',auth[_0xb681('0xa')](),controller[_0xb681('0xb')]);router[_0xb681('0x9')](_0xb681('0xc'),controller[_0xb681('0xd')]);router[_0xb681('0x9')]('/:id/logo',controller[_0xb681('0xe')]);router['get'](_0xb681('0xf'),controller['getLogoLogin']);router[_0xb681('0x9')]('/:id/gdpr',controller[_0xb681('0x10')]);router[_0xb681('0x9')](_0xb681('0x11'),controller[_0xb681('0x12')]);router[_0xb681('0x9')](_0xb681('0x13'),controller[_0xb681('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x49e58f,_0x5a395e,_0x232465){_0x232465(null,path[_0xb681('0x15')](config[_0xb681('0x16')],_0xb681('0x17')));},'filename':function(_0x495a1c,_0x432f1d,_0xf83360){_0xf83360(null,util[_0xb681('0x18')](_0xb681('0x19'),_0xb681('0x1a'),path[_0xb681('0x1b')](_0x432f1d[_0xb681('0x1c')])));}})});router['post']('/:id/logo',upload[_0xb681('0x1d')](_0xb681('0x1e')),controller[_0xb681('0x1f')]);var upload=multer({'storage':multer[_0xb681('0x20')]({'destination':function(_0x9880e1,_0x43eb7c,_0xadb69c){_0xadb69c(null,path['join'](config[_0xb681('0x16')],'server/files/images/logos/'));},'filename':function(_0x398dbd,_0x20b6b0,_0x17900f){_0x17900f(null,util[_0xb681('0x18')](_0xb681('0x19'),_0xb681('0x21'),path[_0xb681('0x1b')](_0x20b6b0[_0xb681('0x1c')])));}})});router['post']('/:id/logo_login',upload['single']('file'),controller[_0xb681('0x22')]);var upload=multer({'storage':multer[_0xb681('0x20')]({'destination':function(_0x5306d8,_0x247f4a,_0x23c07e){_0x23c07e(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x5bb1ec,_0xb4d9fd,_0x165e25){_0x165e25(null,util[_0xb681('0x18')](_0xb681('0x19'),'preferred',path[_0xb681('0x1b')](_0xb4d9fd['originalname'])));}})});router['post']('/:id/preferred',upload[_0xb681('0x1d')](_0xb681('0x1e')),controller[_0xb681('0x23')]);var upload=multer({'storage':multer[_0xb681('0x20')]({'destination':function(_0x392d7b,_0x5a7367,_0x4da85d){_0x4da85d(null,path[_0xb681('0x15')](config['root'],_0xb681('0x17')));},'filename':function(_0x1283fe,_0x652ea0,_0xa0f8e6){_0xa0f8e6(null,util[_0xb681('0x18')](_0xb681('0x19'),_0xb681('0x24'),path[_0xb681('0x1b')](_0x652ea0['originalname'])));}})});router[_0xb681('0x25')](_0xb681('0x13'),upload[_0xb681('0x1d')](_0xb681('0x1e')),controller[_0xb681('0x26')]);router[_0xb681('0x27')](_0xb681('0xc'),auth[_0xb681('0xa')](),controller[_0xb681('0x28')]);module[_0xb681('0x29')]=router;