cb0c9c5713889af2e6020316d1395680804120c7
[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 _0xbd3a=['/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','originalname','post','single','file','addLogo','format','logologin','addLogoLogin','preferred','extname','favicon','addFavicon','isAuthenticated','update','multer','path','Router','fs-extra','../../config/environment','./setting.controller','get','/now','getDate','/:id','/:id/logo_login','/:id/gdpr','gdpr'];(function(_0x1af68c,_0x49a8e7){var _0x3a319d=function(_0x1169d4){while(--_0x1169d4){_0x1af68c['push'](_0x1af68c['shift']());}};_0x3a319d(++_0x49a8e7);}(_0xbd3a,0x11b));var _0xabd3=function(_0x27f0c8,_0x54dcdb){_0x27f0c8=_0x27f0c8-0x0;var _0x47386b=_0xbd3a[_0x27f0c8];return _0x47386b;};'use strict';var multer=require(_0xabd3('0x0'));var util=require('util');var path=require(_0xabd3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xabd3('0x2')]();var fs_extra=require(_0xabd3('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xabd3('0x4'));var controller=require(_0xabd3('0x5'));router[_0xabd3('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xabd3('0x6')](_0xabd3('0x7'),controller[_0xabd3('0x8')]);router[_0xabd3('0x6')](_0xabd3('0x9'),controller['show']);router[_0xabd3('0x6')]('/:id/logo',controller['getLogo']);router['get'](_0xabd3('0xa'),controller['getLogoLogin']);router[_0xabd3('0x6')](_0xabd3('0xb'),controller[_0xabd3('0xc')]);router[_0xabd3('0x6')](_0xabd3('0xd'),controller[_0xabd3('0xe')]);router[_0xabd3('0x6')](_0xabd3('0xf'),controller[_0xabd3('0x10')]);var upload=multer({'storage':multer[_0xabd3('0x11')]({'destination':function(_0x215bb6,_0x1bb583,_0x48b115){_0x48b115(null,path[_0xabd3('0x12')](config[_0xabd3('0x13')],_0xabd3('0x14')));},'filename':function(_0x4ff016,_0x226b81,_0x284e14){_0x284e14(null,util['format'](_0xabd3('0x15'),_0xabd3('0x16'),path['extname'](_0x226b81[_0xabd3('0x17')])));}})});router[_0xabd3('0x18')]('/:id/logo',upload[_0xabd3('0x19')](_0xabd3('0x1a')),controller[_0xabd3('0x1b')]);var upload=multer({'storage':multer[_0xabd3('0x11')]({'destination':function(_0x549c57,_0x16b5be,_0x51bb97){_0x51bb97(null,path[_0xabd3('0x12')](config[_0xabd3('0x13')],'server/files/images/logos/'));},'filename':function(_0x1f3528,_0x5a057b,_0x43e483){_0x43e483(null,util[_0xabd3('0x1c')](_0xabd3('0x15'),_0xabd3('0x1d'),path['extname'](_0x5a057b[_0xabd3('0x17')])));}})});router[_0xabd3('0x18')](_0xabd3('0xa'),upload[_0xabd3('0x19')](_0xabd3('0x1a')),controller[_0xabd3('0x1e')]);var upload=multer({'storage':multer[_0xabd3('0x11')]({'destination':function(_0x2e7f12,_0x1d3b93,_0x55e073){_0x55e073(null,path[_0xabd3('0x12')](config[_0xabd3('0x13')],'server/files/images/logos/'));},'filename':function(_0x42d320,_0x5d1c28,_0x24a654){_0x24a654(null,util[_0xabd3('0x1c')]('%s%s',_0xabd3('0x1f'),path[_0xabd3('0x20')](_0x5d1c28['originalname'])));}})});router['post'](_0xabd3('0xd'),upload[_0xabd3('0x19')](_0xabd3('0x1a')),controller['addPreferred']);var upload=multer({'storage':multer[_0xabd3('0x11')]({'destination':function(_0x4086ff,_0x349d42,_0x5b0886){_0x5b0886(null,path[_0xabd3('0x12')](config['root'],_0xabd3('0x14')));},'filename':function(_0xab20dd,_0x331b27,_0x58f944){_0x58f944(null,util[_0xabd3('0x1c')](_0xabd3('0x15'),_0xabd3('0x21'),path[_0xabd3('0x20')](_0x331b27[_0xabd3('0x17')])));}})});router[_0xabd3('0x18')](_0xabd3('0xf'),upload[_0xabd3('0x19')](_0xabd3('0x1a')),controller[_0xabd3('0x22')]);router['put'](_0xabd3('0x9'),auth[_0xabd3('0x23')](),controller[_0xabd3('0x24')]);module['exports']=router;