Built motion from commit da617fac.|2.6.6
[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 _0x672a=['put','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','show','getLogoLogin','/:id/gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','extname','originalname','/:id/logo','single','server/files/images/logos/','%s%s','logologin','/:id/logo_login','addLogoLogin','preferred','post','/:id/preferred','file','favicon','addFavicon'];(function(_0x2a6268,_0x4b0429){var _0x32f1f1=function(_0xb70ae){while(--_0xb70ae){_0x2a6268['push'](_0x2a6268['shift']());}};_0x32f1f1(++_0x4b0429);}(_0x672a,0x121));var _0xa672=function(_0x574c3b,_0x56c826){_0x574c3b=_0x574c3b-0x0;var _0x24ea08=_0x672a[_0x574c3b];return _0x24ea08;};'use strict';var multer=require(_0xa672('0x0'));var util=require(_0xa672('0x1'));var path=require(_0xa672('0x2'));var timeout=require(_0xa672('0x3'));var express=require(_0xa672('0x4'));var router=express['Router']();var fs_extra=require(_0xa672('0x5'));var auth=require(_0xa672('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa672('0x7'));router['get']('/',auth[_0xa672('0x8')](),controller[_0xa672('0x9')]);router[_0xa672('0xa')](_0xa672('0xb'),controller[_0xa672('0xc')]);router[_0xa672('0xa')](_0xa672('0xd'),controller[_0xa672('0xe')]);router[_0xa672('0xa')]('/:id/logo',controller['getLogo']);router[_0xa672('0xa')]('/:id/logo_login',controller[_0xa672('0xf')]);router[_0xa672('0xa')](_0xa672('0x10'),controller['gdpr']);router[_0xa672('0xa')]('/:id/preferred',controller[_0xa672('0x11')]);router[_0xa672('0xa')](_0xa672('0x12'),controller[_0xa672('0x13')]);var upload=multer({'storage':multer[_0xa672('0x14')]({'destination':function(_0x42833c,_0x3625b8,_0x9aad21){_0x9aad21(null,path[_0xa672('0x15')](config[_0xa672('0x16')],'server/files/images/logos/'));},'filename':function(_0x3c3710,_0x48c55f,_0x4cd1e5){_0x4cd1e5(null,util[_0xa672('0x17')]('%s%s','logo',path[_0xa672('0x18')](_0x48c55f[_0xa672('0x19')])));}})});router['post'](_0xa672('0x1a'),upload[_0xa672('0x1b')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xa672('0x14')]({'destination':function(_0x4f150f,_0x1995bb,_0xbd51e6){_0xbd51e6(null,path[_0xa672('0x15')](config['root'],_0xa672('0x1c')));},'filename':function(_0x6a2dbc,_0x19cef2,_0x329b4d){_0x329b4d(null,util[_0xa672('0x17')](_0xa672('0x1d'),_0xa672('0x1e'),path[_0xa672('0x18')](_0x19cef2[_0xa672('0x19')])));}})});router['post'](_0xa672('0x1f'),upload[_0xa672('0x1b')]('file'),controller[_0xa672('0x20')]);var upload=multer({'storage':multer[_0xa672('0x14')]({'destination':function(_0xd7a9c2,_0x1e1491,_0x45e76f){_0x45e76f(null,path[_0xa672('0x15')](config[_0xa672('0x16')],_0xa672('0x1c')));},'filename':function(_0x3f4c50,_0x10d1cf,_0x403c9d){_0x403c9d(null,util[_0xa672('0x17')](_0xa672('0x1d'),_0xa672('0x21'),path[_0xa672('0x18')](_0x10d1cf[_0xa672('0x19')])));}})});router[_0xa672('0x22')](_0xa672('0x23'),upload[_0xa672('0x1b')](_0xa672('0x24')),controller['addPreferred']);var upload=multer({'storage':multer[_0xa672('0x14')]({'destination':function(_0xc9a63f,_0x39576e,_0x132836){_0x132836(null,path[_0xa672('0x15')](config[_0xa672('0x16')],_0xa672('0x1c')));},'filename':function(_0x47dfd4,_0x27fa29,_0x4100f1){_0x4100f1(null,util['format']('%s%s',_0xa672('0x25'),path[_0xa672('0x18')](_0x27fa29['originalname'])));}})});router[_0xa672('0x22')]('/:id/favicon',upload[_0xa672('0x1b')](_0xa672('0x24')),controller[_0xa672('0x26')]);router[_0xa672('0x27')](_0xa672('0xd'),auth[_0xa672('0x8')](),controller['update']);module[_0xa672('0x28')]=router;