Built motion from commit (unavailable).|2.3.4
[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 _0xcfc7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','/:id/download','download','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','multer','util','path','connect-timeout','express','Router'];(function(_0x5d3eb1,_0x56beb3){var _0x2f3d1e=function(_0x1d7f4e){while(--_0x1d7f4e){_0x5d3eb1['push'](_0x5d3eb1['shift']());}};_0x2f3d1e(++_0x56beb3);}(_0xcfc7,0x19a));var _0x7cfc=function(_0x27a077,_0x120652){_0x27a077=_0x27a077-0x0;var _0x3b9ddf=_0xcfc7[_0x27a077];return _0x3b9ddf;};'use strict';var multer=require(_0x7cfc('0x0'));var util=require(_0x7cfc('0x1'));var path=require(_0x7cfc('0x2'));var timeout=require(_0x7cfc('0x3'));var express=require(_0x7cfc('0x4'));var router=express[_0x7cfc('0x5')]();var auth=require(_0x7cfc('0x6'));var interaction=require(_0x7cfc('0x7'));var config=require(_0x7cfc('0x8'));var controller=require(_0x7cfc('0x9'));router[_0x7cfc('0xa')]('/',auth[_0x7cfc('0xb')](),controller[_0x7cfc('0xc')]);router[_0x7cfc('0xa')](_0x7cfc('0xd'),controller['webhookGet']);router[_0x7cfc('0xa')](_0x7cfc('0xe'),auth[_0x7cfc('0xb')](),controller['show']);router[_0x7cfc('0xa')](_0x7cfc('0xf'),auth['isAuthenticated'](),controller[_0x7cfc('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ac1fd,_0x1926ee,_0xd71062){_0xd71062(null,path['join'](config[_0x7cfc('0x11')],_0x7cfc('0x12')));},'filename':function(_0x171a8c,_0x19151d,_0x2ae29b){_0x19151d[_0x7cfc('0x13')]=_0x19151d[_0x7cfc('0x13')][_0x7cfc('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ae29b(null,util[_0x7cfc('0x15')](_0x7cfc('0x16'),path[_0x7cfc('0x17')](_0x19151d['originalname'],path[_0x7cfc('0x18')](_0x19151d[_0x7cfc('0x13')])),Date[_0x7cfc('0x19')](),path['extname'](_0x19151d[_0x7cfc('0x13')])));}})});router['post']('/',upload[_0x7cfc('0x1a')](_0x7cfc('0x1b')),controller[_0x7cfc('0x1c')]);router[_0x7cfc('0x1d')](_0x7cfc('0xd'),controller[_0x7cfc('0x1e')]);router[_0x7cfc('0x1f')](_0x7cfc('0xe'),auth[_0x7cfc('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['delete']);module['exports']=router;