Built motion from commit f3da74b7.|2.5.36
[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 _0xe821=['delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','put','update'];(function(_0x285b1c,_0x2fac84){var _0x1ed03e=function(_0x503562){while(--_0x503562){_0x285b1c['push'](_0x285b1c['shift']());}};_0x1ed03e(++_0x2fac84);}(_0xe821,0xdb));var _0x1e82=function(_0x57c566,_0x4bdb66){_0x57c566=_0x57c566-0x0;var _0x344f09=_0xe821[_0x57c566];return _0x344f09;};'use strict';var multer=require(_0x1e82('0x0'));var util=require(_0x1e82('0x1'));var path=require('path');var timeout=require(_0x1e82('0x2'));var express=require('express');var router=express[_0x1e82('0x3')]();var fs_extra=require(_0x1e82('0x4'));var auth=require(_0x1e82('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1e82('0x6'));router[_0x1e82('0x7')]('/',auth[_0x1e82('0x8')](),controller['index']);router[_0x1e82('0x7')](_0x1e82('0x9'),auth[_0x1e82('0x8')](),controller[_0x1e82('0xa')]);router[_0x1e82('0x7')](_0x1e82('0xb'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x1e82('0xc')]({'destination':function(_0x1f47c2,_0x3b130c,_0x1d1d55){_0x1d1d55(null,path[_0x1e82('0xd')](config[_0x1e82('0xe')],_0x1e82('0xf')));},'filename':function(_0x575000,_0xa9579f,_0x37b845){_0xa9579f[_0x1e82('0x10')]=_0xa9579f['originalname'][_0x1e82('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x37b845(null,util[_0x1e82('0x12')](_0x1e82('0x13'),path[_0x1e82('0x14')](_0xa9579f['originalname'],path[_0x1e82('0x15')](_0xa9579f[_0x1e82('0x10')])),Date[_0x1e82('0x16')](),path[_0x1e82('0x15')](_0xa9579f[_0x1e82('0x10')])));}})});router[_0x1e82('0x17')]('/',upload[_0x1e82('0x18')](_0x1e82('0x19')),controller[_0x1e82('0x1a')]);router[_0x1e82('0x1b')](_0x1e82('0x9'),auth['isAuthenticated'](),controller[_0x1e82('0x1c')]);router[_0x1e82('0x1d')]('/:id',auth[_0x1e82('0x8')](),controller['delete']);module[_0x1e82('0x1e')]=router;