Built motion from commit (unavailable).|2.4.4
[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 _0x6b3e=['/webhook','webhookGet','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','single','file','upload','/:id','update','delete','exports','path','connect-timeout','express','Router','../../config/environment','./plugin.controller','get','index'];(function(_0xa9054d,_0x3cc1bf){var _0x3aae53=function(_0x54254b){while(--_0x54254b){_0xa9054d['push'](_0xa9054d['shift']());}};_0x3aae53(++_0x3cc1bf);}(_0x6b3e,0x1c9));var _0xe6b3=function(_0x55491f,_0x3aea90){_0x55491f=_0x55491f-0x0;var _0x4bc1fb=_0x6b3e[_0x55491f];return _0x4bc1fb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe6b3('0x0'));var timeout=require(_0xe6b3('0x1'));var express=require(_0xe6b3('0x2'));var router=express[_0xe6b3('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe6b3('0x4'));var controller=require(_0xe6b3('0x5'));router[_0xe6b3('0x6')]('/',auth['isAuthenticated'](),controller[_0xe6b3('0x7')]);router['get'](_0xe6b3('0x8'),controller[_0xe6b3('0x9')]);router[_0xe6b3('0x6')]('/:id',auth[_0xe6b3('0xa')](),controller[_0xe6b3('0xb')]);router[_0xe6b3('0x6')](_0xe6b3('0xc'),auth[_0xe6b3('0xa')](),controller[_0xe6b3('0xd')]);var upload=multer({'storage':multer[_0xe6b3('0xe')]({'destination':function(_0x2a571c,_0x352dc3,_0x3c93bf){_0x3c93bf(null,path[_0xe6b3('0xf')](config[_0xe6b3('0x10')],_0xe6b3('0x11')));},'filename':function(_0x4be828,_0x5bd84c,_0x2008e3){_0x5bd84c[_0xe6b3('0x12')]=_0x5bd84c[_0xe6b3('0x12')][_0xe6b3('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2008e3(null,util[_0xe6b3('0x14')](_0xe6b3('0x15'),path[_0xe6b3('0x16')](_0x5bd84c[_0xe6b3('0x12')],path['extname'](_0x5bd84c[_0xe6b3('0x12')])),Date['now'](),path[_0xe6b3('0x17')](_0x5bd84c[_0xe6b3('0x12')])));}})});router['post']('/',upload[_0xe6b3('0x18')](_0xe6b3('0x19')),controller[_0xe6b3('0x1a')]);router['post'](_0xe6b3('0x8'),controller['webhookPost']);router['put'](_0xe6b3('0x1b'),auth[_0xe6b3('0xa')](),controller[_0xe6b3('0x1c')]);router[_0xe6b3('0x1d')]('/:id',auth[_0xe6b3('0xa')](),controller[_0xe6b3('0x1d')]);module[_0xe6b3('0x1e')]=router;