Built motion from commit (unavailable).|2.5.19
[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 _0x5f86=['addFavicon','isAuthenticated','update','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','index','/now','getDate','/:id','show','get','/:id/logo','getLogo','gdpr','/:id/preferred','getPreferred','/:id/favicon','join','root','server/files/images/logos/','format','%s%s','logo','originalname','post','single','file','addLogo','diskStorage','logologin','extname','/:id/logo_login','addLogoLogin','preferred','addPreferred'];(function(_0x2f379a,_0x53382d){var _0x305249=function(_0x318d5f){while(--_0x318d5f){_0x2f379a['push'](_0x2f379a['shift']());}};_0x305249(++_0x53382d);}(_0x5f86,0x17d));var _0x65f8=function(_0x8a855e,_0x54b703){_0x8a855e=_0x8a855e-0x0;var _0x191fcf=_0x5f86[_0x8a855e];return _0x191fcf;};'use strict';var multer=require('multer');var util=require(_0x65f8('0x0'));var path=require(_0x65f8('0x1'));var timeout=require(_0x65f8('0x2'));var express=require(_0x65f8('0x3'));var router=express[_0x65f8('0x4')]();var auth=require(_0x65f8('0x5'));var interaction=require(_0x65f8('0x6'));var config=require(_0x65f8('0x7'));var controller=require(_0x65f8('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x65f8('0x9')]);router['get'](_0x65f8('0xa'),controller[_0x65f8('0xb')]);router['get'](_0x65f8('0xc'),controller[_0x65f8('0xd')]);router[_0x65f8('0xe')](_0x65f8('0xf'),controller[_0x65f8('0x10')]);router[_0x65f8('0xe')]('/:id/logo_login',controller['getLogoLogin']);router[_0x65f8('0xe')]('/:id/gdpr',controller[_0x65f8('0x11')]);router[_0x65f8('0xe')](_0x65f8('0x12'),controller[_0x65f8('0x13')]);router[_0x65f8('0xe')](_0x65f8('0x14'),controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5f5ab7,_0x136f42,_0x33b50a){_0x33b50a(null,path[_0x65f8('0x15')](config[_0x65f8('0x16')],_0x65f8('0x17')));},'filename':function(_0x3e030c,_0x5280e2,_0x21df50){_0x21df50(null,util[_0x65f8('0x18')](_0x65f8('0x19'),_0x65f8('0x1a'),path['extname'](_0x5280e2[_0x65f8('0x1b')])));}})});router[_0x65f8('0x1c')](_0x65f8('0xf'),upload[_0x65f8('0x1d')](_0x65f8('0x1e')),controller[_0x65f8('0x1f')]);var upload=multer({'storage':multer[_0x65f8('0x20')]({'destination':function(_0x2ad7e4,_0x4f1635,_0x2ab270){_0x2ab270(null,path[_0x65f8('0x15')](config[_0x65f8('0x16')],_0x65f8('0x17')));},'filename':function(_0x59b4b8,_0x27b0a2,_0x40574d){_0x40574d(null,util[_0x65f8('0x18')](_0x65f8('0x19'),_0x65f8('0x21'),path[_0x65f8('0x22')](_0x27b0a2[_0x65f8('0x1b')])));}})});router[_0x65f8('0x1c')](_0x65f8('0x23'),upload[_0x65f8('0x1d')](_0x65f8('0x1e')),controller[_0x65f8('0x24')]);var upload=multer({'storage':multer[_0x65f8('0x20')]({'destination':function(_0x5a496c,_0x3022a1,_0x3034a6){_0x3034a6(null,path[_0x65f8('0x15')](config[_0x65f8('0x16')],'server/files/images/logos/'));},'filename':function(_0xdbad6c,_0x35d312,_0x2fd560){_0x2fd560(null,util['format'](_0x65f8('0x19'),_0x65f8('0x25'),path[_0x65f8('0x22')](_0x35d312[_0x65f8('0x1b')])));}})});router[_0x65f8('0x1c')](_0x65f8('0x12'),upload[_0x65f8('0x1d')](_0x65f8('0x1e')),controller[_0x65f8('0x26')]);var upload=multer({'storage':multer[_0x65f8('0x20')]({'destination':function(_0x225d06,_0x189da8,_0x594add){_0x594add(null,path[_0x65f8('0x15')](config['root'],_0x65f8('0x17')));},'filename':function(_0x2e4ff7,_0x230d34,_0x35e232){_0x35e232(null,util['format']('%s%s','favicon',path[_0x65f8('0x22')](_0x230d34['originalname'])));}})});router[_0x65f8('0x1c')]('/:id/favicon',upload[_0x65f8('0x1d')](_0x65f8('0x1e')),controller[_0x65f8('0x27')]);router['put'](_0x65f8('0xc'),auth[_0x65f8('0x28')](),controller[_0x65f8('0x29')]);module['exports']=router;