Built motion from commit (unavailable).|2.0.76
[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 _0xb4f5=['single','upload','webhookPost','put','update','delete','exports','util','path','../../config/environment','./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','diskStorage','root','originalname','replace','format','%s-%s%s','basename','extname','now','post'];(function(_0xb79925,_0x5b7779){var _0x3d8c81=function(_0x1e01a6){while(--_0x1e01a6){_0xb79925['push'](_0xb79925['shift']());}};_0x3d8c81(++_0x5b7779);}(_0xb4f5,0x13f));var _0x5b4f=function(_0xa89c3e,_0x144268){_0xa89c3e=_0xa89c3e-0x0;var _0x48072f=_0xb4f5[_0xa89c3e];return _0x48072f;};'use strict';var multer=require('multer');var util=require(_0x5b4f('0x0'));var path=require(_0x5b4f('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5b4f('0x2'));var controller=require(_0x5b4f('0x3'));router[_0x5b4f('0x4')]('/',auth[_0x5b4f('0x5')](),controller['index']);router[_0x5b4f('0x4')](_0x5b4f('0x6'),controller[_0x5b4f('0x7')]);router[_0x5b4f('0x4')](_0x5b4f('0x8'),auth[_0x5b4f('0x5')](),controller['show']);router[_0x5b4f('0x4')]('/:id/download',auth[_0x5b4f('0x5')](),controller['download']);var upload=multer({'storage':multer[_0x5b4f('0x9')]({'destination':function(_0x2cb83c,_0x1116c4,_0x325f37){_0x325f37(null,path['join'](config[_0x5b4f('0xa')],'server/files/plugins'));},'filename':function(_0x4271e3,_0x35dcd1,_0x3d450d){_0x35dcd1[_0x5b4f('0xb')]=_0x35dcd1[_0x5b4f('0xb')][_0x5b4f('0xc')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3d450d(null,util[_0x5b4f('0xd')](_0x5b4f('0xe'),path[_0x5b4f('0xf')](_0x35dcd1['originalname'],path[_0x5b4f('0x10')](_0x35dcd1['originalname'])),Date[_0x5b4f('0x11')](),path[_0x5b4f('0x10')](_0x35dcd1[_0x5b4f('0xb')])));}})});router[_0x5b4f('0x12')]('/',upload[_0x5b4f('0x13')]('file'),controller[_0x5b4f('0x14')]);router['post'](_0x5b4f('0x6'),controller[_0x5b4f('0x15')]);router[_0x5b4f('0x16')](_0x5b4f('0x8'),auth[_0x5b4f('0x5')](),controller[_0x5b4f('0x17')]);router[_0x5b4f('0x18')]('/:id',auth['isAuthenticated'](),controller['delete']);module[_0x5b4f('0x19')]=router;