Built motion from commit (unavailable).|2.5.5
[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 _0x2f11=['format','%s-%s%s','extname','now','post','single','file','upload','webhookPost','put','delete','multer','util','path','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace'];(function(_0x31a98e,_0x124c5d){var _0x384772=function(_0x55d3aa){while(--_0x55d3aa){_0x31a98e['push'](_0x31a98e['shift']());}};_0x384772(++_0x124c5d);}(_0x2f11,0x141));var _0x12f1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2f11[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x12f1('0x0'));var util=require(_0x12f1('0x1'));var path=require(_0x12f1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x12f1('0x3')]();var auth=require(_0x12f1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x12f1('0x5'));var controller=require('./plugin.controller');router[_0x12f1('0x6')]('/',auth[_0x12f1('0x7')](),controller[_0x12f1('0x8')]);router['get'](_0x12f1('0x9'),controller[_0x12f1('0xa')]);router['get'](_0x12f1('0xb'),auth[_0x12f1('0x7')](),controller['show']);router[_0x12f1('0x6')](_0x12f1('0xc'),auth['isAuthenticated'](),controller[_0x12f1('0xd')]);var upload=multer({'storage':multer[_0x12f1('0xe')]({'destination':function(_0x305125,_0xe252f7,_0x369499){_0x369499(null,path[_0x12f1('0xf')](config[_0x12f1('0x10')],_0x12f1('0x11')));},'filename':function(_0x200570,_0x1550e7,_0x22e4ca){_0x1550e7[_0x12f1('0x12')]=_0x1550e7[_0x12f1('0x12')][_0x12f1('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x22e4ca(null,util[_0x12f1('0x14')](_0x12f1('0x15'),path['basename'](_0x1550e7[_0x12f1('0x12')],path[_0x12f1('0x16')](_0x1550e7[_0x12f1('0x12')])),Date[_0x12f1('0x17')](),path[_0x12f1('0x16')](_0x1550e7['originalname'])));}})});router[_0x12f1('0x18')]('/',upload[_0x12f1('0x19')](_0x12f1('0x1a')),controller[_0x12f1('0x1b')]);router[_0x12f1('0x18')](_0x12f1('0x9'),controller[_0x12f1('0x1c')]);router[_0x12f1('0x1d')](_0x12f1('0xb'),auth[_0x12f1('0x7')](),controller['update']);router['delete'](_0x12f1('0xb'),auth[_0x12f1('0x7')](),controller[_0x12f1('0x1e')]);module['exports']=router;