Built motion from commit 43538d75.|2.5.35
[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 _0x219a=['getPreferred','/:id/favicon','diskStorage','join','root','%s%s','logo','extname','originalname','single','file','addLogo','server/files/images/logos/','format','logologin','preferred','post','addPreferred','favicon','addFavicon','put','update','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/:id','show','/:id/logo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred'];(function(_0x42c771,_0x8b8314){var _0x335133=function(_0x2c33f7){while(--_0x2c33f7){_0x42c771['push'](_0x42c771['shift']());}};_0x335133(++_0x8b8314);}(_0x219a,0xdf));var _0xa219=function(_0x534af8,_0x5255a8){_0x534af8=_0x534af8-0x0;var _0x2d8f84=_0x219a[_0x534af8];return _0x2d8f84;};'use strict';var multer=require('multer');var util=require(_0xa219('0x0'));var path=require('path');var timeout=require(_0xa219('0x1'));var express=require('express');var router=express[_0xa219('0x2')]();var fs_extra=require(_0xa219('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa219('0x4'));var config=require(_0xa219('0x5'));var controller=require(_0xa219('0x6'));router['get']('/',auth[_0xa219('0x7')](),controller[_0xa219('0x8')]);router[_0xa219('0x9')]('/now',controller['getDate']);router['get'](_0xa219('0xa'),controller[_0xa219('0xb')]);router[_0xa219('0x9')](_0xa219('0xc'),controller['getLogo']);router[_0xa219('0x9')](_0xa219('0xd'),controller['getLogoLogin']);router[_0xa219('0x9')](_0xa219('0xe'),controller[_0xa219('0xf')]);router['get'](_0xa219('0x10'),controller[_0xa219('0x11')]);router[_0xa219('0x9')](_0xa219('0x12'),controller['getFavicon']);var upload=multer({'storage':multer[_0xa219('0x13')]({'destination':function(_0x2817c8,_0x99de75,_0x5bdeac){_0x5bdeac(null,path[_0xa219('0x14')](config[_0xa219('0x15')],'server/files/images/logos/'));},'filename':function(_0x338bee,_0x43430a,_0x17dd78){_0x17dd78(null,util['format'](_0xa219('0x16'),_0xa219('0x17'),path[_0xa219('0x18')](_0x43430a[_0xa219('0x19')])));}})});router['post']('/:id/logo',upload[_0xa219('0x1a')](_0xa219('0x1b')),controller[_0xa219('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x585f5a,_0x2e630b,_0x19242e){_0x19242e(null,path['join'](config[_0xa219('0x15')],_0xa219('0x1d')));},'filename':function(_0x321f7c,_0x5ed242,_0x47f919){_0x47f919(null,util[_0xa219('0x1e')](_0xa219('0x16'),_0xa219('0x1f'),path[_0xa219('0x18')](_0x5ed242[_0xa219('0x19')])));}})});router['post'](_0xa219('0xd'),upload[_0xa219('0x1a')](_0xa219('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xa219('0x13')]({'destination':function(_0x2641f9,_0x1e246a,_0x581dbd){_0x581dbd(null,path[_0xa219('0x14')](config[_0xa219('0x15')],'server/files/images/logos/'));},'filename':function(_0x5b2c2c,_0x1ef091,_0x40627b){_0x40627b(null,util['format'](_0xa219('0x16'),_0xa219('0x20'),path['extname'](_0x1ef091['originalname'])));}})});router[_0xa219('0x21')](_0xa219('0x10'),upload[_0xa219('0x1a')](_0xa219('0x1b')),controller[_0xa219('0x22')]);var upload=multer({'storage':multer[_0xa219('0x13')]({'destination':function(_0x399270,_0x16873d,_0xf574f1){_0xf574f1(null,path['join'](config[_0xa219('0x15')],_0xa219('0x1d')));},'filename':function(_0x29a90e,_0x5df5ab,_0x44efee){_0x44efee(null,util['format'](_0xa219('0x16'),_0xa219('0x23'),path[_0xa219('0x18')](_0x5df5ab[_0xa219('0x19')])));}})});router[_0xa219('0x21')](_0xa219('0x12'),upload[_0xa219('0x1a')]('file'),controller[_0xa219('0x24')]);router[_0xa219('0x25')](_0xa219('0xa'),auth['isAuthenticated'](),controller[_0xa219('0x26')]);module[_0xa219('0x27')]=router;