8e575f2fe52aacef94c0953971ccb7cd7d9b46fc
[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 _0xf84b=['single','file','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','join','root','originalname','replace','format','%s-%s%s','basename','extname','now'];(function(_0x4e0c15,_0xe1159d){var _0x18d9ba=function(_0x300d47){while(--_0x300d47){_0x4e0c15['push'](_0x4e0c15['shift']());}};_0x18d9ba(++_0xe1159d);}(_0xf84b,0x13c));var _0xbf84=function(_0xcd5ef,_0x44ade6){_0xcd5ef=_0xcd5ef-0x0;var _0xba6b95=_0xf84b[_0xcd5ef];return _0xba6b95;};'use strict';var multer=require(_0xbf84('0x0'));var util=require(_0xbf84('0x1'));var path=require(_0xbf84('0x2'));var timeout=require('connect-timeout');var express=require(_0xbf84('0x3'));var router=express[_0xbf84('0x4')]();var auth=require(_0xbf84('0x5'));var interaction=require(_0xbf84('0x6'));var config=require(_0xbf84('0x7'));var controller=require(_0xbf84('0x8'));router[_0xbf84('0x9')]('/',auth[_0xbf84('0xa')](),controller[_0xbf84('0xb')]);router[_0xbf84('0x9')](_0xbf84('0xc'),auth[_0xbf84('0xa')](),controller[_0xbf84('0xd')]);router[_0xbf84('0x9')](_0xbf84('0xe'),auth[_0xbf84('0xa')](),controller[_0xbf84('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c68d8,_0x2cacd5,_0x3cd5c2){_0x3cd5c2(null,path[_0xbf84('0x10')](config[_0xbf84('0x11')],'server/files/sounds/original/'));},'filename':function(_0xea5f8,_0xfe210f,_0x3df53e){_0xfe210f[_0xbf84('0x12')]=_0xfe210f[_0xbf84('0x12')][_0xbf84('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3df53e(null,util[_0xbf84('0x14')](_0xbf84('0x15'),path[_0xbf84('0x16')](_0xfe210f[_0xbf84('0x12')],path[_0xbf84('0x17')](_0xfe210f['originalname'])),Date[_0xbf84('0x18')](),path[_0xbf84('0x17')](_0xfe210f[_0xbf84('0x12')])));}})});router['post']('/',upload[_0xbf84('0x19')](_0xbf84('0x1a')),controller['create']);router[_0xbf84('0x1b')](_0xbf84('0xc'),auth[_0xbf84('0xa')](),controller[_0xbf84('0x1c')]);router[_0xbf84('0x1d')](_0xbf84('0xc'),auth[_0xbf84('0xa')](),controller[_0xbf84('0x1d')]);module[_0xbf84('0x1e')]=router;