4f9363955cc264b464302a98d0ac427760161f83
[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 _0x4814=['/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getFavicon','join','root','server/files/images/logos/','format','%s%s','extname','originalname','post','single','file','addLogo','diskStorage','preferred','addPreferred','favicon','/:id/favicon','addFavicon','put','update','multer','util','express','Router','fs-extra','../../config/environment','./setting.controller','isAuthenticated','index','get','/now','getDate'];(function(_0x3edea9,_0x7b82b9){var _0x13cde7=function(_0x1e87a9){while(--_0x1e87a9){_0x3edea9['push'](_0x3edea9['shift']());}};_0x13cde7(++_0x7b82b9);}(_0x4814,0x153));var _0x4481=function(_0x60aebe,_0x224f98){_0x60aebe=_0x60aebe-0x0;var _0x41cfa7=_0x4814[_0x60aebe];return _0x41cfa7;};'use strict';var multer=require(_0x4481('0x0'));var util=require(_0x4481('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4481('0x2'));var router=express[_0x4481('0x3')]();var fs_extra=require(_0x4481('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4481('0x5'));var controller=require(_0x4481('0x6'));router['get']('/',auth[_0x4481('0x7')](),controller[_0x4481('0x8')]);router[_0x4481('0x9')](_0x4481('0xa'),controller[_0x4481('0xb')]);router[_0x4481('0x9')](_0x4481('0xc'),controller[_0x4481('0xd')]);router[_0x4481('0x9')](_0x4481('0xe'),controller['getLogo']);router[_0x4481('0x9')](_0x4481('0xf'),controller[_0x4481('0x10')]);router[_0x4481('0x9')](_0x4481('0x11'),controller[_0x4481('0x12')]);router[_0x4481('0x9')]('/:id/preferred',controller['getPreferred']);router[_0x4481('0x9')]('/:id/favicon',controller[_0x4481('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x555d3d,_0xab83b7,_0x3680cd){_0x3680cd(null,path[_0x4481('0x14')](config[_0x4481('0x15')],_0x4481('0x16')));},'filename':function(_0x344ecb,_0x1520e2,_0x25ee18){_0x25ee18(null,util[_0x4481('0x17')](_0x4481('0x18'),'logo',path[_0x4481('0x19')](_0x1520e2[_0x4481('0x1a')])));}})});router[_0x4481('0x1b')](_0x4481('0xe'),upload[_0x4481('0x1c')](_0x4481('0x1d')),controller[_0x4481('0x1e')]);var upload=multer({'storage':multer[_0x4481('0x1f')]({'destination':function(_0x23641d,_0x31173a,_0x4e5301){_0x4e5301(null,path[_0x4481('0x14')](config[_0x4481('0x15')],_0x4481('0x16')));},'filename':function(_0x2bd48d,_0x8f0ba5,_0x396da6){_0x396da6(null,util[_0x4481('0x17')](_0x4481('0x18'),'logologin',path[_0x4481('0x19')](_0x8f0ba5[_0x4481('0x1a')])));}})});router[_0x4481('0x1b')](_0x4481('0xf'),upload[_0x4481('0x1c')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x14bf4f,_0x331046,_0xf73d06){_0xf73d06(null,path[_0x4481('0x14')](config[_0x4481('0x15')],_0x4481('0x16')));},'filename':function(_0x4505d,_0xc727cd,_0x229d33){_0x229d33(null,util['format']('%s%s',_0x4481('0x20'),path['extname'](_0xc727cd['originalname'])));}})});router[_0x4481('0x1b')]('/:id/preferred',upload['single'](_0x4481('0x1d')),controller[_0x4481('0x21')]);var upload=multer({'storage':multer[_0x4481('0x1f')]({'destination':function(_0x5c5a24,_0x17e250,_0x3522b4){_0x3522b4(null,path['join'](config['root'],_0x4481('0x16')));},'filename':function(_0x1fc0c0,_0x40e399,_0x44131d){_0x44131d(null,util[_0x4481('0x17')]('%s%s',_0x4481('0x22'),path[_0x4481('0x19')](_0x40e399[_0x4481('0x1a')])));}})});router[_0x4481('0x1b')](_0x4481('0x23'),upload[_0x4481('0x1c')](_0x4481('0x1d')),controller[_0x4481('0x24')]);router[_0x4481('0x25')]('/:id',auth[_0x4481('0x7')](),controller[_0x4481('0x26')]);module['exports']=router;