649a89205f9a94e3761d4955dc89dc75488308e1
[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 _0xac9d=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','post','single','file','upload'];(function(_0x36d203,_0x3653f3){var _0x2f9e62=function(_0x461a77){while(--_0x461a77){_0x36d203['push'](_0x36d203['shift']());}};_0x2f9e62(++_0x3653f3);}(_0xac9d,0x14d));var _0xdac9=function(_0x39aedf,_0x2f5df8){_0x39aedf=_0x39aedf-0x0;var _0x39356c=_0xac9d[_0x39aedf];return _0x39356c;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./plugin.controller');router[_0xdac9('0x9')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xb')]);router[_0xdac9('0x9')](_0xdac9('0xc'),controller[_0xdac9('0xd')]);router['get'](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0xf')]);router[_0xdac9('0x9')](_0xdac9('0x10'),auth[_0xdac9('0xa')](),controller[_0xdac9('0x11')]);var upload=multer({'storage':multer[_0xdac9('0x12')]({'destination':function(_0x255627,_0x1b604a,_0xbb5615){_0xbb5615(null,path['join'](config[_0xdac9('0x13')],_0xdac9('0x14')));},'filename':function(_0x5a9bde,_0x3d8e97,_0xeddbc1){_0x3d8e97[_0xdac9('0x15')]=_0x3d8e97['originalname'][_0xdac9('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xeddbc1(null,util[_0xdac9('0x17')](_0xdac9('0x18'),path['basename'](_0x3d8e97['originalname'],path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])),Date['now'](),path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])));}})});router[_0xdac9('0x1a')]('/',upload[_0xdac9('0x1b')](_0xdac9('0x1c')),controller[_0xdac9('0x1d')]);router[_0xdac9('0x1a')](_0xdac9('0xc'),controller['webhookPost']);router[_0xdac9('0x1e')](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0x1f')]);router[_0xdac9('0x20')](_0xdac9('0xe'),auth[_0xdac9('0xa')](),controller['delete']);module['exports']=router;