Built motion from commit (unavailable).|2.5.14
[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 _0x20b5=['get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','diskStorage','root','originalname','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','/:id','update','delete','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller'];(function(_0x117475,_0xb11d93){var _0xdb578b=function(_0x5eb15a){while(--_0x5eb15a){_0x117475['push'](_0x117475['shift']());}};_0xdb578b(++_0xb11d93);}(_0x20b5,0xf8));var _0x520b=function(_0x589914,_0x202fff){_0x589914=_0x589914-0x0;var _0x17ef31=_0x20b5[_0x589914];return _0x17ef31;};'use strict';var multer=require(_0x520b('0x0'));var util=require(_0x520b('0x1'));var path=require(_0x520b('0x2'));var timeout=require('connect-timeout');var express=require(_0x520b('0x3'));var router=express['Router']();var auth=require(_0x520b('0x4'));var interaction=require(_0x520b('0x5'));var config=require(_0x520b('0x6'));var controller=require(_0x520b('0x7'));router[_0x520b('0x8')]('/',auth[_0x520b('0x9')](),controller[_0x520b('0xa')]);router['get'](_0x520b('0xb'),controller[_0x520b('0xc')]);router[_0x520b('0x8')]('/:id',auth[_0x520b('0x9')](),controller[_0x520b('0xd')]);router['get'](_0x520b('0xe'),auth[_0x520b('0x9')](),controller['download']);var upload=multer({'storage':multer[_0x520b('0xf')]({'destination':function(_0x1afe85,_0x33d05c,_0x2274c2){_0x2274c2(null,path['join'](config[_0x520b('0x10')],'server/files/plugins'));},'filename':function(_0xe3a7b0,_0xc18fb2,_0x24d692){_0xc18fb2[_0x520b('0x11')]=_0xc18fb2[_0x520b('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x24d692(null,util[_0x520b('0x12')](_0x520b('0x13'),path[_0x520b('0x14')](_0xc18fb2[_0x520b('0x11')],path[_0x520b('0x15')](_0xc18fb2[_0x520b('0x11')])),Date[_0x520b('0x16')](),path[_0x520b('0x15')](_0xc18fb2[_0x520b('0x11')])));}})});router[_0x520b('0x17')]('/',upload[_0x520b('0x18')](_0x520b('0x19')),controller[_0x520b('0x1a')]);router[_0x520b('0x17')](_0x520b('0xb'),controller[_0x520b('0x1b')]);router[_0x520b('0x1c')](_0x520b('0x1d'),auth[_0x520b('0x9')](),controller[_0x520b('0x1e')]);router[_0x520b('0x1f')](_0x520b('0x1d'),auth[_0x520b('0x9')](),controller[_0x520b('0x1f')]);module['exports']=router;