Built motion from commit 19a84241.|2.5.34
[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 _0x81bd=['diskStorage','join','root','server/files/plugins','originalname','format','basename','extname','now','post','file','upload','/webhook','webhookPost','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','show','/:id/download','download'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x81bd,0x7c));var _0xd81b=function(_0x2e2910,_0x3b06e0){_0x2e2910=_0x2e2910-0x0;var _0x22e05c=_0x81bd[_0x2e2910];return _0x22e05c;};'use strict';var multer=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var path=require(_0xd81b('0x2'));var timeout=require(_0xd81b('0x3'));var express=require(_0xd81b('0x4'));var router=express[_0xd81b('0x5')]();var fs_extra=require(_0xd81b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var controller=require(_0xd81b('0x9'));router['get']('/',auth[_0xd81b('0xa')](),controller[_0xd81b('0xb')]);router[_0xd81b('0xc')]('/webhook',controller['webhookGet']);router[_0xd81b('0xc')]('/:id',auth[_0xd81b('0xa')](),controller[_0xd81b('0xd')]);router[_0xd81b('0xc')](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller[_0xd81b('0xf')]);var upload=multer({'storage':multer[_0xd81b('0x10')]({'destination':function(_0x17e09f,_0x2090e1,_0x23c789){_0x23c789(null,path[_0xd81b('0x11')](config[_0xd81b('0x12')],_0xd81b('0x13')));},'filename':function(_0x560530,_0x21dfff,_0x57f71d){_0x21dfff[_0xd81b('0x14')]=_0x21dfff[_0xd81b('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x57f71d(null,util[_0xd81b('0x15')]('%s-%s%s',path[_0xd81b('0x16')](_0x21dfff[_0xd81b('0x14')],path[_0xd81b('0x17')](_0x21dfff[_0xd81b('0x14')])),Date[_0xd81b('0x18')](),path['extname'](_0x21dfff[_0xd81b('0x14')])));}})});router[_0xd81b('0x19')]('/',upload['single'](_0xd81b('0x1a')),controller[_0xd81b('0x1b')]);router[_0xd81b('0x19')](_0xd81b('0x1c'),controller[_0xd81b('0x1d')]);router[_0xd81b('0x1e')](_0xd81b('0x1f'),auth[_0xd81b('0xa')](),controller[_0xd81b('0x20')]);router[_0xd81b('0x21')](_0xd81b('0x1f'),auth[_0xd81b('0xa')](),controller[_0xd81b('0x21')]);module[_0xd81b('0x22')]=router;