Built motion from commit (unavailable).|2.5.30
[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 _0x0c10=['file','upload','webhookPost','put','/:id','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','webhookGet','show','/:id/download','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','single'];(function(_0x3a5515,_0x13464f){var _0x6a78ca=function(_0x49987d){while(--_0x49987d){_0x3a5515['push'](_0x3a5515['shift']());}};_0x6a78ca(++_0x13464f);}(_0x0c10,0x1a8));var _0x00c1=function(_0x4a00d0,_0x56d533){_0x4a00d0=_0x4a00d0-0x0;var _0x6e25bf=_0x0c10[_0x4a00d0];return _0x6e25bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x00c1('0x0'));var timeout=require(_0x00c1('0x1'));var express=require(_0x00c1('0x2'));var router=express[_0x00c1('0x3')]();var fs_extra=require(_0x00c1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x00c1('0x5'));var config=require('../../config/environment');var controller=require(_0x00c1('0x6'));router[_0x00c1('0x7')]('/',auth[_0x00c1('0x8')](),controller[_0x00c1('0x9')]);router[_0x00c1('0x7')]('/webhook',controller[_0x00c1('0xa')]);router[_0x00c1('0x7')]('/:id',auth[_0x00c1('0x8')](),controller[_0x00c1('0xb')]);router[_0x00c1('0x7')](_0x00c1('0xc'),auth[_0x00c1('0x8')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x465ef9,_0x1f1cdd,_0x22c657){_0x22c657(null,path[_0x00c1('0xd')](config[_0x00c1('0xe')],_0x00c1('0xf')));},'filename':function(_0xfb2cd1,_0x1c125c,_0x486ede){_0x1c125c[_0x00c1('0x10')]=_0x1c125c[_0x00c1('0x10')][_0x00c1('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x486ede(null,util[_0x00c1('0x12')](_0x00c1('0x13'),path['basename'](_0x1c125c['originalname'],path[_0x00c1('0x14')](_0x1c125c[_0x00c1('0x10')])),Date[_0x00c1('0x15')](),path['extname'](_0x1c125c['originalname'])));}})});router[_0x00c1('0x16')]('/',upload[_0x00c1('0x17')](_0x00c1('0x18')),controller[_0x00c1('0x19')]);router[_0x00c1('0x16')]('/webhook',controller[_0x00c1('0x1a')]);router[_0x00c1('0x1b')](_0x00c1('0x1c'),auth[_0x00c1('0x8')](),controller[_0x00c1('0x1d')]);router[_0x00c1('0x1e')](_0x00c1('0x1c'),auth[_0x00c1('0x8')](),controller['delete']);module[_0x00c1('0x1f')]=router;