Built motion from commit (unavailable).|2.5.7
[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 _0x28f7=['diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','create','put','update','delete','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x599c94,_0x464f0e){var _0x34e215=function(_0x36295a){while(--_0x36295a){_0x599c94['push'](_0x599c94['shift']());}};_0x34e215(++_0x464f0e);}(_0x28f7,0x129));var _0x728f=function(_0x201976,_0x35f184){_0x201976=_0x201976-0x0;var _0x313b93=_0x28f7[_0x201976];return _0x313b93;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x728f('0x0'));var timeout=require(_0x728f('0x1'));var express=require(_0x728f('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x728f('0x3'));var config=require(_0x728f('0x4'));var controller=require('./sound.controller');router[_0x728f('0x5')]('/',auth[_0x728f('0x6')](),controller[_0x728f('0x7')]);router[_0x728f('0x5')](_0x728f('0x8'),auth['isAuthenticated'](),controller[_0x728f('0x9')]);router[_0x728f('0x5')](_0x728f('0xa'),auth[_0x728f('0x6')](),controller['download']);var upload=multer({'storage':multer[_0x728f('0xb')]({'destination':function(_0x287d09,_0x3e1f31,_0x570263){_0x570263(null,path[_0x728f('0xc')](config[_0x728f('0xd')],_0x728f('0xe')));},'filename':function(_0x46e027,_0x1da889,_0x1f97f5){_0x1da889[_0x728f('0xf')]=_0x1da889[_0x728f('0xf')][_0x728f('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1f97f5(null,util[_0x728f('0x11')](_0x728f('0x12'),path[_0x728f('0x13')](_0x1da889[_0x728f('0xf')],path[_0x728f('0x14')](_0x1da889[_0x728f('0xf')])),Date[_0x728f('0x15')](),path[_0x728f('0x14')](_0x1da889[_0x728f('0xf')])));}})});router['post']('/',upload[_0x728f('0x16')](_0x728f('0x17')),controller[_0x728f('0x18')]);router[_0x728f('0x19')](_0x728f('0x8'),auth[_0x728f('0x6')](),controller[_0x728f('0x1a')]);router['delete'](_0x728f('0x8'),auth[_0x728f('0x6')](),controller[_0x728f('0x1b')]);module['exports']=router;