Built motion from commit (unavailable).|2.5.31
[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 _0x519e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','index','/webhook','webhookGet','get','/:id','show','/:id/download','isAuthenticated','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','upload','webhookPost','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3c62e1,_0x3ca36f){var _0x5778c9=function(_0x254169){while(--_0x254169){_0x3c62e1['push'](_0x3c62e1['shift']());}};_0x5778c9(++_0x3ca36f);}(_0x519e,0x147));var _0xe519=function(_0x4562a4,_0x1a371c){_0x4562a4=_0x4562a4-0x0;var _0x40f62b=_0x519e[_0x4562a4];return _0x40f62b;};'use strict';var multer=require(_0xe519('0x0'));var util=require('util');var path=require(_0xe519('0x1'));var timeout=require(_0xe519('0x2'));var express=require(_0xe519('0x3'));var router=express[_0xe519('0x4')]();var fs_extra=require(_0xe519('0x5'));var auth=require(_0xe519('0x6'));var interaction=require(_0xe519('0x7'));var config=require(_0xe519('0x8'));var controller=require(_0xe519('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe519('0xa')]);router['get'](_0xe519('0xb'),controller[_0xe519('0xc')]);router[_0xe519('0xd')](_0xe519('0xe'),auth['isAuthenticated'](),controller[_0xe519('0xf')]);router[_0xe519('0xd')](_0xe519('0x10'),auth[_0xe519('0x11')](),controller[_0xe519('0x12')]);var upload=multer({'storage':multer[_0xe519('0x13')]({'destination':function(_0x5b1db6,_0x4bfd1d,_0x4f6dbd){_0x4f6dbd(null,path[_0xe519('0x14')](config[_0xe519('0x15')],'server/files/plugins'));},'filename':function(_0x4d727f,_0xcc7796,_0x28dc91){_0xcc7796[_0xe519('0x16')]=_0xcc7796['originalname'][_0xe519('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x28dc91(null,util[_0xe519('0x18')](_0xe519('0x19'),path[_0xe519('0x1a')](_0xcc7796[_0xe519('0x16')],path['extname'](_0xcc7796[_0xe519('0x16')])),Date[_0xe519('0x1b')](),path[_0xe519('0x1c')](_0xcc7796[_0xe519('0x16')])));}})});router[_0xe519('0x1d')]('/',upload[_0xe519('0x1e')]('file'),controller[_0xe519('0x1f')]);router[_0xe519('0x1d')](_0xe519('0xb'),controller[_0xe519('0x20')]);router[_0xe519('0x21')](_0xe519('0xe'),auth[_0xe519('0x11')](),controller[_0xe519('0x22')]);router[_0xe519('0x23')](_0xe519('0xe'),auth['isAuthenticated'](),controller[_0xe519('0x23')]);module[_0xe519('0x24')]=router;