Built motion from commit (unavailable).|2.5.14
[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 _0x29e4=['download','diskStorage','root','server/files/plugins','originalname','replace','%s-%s%s','extname','now','post','single','webhookPost','put','update','delete','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show'];(function(_0x273938,_0x1c28d5){var _0x20c34d=function(_0x39d260){while(--_0x39d260){_0x273938['push'](_0x273938['shift']());}};_0x20c34d(++_0x1c28d5);}(_0x29e4,0x14e));var _0x429e=function(_0x589081,_0x54d794){_0x589081=_0x589081-0x0;var _0x4b7e8c=_0x29e4[_0x589081];return _0x4b7e8c;};'use strict';var multer=require(_0x429e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x429e('0x1'));var express=require(_0x429e('0x2'));var router=express[_0x429e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x429e('0x4'));var config=require(_0x429e('0x5'));var controller=require(_0x429e('0x6'));router[_0x429e('0x7')]('/',auth[_0x429e('0x8')](),controller[_0x429e('0x9')]);router[_0x429e('0x7')](_0x429e('0xa'),controller[_0x429e('0xb')]);router[_0x429e('0x7')](_0x429e('0xc'),auth['isAuthenticated'](),controller[_0x429e('0xd')]);router[_0x429e('0x7')]('/:id/download',auth[_0x429e('0x8')](),controller[_0x429e('0xe')]);var upload=multer({'storage':multer[_0x429e('0xf')]({'destination':function(_0x5deb9,_0x417c55,_0x17cb05){_0x17cb05(null,path['join'](config[_0x429e('0x10')],_0x429e('0x11')));},'filename':function(_0x2b68b2,_0x4312af,_0x3a53ba){_0x4312af[_0x429e('0x12')]=_0x4312af[_0x429e('0x12')][_0x429e('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3a53ba(null,util['format'](_0x429e('0x14'),path['basename'](_0x4312af[_0x429e('0x12')],path[_0x429e('0x15')](_0x4312af['originalname'])),Date[_0x429e('0x16')](),path[_0x429e('0x15')](_0x4312af[_0x429e('0x12')])));}})});router[_0x429e('0x17')]('/',upload[_0x429e('0x18')]('file'),controller['upload']);router[_0x429e('0x17')](_0x429e('0xa'),controller[_0x429e('0x19')]);router[_0x429e('0x1a')](_0x429e('0xc'),auth['isAuthenticated'](),controller[_0x429e('0x1b')]);router[_0x429e('0x1c')](_0x429e('0xc'),auth[_0x429e('0x8')](),controller['delete']);module['exports']=router;