Built motion from commit (unavailable).|2.5.15
[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 _0xcbfb=['file','put','update','delete','exports','util','path','express','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','download','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post'];(function(_0x2a916c,_0x1e31d0){var _0x5dea99=function(_0x3565a0){while(--_0x3565a0){_0x2a916c['push'](_0x2a916c['shift']());}};_0x5dea99(++_0x1e31d0);}(_0xcbfb,0xcd));var _0xbcbf=function(_0x545bf9,_0x56874d){_0x545bf9=_0x545bf9-0x0;var _0xbfa504=_0xcbfb[_0x545bf9];return _0xbfa504;};'use strict';var multer=require('multer');var util=require(_0xbcbf('0x0'));var path=require(_0xbcbf('0x1'));var timeout=require('connect-timeout');var express=require(_0xbcbf('0x2'));var router=express['Router']();var auth=require(_0xbcbf('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbcbf('0x4'));var controller=require(_0xbcbf('0x5'));router[_0xbcbf('0x6')]('/',auth[_0xbcbf('0x7')](),controller['index']);router[_0xbcbf('0x6')](_0xbcbf('0x8'),auth['isAuthenticated'](),controller[_0xbcbf('0x9')]);router[_0xbcbf('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0xbcbf('0xa')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x231897,_0x4e6eed,_0x52c92a){_0x52c92a(null,path['join'](config[_0xbcbf('0xb')],_0xbcbf('0xc')));},'filename':function(_0x2edcdc,_0x5407f3,_0x2ae9a3){_0x5407f3[_0xbcbf('0xd')]=_0x5407f3[_0xbcbf('0xd')][_0xbcbf('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ae9a3(null,util['format'](_0xbcbf('0xf'),path[_0xbcbf('0x10')](_0x5407f3['originalname'],path[_0xbcbf('0x11')](_0x5407f3[_0xbcbf('0xd')])),Date[_0xbcbf('0x12')](),path[_0xbcbf('0x11')](_0x5407f3['originalname'])));}})});router[_0xbcbf('0x13')]('/',upload['single'](_0xbcbf('0x14')),controller['create']);router[_0xbcbf('0x15')](_0xbcbf('0x8'),auth['isAuthenticated'](),controller[_0xbcbf('0x16')]);router[_0xbcbf('0x17')](_0xbcbf('0x8'),auth['isAuthenticated'](),controller[_0xbcbf('0x17')]);module[_0xbcbf('0x18')]=router;