Built motion from commit ddca4d0d.|2.5.47
[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 _0x54a2=['delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','get','/:id','show','/:id/download','download','join','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','single','create','put'];(function(_0x33849a,_0x1ec18d){var _0x4a66ed=function(_0x5d1878){while(--_0x5d1878){_0x33849a['push'](_0x33849a['shift']());}};_0x4a66ed(++_0x1ec18d);}(_0x54a2,0x1e2));var _0x254a=function(_0x300a0a,_0x1653d4){_0x300a0a=_0x300a0a-0x0;var _0x28b718=_0x54a2[_0x300a0a];return _0x28b718;};'use strict';var multer=require('multer');var util=require(_0x254a('0x0'));var path=require(_0x254a('0x1'));var timeout=require(_0x254a('0x2'));var express=require(_0x254a('0x3'));var router=express[_0x254a('0x4')]();var fs_extra=require(_0x254a('0x5'));var auth=require(_0x254a('0x6'));var interaction=require(_0x254a('0x7'));var config=require(_0x254a('0x8'));var controller=require(_0x254a('0x9'));router['get']('/',auth[_0x254a('0xa')](),controller['index']);router[_0x254a('0xb')](_0x254a('0xc'),auth[_0x254a('0xa')](),controller[_0x254a('0xd')]);router[_0x254a('0xb')](_0x254a('0xe'),auth[_0x254a('0xa')](),controller[_0x254a('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42856d,_0x23ab34,_0x4fe5d4){_0x4fe5d4(null,path[_0x254a('0x10')](config[_0x254a('0x11')],_0x254a('0x12')));},'filename':function(_0x14b766,_0x4b6cf1,_0x29bc02){_0x4b6cf1[_0x254a('0x13')]=_0x4b6cf1[_0x254a('0x13')][_0x254a('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x29bc02(null,util[_0x254a('0x15')]('%s-%s%s',path[_0x254a('0x16')](_0x4b6cf1[_0x254a('0x13')],path[_0x254a('0x17')](_0x4b6cf1[_0x254a('0x13')])),Date[_0x254a('0x18')](),path[_0x254a('0x17')](_0x4b6cf1[_0x254a('0x13')])));}})});router['post']('/',upload[_0x254a('0x19')]('file'),controller[_0x254a('0x1a')]);router[_0x254a('0x1b')](_0x254a('0xc'),auth[_0x254a('0xa')](),controller['update']);router[_0x254a('0x1c')](_0x254a('0xc'),auth['isAuthenticated'](),controller[_0x254a('0x1c')]);module[_0x254a('0x1d')]=router;