Built motion from commit (unavailable).|2.5.0
[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 _0xd2d4=['%s-%s%s','basename','extname','now','post','single','file','webhookPost','put','update','delete','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','/webhook','/:id','show','/:id/download','download','diskStorage','join','originalname','format'];(function(_0x4712c2,_0x5529df){var _0x2d9923=function(_0x4163bb){while(--_0x4163bb){_0x4712c2['push'](_0x4712c2['shift']());}};_0x2d9923(++_0x5529df);}(_0xd2d4,0xb2));var _0x4d2d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd2d4[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4d2d('0x0'));var util=require(_0x4d2d('0x1'));var path=require(_0x4d2d('0x2'));var timeout=require(_0x4d2d('0x3'));var express=require(_0x4d2d('0x4'));var router=express[_0x4d2d('0x5')]();var auth=require(_0x4d2d('0x6'));var interaction=require(_0x4d2d('0x7'));var config=require(_0x4d2d('0x8'));var controller=require(_0x4d2d('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4d2d('0xa')](_0x4d2d('0xb'),controller['webhookGet']);router['get'](_0x4d2d('0xc'),auth['isAuthenticated'](),controller[_0x4d2d('0xd')]);router[_0x4d2d('0xa')](_0x4d2d('0xe'),auth['isAuthenticated'](),controller[_0x4d2d('0xf')]);var upload=multer({'storage':multer[_0x4d2d('0x10')]({'destination':function(_0x2d8510,_0x555e59,_0x285824){_0x285824(null,path[_0x4d2d('0x11')](config['root'],'server/files/plugins'));},'filename':function(_0x5242f4,_0x41f621,_0x327fe8){_0x41f621['originalname']=_0x41f621[_0x4d2d('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x327fe8(null,util[_0x4d2d('0x13')](_0x4d2d('0x14'),path[_0x4d2d('0x15')](_0x41f621['originalname'],path[_0x4d2d('0x16')](_0x41f621[_0x4d2d('0x12')])),Date[_0x4d2d('0x17')](),path['extname'](_0x41f621[_0x4d2d('0x12')])));}})});router[_0x4d2d('0x18')]('/',upload[_0x4d2d('0x19')](_0x4d2d('0x1a')),controller['upload']);router[_0x4d2d('0x18')](_0x4d2d('0xb'),controller[_0x4d2d('0x1b')]);router[_0x4d2d('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x4d2d('0x1d')]);router[_0x4d2d('0x1e')](_0x4d2d('0xc'),auth[_0x4d2d('0x1f')](),controller[_0x4d2d('0x1e')]);module[_0x4d2d('0x20')]=router;