Built motion from commit (unavailable).|2.5.1
[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 _0xbb87=['single','create','put','update','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post'];(function(_0x2cb34e,_0x1853bb){var _0x15b347=function(_0x248669){while(--_0x248669){_0x2cb34e['push'](_0x2cb34e['shift']());}};_0x15b347(++_0x1853bb);}(_0xbb87,0x7a));var _0x7bb8=function(_0x4c8e47,_0x445cc1){_0x4c8e47=_0x4c8e47-0x0;var _0x1d721e=_0xbb87[_0x4c8e47];return _0x1d721e;};'use strict';var multer=require('multer');var util=require(_0x7bb8('0x0'));var path=require('path');var timeout=require(_0x7bb8('0x1'));var express=require(_0x7bb8('0x2'));var router=express[_0x7bb8('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7bb8('0x4'));var config=require(_0x7bb8('0x5'));var controller=require('./sound.controller');router[_0x7bb8('0x6')]('/',auth[_0x7bb8('0x7')](),controller[_0x7bb8('0x8')]);router[_0x7bb8('0x6')](_0x7bb8('0x9'),auth[_0x7bb8('0x7')](),controller[_0x7bb8('0xa')]);router[_0x7bb8('0x6')](_0x7bb8('0xb'),auth[_0x7bb8('0x7')](),controller['download']);var upload=multer({'storage':multer[_0x7bb8('0xc')]({'destination':function(_0x2a78d7,_0x2ecaee,_0x510c62){_0x510c62(null,path[_0x7bb8('0xd')](config[_0x7bb8('0xe')],_0x7bb8('0xf')));},'filename':function(_0x2473e3,_0x472afd,_0x50a10f){_0x472afd[_0x7bb8('0x10')]=_0x472afd['originalname'][_0x7bb8('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x50a10f(null,util['format'](_0x7bb8('0x12'),path[_0x7bb8('0x13')](_0x472afd[_0x7bb8('0x10')],path[_0x7bb8('0x14')](_0x472afd[_0x7bb8('0x10')])),Date[_0x7bb8('0x15')](),path[_0x7bb8('0x14')](_0x472afd['originalname'])));}})});router[_0x7bb8('0x16')]('/',upload[_0x7bb8('0x17')]('file'),controller[_0x7bb8('0x18')]);router[_0x7bb8('0x19')](_0x7bb8('0x9'),auth[_0x7bb8('0x7')](),controller[_0x7bb8('0x1a')]);router[_0x7bb8('0x1b')](_0x7bb8('0x9'),auth['isAuthenticated'](),controller['delete']);module[_0x7bb8('0x1c')]=router;