Built motion from commit (unavailable).|2.5.22
[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 _0xf8f1=['server/files/images/logos/','format','%s%s','extname','originalname','file','addLogo','diskStorage','logologin','post','addLogoLogin','/:id/preferred','single','update','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/favicon','getFavicon','join','root'];(function(_0x185a67,_0x244aa7){var _0x95a3f4=function(_0x4f8e83){while(--_0x4f8e83){_0x185a67['push'](_0x185a67['shift']());}};_0x95a3f4(++_0x244aa7);}(_0xf8f1,0x16d));var _0x1f8f=function(_0x5ca5bc,_0x5b8a9d){_0x5ca5bc=_0x5ca5bc-0x0;var _0x26ca86=_0xf8f1[_0x5ca5bc];return _0x26ca86;};'use strict';var multer=require('multer');var util=require(_0x1f8f('0x0'));var path=require('path');var timeout=require(_0x1f8f('0x1'));var express=require('express');var router=express[_0x1f8f('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x1f8f('0x3'));var config=require(_0x1f8f('0x4'));var controller=require('./setting.controller');router[_0x1f8f('0x5')]('/',auth['isAuthenticated'](),controller[_0x1f8f('0x6')]);router[_0x1f8f('0x5')](_0x1f8f('0x7'),controller[_0x1f8f('0x8')]);router[_0x1f8f('0x5')](_0x1f8f('0x9'),controller[_0x1f8f('0xa')]);router[_0x1f8f('0x5')](_0x1f8f('0xb'),controller[_0x1f8f('0xc')]);router[_0x1f8f('0x5')](_0x1f8f('0xd'),controller[_0x1f8f('0xe')]);router[_0x1f8f('0x5')]('/:id/gdpr',controller[_0x1f8f('0xf')]);router['get']('/:id/preferred',controller['getPreferred']);router[_0x1f8f('0x5')](_0x1f8f('0x10'),controller[_0x1f8f('0x11')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xeff99e,_0xa918a5,_0x1ff701){_0x1ff701(null,path[_0x1f8f('0x12')](config[_0x1f8f('0x13')],_0x1f8f('0x14')));},'filename':function(_0x145824,_0x10bd79,_0x461f05){_0x461f05(null,util[_0x1f8f('0x15')](_0x1f8f('0x16'),'logo',path[_0x1f8f('0x17')](_0x10bd79[_0x1f8f('0x18')])));}})});router['post']('/:id/logo',upload['single'](_0x1f8f('0x19')),controller[_0x1f8f('0x1a')]);var upload=multer({'storage':multer[_0x1f8f('0x1b')]({'destination':function(_0xf886a9,_0x26ebc0,_0x5235a6){_0x5235a6(null,path[_0x1f8f('0x12')](config[_0x1f8f('0x13')],_0x1f8f('0x14')));},'filename':function(_0x388b49,_0x1c4e5f,_0x3d52e7){_0x3d52e7(null,util[_0x1f8f('0x15')](_0x1f8f('0x16'),_0x1f8f('0x1c'),path[_0x1f8f('0x17')](_0x1c4e5f[_0x1f8f('0x18')])));}})});router[_0x1f8f('0x1d')](_0x1f8f('0xd'),upload['single'](_0x1f8f('0x19')),controller[_0x1f8f('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x552e98,_0x3baa5a,_0x2ebf7a){_0x2ebf7a(null,path[_0x1f8f('0x12')](config[_0x1f8f('0x13')],_0x1f8f('0x14')));},'filename':function(_0x14ff87,_0x59dfff,_0x35af25){_0x35af25(null,util[_0x1f8f('0x15')]('%s%s','preferred',path['extname'](_0x59dfff[_0x1f8f('0x18')])));}})});router['post'](_0x1f8f('0x1f'),upload[_0x1f8f('0x20')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x1f8f('0x1b')]({'destination':function(_0x5d06db,_0x201726,_0x1f20b1){_0x1f20b1(null,path['join'](config['root'],_0x1f8f('0x14')));},'filename':function(_0x5ebf10,_0x98de32,_0x2f22bd){_0x2f22bd(null,util['format']('%s%s','favicon',path['extname'](_0x98de32[_0x1f8f('0x18')])));}})});router['post'](_0x1f8f('0x10'),upload[_0x1f8f('0x20')](_0x1f8f('0x19')),controller['addFavicon']);router['put'](_0x1f8f('0x9'),auth['isAuthenticated'](),controller[_0x1f8f('0x21')]);module[_0x1f8f('0x22')]=router;