28b5a19b7f4e1b0a37aae5c99729325fa747e800
[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 _0x10b5=['%s%s','logo','extname','originalname','post','file','addLogo','root','server/files/images/logos/','logologin','single','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','format'];(function(_0x162cb1,_0x1fe82a){var _0x3191cc=function(_0x2b076e){while(--_0x2b076e){_0x162cb1['push'](_0x162cb1['shift']());}};_0x3191cc(++_0x1fe82a);}(_0x10b5,0x6b));var _0x510b=function(_0x417955,_0x4ed8c8){_0x417955=_0x417955-0x0;var _0x3a94ef=_0x10b5[_0x417955];return _0x3a94ef;};'use strict';var multer=require(_0x510b('0x0'));var util=require(_0x510b('0x1'));var path=require('path');var timeout=require(_0x510b('0x2'));var express=require(_0x510b('0x3'));var router=express[_0x510b('0x4')]();var fs_extra=require(_0x510b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x510b('0x6'));var config=require(_0x510b('0x7'));var controller=require(_0x510b('0x8'));router[_0x510b('0x9')]('/',auth[_0x510b('0xa')](),controller[_0x510b('0xb')]);router['get'](_0x510b('0xc'),controller[_0x510b('0xd')]);router[_0x510b('0x9')](_0x510b('0xe'),controller[_0x510b('0xf')]);router[_0x510b('0x9')](_0x510b('0x10'),controller['getLogo']);router[_0x510b('0x9')](_0x510b('0x11'),controller[_0x510b('0x12')]);router[_0x510b('0x9')](_0x510b('0x13'),controller[_0x510b('0x14')]);router['get'](_0x510b('0x15'),controller[_0x510b('0x16')]);router['get'](_0x510b('0x17'),controller[_0x510b('0x18')]);var upload=multer({'storage':multer[_0x510b('0x19')]({'destination':function(_0x12573f,_0x5b6bc9,_0x53af60){_0x53af60(null,path[_0x510b('0x1a')](config['root'],'server/files/images/logos/'));},'filename':function(_0x59d87f,_0x59261c,_0xa07114){_0xa07114(null,util[_0x510b('0x1b')](_0x510b('0x1c'),_0x510b('0x1d'),path[_0x510b('0x1e')](_0x59261c[_0x510b('0x1f')])));}})});router[_0x510b('0x20')](_0x510b('0x10'),upload['single'](_0x510b('0x21')),controller[_0x510b('0x22')]);var upload=multer({'storage':multer[_0x510b('0x19')]({'destination':function(_0x4e8b02,_0xcb2045,_0x3b2782){_0x3b2782(null,path['join'](config[_0x510b('0x23')],_0x510b('0x24')));},'filename':function(_0x4faed3,_0x4c3ea1,_0x54cfdf){_0x54cfdf(null,util[_0x510b('0x1b')](_0x510b('0x1c'),_0x510b('0x25'),path[_0x510b('0x1e')](_0x4c3ea1[_0x510b('0x1f')])));}})});router[_0x510b('0x20')]('/:id/logo_login',upload[_0x510b('0x26')](_0x510b('0x21')),controller[_0x510b('0x27')]);var upload=multer({'storage':multer[_0x510b('0x19')]({'destination':function(_0x5a1259,_0x290d2b,_0xa68a83){_0xa68a83(null,path[_0x510b('0x1a')](config[_0x510b('0x23')],_0x510b('0x24')));},'filename':function(_0x1320f6,_0x23a7b2,_0x164149){_0x164149(null,util[_0x510b('0x1b')](_0x510b('0x1c'),_0x510b('0x28'),path[_0x510b('0x1e')](_0x23a7b2[_0x510b('0x1f')])));}})});router[_0x510b('0x20')](_0x510b('0x15'),upload[_0x510b('0x26')]('file'),controller[_0x510b('0x29')]);var upload=multer({'storage':multer[_0x510b('0x19')]({'destination':function(_0x54b6f3,_0xb53133,_0x33a876){_0x33a876(null,path[_0x510b('0x1a')](config[_0x510b('0x23')],'server/files/images/logos/'));},'filename':function(_0x3df73c,_0x291cbd,_0x183991){_0x183991(null,util[_0x510b('0x1b')](_0x510b('0x1c'),_0x510b('0x2a'),path[_0x510b('0x1e')](_0x291cbd['originalname'])));}})});router[_0x510b('0x20')]('/:id/favicon',upload[_0x510b('0x26')]('file'),controller[_0x510b('0x2b')]);router[_0x510b('0x2c')](_0x510b('0xe'),auth['isAuthenticated'](),controller['update']);module['exports']=router;