Built motion from commit bab6f49e.|2.6.17
[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 _0x0f50=['single','file','addLogo','logologin','originalname','favicon','addFavicon','put','update','exports','multer','util','connect-timeout','express','Router','../../config/environment','index','get','getDate','/:id','show','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','post','/:id/logo'];(function(_0x51f250,_0x4a748d){var _0x357e88=function(_0xa66b70){while(--_0xa66b70){_0x51f250['push'](_0x51f250['shift']());}};_0x357e88(++_0x4a748d);}(_0x0f50,0x9e));var _0x00f5=function(_0x2e1170,_0x1fc9cf){_0x2e1170=_0x2e1170-0x0;var _0x2322af=_0x0f50[_0x2e1170];return _0x2322af;};'use strict';var multer=require(_0x00f5('0x0'));var util=require(_0x00f5('0x1'));var path=require('path');var timeout=require(_0x00f5('0x2'));var express=require(_0x00f5('0x3'));var router=express[_0x00f5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x00f5('0x5'));var controller=require('./setting.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x00f5('0x6')]);router[_0x00f5('0x7')]('/now',controller[_0x00f5('0x8')]);router[_0x00f5('0x7')](_0x00f5('0x9'),controller[_0x00f5('0xa')]);router[_0x00f5('0x7')]('/:id/logo',controller[_0x00f5('0xb')]);router[_0x00f5('0x7')](_0x00f5('0xc'),controller[_0x00f5('0xd')]);router[_0x00f5('0x7')]('/:id/gdpr',controller[_0x00f5('0xe')]);router[_0x00f5('0x7')](_0x00f5('0xf'),controller['getPreferred']);router[_0x00f5('0x7')](_0x00f5('0x10'),controller[_0x00f5('0x11')]);var upload=multer({'storage':multer[_0x00f5('0x12')]({'destination':function(_0x5db5c7,_0xac6afa,_0x3ec7a2){_0x3ec7a2(null,path[_0x00f5('0x13')](config[_0x00f5('0x14')],_0x00f5('0x15')));},'filename':function(_0x49beb2,_0x2f1356,_0x1aae2a){_0x1aae2a(null,util[_0x00f5('0x16')](_0x00f5('0x17'),'logo',path[_0x00f5('0x18')](_0x2f1356['originalname'])));}})});router[_0x00f5('0x19')](_0x00f5('0x1a'),upload[_0x00f5('0x1b')](_0x00f5('0x1c')),controller[_0x00f5('0x1d')]);var upload=multer({'storage':multer[_0x00f5('0x12')]({'destination':function(_0x8bd91,_0x39de29,_0x58cdbc){_0x58cdbc(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x4237ca,_0x193219,_0xad6489){_0xad6489(null,util['format']('%s%s',_0x00f5('0x1e'),path['extname'](_0x193219[_0x00f5('0x1f')])));}})});router[_0x00f5('0x19')](_0x00f5('0xc'),upload[_0x00f5('0x1b')](_0x00f5('0x1c')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x00f5('0x12')]({'destination':function(_0x44dfc8,_0x1264ce,_0x92610f){_0x92610f(null,path[_0x00f5('0x13')](config['root'],_0x00f5('0x15')));},'filename':function(_0x41b5f7,_0x2fabc7,_0x3ca638){_0x3ca638(null,util['format'](_0x00f5('0x17'),'preferred',path['extname'](_0x2fabc7[_0x00f5('0x1f')])));}})});router[_0x00f5('0x19')](_0x00f5('0xf'),upload['single'](_0x00f5('0x1c')),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5bc89b,_0xf63730,_0x4ce6f7){_0x4ce6f7(null,path[_0x00f5('0x13')](config['root'],_0x00f5('0x15')));},'filename':function(_0x15b604,_0x16fa1e,_0xc7211a){_0xc7211a(null,util[_0x00f5('0x16')](_0x00f5('0x17'),_0x00f5('0x20'),path[_0x00f5('0x18')](_0x16fa1e[_0x00f5('0x1f')])));}})});router[_0x00f5('0x19')](_0x00f5('0x10'),upload['single'](_0x00f5('0x1c')),controller[_0x00f5('0x21')]);router[_0x00f5('0x22')](_0x00f5('0x9'),auth['isAuthenticated'](),controller[_0x00f5('0x23')]);module[_0x00f5('0x24')]=router;