Built motion from commit (unavailable).|2.5.14
[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 _0xb2b2=['get','isAuthenticated','index','/:id','show','/:id/download','download','join','root','server/files/sounds/original/','replace','format','%s-%s%s','basename','originalname','extname','single','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./sound.controller'];(function(_0x44bb91,_0x4fd73d){var _0x52e92a=function(_0x39bd4d){while(--_0x39bd4d){_0x44bb91['push'](_0x44bb91['shift']());}};_0x52e92a(++_0x4fd73d);}(_0xb2b2,0x17e));var _0x2b2b=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xb2b2[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require(_0x2b2b('0x0'));var util=require('util');var path=require(_0x2b2b('0x1'));var timeout=require(_0x2b2b('0x2'));var express=require(_0x2b2b('0x3'));var router=express[_0x2b2b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2b2b('0x5'));var config=require(_0x2b2b('0x6'));var controller=require(_0x2b2b('0x7'));router[_0x2b2b('0x8')]('/',auth[_0x2b2b('0x9')](),controller[_0x2b2b('0xa')]);router['get'](_0x2b2b('0xb'),auth[_0x2b2b('0x9')](),controller[_0x2b2b('0xc')]);router[_0x2b2b('0x8')](_0x2b2b('0xd'),auth[_0x2b2b('0x9')](),controller[_0x2b2b('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c50d4,_0x29c558,_0x3a1b86){_0x3a1b86(null,path[_0x2b2b('0xf')](config[_0x2b2b('0x10')],_0x2b2b('0x11')));},'filename':function(_0x309d62,_0x300bd9,_0x2cddd8){_0x300bd9['originalname']=_0x300bd9['originalname'][_0x2b2b('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2cddd8(null,util[_0x2b2b('0x13')](_0x2b2b('0x14'),path[_0x2b2b('0x15')](_0x300bd9[_0x2b2b('0x16')],path['extname'](_0x300bd9[_0x2b2b('0x16')])),Date['now'](),path[_0x2b2b('0x17')](_0x300bd9[_0x2b2b('0x16')])));}})});router['post']('/',upload[_0x2b2b('0x18')]('file'),controller[_0x2b2b('0x19')]);router[_0x2b2b('0x1a')](_0x2b2b('0xb'),auth[_0x2b2b('0x9')](),controller[_0x2b2b('0x1b')]);router[_0x2b2b('0x1c')](_0x2b2b('0xb'),auth['isAuthenticated'](),controller[_0x2b2b('0x1c')]);module[_0x2b2b('0x1d')]=router;