Built motion from commit 6a92c2cd.|2.6.29
[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 _0x668b=['fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','webhookPost','put','update','/:id','delete','exports','multer','util','connect-timeout','express'];(function(_0x319a85,_0xde0e56){var _0x21db4d=function(_0x9a700f){while(--_0x9a700f){_0x319a85['push'](_0x319a85['shift']());}};_0x21db4d(++_0xde0e56);}(_0x668b,0x140));var _0xb668=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0x668b[_0x5f4cd7];return _0x47c93f;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require('path');var timeout=require(_0xb668('0x2'));var express=require(_0xb668('0x3'));var router=express['Router']();var fs_extra=require(_0xb668('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var controller=require(_0xb668('0x7'));router['get']('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0xa')](_0xb668('0xb'),controller[_0xb668('0xc')]);router[_0xb668('0xa')]('/:id',auth[_0xb668('0x8')](),controller[_0xb668('0xd')]);router[_0xb668('0xa')](_0xb668('0xe'),auth[_0xb668('0x8')](),controller[_0xb668('0xf')]);var upload=multer({'storage':multer[_0xb668('0x10')]({'destination':function(_0x3616e9,_0x567ea9,_0x3b15a6){_0x3b15a6(null,path[_0xb668('0x11')](config[_0xb668('0x12')],_0xb668('0x13')));},'filename':function(_0x16ca75,_0x167057,_0x1d111a){_0x167057[_0xb668('0x14')]=_0x167057[_0xb668('0x14')][_0xb668('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d111a(null,util[_0xb668('0x16')](_0xb668('0x17'),path[_0xb668('0x18')](_0x167057[_0xb668('0x14')],path[_0xb668('0x19')](_0x167057[_0xb668('0x14')])),Date[_0xb668('0x1a')](),path[_0xb668('0x19')](_0x167057[_0xb668('0x14')])));}})});router[_0xb668('0x1b')]('/',upload[_0xb668('0x1c')](_0xb668('0x1d')),controller['upload']);router[_0xb668('0x1b')]('/webhook',controller[_0xb668('0x1e')]);router[_0xb668('0x1f')]('/:id',auth[_0xb668('0x8')](),controller[_0xb668('0x20')]);router['delete'](_0xb668('0x21'),auth['isAuthenticated'](),controller[_0xb668('0x22')]);module[_0xb668('0x23')]=router;