7fa33fbb255d31fd4b84918a4ce0b6c960e61cf6
[motion2.git] / server / api / plugin / 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 _0xbec5=['../../config/environment','./plugin.controller','isAuthenticated','index','/webhook','/:id','show','get','download','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','upload','webhookPost','put','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2dc098,_0x48eb28){var _0x391d8d=function(_0x54bdb7){while(--_0x54bdb7){_0x2dc098['push'](_0x2dc098['shift']());}};_0x391d8d(++_0x48eb28);}(_0xbec5,0x1ca));var _0x5bec=function(_0x3a2118,_0x31fc3c){_0x3a2118=_0x3a2118-0x0;var _0x1d181d=_0xbec5[_0x3a2118];return _0x1d181d;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var auth=require(_0x5bec('0x5'));var interaction=require(_0x5bec('0x6'));var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router['get']('/',auth[_0x5bec('0x9')](),controller[_0x5bec('0xa')]);router['get'](_0x5bec('0xb'),controller['webhookGet']);router['get'](_0x5bec('0xc'),auth[_0x5bec('0x9')](),controller[_0x5bec('0xd')]);router[_0x5bec('0xe')]('/:id/download',auth[_0x5bec('0x9')](),controller[_0x5bec('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d04a6,_0x561cf2,_0x349c85){_0x349c85(null,path['join'](config[_0x5bec('0x10')],_0x5bec('0x11')));},'filename':function(_0x264ee6,_0x1c324d,_0x43b9e4){_0x1c324d[_0x5bec('0x12')]=_0x1c324d['originalname'][_0x5bec('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x43b9e4(null,util[_0x5bec('0x14')](_0x5bec('0x15'),path[_0x5bec('0x16')](_0x1c324d[_0x5bec('0x12')],path[_0x5bec('0x17')](_0x1c324d[_0x5bec('0x12')])),Date[_0x5bec('0x18')](),path[_0x5bec('0x17')](_0x1c324d[_0x5bec('0x12')])));}})});router[_0x5bec('0x19')]('/',upload[_0x5bec('0x1a')]('file'),controller[_0x5bec('0x1b')]);router[_0x5bec('0x19')](_0x5bec('0xb'),controller[_0x5bec('0x1c')]);router[_0x5bec('0x1d')](_0x5bec('0xc'),auth[_0x5bec('0x9')](),controller['update']);router['delete']('/:id',auth[_0x5bec('0x9')](),controller[_0x5bec('0x1e')]);module['exports']=router;