Built motion from commit (unavailable).|2.5.27
[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 _0x42dd=['webhookPost','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/webhook','webhookGet','/:id','show','/:id/download','isAuthenticated','download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','upload'];(function(_0x12c280,_0x51dd07){var _0x3638d3=function(_0x53b273){while(--_0x53b273){_0x12c280['push'](_0x12c280['shift']());}};_0x3638d3(++_0x51dd07);}(_0x42dd,0xbc));var _0xd42d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x42dd[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xd42d('0x0'));var util=require(_0xd42d('0x1'));var path=require(_0xd42d('0x2'));var timeout=require(_0xd42d('0x3'));var express=require(_0xd42d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd42d('0x5'));var interaction=require(_0xd42d('0x6'));var config=require(_0xd42d('0x7'));var controller=require('./plugin.controller');router[_0xd42d('0x8')]('/',auth['isAuthenticated'](),controller[_0xd42d('0x9')]);router['get'](_0xd42d('0xa'),controller[_0xd42d('0xb')]);router[_0xd42d('0x8')](_0xd42d('0xc'),auth['isAuthenticated'](),controller[_0xd42d('0xd')]);router[_0xd42d('0x8')](_0xd42d('0xe'),auth[_0xd42d('0xf')](),controller[_0xd42d('0x10')]);var upload=multer({'storage':multer[_0xd42d('0x11')]({'destination':function(_0x409e0f,_0x426a61,_0x46109c){_0x46109c(null,path[_0xd42d('0x12')](config[_0xd42d('0x13')],_0xd42d('0x14')));},'filename':function(_0x16dad2,_0x5891ed,_0x4dc64c){_0x5891ed[_0xd42d('0x15')]=_0x5891ed['originalname'][_0xd42d('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4dc64c(null,util['format'](_0xd42d('0x17'),path[_0xd42d('0x18')](_0x5891ed[_0xd42d('0x15')],path[_0xd42d('0x19')](_0x5891ed['originalname'])),Date[_0xd42d('0x1a')](),path['extname'](_0x5891ed['originalname'])));}})});router[_0xd42d('0x1b')]('/',upload['single']('file'),controller[_0xd42d('0x1c')]);router['post'](_0xd42d('0xa'),controller[_0xd42d('0x1d')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xd42d('0xc'),auth[_0xd42d('0xf')](),controller[_0xd42d('0x1e')]);module['exports']=router;