Built motion from commit (unavailable).|2.5.3
[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 _0x2c72=['join','root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','post','single','file','upload','put','update','delete','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/webhook','/:id','show','download','diskStorage'];(function(_0x16b47d,_0x1b2412){var _0x53654f=function(_0x2ed466){while(--_0x2ed466){_0x16b47d['push'](_0x16b47d['shift']());}};_0x53654f(++_0x1b2412);}(_0x2c72,0xa1));var _0x22c7=function(_0x2a83de,_0x51d41d){_0x2a83de=_0x2a83de-0x0;var _0x421de0=_0x2c72[_0x2a83de];return _0x421de0;};'use strict';var multer=require('multer');var util=require(_0x22c7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x22c7('0x1')]();var auth=require(_0x22c7('0x2'));var interaction=require(_0x22c7('0x3'));var config=require(_0x22c7('0x4'));var controller=require('./plugin.controller');router[_0x22c7('0x5')]('/',auth[_0x22c7('0x6')](),controller[_0x22c7('0x7')]);router['get'](_0x22c7('0x8'),controller['webhookGet']);router['get'](_0x22c7('0x9'),auth[_0x22c7('0x6')](),controller[_0x22c7('0xa')]);router[_0x22c7('0x5')]('/:id/download',auth[_0x22c7('0x6')](),controller[_0x22c7('0xb')]);var upload=multer({'storage':multer[_0x22c7('0xc')]({'destination':function(_0x1f1c42,_0x3e019e,_0xb3e72c){_0xb3e72c(null,path[_0x22c7('0xd')](config[_0x22c7('0xe')],_0x22c7('0xf')));},'filename':function(_0x327666,_0x542226,_0x9f2b50){_0x542226[_0x22c7('0x10')]=_0x542226[_0x22c7('0x10')][_0x22c7('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x9f2b50(null,util['format'](_0x22c7('0x12'),path[_0x22c7('0x13')](_0x542226[_0x22c7('0x10')],path[_0x22c7('0x14')](_0x542226[_0x22c7('0x10')])),Date['now'](),path[_0x22c7('0x14')](_0x542226[_0x22c7('0x10')])));}})});router[_0x22c7('0x15')]('/',upload[_0x22c7('0x16')](_0x22c7('0x17')),controller[_0x22c7('0x18')]);router[_0x22c7('0x15')](_0x22c7('0x8'),controller['webhookPost']);router[_0x22c7('0x19')]('/:id',auth[_0x22c7('0x6')](),controller[_0x22c7('0x1a')]);router[_0x22c7('0x1b')](_0x22c7('0x9'),auth[_0x22c7('0x6')](),controller['delete']);module[_0x22c7('0x1c')]=router;