Built motion from commit (unavailable).|2.5.6
[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 _0xc885=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','/:id/download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','/webhook','webhookPost','put','/:id','update','delete','util','path'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xc885,0x153));var _0x5c88=function(_0x592c29,_0x33a20d){_0x592c29=_0x592c29-0x0;var _0x952aa7=_0xc885[_0x592c29];return _0x952aa7;};'use strict';var multer=require('multer');var util=require(_0x5c88('0x0'));var path=require(_0x5c88('0x1'));var timeout=require(_0x5c88('0x2'));var express=require(_0x5c88('0x3'));var router=express[_0x5c88('0x4')]();var auth=require(_0x5c88('0x5'));var interaction=require(_0x5c88('0x6'));var config=require(_0x5c88('0x7'));var controller=require(_0x5c88('0x8'));router[_0x5c88('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5c88('0x9')]('/webhook',controller['webhookGet']);router[_0x5c88('0x9')]('/:id',auth[_0x5c88('0xa')](),controller['show']);router['get'](_0x5c88('0xb'),auth[_0x5c88('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x5c88('0xc')]({'destination':function(_0x423e9f,_0xf26053,_0x151d6f){_0x151d6f(null,path[_0x5c88('0xd')](config['root'],_0x5c88('0xe')));},'filename':function(_0x2a9ffe,_0x4e6ff3,_0x4b8ff0){_0x4e6ff3[_0x5c88('0xf')]=_0x4e6ff3[_0x5c88('0xf')][_0x5c88('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4b8ff0(null,util[_0x5c88('0x11')](_0x5c88('0x12'),path[_0x5c88('0x13')](_0x4e6ff3[_0x5c88('0xf')],path[_0x5c88('0x14')](_0x4e6ff3[_0x5c88('0xf')])),Date[_0x5c88('0x15')](),path[_0x5c88('0x14')](_0x4e6ff3[_0x5c88('0xf')])));}})});router[_0x5c88('0x16')]('/',upload[_0x5c88('0x17')](_0x5c88('0x18')),controller['upload']);router[_0x5c88('0x16')](_0x5c88('0x19'),controller[_0x5c88('0x1a')]);router[_0x5c88('0x1b')](_0x5c88('0x1c'),auth['isAuthenticated'](),controller[_0x5c88('0x1d')]);router[_0x5c88('0x1e')]('/:id',auth[_0x5c88('0xa')](),controller[_0x5c88('0x1e')]);module['exports']=router;