Built motion from commit c1aa34a0.|2.6.28
[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 _0x579c=['../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','extname','file','upload','post','/webhook','webhookPost','put','update','delete','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x20777b,_0x5f30df){var _0x43a237=function(_0x15d149){while(--_0x15d149){_0x20777b['push'](_0x20777b['shift']());}};_0x43a237(++_0x5f30df);}(_0x579c,0xda));var _0xc579=function(_0x1debb4,_0x5d05d4){_0x1debb4=_0x1debb4-0x0;var _0x419b76=_0x579c[_0x1debb4];return _0x419b76;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/webhook',controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth[_0xc579('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xc579('0x10')]({'destination':function(_0x2048bc,_0x17e37f,_0x3684b7){_0x3684b7(null,path[_0xc579('0x11')](config[_0xc579('0x12')],_0xc579('0x13')));},'filename':function(_0x1905b7,_0x421812,_0x441028){_0x421812[_0xc579('0x14')]=_0x421812['originalname'][_0xc579('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x441028(null,util['format'](_0xc579('0x16'),path['basename'](_0x421812[_0xc579('0x14')],path['extname'](_0x421812[_0xc579('0x14')])),Date['now'](),path[_0xc579('0x17')](_0x421812[_0xc579('0x14')])));}})});router['post']('/',upload['single'](_0xc579('0x18')),controller[_0xc579('0x19')]);router[_0xc579('0x1a')](_0xc579('0x1b'),controller[_0xc579('0x1c')]);router[_0xc579('0x1d')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x1e')]);router[_0xc579('0x1f')]('/:id',auth[_0xc579('0xa')](),controller[_0xc579('0x1f')]);module['exports']=router;