0fe01a0566373f726887b5013db3b514c73f365b
[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 _0xad58=['%s%s','extname','originalname','post','single','file','addLogo','addLogoLogin','preferred','favicon','addFavicon','put','/:id','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format'];(function(_0x1fd9e7,_0x24cdbe){var _0x1781f2=function(_0x2bd0a3){while(--_0x2bd0a3){_0x1fd9e7['push'](_0x1fd9e7['shift']());}};_0x1781f2(++_0x24cdbe);}(_0xad58,0x1bd));var _0x8ad5=function(_0x290fd1,_0x5df6f1){_0x290fd1=_0x290fd1-0x0;var _0x5bdf49=_0xad58[_0x290fd1];return _0x5bdf49;};'use strict';var multer=require(_0x8ad5('0x0'));var util=require('util');var path=require(_0x8ad5('0x1'));var timeout=require(_0x8ad5('0x2'));var express=require(_0x8ad5('0x3'));var router=express[_0x8ad5('0x4')]();var auth=require(_0x8ad5('0x5'));var interaction=require(_0x8ad5('0x6'));var config=require(_0x8ad5('0x7'));var controller=require(_0x8ad5('0x8'));router[_0x8ad5('0x9')]('/',auth[_0x8ad5('0xa')](),controller[_0x8ad5('0xb')]);router[_0x8ad5('0x9')]('/:id',controller[_0x8ad5('0xc')]);router[_0x8ad5('0x9')](_0x8ad5('0xd'),controller[_0x8ad5('0xe')]);router[_0x8ad5('0x9')](_0x8ad5('0xf'),controller[_0x8ad5('0x10')]);router[_0x8ad5('0x9')](_0x8ad5('0x11'),controller[_0x8ad5('0x12')]);router[_0x8ad5('0x9')](_0x8ad5('0x13'),controller[_0x8ad5('0x14')]);router[_0x8ad5('0x9')](_0x8ad5('0x15'),controller[_0x8ad5('0x16')]);var upload=multer({'storage':multer[_0x8ad5('0x17')]({'destination':function(_0x37fbbe,_0x572d1f,_0x23a28e){_0x23a28e(null,path[_0x8ad5('0x18')](config[_0x8ad5('0x19')],_0x8ad5('0x1a')));},'filename':function(_0x39b19b,_0x4505e4,_0x58dfc7){_0x58dfc7(null,util[_0x8ad5('0x1b')](_0x8ad5('0x1c'),'logo',path[_0x8ad5('0x1d')](_0x4505e4[_0x8ad5('0x1e')])));}})});router[_0x8ad5('0x1f')](_0x8ad5('0xd'),upload[_0x8ad5('0x20')](_0x8ad5('0x21')),controller[_0x8ad5('0x22')]);var upload=multer({'storage':multer[_0x8ad5('0x17')]({'destination':function(_0xd47ccb,_0x4ea08c,_0x211459){_0x211459(null,path[_0x8ad5('0x18')](config[_0x8ad5('0x19')],_0x8ad5('0x1a')));},'filename':function(_0x31d649,_0xda6578,_0x2c7040){_0x2c7040(null,util['format'](_0x8ad5('0x1c'),'logologin',path['extname'](_0xda6578[_0x8ad5('0x1e')])));}})});router[_0x8ad5('0x1f')](_0x8ad5('0xf'),upload['single'](_0x8ad5('0x21')),controller[_0x8ad5('0x23')]);var upload=multer({'storage':multer[_0x8ad5('0x17')]({'destination':function(_0xc3279a,_0x4c6331,_0x2345c6){_0x2345c6(null,path[_0x8ad5('0x18')](config[_0x8ad5('0x19')],'server/files/images/logos/'));},'filename':function(_0x54645c,_0x4a55b6,_0x3acfcf){_0x3acfcf(null,util[_0x8ad5('0x1b')]('%s%s',_0x8ad5('0x24'),path[_0x8ad5('0x1d')](_0x4a55b6[_0x8ad5('0x1e')])));}})});router[_0x8ad5('0x1f')](_0x8ad5('0x13'),upload[_0x8ad5('0x20')](_0x8ad5('0x21')),controller['addPreferred']);var upload=multer({'storage':multer[_0x8ad5('0x17')]({'destination':function(_0xea765e,_0x258c88,_0x37a9ad){_0x37a9ad(null,path[_0x8ad5('0x18')](config['root'],_0x8ad5('0x1a')));},'filename':function(_0x46b442,_0x16e438,_0x4acb73){_0x4acb73(null,util['format'](_0x8ad5('0x1c'),_0x8ad5('0x25'),path['extname'](_0x16e438[_0x8ad5('0x1e')])));}})});router[_0x8ad5('0x1f')](_0x8ad5('0x15'),upload[_0x8ad5('0x20')](_0x8ad5('0x21')),controller[_0x8ad5('0x26')]);router[_0x8ad5('0x27')](_0x8ad5('0x28'),auth['isAuthenticated'](),controller[_0x8ad5('0x29')]);module[_0x8ad5('0x2a')]=router;