Built motion from commit (unavailable).|2.5.9
[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 _0x74e7=['show','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','create','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x4692c5,_0x113da9){var _0x22cedb=function(_0x1e62ae){while(--_0x1e62ae){_0x4692c5['push'](_0x4692c5['shift']());}};_0x22cedb(++_0x113da9);}(_0x74e7,0xb2));var _0x774e=function(_0x2061c8,_0x15cb69){_0x2061c8=_0x2061c8-0x0;var _0x259e0f=_0x74e7[_0x2061c8];return _0x259e0f;};'use strict';var multer=require('multer');var util=require(_0x774e('0x0'));var path=require(_0x774e('0x1'));var timeout=require('connect-timeout');var express=require(_0x774e('0x2'));var router=express[_0x774e('0x3')]();var auth=require(_0x774e('0x4'));var interaction=require(_0x774e('0x5'));var config=require(_0x774e('0x6'));var controller=require('./sound.controller');router[_0x774e('0x7')]('/',auth[_0x774e('0x8')](),controller[_0x774e('0x9')]);router[_0x774e('0x7')](_0x774e('0xa'),auth[_0x774e('0x8')](),controller[_0x774e('0xb')]);router[_0x774e('0x7')]('/:id/download',auth[_0x774e('0x8')](),controller[_0x774e('0xc')]);var upload=multer({'storage':multer[_0x774e('0xd')]({'destination':function(_0x1e16d8,_0x5c3f88,_0x1e70ee){_0x1e70ee(null,path[_0x774e('0xe')](config[_0x774e('0xf')],'server/files/sounds/original/'));},'filename':function(_0x230450,_0x1f167b,_0x30424a){_0x1f167b['originalname']=_0x1f167b[_0x774e('0x10')][_0x774e('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x30424a(null,util[_0x774e('0x12')](_0x774e('0x13'),path[_0x774e('0x14')](_0x1f167b[_0x774e('0x10')],path[_0x774e('0x15')](_0x1f167b[_0x774e('0x10')])),Date[_0x774e('0x16')](),path[_0x774e('0x15')](_0x1f167b[_0x774e('0x10')])));}})});router['post']('/',upload[_0x774e('0x17')](_0x774e('0x18')),controller[_0x774e('0x19')]);router['put'](_0x774e('0xa'),auth[_0x774e('0x8')](),controller['update']);router['delete'](_0x774e('0xa'),auth[_0x774e('0x8')](),controller['delete']);module[_0x774e('0x1a')]=router;