Built motion from commit (unavailable).|2.5.11
[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 _0x8bb1=['/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','replace','format','basename','originalname','extname','post','upload','/webhook','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet'];(function(_0x195fd3,_0x4f710b){var _0x34759c=function(_0x513585){while(--_0x513585){_0x195fd3['push'](_0x195fd3['shift']());}};_0x34759c(++_0x4f710b);}(_0x8bb1,0xcc));var _0x18bb=function(_0x234830,_0xcee0db){_0x234830=_0x234830-0x0;var _0x25ed18=_0x8bb1[_0x234830];return _0x25ed18;};'use strict';var multer=require(_0x18bb('0x0'));var util=require(_0x18bb('0x1'));var path=require(_0x18bb('0x2'));var timeout=require(_0x18bb('0x3'));var express=require(_0x18bb('0x4'));var router=express[_0x18bb('0x5')]();var auth=require(_0x18bb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x18bb('0x7'));var controller=require(_0x18bb('0x8'));router[_0x18bb('0x9')]('/',auth[_0x18bb('0xa')](),controller[_0x18bb('0xb')]);router[_0x18bb('0x9')]('/webhook',controller[_0x18bb('0xc')]);router[_0x18bb('0x9')](_0x18bb('0xd'),auth[_0x18bb('0xa')](),controller[_0x18bb('0xe')]);router['get'](_0x18bb('0xf'),auth[_0x18bb('0xa')](),controller[_0x18bb('0x10')]);var upload=multer({'storage':multer[_0x18bb('0x11')]({'destination':function(_0x2f2f5a,_0x11c2b6,_0x3b7745){_0x3b7745(null,path['join'](config[_0x18bb('0x12')],_0x18bb('0x13')));},'filename':function(_0x38a148,_0x28eed3,_0x5e8283){_0x28eed3['originalname']=_0x28eed3['originalname'][_0x18bb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5e8283(null,util[_0x18bb('0x15')]('%s-%s%s',path[_0x18bb('0x16')](_0x28eed3[_0x18bb('0x17')],path[_0x18bb('0x18')](_0x28eed3[_0x18bb('0x17')])),Date['now'](),path[_0x18bb('0x18')](_0x28eed3[_0x18bb('0x17')])));}})});router[_0x18bb('0x19')]('/',upload['single']('file'),controller[_0x18bb('0x1a')]);router['post'](_0x18bb('0x1b'),controller['webhookPost']);router[_0x18bb('0x1c')](_0x18bb('0xd'),auth['isAuthenticated'](),controller[_0x18bb('0x1d')]);router[_0x18bb('0x1e')]('/:id',auth[_0x18bb('0xa')](),controller[_0x18bb('0x1e')]);module['exports']=router;