9d63eb08a674b4fafa301259a718388e06918683
[motion2.git] / server / api / sound / 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 _0xfa5e=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','show','/:id/download','download','join','root','server/files/sounds/original/','originalname','replace','basename','now','extname','post','file','create','put','/:id','update','delete'];(function(_0x5dea35,_0x4403ce){var _0x420537=function(_0x262e1c){while(--_0x262e1c){_0x5dea35['push'](_0x5dea35['shift']());}};_0x420537(++_0x4403ce);}(_0xfa5e,0x169));var _0xefa5=function(_0x21a486,_0x5e8058){_0x21a486=_0x21a486-0x0;var _0x29a70b=_0xfa5e[_0x21a486];return _0x29a70b;};'use strict';var multer=require(_0xefa5('0x0'));var util=require(_0xefa5('0x1'));var path=require(_0xefa5('0x2'));var timeout=require(_0xefa5('0x3'));var express=require(_0xefa5('0x4'));var router=express[_0xefa5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xefa5('0x6'));var config=require(_0xefa5('0x7'));var controller=require(_0xefa5('0x8'));router[_0xefa5('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xefa5('0x9')]('/:id',auth[_0xefa5('0xa')](),controller[_0xefa5('0xb')]);router[_0xefa5('0x9')](_0xefa5('0xc'),auth[_0xefa5('0xa')](),controller[_0xefa5('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x281ba2,_0x5c45dc,_0x126dfa){_0x126dfa(null,path[_0xefa5('0xe')](config[_0xefa5('0xf')],_0xefa5('0x10')));},'filename':function(_0x3c753f,_0xad2c0c,_0x4c8730){_0xad2c0c[_0xefa5('0x11')]=_0xad2c0c[_0xefa5('0x11')][_0xefa5('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4c8730(null,util['format']('%s-%s%s',path[_0xefa5('0x13')](_0xad2c0c[_0xefa5('0x11')],path['extname'](_0xad2c0c[_0xefa5('0x11')])),Date[_0xefa5('0x14')](),path[_0xefa5('0x15')](_0xad2c0c[_0xefa5('0x11')])));}})});router[_0xefa5('0x16')]('/',upload['single'](_0xefa5('0x17')),controller[_0xefa5('0x18')]);router[_0xefa5('0x19')](_0xefa5('0x1a'),auth[_0xefa5('0xa')](),controller[_0xefa5('0x1b')]);router[_0xefa5('0x1c')]('/:id',auth[_0xefa5('0xa')](),controller[_0xefa5('0x1c')]);module[_0xefa5('0x1d')]=router;