9b5be99dd3a9c8b8188837f6748e93260cf5b40e
[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 _0x9f70=['join','favicon','addFavicon','put','isAuthenticated','update','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','/now','getDate','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','/:id/preferred','/:id/favicon','diskStorage','root','server/files/images/logos/','%s%s','logo','extname','originalname','logologin','post','single','file','format','addPreferred'];(function(_0x5d381c,_0x445675){var _0x5d0199=function(_0x3344e3){while(--_0x3344e3){_0x5d381c['push'](_0x5d381c['shift']());}};_0x5d0199(++_0x445675);}(_0x9f70,0x137));var _0x09f7=function(_0x44d95e,_0x545bdf){_0x44d95e=_0x44d95e-0x0;var _0x4b85e3=_0x9f70[_0x44d95e];return _0x4b85e3;};'use strict';var multer=require(_0x09f7('0x0'));var util=require('util');var path=require(_0x09f7('0x1'));var timeout=require(_0x09f7('0x2'));var express=require(_0x09f7('0x3'));var router=express['Router']();var fs_extra=require(_0x09f7('0x4'));var auth=require(_0x09f7('0x5'));var interaction=require(_0x09f7('0x6'));var config=require('../../config/environment');var controller=require(_0x09f7('0x7'));router[_0x09f7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x09f7('0x9'),controller[_0x09f7('0xa')]);router[_0x09f7('0x8')]('/:id',controller[_0x09f7('0xb')]);router['get'](_0x09f7('0xc'),controller[_0x09f7('0xd')]);router[_0x09f7('0x8')]('/:id/logo_login',controller[_0x09f7('0xe')]);router['get'](_0x09f7('0xf'),controller['gdpr']);router[_0x09f7('0x8')](_0x09f7('0x10'),controller['getPreferred']);router[_0x09f7('0x8')](_0x09f7('0x11'),controller['getFavicon']);var upload=multer({'storage':multer[_0x09f7('0x12')]({'destination':function(_0x2bb175,_0x46bb09,_0x1ee5f3){_0x1ee5f3(null,path['join'](config[_0x09f7('0x13')],_0x09f7('0x14')));},'filename':function(_0x7474a4,_0xf0dc60,_0x8431ec){_0x8431ec(null,util['format'](_0x09f7('0x15'),_0x09f7('0x16'),path[_0x09f7('0x17')](_0xf0dc60[_0x09f7('0x18')])));}})});router['post']('/:id/logo',upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x09f7('0x12')]({'destination':function(_0x18ebc3,_0x1f0b06,_0x41bb6a){_0x41bb6a(null,path['join'](config[_0x09f7('0x13')],_0x09f7('0x14')));},'filename':function(_0x138d22,_0x85f8cc,_0x394751){_0x394751(null,util['format'](_0x09f7('0x15'),_0x09f7('0x19'),path['extname'](_0x85f8cc[_0x09f7('0x18')])));}})});router[_0x09f7('0x1a')]('/:id/logo_login',upload[_0x09f7('0x1b')](_0x09f7('0x1c')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x09f7('0x12')]({'destination':function(_0x238bbd,_0x4e57ee,_0x27cdcb){_0x27cdcb(null,path['join'](config[_0x09f7('0x13')],_0x09f7('0x14')));},'filename':function(_0x49b95a,_0x5196af,_0x36c536){_0x36c536(null,util[_0x09f7('0x1d')](_0x09f7('0x15'),'preferred',path[_0x09f7('0x17')](_0x5196af['originalname'])));}})});router[_0x09f7('0x1a')]('/:id/preferred',upload['single'](_0x09f7('0x1c')),controller[_0x09f7('0x1e')]);var upload=multer({'storage':multer[_0x09f7('0x12')]({'destination':function(_0x3bc71c,_0x87b0de,_0x56c653){_0x56c653(null,path[_0x09f7('0x1f')](config[_0x09f7('0x13')],_0x09f7('0x14')));},'filename':function(_0xf6052c,_0x34bd15,_0x2026cb){_0x2026cb(null,util[_0x09f7('0x1d')](_0x09f7('0x15'),_0x09f7('0x20'),path[_0x09f7('0x17')](_0x34bd15[_0x09f7('0x18')])));}})});router[_0x09f7('0x1a')](_0x09f7('0x11'),upload[_0x09f7('0x1b')](_0x09f7('0x1c')),controller[_0x09f7('0x21')]);router[_0x09f7('0x22')]('/:id',auth[_0x09f7('0x23')](),controller[_0x09f7('0x24')]);module[_0x09f7('0x25')]=router;