52c93a768e502c2e0b1de46242cc890985d00fe6
[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 _0xd38b=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','server/files/images/logos/','%s%s','logo','extname','single','addLogo','root','logologin','post','file','addLogoLogin','format','originalname','favicon','addFavicon','put','update'];(function(_0x48348e,_0x3c50c9){var _0x10b100=function(_0x43a84d){while(--_0x43a84d){_0x48348e['push'](_0x48348e['shift']());}};_0x10b100(++_0x3c50c9);}(_0xd38b,0x17b));var _0xbd38=function(_0x310ee0,_0x1c5d46){_0x310ee0=_0x310ee0-0x0;var _0x2aae43=_0xd38b[_0x310ee0];return _0x2aae43;};'use strict';var multer=require(_0xbd38('0x0'));var util=require(_0xbd38('0x1'));var path=require(_0xbd38('0x2'));var timeout=require(_0xbd38('0x3'));var express=require('express');var router=express[_0xbd38('0x4')]();var fs_extra=require(_0xbd38('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbd38('0x6'));var controller=require(_0xbd38('0x7'));router[_0xbd38('0x8')]('/',auth[_0xbd38('0x9')](),controller[_0xbd38('0xa')]);router[_0xbd38('0x8')](_0xbd38('0xb'),controller[_0xbd38('0xc')]);router['get'](_0xbd38('0xd'),controller[_0xbd38('0xe')]);router[_0xbd38('0x8')]('/:id/logo',controller['getLogo']);router[_0xbd38('0x8')](_0xbd38('0xf'),controller[_0xbd38('0x10')]);router[_0xbd38('0x8')](_0xbd38('0x11'),controller[_0xbd38('0x12')]);router[_0xbd38('0x8')](_0xbd38('0x13'),controller[_0xbd38('0x14')]);router[_0xbd38('0x8')](_0xbd38('0x15'),controller['getFavicon']);var upload=multer({'storage':multer[_0xbd38('0x16')]({'destination':function(_0x402576,_0x19425b,_0x170123){_0x170123(null,path[_0xbd38('0x17')](config['root'],_0xbd38('0x18')));},'filename':function(_0x235132,_0x2bad31,_0x38c758){_0x38c758(null,util['format'](_0xbd38('0x19'),_0xbd38('0x1a'),path[_0xbd38('0x1b')](_0x2bad31['originalname'])));}})});router['post']('/:id/logo',upload[_0xbd38('0x1c')]('file'),controller[_0xbd38('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x153604,_0x24156c,_0x53952c){_0x53952c(null,path['join'](config[_0xbd38('0x1e')],'server/files/images/logos/'));},'filename':function(_0x2341b4,_0x2fa358,_0x52c872){_0x52c872(null,util['format'](_0xbd38('0x19'),_0xbd38('0x1f'),path[_0xbd38('0x1b')](_0x2fa358['originalname'])));}})});router[_0xbd38('0x20')](_0xbd38('0xf'),upload[_0xbd38('0x1c')](_0xbd38('0x21')),controller[_0xbd38('0x22')]);var upload=multer({'storage':multer[_0xbd38('0x16')]({'destination':function(_0x48afea,_0x4ca80e,_0x2d39cc){_0x2d39cc(null,path['join'](config['root'],_0xbd38('0x18')));},'filename':function(_0x506de2,_0x5d453d,_0x928c9c){_0x928c9c(null,util[_0xbd38('0x23')](_0xbd38('0x19'),'preferred',path[_0xbd38('0x1b')](_0x5d453d[_0xbd38('0x24')])));}})});router['post'](_0xbd38('0x13'),upload[_0xbd38('0x1c')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0xbd38('0x16')]({'destination':function(_0x55569d,_0x56d396,_0x4fd557){_0x4fd557(null,path[_0xbd38('0x17')](config[_0xbd38('0x1e')],_0xbd38('0x18')));},'filename':function(_0x49f9ba,_0x2de3a5,_0x39d7fb){_0x39d7fb(null,util[_0xbd38('0x23')](_0xbd38('0x19'),_0xbd38('0x25'),path[_0xbd38('0x1b')](_0x2de3a5['originalname'])));}})});router['post'](_0xbd38('0x15'),upload[_0xbd38('0x1c')](_0xbd38('0x21')),controller[_0xbd38('0x26')]);router[_0xbd38('0x27')](_0xbd38('0xd'),auth['isAuthenticated'](),controller[_0xbd38('0x28')]);module[_0xbd38('0x29')]=router;