Built motion from commit d5e4af8c.|2.6.23
[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 _0xfa1b=['logo','extname','originalname','post','single','file','addLogo','root','logologin','preferred','addPreferred','favicon','addFavicon','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','/:id','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','format','%s%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfa1b,0x1bd));var _0xbfa1=function(_0x2f470f,_0x132ae8){_0x2f470f=_0x2f470f-0x0;var _0xe996b=_0xfa1b[_0x2f470f];return _0xe996b;};'use strict';var multer=require(_0xbfa1('0x0'));var util=require(_0xbfa1('0x1'));var path=require(_0xbfa1('0x2'));var timeout=require(_0xbfa1('0x3'));var express=require(_0xbfa1('0x4'));var router=express[_0xbfa1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbfa1('0x6'));var interaction=require(_0xbfa1('0x7'));var config=require(_0xbfa1('0x8'));var controller=require(_0xbfa1('0x9'));router[_0xbfa1('0xa')]('/',auth[_0xbfa1('0xb')](),controller['index']);router[_0xbfa1('0xa')](_0xbfa1('0xc'),controller['getDate']);router[_0xbfa1('0xa')](_0xbfa1('0xd'),controller['show']);router[_0xbfa1('0xa')](_0xbfa1('0xe'),controller[_0xbfa1('0xf')]);router[_0xbfa1('0xa')](_0xbfa1('0x10'),controller['getLogoLogin']);router[_0xbfa1('0xa')](_0xbfa1('0x11'),controller[_0xbfa1('0x12')]);router[_0xbfa1('0xa')](_0xbfa1('0x13'),controller[_0xbfa1('0x14')]);router[_0xbfa1('0xa')](_0xbfa1('0x15'),controller[_0xbfa1('0x16')]);var upload=multer({'storage':multer[_0xbfa1('0x17')]({'destination':function(_0x1cc1da,_0x4a08d6,_0x5d3219){_0x5d3219(null,path[_0xbfa1('0x18')](config['root'],_0xbfa1('0x19')));},'filename':function(_0x1a43bd,_0x29ecba,_0x46ef6e){_0x46ef6e(null,util[_0xbfa1('0x1a')](_0xbfa1('0x1b'),_0xbfa1('0x1c'),path[_0xbfa1('0x1d')](_0x29ecba[_0xbfa1('0x1e')])));}})});router[_0xbfa1('0x1f')](_0xbfa1('0xe'),upload[_0xbfa1('0x20')](_0xbfa1('0x21')),controller[_0xbfa1('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1040b7,_0x2ed041,_0x4d1fa0){_0x4d1fa0(null,path[_0xbfa1('0x18')](config[_0xbfa1('0x23')],_0xbfa1('0x19')));},'filename':function(_0x5a0622,_0x5e8847,_0x4e11ed){_0x4e11ed(null,util[_0xbfa1('0x1a')](_0xbfa1('0x1b'),_0xbfa1('0x24'),path['extname'](_0x5e8847[_0xbfa1('0x1e')])));}})});router[_0xbfa1('0x1f')](_0xbfa1('0x10'),upload['single'](_0xbfa1('0x21')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c40a9,_0x1ff58a,_0x217cc0){_0x217cc0(null,path[_0xbfa1('0x18')](config[_0xbfa1('0x23')],_0xbfa1('0x19')));},'filename':function(_0x49991f,_0x17c4e0,_0xfd117){_0xfd117(null,util[_0xbfa1('0x1a')]('%s%s',_0xbfa1('0x25'),path['extname'](_0x17c4e0[_0xbfa1('0x1e')])));}})});router[_0xbfa1('0x1f')]('/:id/preferred',upload['single'](_0xbfa1('0x21')),controller[_0xbfa1('0x26')]);var upload=multer({'storage':multer[_0xbfa1('0x17')]({'destination':function(_0x53ab06,_0x2e782d,_0x6f37a2){_0x6f37a2(null,path[_0xbfa1('0x18')](config[_0xbfa1('0x23')],_0xbfa1('0x19')));},'filename':function(_0x30ba87,_0x67cab2,_0x1434b1){_0x1434b1(null,util['format'](_0xbfa1('0x1b'),_0xbfa1('0x27'),path[_0xbfa1('0x1d')](_0x67cab2[_0xbfa1('0x1e')])));}})});router[_0xbfa1('0x1f')]('/:id/favicon',upload[_0xbfa1('0x20')](_0xbfa1('0x21')),controller[_0xbfa1('0x28')]);router['put']('/:id',auth[_0xbfa1('0xb')](),controller[_0xbfa1('0x29')]);module[_0xbfa1('0x2a')]=router;