Built motion from commit (unavailable).|2.5.22
[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 _0x9ef0=['put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','/:id','isAuthenticated','show','download','diskStorage','join','server/files/sounds/original/','replace','format','%s-%s%s','basename','originalname','now','extname','post','single','file','create'];(function(_0x5a40ce,_0x20dad2){var _0xcb5a53=function(_0x2e264e){while(--_0x2e264e){_0x5a40ce['push'](_0x5a40ce['shift']());}};_0xcb5a53(++_0x20dad2);}(_0x9ef0,0x177));var _0x09ef=function(_0x11e6b3,_0x3f7374){_0x11e6b3=_0x11e6b3-0x0;var _0x2bb29d=_0x9ef0[_0x11e6b3];return _0x2bb29d;};'use strict';var multer=require(_0x09ef('0x0'));var util=require(_0x09ef('0x1'));var path=require('path');var timeout=require(_0x09ef('0x2'));var express=require(_0x09ef('0x3'));var router=express[_0x09ef('0x4')]();var auth=require(_0x09ef('0x5'));var interaction=require(_0x09ef('0x6'));var config=require(_0x09ef('0x7'));var controller=require(_0x09ef('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x09ef('0x9')](_0x09ef('0xa'),auth[_0x09ef('0xb')](),controller[_0x09ef('0xc')]);router[_0x09ef('0x9')]('/:id/download',auth[_0x09ef('0xb')](),controller[_0x09ef('0xd')]);var upload=multer({'storage':multer[_0x09ef('0xe')]({'destination':function(_0x19ad80,_0x18f18f,_0x31aa11){_0x31aa11(null,path[_0x09ef('0xf')](config['root'],_0x09ef('0x10')));},'filename':function(_0x16dd5f,_0x30e953,_0x57d5f6){_0x30e953['originalname']=_0x30e953['originalname'][_0x09ef('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x57d5f6(null,util[_0x09ef('0x12')](_0x09ef('0x13'),path[_0x09ef('0x14')](_0x30e953['originalname'],path['extname'](_0x30e953[_0x09ef('0x15')])),Date[_0x09ef('0x16')](),path[_0x09ef('0x17')](_0x30e953[_0x09ef('0x15')])));}})});router[_0x09ef('0x18')]('/',upload[_0x09ef('0x19')](_0x09ef('0x1a')),controller[_0x09ef('0x1b')]);router[_0x09ef('0x1c')](_0x09ef('0xa'),auth[_0x09ef('0xb')](),controller['update']);router[_0x09ef('0x1d')](_0x09ef('0xa'),auth['isAuthenticated'](),controller[_0x09ef('0x1d')]);module[_0x09ef('0x1e')]=router;