97d77e311b4a4fe006914208b5426eb57c58068d
[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 _0x8012=['create','put','/:id','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./sound.controller','get','index','isAuthenticated','/:id/download','download','diskStorage','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file'];(function(_0x40d756,_0x5c1d15){var _0x5a0611=function(_0x36dbc5){while(--_0x36dbc5){_0x40d756['push'](_0x40d756['shift']());}};_0x5a0611(++_0x5c1d15);}(_0x8012,0x16d));var _0x2801=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x8012[_0xe73080];return _0x12cbc4;};'use strict';var multer=require(_0x2801('0x0'));var util=require(_0x2801('0x1'));var path=require(_0x2801('0x2'));var timeout=require(_0x2801('0x3'));var express=require(_0x2801('0x4'));var router=express['Router']();var auth=require(_0x2801('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2801('0x6'));var controller=require(_0x2801('0x7'));router[_0x2801('0x8')]('/',auth['isAuthenticated'](),controller[_0x2801('0x9')]);router['get']('/:id',auth[_0x2801('0xa')](),controller['show']);router['get'](_0x2801('0xb'),auth[_0x2801('0xa')](),controller[_0x2801('0xc')]);var upload=multer({'storage':multer[_0x2801('0xd')]({'destination':function(_0x1d20a1,_0x139329,_0x4a4654){_0x4a4654(null,path['join'](config['root'],_0x2801('0xe')));},'filename':function(_0x289222,_0x405b38,_0x126e32){_0x405b38[_0x2801('0xf')]=_0x405b38['originalname'][_0x2801('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x126e32(null,util[_0x2801('0x11')](_0x2801('0x12'),path[_0x2801('0x13')](_0x405b38[_0x2801('0xf')],path[_0x2801('0x14')](_0x405b38[_0x2801('0xf')])),Date[_0x2801('0x15')](),path[_0x2801('0x14')](_0x405b38[_0x2801('0xf')])));}})});router[_0x2801('0x16')]('/',upload[_0x2801('0x17')](_0x2801('0x18')),controller[_0x2801('0x19')]);router[_0x2801('0x1a')](_0x2801('0x1b'),auth[_0x2801('0xa')](),controller[_0x2801('0x1c')]);router[_0x2801('0x1d')]('/:id',auth[_0x2801('0xa')](),controller[_0x2801('0x1d')]);module['exports']=router;