Built motion from commit f6d7e26c.|2.6.14
[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 _0x8a71=['/:id/logo_login','addLogoLogin','preferred','favicon','addFavicon','isAuthenticated','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./setting.controller','index','get','/now','/:id','/:id/logo','getLogo','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','root','format','%s%s','extname','originalname','post','single','file','addLogo','server/files/images/logos/','logologin'];(function(_0x40b682,_0xa71dbf){var _0x18fac9=function(_0x3bcddb){while(--_0x3bcddb){_0x40b682['push'](_0x40b682['shift']());}};_0x18fac9(++_0xa71dbf);}(_0x8a71,0xa8));var _0x18a7=function(_0x269644,_0x204ca2){_0x269644=_0x269644-0x0;var _0x2e3291=_0x8a71[_0x269644];return _0x2e3291;};'use strict';var multer=require(_0x18a7('0x0'));var util=require(_0x18a7('0x1'));var path=require('path');var timeout=require(_0x18a7('0x2'));var express=require(_0x18a7('0x3'));var router=express[_0x18a7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x18a7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x18a7('0x6'));var controller=require(_0x18a7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x18a7('0x8')]);router[_0x18a7('0x9')](_0x18a7('0xa'),controller['getDate']);router[_0x18a7('0x9')](_0x18a7('0xb'),controller['show']);router[_0x18a7('0x9')](_0x18a7('0xc'),controller[_0x18a7('0xd')]);router[_0x18a7('0x9')]('/:id/logo_login',controller[_0x18a7('0xe')]);router['get']('/:id/gdpr',controller[_0x18a7('0xf')]);router[_0x18a7('0x9')](_0x18a7('0x10'),controller[_0x18a7('0x11')]);router[_0x18a7('0x9')](_0x18a7('0x12'),controller['getFavicon']);var upload=multer({'storage':multer[_0x18a7('0x13')]({'destination':function(_0xe948bd,_0x2fa748,_0x46e679){_0x46e679(null,path[_0x18a7('0x14')](config[_0x18a7('0x15')],'server/files/images/logos/'));},'filename':function(_0x50edbc,_0x3035d6,_0x1bdf33){_0x1bdf33(null,util[_0x18a7('0x16')](_0x18a7('0x17'),'logo',path[_0x18a7('0x18')](_0x3035d6[_0x18a7('0x19')])));}})});router[_0x18a7('0x1a')]('/:id/logo',upload[_0x18a7('0x1b')](_0x18a7('0x1c')),controller[_0x18a7('0x1d')]);var upload=multer({'storage':multer[_0x18a7('0x13')]({'destination':function(_0x353a42,_0x1ce74c,_0x973fb9){_0x973fb9(null,path[_0x18a7('0x14')](config['root'],_0x18a7('0x1e')));},'filename':function(_0xe560d2,_0x1179d7,_0x4bfedc){_0x4bfedc(null,util[_0x18a7('0x16')](_0x18a7('0x17'),_0x18a7('0x1f'),path[_0x18a7('0x18')](_0x1179d7['originalname'])));}})});router[_0x18a7('0x1a')](_0x18a7('0x20'),upload[_0x18a7('0x1b')](_0x18a7('0x1c')),controller[_0x18a7('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x21fe80,_0x272aba,_0x6cc0aa){_0x6cc0aa(null,path[_0x18a7('0x14')](config[_0x18a7('0x15')],_0x18a7('0x1e')));},'filename':function(_0x15ba9b,_0x332fbf,_0x409ac9){_0x409ac9(null,util[_0x18a7('0x16')](_0x18a7('0x17'),_0x18a7('0x22'),path[_0x18a7('0x18')](_0x332fbf['originalname'])));}})});router[_0x18a7('0x1a')](_0x18a7('0x10'),upload[_0x18a7('0x1b')](_0x18a7('0x1c')),controller['addPreferred']);var upload=multer({'storage':multer[_0x18a7('0x13')]({'destination':function(_0x2f67ce,_0x22b298,_0x2da222){_0x2da222(null,path[_0x18a7('0x14')](config[_0x18a7('0x15')],'server/files/images/logos/'));},'filename':function(_0xcd1812,_0x2450fa,_0x31085a){_0x31085a(null,util['format'](_0x18a7('0x17'),_0x18a7('0x23'),path[_0x18a7('0x18')](_0x2450fa['originalname'])));}})});router['post'](_0x18a7('0x12'),upload['single']('file'),controller[_0x18a7('0x24')]);router['put'](_0x18a7('0xb'),auth[_0x18a7('0x25')](),controller[_0x18a7('0x26')]);module[_0x18a7('0x27')]=router;