85b4292d11d81123ca88dd569966e314a9f93fd4
[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 _0x0cd7=['getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','gdpr','/:id/preferred','getPreferred','join','root','format','logo','extname','originalname','post','single','file','diskStorage','%s%s','logologin','addLogoLogin','preferred','addPreferred','server/files/images/logos/','favicon','/:id/favicon','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/now'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x0cd7,0x9b));var _0x70cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0cd7[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x70cd('0x0'));var util=require(_0x70cd('0x1'));var path=require(_0x70cd('0x2'));var timeout=require(_0x70cd('0x3'));var express=require('express');var router=express[_0x70cd('0x4')]();var fs_extra=require(_0x70cd('0x5'));var auth=require(_0x70cd('0x6'));var interaction=require(_0x70cd('0x7'));var config=require(_0x70cd('0x8'));var controller=require('./setting.controller');router[_0x70cd('0x9')]('/',auth[_0x70cd('0xa')](),controller[_0x70cd('0xb')]);router[_0x70cd('0x9')](_0x70cd('0xc'),controller[_0x70cd('0xd')]);router['get'](_0x70cd('0xe'),controller[_0x70cd('0xf')]);router[_0x70cd('0x9')](_0x70cd('0x10'),controller[_0x70cd('0x11')]);router['get'](_0x70cd('0x12'),controller['getLogoLogin']);router[_0x70cd('0x9')]('/:id/gdpr',controller[_0x70cd('0x13')]);router['get'](_0x70cd('0x14'),controller[_0x70cd('0x15')]);router[_0x70cd('0x9')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f25f2,_0x578a31,_0x399ee3){_0x399ee3(null,path[_0x70cd('0x16')](config[_0x70cd('0x17')],'server/files/images/logos/'));},'filename':function(_0x3b120f,_0x1da009,_0x294ec5){_0x294ec5(null,util[_0x70cd('0x18')]('%s%s',_0x70cd('0x19'),path[_0x70cd('0x1a')](_0x1da009[_0x70cd('0x1b')])));}})});router[_0x70cd('0x1c')](_0x70cd('0x10'),upload[_0x70cd('0x1d')](_0x70cd('0x1e')),controller['addLogo']);var upload=multer({'storage':multer[_0x70cd('0x1f')]({'destination':function(_0x7da358,_0x51155b,_0x36b265){_0x36b265(null,path[_0x70cd('0x16')](config[_0x70cd('0x17')],'server/files/images/logos/'));},'filename':function(_0x4dac99,_0x569e3a,_0xc626f){_0xc626f(null,util[_0x70cd('0x18')](_0x70cd('0x20'),_0x70cd('0x21'),path['extname'](_0x569e3a[_0x70cd('0x1b')])));}})});router[_0x70cd('0x1c')](_0x70cd('0x12'),upload['single'](_0x70cd('0x1e')),controller[_0x70cd('0x22')]);var upload=multer({'storage':multer[_0x70cd('0x1f')]({'destination':function(_0x2a428f,_0x361e29,_0x4e66c8){_0x4e66c8(null,path['join'](config[_0x70cd('0x17')],'server/files/images/logos/'));},'filename':function(_0xc90274,_0x420c6c,_0x444846){_0x444846(null,util[_0x70cd('0x18')](_0x70cd('0x20'),_0x70cd('0x23'),path[_0x70cd('0x1a')](_0x420c6c[_0x70cd('0x1b')])));}})});router[_0x70cd('0x1c')]('/:id/preferred',upload['single']('file'),controller[_0x70cd('0x24')]);var upload=multer({'storage':multer[_0x70cd('0x1f')]({'destination':function(_0x350a31,_0x1682cf,_0x3fcfb7){_0x3fcfb7(null,path[_0x70cd('0x16')](config[_0x70cd('0x17')],_0x70cd('0x25')));},'filename':function(_0x5c9f0c,_0x1072e5,_0x4972b4){_0x4972b4(null,util[_0x70cd('0x18')]('%s%s',_0x70cd('0x26'),path['extname'](_0x1072e5['originalname'])));}})});router[_0x70cd('0x1c')](_0x70cd('0x27'),upload[_0x70cd('0x1d')](_0x70cd('0x1e')),controller['addFavicon']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x70cd('0x28')]);module[_0x70cd('0x29')]=router;