Built motion from commit b5996064.|2.6.21
[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 _0xbd76=['favicon','/:id/favicon','addFavicon','update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','server/files/images/logos/','format','%s%s','logo','originalname','post','file','addLogo','root','single','preferred','extname'];(function(_0x1ae59e,_0x3b7345){var _0x46a118=function(_0x567ae1){while(--_0x567ae1){_0x1ae59e['push'](_0x1ae59e['shift']());}};_0x46a118(++_0x3b7345);}(_0xbd76,0xfa));var _0x6bd7=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xbd76[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x6bd7('0x0'));var util=require(_0x6bd7('0x1'));var path=require(_0x6bd7('0x2'));var timeout=require('connect-timeout');var express=require(_0x6bd7('0x3'));var router=express[_0x6bd7('0x4')]();var fs_extra=require(_0x6bd7('0x5'));var auth=require(_0x6bd7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6bd7('0x7'));var controller=require('./setting.controller');router[_0x6bd7('0x8')]('/',auth[_0x6bd7('0x9')](),controller[_0x6bd7('0xa')]);router[_0x6bd7('0x8')](_0x6bd7('0xb'),controller[_0x6bd7('0xc')]);router[_0x6bd7('0x8')](_0x6bd7('0xd'),controller[_0x6bd7('0xe')]);router[_0x6bd7('0x8')](_0x6bd7('0xf'),controller[_0x6bd7('0x10')]);router[_0x6bd7('0x8')](_0x6bd7('0x11'),controller['getLogoLogin']);router[_0x6bd7('0x8')](_0x6bd7('0x12'),controller[_0x6bd7('0x13')]);router[_0x6bd7('0x8')](_0x6bd7('0x14'),controller[_0x6bd7('0x15')]);router[_0x6bd7('0x8')]('/:id/favicon',controller[_0x6bd7('0x16')]);var upload=multer({'storage':multer[_0x6bd7('0x17')]({'destination':function(_0x1dbf24,_0x1945ca,_0x41c947){_0x41c947(null,path[_0x6bd7('0x18')](config['root'],_0x6bd7('0x19')));},'filename':function(_0x5441a5,_0x6c1fac,_0x2f6aed){_0x2f6aed(null,util[_0x6bd7('0x1a')](_0x6bd7('0x1b'),_0x6bd7('0x1c'),path['extname'](_0x6c1fac[_0x6bd7('0x1d')])));}})});router[_0x6bd7('0x1e')](_0x6bd7('0xf'),upload['single'](_0x6bd7('0x1f')),controller[_0x6bd7('0x20')]);var upload=multer({'storage':multer[_0x6bd7('0x17')]({'destination':function(_0x5d4427,_0xa47eae,_0x147fd1){_0x147fd1(null,path[_0x6bd7('0x18')](config[_0x6bd7('0x21')],_0x6bd7('0x19')));},'filename':function(_0x46ab3b,_0x1a3c55,_0x2bb6cd){_0x2bb6cd(null,util[_0x6bd7('0x1a')](_0x6bd7('0x1b'),'logologin',path['extname'](_0x1a3c55[_0x6bd7('0x1d')])));}})});router[_0x6bd7('0x1e')](_0x6bd7('0x11'),upload[_0x6bd7('0x22')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x6bd7('0x17')]({'destination':function(_0x5c39e9,_0xee78d2,_0x3e6ad9){_0x3e6ad9(null,path[_0x6bd7('0x18')](config[_0x6bd7('0x21')],'server/files/images/logos/'));},'filename':function(_0x4147a2,_0x1bffb1,_0x4d5bc9){_0x4d5bc9(null,util[_0x6bd7('0x1a')](_0x6bd7('0x1b'),_0x6bd7('0x23'),path[_0x6bd7('0x24')](_0x1bffb1[_0x6bd7('0x1d')])));}})});router[_0x6bd7('0x1e')](_0x6bd7('0x14'),upload['single'](_0x6bd7('0x1f')),controller['addPreferred']);var upload=multer({'storage':multer[_0x6bd7('0x17')]({'destination':function(_0x29aaa1,_0xc68981,_0x39c93a){_0x39c93a(null,path[_0x6bd7('0x18')](config[_0x6bd7('0x21')],'server/files/images/logos/'));},'filename':function(_0x117d48,_0x5ebd41,_0x452510){_0x452510(null,util[_0x6bd7('0x1a')](_0x6bd7('0x1b'),_0x6bd7('0x25'),path[_0x6bd7('0x24')](_0x5ebd41[_0x6bd7('0x1d')])));}})});router[_0x6bd7('0x1e')](_0x6bd7('0x26'),upload['single'](_0x6bd7('0x1f')),controller[_0x6bd7('0x27')]);router['put'](_0x6bd7('0xd'),auth['isAuthenticated'](),controller[_0x6bd7('0x28')]);module['exports']=router;