Built motion from commit (unavailable).|2.3.1
[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 _0x9697=['post','single','file','upload','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','now'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9697,0x1b6));var _0x7969=function(_0x58c0a7,_0x4afc08){_0x58c0a7=_0x58c0a7-0x0;var _0x18f837=_0x9697[_0x58c0a7];return _0x18f837;};'use strict';var multer=require(_0x7969('0x0'));var util=require(_0x7969('0x1'));var path=require(_0x7969('0x2'));var timeout=require(_0x7969('0x3'));var express=require(_0x7969('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7969('0x5'));var config=require(_0x7969('0x6'));var controller=require(_0x7969('0x7'));router[_0x7969('0x8')]('/',auth[_0x7969('0x9')](),controller[_0x7969('0xa')]);router[_0x7969('0x8')](_0x7969('0xb'),controller[_0x7969('0xc')]);router[_0x7969('0x8')](_0x7969('0xd'),auth[_0x7969('0x9')](),controller['show']);router[_0x7969('0x8')](_0x7969('0xe'),auth['isAuthenticated'](),controller[_0x7969('0xf')]);var upload=multer({'storage':multer[_0x7969('0x10')]({'destination':function(_0x4cbb3a,_0x21eb29,_0x33f67f){_0x33f67f(null,path[_0x7969('0x11')](config[_0x7969('0x12')],_0x7969('0x13')));},'filename':function(_0x49ab10,_0x41e360,_0x510a12){_0x41e360[_0x7969('0x14')]=_0x41e360['originalname'][_0x7969('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x510a12(null,util[_0x7969('0x16')]('%s-%s%s',path['basename'](_0x41e360[_0x7969('0x14')],path['extname'](_0x41e360[_0x7969('0x14')])),Date[_0x7969('0x17')](),path['extname'](_0x41e360[_0x7969('0x14')])));}})});router[_0x7969('0x18')]('/',upload[_0x7969('0x19')](_0x7969('0x1a')),controller[_0x7969('0x1b')]);router[_0x7969('0x18')]('/webhook',controller[_0x7969('0x1c')]);router[_0x7969('0x1d')](_0x7969('0xd'),auth[_0x7969('0x9')](),controller[_0x7969('0x1e')]);router[_0x7969('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x7969('0x1f')]);module[_0x7969('0x20')]=router;