Built motion from commit (unavailable).|2.5.16
[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 _0xb90a=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/now','getDate','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname','post','single','addLogo','file','addLogoLogin','addPreferred','favicon','addFavicon','update','exports'];(function(_0x2145f3,_0x31fe20){var _0x11b331=function(_0x3268f0){while(--_0x3268f0){_0x2145f3['push'](_0x2145f3['shift']());}};_0x11b331(++_0x31fe20);}(_0xb90a,0x1d4));var _0xab90=function(_0x52541a,_0x346995){_0x52541a=_0x52541a-0x0;var _0x14163e=_0xb90a[_0x52541a];return _0x14163e;};'use strict';var multer=require('multer');var util=require(_0xab90('0x0'));var path=require(_0xab90('0x1'));var timeout=require(_0xab90('0x2'));var express=require(_0xab90('0x3'));var router=express[_0xab90('0x4')]();var auth=require(_0xab90('0x5'));var interaction=require(_0xab90('0x6'));var config=require(_0xab90('0x7'));var controller=require('./setting.controller');router[_0xab90('0x8')]('/',auth[_0xab90('0x9')](),controller[_0xab90('0xa')]);router[_0xab90('0x8')](_0xab90('0xb'),controller[_0xab90('0xc')]);router['get']('/:id',controller[_0xab90('0xd')]);router[_0xab90('0x8')](_0xab90('0xe'),controller[_0xab90('0xf')]);router[_0xab90('0x8')](_0xab90('0x10'),controller[_0xab90('0x11')]);router[_0xab90('0x8')](_0xab90('0x12'),controller['gdpr']);router[_0xab90('0x8')]('/:id/preferred',controller['getPreferred']);router['get'](_0xab90('0x13'),controller[_0xab90('0x14')]);var upload=multer({'storage':multer[_0xab90('0x15')]({'destination':function(_0x2d6c97,_0x43de19,_0x1eb7ad){_0x1eb7ad(null,path[_0xab90('0x16')](config[_0xab90('0x17')],_0xab90('0x18')));},'filename':function(_0x1c8973,_0x585cc4,_0x2c1ae7){_0x2c1ae7(null,util[_0xab90('0x19')](_0xab90('0x1a'),'logo',path[_0xab90('0x1b')](_0x585cc4[_0xab90('0x1c')])));}})});router[_0xab90('0x1d')](_0xab90('0xe'),upload[_0xab90('0x1e')]('file'),controller[_0xab90('0x1f')]);var upload=multer({'storage':multer[_0xab90('0x15')]({'destination':function(_0x511db0,_0x2fedef,_0x2b4b3c){_0x2b4b3c(null,path[_0xab90('0x16')](config[_0xab90('0x17')],_0xab90('0x18')));},'filename':function(_0x35f312,_0x20e716,_0x2efb6f){_0x2efb6f(null,util['format'](_0xab90('0x1a'),'logologin',path[_0xab90('0x1b')](_0x20e716['originalname'])));}})});router[_0xab90('0x1d')](_0xab90('0x10'),upload[_0xab90('0x1e')](_0xab90('0x20')),controller[_0xab90('0x21')]);var upload=multer({'storage':multer[_0xab90('0x15')]({'destination':function(_0x107d4d,_0x394022,_0x378474){_0x378474(null,path[_0xab90('0x16')](config['root'],_0xab90('0x18')));},'filename':function(_0x5b56a7,_0x5eda12,_0x22c7b4){_0x22c7b4(null,util['format']('%s%s','preferred',path['extname'](_0x5eda12[_0xab90('0x1c')])));}})});router[_0xab90('0x1d')]('/:id/preferred',upload['single'](_0xab90('0x20')),controller[_0xab90('0x22')]);var upload=multer({'storage':multer[_0xab90('0x15')]({'destination':function(_0x4c20ef,_0x1c3672,_0xe3f589){_0xe3f589(null,path[_0xab90('0x16')](config[_0xab90('0x17')],_0xab90('0x18')));},'filename':function(_0x4a94de,_0x4289f1,_0xb8f905){_0xb8f905(null,util[_0xab90('0x19')]('%s%s',_0xab90('0x23'),path[_0xab90('0x1b')](_0x4289f1[_0xab90('0x1c')])));}})});router[_0xab90('0x1d')](_0xab90('0x13'),upload[_0xab90('0x1e')](_0xab90('0x20')),controller[_0xab90('0x24')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xab90('0x25')]);module[_0xab90('0x26')]=router;