8ed16759e8c111c45896d78bd2f3eb3860211dcc
[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 _0xc201=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','post','file','create','put','update','delete','multer','util'];(function(_0x7af6a1,_0x2cf8fd){var _0x5107e8=function(_0x21342d){while(--_0x21342d){_0x7af6a1['push'](_0x7af6a1['shift']());}};_0x5107e8(++_0x2cf8fd);}(_0xc201,0xee));var _0x1c20=function(_0x5c3488,_0x24f456){_0x5c3488=_0x5c3488-0x0;var _0x48e6f7=_0xc201[_0x5c3488];return _0x48e6f7;};'use strict';var multer=require(_0x1c20('0x0'));var util=require(_0x1c20('0x1'));var path=require(_0x1c20('0x2'));var timeout=require(_0x1c20('0x3'));var express=require(_0x1c20('0x4'));var router=express[_0x1c20('0x5')]();var fs_extra=require(_0x1c20('0x6'));var auth=require(_0x1c20('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1c20('0x8'));var controller=require('./sound.controller');router[_0x1c20('0x9')]('/',auth[_0x1c20('0xa')](),controller[_0x1c20('0xb')]);router[_0x1c20('0x9')](_0x1c20('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x1c20('0x9')](_0x1c20('0xd'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x1c20('0xe')]({'destination':function(_0x3aeec8,_0x1c1cd6,_0x164944){_0x164944(null,path[_0x1c20('0xf')](config[_0x1c20('0x10')],_0x1c20('0x11')));},'filename':function(_0x848323,_0xa45856,_0x542046){_0xa45856[_0x1c20('0x12')]=_0xa45856[_0x1c20('0x12')][_0x1c20('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x542046(null,util[_0x1c20('0x14')](_0x1c20('0x15'),path['basename'](_0xa45856['originalname'],path[_0x1c20('0x16')](_0xa45856['originalname'])),Date[_0x1c20('0x17')](),path[_0x1c20('0x16')](_0xa45856[_0x1c20('0x12')])));}})});router[_0x1c20('0x18')]('/',upload['single'](_0x1c20('0x19')),controller[_0x1c20('0x1a')]);router[_0x1c20('0x1b')](_0x1c20('0xc'),auth[_0x1c20('0xa')](),controller[_0x1c20('0x1c')]);router[_0x1c20('0x1d')](_0x1c20('0xc'),auth[_0x1c20('0xa')](),controller[_0x1c20('0x1d')]);module['exports']=router;