Built motion from commit (unavailable).|2.4.18
[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 _0x106a=['format','extname','now','post','file','upload','webhookPost','/:id','update','delete','exports','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet','isAuthenticated','/:id/download','download','diskStorage','server/files/plugins','originalname'];(function(_0xca8608,_0xe7e2a4){var _0x18f4e7=function(_0x5d1691){while(--_0x5d1691){_0xca8608['push'](_0xca8608['shift']());}};_0x18f4e7(++_0xe7e2a4);}(_0x106a,0xf5));var _0xa106=function(_0x52c071,_0x3731a4){_0x52c071=_0x52c071-0x0;var _0x2246aa=_0x106a[_0x52c071];return _0x2246aa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa106('0x0'));var timeout=require('connect-timeout');var express=require(_0xa106('0x1'));var router=express['Router']();var auth=require(_0xa106('0x2'));var interaction=require(_0xa106('0x3'));var config=require(_0xa106('0x4'));var controller=require(_0xa106('0x5'));router[_0xa106('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa106('0x7'),controller[_0xa106('0x8')]);router['get']('/:id',auth[_0xa106('0x9')](),controller['show']);router[_0xa106('0x6')](_0xa106('0xa'),auth['isAuthenticated'](),controller[_0xa106('0xb')]);var upload=multer({'storage':multer[_0xa106('0xc')]({'destination':function(_0x2e2e67,_0x2722a4,_0x593e6a){_0x593e6a(null,path['join'](config['root'],_0xa106('0xd')));},'filename':function(_0x3bbf1b,_0x107ac6,_0x3452fe){_0x107ac6[_0xa106('0xe')]=_0x107ac6[_0xa106('0xe')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3452fe(null,util[_0xa106('0xf')]('%s-%s%s',path['basename'](_0x107ac6[_0xa106('0xe')],path[_0xa106('0x10')](_0x107ac6[_0xa106('0xe')])),Date[_0xa106('0x11')](),path[_0xa106('0x10')](_0x107ac6['originalname'])));}})});router[_0xa106('0x12')]('/',upload['single'](_0xa106('0x13')),controller[_0xa106('0x14')]);router[_0xa106('0x12')](_0xa106('0x7'),controller[_0xa106('0x15')]);router['put'](_0xa106('0x16'),auth[_0xa106('0x9')](),controller[_0xa106('0x17')]);router[_0xa106('0x18')](_0xa106('0x16'),auth['isAuthenticated'](),controller['delete']);module[_0xa106('0x19')]=router;