08c89252d752295597d49f8b6e34dfa721538d63
[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 _0x0ac1=['/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','format','%s%s','extname','originalname','single','file','addLogo','join','server/files/images/logos/','logologin','post','addLogoLogin','root','preferred','favicon','addFavicon','/:id','update','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','getDate','show','/:id/logo'];(function(_0x515df7,_0x27dfba){var _0x26b275=function(_0x542723){while(--_0x542723){_0x515df7['push'](_0x515df7['shift']());}};_0x26b275(++_0x27dfba);}(_0x0ac1,0x1b5));var _0x10ac=function(_0x2c55a8,_0x486225){_0x2c55a8=_0x2c55a8-0x0;var _0x224e2a=_0x0ac1[_0x2c55a8];return _0x224e2a;};'use strict';var multer=require(_0x10ac('0x0'));var util=require(_0x10ac('0x1'));var path=require(_0x10ac('0x2'));var timeout=require('connect-timeout');var express=require(_0x10ac('0x3'));var router=express['Router']();var fs_extra=require(_0x10ac('0x4'));var auth=require(_0x10ac('0x5'));var interaction=require(_0x10ac('0x6'));var config=require(_0x10ac('0x7'));var controller=require(_0x10ac('0x8'));router[_0x10ac('0x9')]('/',auth[_0x10ac('0xa')](),controller['index']);router['get']('/now',controller[_0x10ac('0xb')]);router[_0x10ac('0x9')]('/:id',controller[_0x10ac('0xc')]);router[_0x10ac('0x9')](_0x10ac('0xd'),controller['getLogo']);router[_0x10ac('0x9')](_0x10ac('0xe'),controller[_0x10ac('0xf')]);router[_0x10ac('0x9')](_0x10ac('0x10'),controller[_0x10ac('0x11')]);router[_0x10ac('0x9')](_0x10ac('0x12'),controller[_0x10ac('0x13')]);router[_0x10ac('0x9')](_0x10ac('0x14'),controller['getFavicon']);var upload=multer({'storage':multer[_0x10ac('0x15')]({'destination':function(_0x335bb9,_0x56a73f,_0x2ed5eb){_0x2ed5eb(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x1ed8b9,_0x3cabf9,_0x34eeda){_0x34eeda(null,util[_0x10ac('0x16')](_0x10ac('0x17'),'logo',path[_0x10ac('0x18')](_0x3cabf9[_0x10ac('0x19')])));}})});router['post'](_0x10ac('0xd'),upload[_0x10ac('0x1a')](_0x10ac('0x1b')),controller[_0x10ac('0x1c')]);var upload=multer({'storage':multer[_0x10ac('0x15')]({'destination':function(_0x331a4d,_0xeaf709,_0x242c0f){_0x242c0f(null,path[_0x10ac('0x1d')](config['root'],_0x10ac('0x1e')));},'filename':function(_0x23584a,_0x367667,_0x1cbba7){_0x1cbba7(null,util['format'](_0x10ac('0x17'),_0x10ac('0x1f'),path[_0x10ac('0x18')](_0x367667[_0x10ac('0x19')])));}})});router[_0x10ac('0x20')](_0x10ac('0xe'),upload[_0x10ac('0x1a')](_0x10ac('0x1b')),controller[_0x10ac('0x21')]);var upload=multer({'storage':multer[_0x10ac('0x15')]({'destination':function(_0x3b711a,_0x91c369,_0x55d943){_0x55d943(null,path[_0x10ac('0x1d')](config[_0x10ac('0x22')],_0x10ac('0x1e')));},'filename':function(_0x4c56ef,_0x2ba2c8,_0x1f6137){_0x1f6137(null,util['format'](_0x10ac('0x17'),_0x10ac('0x23'),path['extname'](_0x2ba2c8[_0x10ac('0x19')])));}})});router['post'](_0x10ac('0x12'),upload[_0x10ac('0x1a')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x10ac('0x15')]({'destination':function(_0x360173,_0x1c6af9,_0x5ad64b){_0x5ad64b(null,path[_0x10ac('0x1d')](config[_0x10ac('0x22')],_0x10ac('0x1e')));},'filename':function(_0x4ef857,_0x4bb114,_0x5f0dc8){_0x5f0dc8(null,util['format'](_0x10ac('0x17'),_0x10ac('0x24'),path[_0x10ac('0x18')](_0x4bb114[_0x10ac('0x19')])));}})});router[_0x10ac('0x20')](_0x10ac('0x14'),upload[_0x10ac('0x1a')](_0x10ac('0x1b')),controller[_0x10ac('0x25')]);router['put'](_0x10ac('0x26'),auth['isAuthenticated'](),controller[_0x10ac('0x27')]);module[_0x10ac('0x28')]=router;