Built motion from commit (unavailable).|2.6.0
[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 _0x9e96=['../../components/interaction/service','./plugin.controller','index','get','/webhook','webhookGet','/:id','show','/:id/download','isAuthenticated','download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','upload','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x348045,_0x4f4414){var _0x3a5c1a=function(_0x4345d2){while(--_0x4345d2){_0x348045['push'](_0x348045['shift']());}};_0x3a5c1a(++_0x4f4414);}(_0x9e96,0x89));var _0x69e9=function(_0x3edbff,_0x2bb38e){_0x3edbff=_0x3edbff-0x0;var _0x3fbd31=_0x9e96[_0x3edbff];return _0x3fbd31;};'use strict';var multer=require(_0x69e9('0x0'));var util=require(_0x69e9('0x1'));var path=require(_0x69e9('0x2'));var timeout=require(_0x69e9('0x3'));var express=require(_0x69e9('0x4'));var router=express[_0x69e9('0x5')]();var fs_extra=require(_0x69e9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x69e9('0x7'));var config=require('../../config/environment');var controller=require(_0x69e9('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x69e9('0x9')]);router[_0x69e9('0xa')](_0x69e9('0xb'),controller[_0x69e9('0xc')]);router[_0x69e9('0xa')](_0x69e9('0xd'),auth['isAuthenticated'](),controller[_0x69e9('0xe')]);router[_0x69e9('0xa')](_0x69e9('0xf'),auth[_0x69e9('0x10')](),controller[_0x69e9('0x11')]);var upload=multer({'storage':multer[_0x69e9('0x12')]({'destination':function(_0x27fe71,_0x21f1fe,_0x886d3c){_0x886d3c(null,path[_0x69e9('0x13')](config['root'],_0x69e9('0x14')));},'filename':function(_0x26e09e,_0x482729,_0x694396){_0x482729[_0x69e9('0x15')]=_0x482729['originalname'][_0x69e9('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x694396(null,util[_0x69e9('0x17')](_0x69e9('0x18'),path[_0x69e9('0x19')](_0x482729[_0x69e9('0x15')],path['extname'](_0x482729[_0x69e9('0x15')])),Date['now'](),path[_0x69e9('0x1a')](_0x482729[_0x69e9('0x15')])));}})});router[_0x69e9('0x1b')]('/',upload[_0x69e9('0x1c')](_0x69e9('0x1d')),controller[_0x69e9('0x1e')]);router['post'](_0x69e9('0xb'),controller[_0x69e9('0x1f')]);router[_0x69e9('0x20')]('/:id',auth[_0x69e9('0x10')](),controller[_0x69e9('0x21')]);router[_0x69e9('0x22')](_0x69e9('0xd'),auth[_0x69e9('0x10')](),controller['delete']);module[_0x69e9('0x23')]=router;