a9d3f8d87e208988fc3dd216f5a91c8c672f330f
[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 _0xbc7c=['/webhook','webhookGet','/:id','show','/:id/download','isAuthenticated','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','single','file','upload','post','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','index'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbc7c,0xbb));var _0xcbc7=function(_0x5c1ddc,_0x587040){_0x5c1ddc=_0x5c1ddc-0x0;var _0x542a11=_0xbc7c[_0x5c1ddc];return _0x542a11;};'use strict';var multer=require(_0xcbc7('0x0'));var util=require(_0xcbc7('0x1'));var path=require(_0xcbc7('0x2'));var timeout=require(_0xcbc7('0x3'));var express=require(_0xcbc7('0x4'));var router=express[_0xcbc7('0x5')]();var auth=require(_0xcbc7('0x6'));var interaction=require(_0xcbc7('0x7'));var config=require('../../config/environment');var controller=require(_0xcbc7('0x8'));router[_0xcbc7('0x9')]('/',auth['isAuthenticated'](),controller[_0xcbc7('0xa')]);router[_0xcbc7('0x9')](_0xcbc7('0xb'),controller[_0xcbc7('0xc')]);router[_0xcbc7('0x9')](_0xcbc7('0xd'),auth['isAuthenticated'](),controller[_0xcbc7('0xe')]);router[_0xcbc7('0x9')](_0xcbc7('0xf'),auth[_0xcbc7('0x10')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54c769,_0x4ddda8,_0x543c4d){_0x543c4d(null,path['join'](config[_0xcbc7('0x11')],_0xcbc7('0x12')));},'filename':function(_0x2dcc2e,_0x9367b8,_0x1aa124){_0x9367b8[_0xcbc7('0x13')]=_0x9367b8[_0xcbc7('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1aa124(null,util[_0xcbc7('0x14')](_0xcbc7('0x15'),path[_0xcbc7('0x16')](_0x9367b8[_0xcbc7('0x13')],path['extname'](_0x9367b8[_0xcbc7('0x13')])),Date['now'](),path[_0xcbc7('0x17')](_0x9367b8[_0xcbc7('0x13')])));}})});router['post']('/',upload[_0xcbc7('0x18')](_0xcbc7('0x19')),controller[_0xcbc7('0x1a')]);router[_0xcbc7('0x1b')](_0xcbc7('0xb'),controller[_0xcbc7('0x1c')]);router[_0xcbc7('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xcbc7('0x1e')]);router[_0xcbc7('0x1f')](_0xcbc7('0xd'),auth[_0xcbc7('0x10')](),controller[_0xcbc7('0x1f')]);module[_0xcbc7('0x20')]=router;