cbe7c94d589045cf1e319bd9b2d17374df48b903
[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 _0x74f0=['originalname','replace','format','%s-%s%s','basename','extname','now','post','single','create','put','update','delete','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/'];(function(_0x1622d2,_0x918280){var _0x239c91=function(_0x540cc5){while(--_0x540cc5){_0x1622d2['push'](_0x1622d2['shift']());}};_0x239c91(++_0x918280);}(_0x74f0,0x1b1));var _0x074f=function(_0x53ba51,_0x2f2321){_0x53ba51=_0x53ba51-0x0;var _0x2e776e=_0x74f0[_0x53ba51];return _0x2e776e;};'use strict';var multer=require('multer');var util=require(_0x074f('0x0'));var path=require('path');var timeout=require(_0x074f('0x1'));var express=require(_0x074f('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x074f('0x3'));var config=require(_0x074f('0x4'));var controller=require(_0x074f('0x5'));router[_0x074f('0x6')]('/',auth[_0x074f('0x7')](),controller[_0x074f('0x8')]);router[_0x074f('0x6')](_0x074f('0x9'),auth[_0x074f('0x7')](),controller[_0x074f('0xa')]);router['get'](_0x074f('0xb'),auth[_0x074f('0x7')](),controller[_0x074f('0xc')]);var upload=multer({'storage':multer[_0x074f('0xd')]({'destination':function(_0x50bfde,_0x552c44,_0x10f1a9){_0x10f1a9(null,path[_0x074f('0xe')](config[_0x074f('0xf')],_0x074f('0x10')));},'filename':function(_0x22f81b,_0x3c2834,_0x1b9af1){_0x3c2834[_0x074f('0x11')]=_0x3c2834[_0x074f('0x11')][_0x074f('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1b9af1(null,util[_0x074f('0x13')](_0x074f('0x14'),path[_0x074f('0x15')](_0x3c2834[_0x074f('0x11')],path[_0x074f('0x16')](_0x3c2834[_0x074f('0x11')])),Date[_0x074f('0x17')](),path['extname'](_0x3c2834[_0x074f('0x11')])));}})});router[_0x074f('0x18')]('/',upload[_0x074f('0x19')]('file'),controller[_0x074f('0x1a')]);router[_0x074f('0x1b')](_0x074f('0x9'),auth[_0x074f('0x7')](),controller[_0x074f('0x1c')]);router[_0x074f('0x1d')](_0x074f('0x9'),auth['isAuthenticated'](),controller[_0x074f('0x1d')]);module['exports']=router;