Built motion from commit (unavailable).|2.5.30
[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 _0x3546=['isAuthenticated','index','/:id','/:id/download','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','put','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./sound.controller','get'];(function(_0x2f5334,_0x5db618){var _0x400382=function(_0x17681e){while(--_0x17681e){_0x2f5334['push'](_0x2f5334['shift']());}};_0x400382(++_0x5db618);}(_0x3546,0x147));var _0x6354=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x3546[_0x3f4891];return _0x54f2d8;};'use strict';var multer=require('multer');var util=require(_0x6354('0x0'));var path=require(_0x6354('0x1'));var timeout=require(_0x6354('0x2'));var express=require(_0x6354('0x3'));var router=express[_0x6354('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6354('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6354('0x6'));var controller=require(_0x6354('0x7'));router[_0x6354('0x8')]('/',auth[_0x6354('0x9')](),controller[_0x6354('0xa')]);router['get'](_0x6354('0xb'),auth[_0x6354('0x9')](),controller['show']);router[_0x6354('0x8')](_0x6354('0xc'),auth[_0x6354('0x9')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x51bc61,_0x22610d,_0x89af13){_0x89af13(null,path['join'](config[_0x6354('0xd')],'server/files/sounds/original/'));},'filename':function(_0x1f455e,_0x455c42,_0x264658){_0x455c42[_0x6354('0xe')]=_0x455c42[_0x6354('0xe')][_0x6354('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x264658(null,util[_0x6354('0x10')](_0x6354('0x11'),path[_0x6354('0x12')](_0x455c42[_0x6354('0xe')],path[_0x6354('0x13')](_0x455c42[_0x6354('0xe')])),Date[_0x6354('0x14')](),path[_0x6354('0x13')](_0x455c42[_0x6354('0xe')])));}})});router[_0x6354('0x15')]('/',upload[_0x6354('0x16')](_0x6354('0x17')),controller[_0x6354('0x18')]);router[_0x6354('0x19')]('/:id',auth[_0x6354('0x9')](),controller[_0x6354('0x1a')]);router['delete'](_0x6354('0xb'),auth[_0x6354('0x9')](),controller['delete']);module[_0x6354('0x1b')]=router;