Built motion from commit (unavailable).|2.0.80
[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 _0x44dc=['replace','%s-%s%s','basename','extname','post','single','file','upload','webhookPost','update','/:id','delete','exports','path','express','../../components/interaction/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet','isAuthenticated','show','download','diskStorage','join','root','server/files/plugins','originalname'];(function(_0x589228,_0x3f9997){var _0x3ee8b9=function(_0x8f742c){while(--_0x8f742c){_0x589228['push'](_0x589228['shift']());}};_0x3ee8b9(++_0x3f9997);}(_0x44dc,0xf5));var _0xc44d=function(_0x210f9b,_0x287d0c){_0x210f9b=_0x210f9b-0x0;var _0x36d63b=_0x44dc[_0x210f9b];return _0x36d63b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc44d('0x0'));var timeout=require('connect-timeout');var express=require(_0xc44d('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc44d('0x2'));var config=require(_0xc44d('0x3'));var controller=require(_0xc44d('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc44d('0x5')](_0xc44d('0x6'),controller[_0xc44d('0x7')]);router[_0xc44d('0x5')]('/:id',auth[_0xc44d('0x8')](),controller[_0xc44d('0x9')]);router[_0xc44d('0x5')]('/:id/download',auth[_0xc44d('0x8')](),controller[_0xc44d('0xa')]);var upload=multer({'storage':multer[_0xc44d('0xb')]({'destination':function(_0x3bea99,_0x454746,_0x43b877){_0x43b877(null,path[_0xc44d('0xc')](config[_0xc44d('0xd')],_0xc44d('0xe')));},'filename':function(_0x594d7e,_0x488ff4,_0x94c3d5){_0x488ff4[_0xc44d('0xf')]=_0x488ff4[_0xc44d('0xf')][_0xc44d('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x94c3d5(null,util['format'](_0xc44d('0x11'),path[_0xc44d('0x12')](_0x488ff4[_0xc44d('0xf')],path['extname'](_0x488ff4[_0xc44d('0xf')])),Date['now'](),path[_0xc44d('0x13')](_0x488ff4[_0xc44d('0xf')])));}})});router[_0xc44d('0x14')]('/',upload[_0xc44d('0x15')](_0xc44d('0x16')),controller[_0xc44d('0x17')]);router[_0xc44d('0x14')](_0xc44d('0x6'),controller[_0xc44d('0x18')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc44d('0x19')]);router['delete'](_0xc44d('0x1a'),auth[_0xc44d('0x8')](),controller[_0xc44d('0x1b')]);module[_0xc44d('0x1c')]=router;