Built motion from commit (unavailable).|2.5.4
[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 _0xff42=['update','delete','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','single','create','put','/:id'];(function(_0x71e875,_0x135f75){var _0x50ad00=function(_0x33a317){while(--_0x33a317){_0x71e875['push'](_0x71e875['shift']());}};_0x50ad00(++_0x135f75);}(_0xff42,0x120));var _0x2ff4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xff42[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x2ff4('0x0'));var path=require('path');var timeout=require(_0x2ff4('0x1'));var express=require(_0x2ff4('0x2'));var router=express['Router']();var auth=require(_0x2ff4('0x3'));var interaction=require(_0x2ff4('0x4'));var config=require(_0x2ff4('0x5'));var controller=require('./sound.controller');router[_0x2ff4('0x6')]('/',auth[_0x2ff4('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2ff4('0x8')]);router[_0x2ff4('0x6')](_0x2ff4('0x9'),auth[_0x2ff4('0x7')](),controller[_0x2ff4('0xa')]);var upload=multer({'storage':multer[_0x2ff4('0xb')]({'destination':function(_0x37365c,_0x2c4f9,_0x2678f9){_0x2678f9(null,path['join'](config[_0x2ff4('0xc')],_0x2ff4('0xd')));},'filename':function(_0x397e1b,_0x5c5ecf,_0x9c13ca){_0x5c5ecf[_0x2ff4('0xe')]=_0x5c5ecf[_0x2ff4('0xe')][_0x2ff4('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x9c13ca(null,util[_0x2ff4('0x10')](_0x2ff4('0x11'),path['basename'](_0x5c5ecf[_0x2ff4('0xe')],path[_0x2ff4('0x12')](_0x5c5ecf[_0x2ff4('0xe')])),Date[_0x2ff4('0x13')](),path['extname'](_0x5c5ecf[_0x2ff4('0xe')])));}})});router['post']('/',upload[_0x2ff4('0x14')]('file'),controller[_0x2ff4('0x15')]);router[_0x2ff4('0x16')](_0x2ff4('0x17'),auth[_0x2ff4('0x7')](),controller[_0x2ff4('0x18')]);router[_0x2ff4('0x19')](_0x2ff4('0x17'),auth[_0x2ff4('0x7')](),controller[_0x2ff4('0x19')]);module['exports']=router;