Built motion from commit (unavailable).|2.5.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 _0x081e=['webhookGet','show','/:id/download','download','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','upload','webhookPost','put','/:id','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index'];(function(_0x1ff4e2,_0x2d9f5e){var _0x258091=function(_0x46b8b4){while(--_0x46b8b4){_0x1ff4e2['push'](_0x1ff4e2['shift']());}};_0x258091(++_0x2d9f5e);}(_0x081e,0x126));var _0xe081=function(_0x45c856,_0x5e6a1e){_0x45c856=_0x45c856-0x0;var _0x4961aa=_0x081e[_0x45c856];return _0x4961aa;};'use strict';var multer=require(_0xe081('0x0'));var util=require(_0xe081('0x1'));var path=require('path');var timeout=require(_0xe081('0x2'));var express=require(_0xe081('0x3'));var router=express[_0xe081('0x4')]();var auth=require(_0xe081('0x5'));var interaction=require(_0xe081('0x6'));var config=require(_0xe081('0x7'));var controller=require(_0xe081('0x8'));router[_0xe081('0x9')]('/',auth[_0xe081('0xa')](),controller[_0xe081('0xb')]);router['get']('/webhook',controller[_0xe081('0xc')]);router[_0xe081('0x9')]('/:id',auth[_0xe081('0xa')](),controller[_0xe081('0xd')]);router[_0xe081('0x9')](_0xe081('0xe'),auth[_0xe081('0xa')](),controller[_0xe081('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x479126,_0x362419,_0x17c46a){_0x17c46a(null,path[_0xe081('0x10')](config[_0xe081('0x11')],_0xe081('0x12')));},'filename':function(_0xf097f1,_0x19550a,_0x3f8cdd){_0x19550a[_0xe081('0x13')]=_0x19550a[_0xe081('0x13')][_0xe081('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3f8cdd(null,util[_0xe081('0x15')](_0xe081('0x16'),path[_0xe081('0x17')](_0x19550a[_0xe081('0x13')],path[_0xe081('0x18')](_0x19550a[_0xe081('0x13')])),Date[_0xe081('0x19')](),path['extname'](_0x19550a[_0xe081('0x13')])));}})});router[_0xe081('0x1a')]('/',upload[_0xe081('0x1b')]('file'),controller[_0xe081('0x1c')]);router[_0xe081('0x1a')]('/webhook',controller[_0xe081('0x1d')]);router[_0xe081('0x1e')](_0xe081('0x1f'),auth[_0xe081('0xa')](),controller[_0xe081('0x20')]);router[_0xe081('0x21')](_0xe081('0x1f'),auth[_0xe081('0xa')](),controller['delete']);module['exports']=router;